index
int64
0
20.3k
text
stringlengths
0
1.3M
year
stringdate
1987-01-01 00:00:00
2024-01-01 00:00:00
No
stringlengths
1
4
7,300
Scalable Coordinated Exploration in Concurrent Reinforcement Learning Maria Dimakopoulou Stanford University madima@stanford.edu Ian Osband Google DeepMind iosband@google.com Benjamin Van Roy Stanford University bvr@stanford.edu Abstract We consider a team of reinforcement learning agents that concurrently operate in a common environment, and we develop an approach to efficient coordinated exploration that is suitable for problems of practical scale. Our approach builds on seed sampling[1] and randomized value function learning [11]. We demonstrate that, for simple tabular contexts, the approach is competitive with previously proposed tabular model learning methods [1]. With a higher-dimensional problem and a neural network value function representation, the approach learns quickly with far fewer agents than alternative exploration schemes. 1 Introduction Consider a farm of robots operating concurrently, learning how to carry out a task, as studied in [3]. There are benefits to scale, since a larger number of robots can gather and share larger volumes of data that enable each to learn faster. These benefits are most dramatic if the robots explore in a coordinated fashion, diversifying their learning goals and adapting appropriately as data is gathered. Web services present a similar situation, as considered in [18]. Each user is served by an agent, and the collective of agents can accelerate learning by intelligently coordinating how they experiment. Considering its importance, the problem of coordinated exploration in reinforcement learning has received surprisingly little attention; while [3] and [18] consider teams of agents that gather data in parallel, they do not address coordination of data gathering, though this can be key to team performance. Dimakopolou and Van Roy [1] recently identified properties that are essential to efficient coordinated exploration and proposed suitable tabular model learning methods based on seed sampling. Though this represents a conceptual advance, the methods do not scale to meet the needs of practical applications, which require generalization to address intractable state spaces. In this paper, we develop scalable reinforcement learning algorithms that aim to efficiently coordinate exploration and we present computational results that establish their substantial benefit. Work on coordinated exploration builds on a large literature that addresses efficient exploration in single-agent reinforcement learning (see, e.g., [6, 5, 21]). A growing segment of this literature studies and extends posterior sampling for reinforcement learning (PSRL) [19], which has led to statistically efficient and computationally tractable approaches to exploration [10, 12, 13]. The methods we will propose leverage this line of work, particularly the use of randomized value function learning [14]. The problem we address is known as concurrent reinforcement learning [18, 15, 4, 16, 1]. A team of reinforcement learning agents interact with the same unknown environment, share data with one another, and learn in parallel how to operate effectively. To learn efficiently in such settings, the agents should coordinate their exploratory effort. Three properties essential to efficient coordinated exploration, identified in [1], are real-time adaptivity to shared observations, commitment to carry through with action sequences that reveal new information, and diversity across learning opportunities pursued by different agents. That paper demonstrated that upper-confidence-bound (UCB) exploration schemes for concurrent reinforcement learning (concurrent UCRL), such as those 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. discussed in [15, 4, 16], fail to satisfy the diversity property due to their deterministic nature. Further, a straightforward extension of PSRL to the concurrent multi-agent setting, in which each agent independently samples a new MDP at the start of each time period, as done in [7], fails to satisfy the commitment property because the agents are unable to explore the environment thoroughly [17]. As an alternative, [1] proposed seed sampling, which extends PSRL in a manner that simultaneously satisfies the three properties. The idea is that each concurrent agent independently samples a random seed, a mapping from seed to the MDP is determined by the prevailing posterior distribution. Independence among seeds diversifies exploratory effort among agents. If the mapping is defined in an appropriate manner, the fact that each agent maintains a consistent seed ensures a sufficient degree of commitment, while the fact that the posterior adapts to new data allows each agent to react intelligently to new information. Algorithms presented in [1] are tabular and hence do not scale to address intractable state spaces. Further, computational studies carried out in [1] focus on simple stylized problems designed to illustrate the benefits of seed sampling. In the next section, we demonstrate that observations made in these stylized contexts extend to a more realistic problem involving swinging up and balancing a pole. Subsequent sections extend the seed sampling concept to operate with generalizing randomized value functions [14], leading to new algorithms such as seed temporal-difference learning (seed TD) and seed least-squares value iteration (seed LSVI). We show that on tabular problems, these scalable seed sampling algorithms perform as well as the tabular seed sampling algorithms of [1]. Finally, we present computational results demonstrating effectiveness of one of our new algorithms applied in conjunction with a neural network representation of the value function on another pole balancing problem with a state space too large to be addressed by tabular methods. 2 Seeding with Tabular Representations This section shows that the advantages of seed sampling over alternative exploration schemes extend beyond the toy problems with known transition dynamics and a handful of unknown rewards considered in [1]. We consider a problem that is more realistic and complex, but of sufficiently small scale to be addressed by tabular methods, in which a group of agents learn to swing-up and balance a pole. We demonstrate that seed sampling learns to achieve the goal quickly and with far fewer agents than other exploration strategies. In the classic problem [20], a pole is attached to a cart that moves on a frictionless rail. We modify the problem so that deep exploration is crucial to identifying rewarding states and thus learning the optimal policy. Unlike the traditional cartpole problem, where the interaction begins with the pole stood upright and the agent must learn to balance it, in our problem the interaction begins with the pole hanging down and the agent must learn to swing it up. The cart moves on an infinite rail. Concretely the agent interacts with the environment through the state st = (φt, ˙φt) ∈ℜ2, where φt is the angle of the pole from the vertical, upright position φ = 0 and ˙φt is the respective angular velocity. The cart is of mass M = 1 and the pole has mass m = 0.1 and length l = 1, with acceleration due to gravity g = 9.8. At each timestep the agent can apply a horizontal force Ft to the cart. The second order differential equation governing the system is ¨φt = g sin(φt)−cos(φt)τt l 2( 4 3 − m m+M cos(φt)2), τt = Ft+ l 2 ˙φ2 t sin(φt) m+M [11]. We discretize the evolution of this second order differential equation with timescale ∆t = 0.02 and present a choice of actions Ft = {−10, 0, 10} for all t. At each timestep the agent pays a cost |Ft| 1000 for its action but can receive a reward of 1 if the pole is balanced upright (cos(φt) > 0.75) and steady (angular velocity less than 1). The interaction ends after 1000 actions, i.e. at t = 20. The environment is modeled as a time-homogeneous MDP, which is identified by M = (S, A, R, P, ρ), where S is the discretized state space [0, 2π] × [−2π, 2π], A = {−10, 0, 10} is the action space, R is the reward model, P is the transition model and ρ is the initial state distribution. Consider a group of K agents, who explore and learn to operate in parallel in this common environment. Each kth agent begins at state sk,0 = (π, 0) + wk, where each component of wk is uniformly distributed in [−0.05, 0.05]. Each agent k takes an action at arrival times tk,1, tk,2, . . . , tk,H of an independent Poisson process with rate κ = 1. At time tk,m, the agent takes action ak,m, transitions from state sk,m−1 to state sk,m and observes reward rk,m. The agents are uncertain about the transition structure P and share a common Dirichlet prior over the transition probabilities associated with each state-action pair (s, a) ∈S × A with parameters α0(s, a, s′) = 1, for all s′ ∈S. The agents are also uncertain about the reward structure R and share a common Gaussian prior over the reward 2 Figure 1: Performance of PSRL (no adaptivity), concurrent UCRL (no diversity), Thompson resampling (no commitment) and seed sampling in the tabular problem of learning how to swing and keep upright a pole attached to a cart that moves left and right on an infinite rail. associated with each state-action pair (s, a) ∈S × A with parameters µ0(s, a) = 0, σ2 0(s, a) = 1. Agents share information in real time and update their posterior beliefs. We compare seed sampling with three baselines, PSRL, concurrent UCRL and Thompson resampling. In PSRL, each agent k samples an MDP Mk,0 from the common prior at time tk,0 and computes the optimal policy πk,0(·) with respect to Mk,0, which does not change throughout the agent’s interaction with the environment. Therefore, the PSRL agents do not adapt to the new information in real-time. On the other hand, in concurrent UCRL, Thompson resampling and seed sampling, at each time tk,m, the agent k generates a new MDP Mk,m based on the data gathered by all agents up to that time, computes the optimal policy πk,m for Mk,m and takes an action ak,m = πk,m(sk,m−1) according to the new policy. Concurrent UCRL is a deterministic approach according to which all the parallel agents construct the same optimistic MDP conditioned on the common shared information up to that time. Therefore, the concurrent UCRL agents do not diversify their exploratory effort. Thompson resampling has each agent independently sample a new MDP at each time period from the common posterior distribution conditioned on the shared information up to that time. Resampling an MDP independently at each time period breaks the agent’s intent to pursue a sequence of actions revealing the rare reward states. Therefore, the Thompson resampling agents do not commit. Finally, in seed sampling, at the beginning of the experiment, each agent k samples a random seed ωk with two components that remain fixed throughout the experiment. The first component is |S|2|A| sequences of independent and identically distributed Exp(1) random variables; the second component is |S||A| independent and identically distributed N(0, 1) random variables. At each time tk,m, agent k maps the data gathered by all agents up to that time and its seed ωk to an MDP Mk,m by combining the Exponential-Dirichlet seed sampling and the standard-Gaussian seed sampling methods described in [1]. Independence among seeds diversifies exploratory effort among agents. The fact that the agent maintains a consistent seed leads to a sufficient degree of commitment, while the fact that the posterior adapts to new data allows the agent to react intelligently to new information. After the end of the learning interaction, there is an evaluation of what the group of K agents learned. The performance of each algorithm is measured with respect to the reward achieved during this evaluation, where a greedy agent starts at s0 = (π, 0), generates the expected MDP of the cartpole environment based on the posterior beliefs formed by the K parallel agents at the end of their learning, and interacts with the cartpole as dictated by the optimal policy with respect to this MDP. Figure 1 plots the reward achieved by the evaluation agent for increasing number of PSRL, seed sampling, concurrent UCRL and Thompson resampling agents operating in parallel in the cartpole environment. As the number of parallel learning agents grows, seed sampling quickly increases its evaluation reward and soon attains a high reward only within 20 seconds of learning. On the other hand, the evaluation reward achieved by episodic PSRL (no adaptivity), concurrent UCRL (no diversity), and Thompson resampling (no commitment) does not improve at all or improves in a much slower rate as the number of parallel agents increases. 3 Seeding with Generalizing Representations As we demonstrated in Section 2, seed sampling can offer great advantage over other exploration schemes. However, our examples involved tabular learning and the algorithms we considered do 3 not scale gracefully to address practical problems that typically pose enormous state spaces. In this section, we propose an algorithmic framework that extends the seeding concept from tabular to generalizing representations. This framework supports scalable reinforcement learning algorithms with the degrees of adaptivity, commitment, and intent required for efficient coordinated exploration. We consider algorithms with which each agent is instantiated with a seed and then learns a parameterized value function over the course of operation. When data is insufficient, the seeds govern behavior. As data accumulates and is shared across agents, each agent perturbs each observation in a manner distinguished by its seed before training its value function on the data. The varied perturbations of shared observations result in diverse value function estimates and, consequently, diverse behavior. By maintaining a constant seed throughout learning, an agent does not change his interpretation of the same observation from one time period to the next, and this achieves the desired level of commitment, which can be essential in the presence of delayed consequences. Finally, by using parameterized value functions, agents can cope with intractably large state spaces. Section 3.1 offers a more detailed description of our proposed algorithmic framework, and Section 3.2 provides examples of algorithms that fit this framework. 3.1 Algorithmic Framework There are K agents, indexed 1, . . . , K. The agents operate over H time periods in identical environments, each with state space S and action space A. Denote by tk,m the time at which agent k applies its mth action. The agents may progress synchronously (tk,m = tk′,m) or asynchronously (tk,m ̸= tk′,m). Each agent k begins at state sk,0. At time tk,m, agent k is at state sk,m, takes action ak,m, observes reward rk,m and transitions to state sk,m+1. In order for the agents to adapt their policies in real-time, each agent has access to a buffer B with observations of the form (s, a, r, s′). This buffer stores past observations of all K agents. Denote by Bt the content of this buffer at time t. With value function learning, agent k uses a family ˜Qk of state action value functions indexed by a set of parameters Θk. Each θ ∈Θk defines a state-action value function ˜Qk,θ : S × A →ℜ. The value ˜Qk,θ(s, a) could be, for example, the output of a neural network with weights θ in response to an input (s, a). Initially, the agents may have prior beliefs over the parameter θ, such as the expectation, ¯θ, or the level of uncertainty, λ, on θ. Agents diversify their behavior through a seeding mechanism. Under this mechanism, each agent k is instantiated with a seed ωk. Seed ωk is intrinsic to agent k and differentiates how agent k interprets the common history of observations in the buffer B. A form of seeding is that each agent k can independently and randomly perturb observations in the buffer. For example, different agents k, k′ can add different noise terms zk,j and zk′,j of variance v, which are determined by seeds ωk and ωk′, respectively, to rewards from the same jth observation (sj, aj, rj, s′ j) in the buffer B, as discussed in [14] for the single-agent setting. This induces diversity by creating modified training sets from the same history among the agents. Based on the prior distribution for the parameter θ, agent k can initialize the value function with a sample ˆθk from this distribution, with the seed ωk providing the source of randomness. These independent value function parameter samples diversify the exploration in initial stages of operation. The seed ωk remains fixed throughout the course of learning. This induces a level of commitment in agent k, which can be important in reinforcement learning settings where delayed consequences are present. At time tk,m, before taking the mth action, agent k fits its generalized representation model on the history (or a subset thereof) of observations (sj, aj, rj, s′ j) perturbed by the noise seeds zk,j, j = 1, . . . , |Btk,m|. The initial parameter seed ˆθk can also play a role in subsequent stages of learning, other than the first time period, by influencing the model fitting. An example of employing the initial parameter seed ˆθk in the model fitting of subsequent time periods is by having a function ψ(·) as a regularization term in which ˆθk appears. By this model fitting, agent k obtains parameters θk,m at time period tk,m. These parameters define a state-action value function ˜Qk,θk,m(·, ·) based on which a policy is computed. Based on the obtained policy and its current state sk,m, the agent takes a greedy action ak,m, observes reward rk,m and transitions to state sk,m+1. The agent k stores this observation (sk,m, ak,m, rk,m, sk,m+1) in the buffer B so that all agents can access it next time they fit their models. For learning problems with large learning periods, it may be practical to cap the common buffer to a certain capacity C and once this capacity is exceeded to start overwriting observations at 4 random. In this case, the way observations are overwritten can also be different for each agent and determined by seed ωk (e.g. by ωk also defining random permutation of indices 1, . . . , C). The ability of the agents to make decisions in the high-dimensional environments of real systems, where the number of states is enormous or even infinite, is achieved through the value function representations, while coordinating the exploratory effort of the group of agents is achieved through the way that the seeding mechanism controls the fitting of these generalized representations. As the number of parallel agents increases, this framework enables the agents to learn to operate and achieve high rewards in complex environments very quickly. 3.2 Examples of Algorithms We now present examples of algorithms that fit the framework of Section 3.1. In our proposed algorithms, agents share a Gaussian prior over unknown parameters θ∗∼N(¯θ, λI) and a Gaussian likelihood, N(0, v). Each agent k samples independently noise seeds zk,j ∼N(0, v) for each observation j in the buffer and initial parameter seeds ˆθk ∼N(¯θ, λI). These seeds remain fixed throughout learning. We now explain how the algorithms we propose satisfy the three properties of efficient coordinated exploration. 1. Adaptivity: The key idea behind randomized value functions is that fitting a model to a randomly perturbed prior and randomly perturbed observations can be used to generate posterior samples or approximate posterior samples. Consider the data (X, y) = {xj}N j=1, {yj}N j=1  , where yj = θ∗T xj + ϵj, with IID ϵj ∼N(0, v). Let fθ = θT x, ˆθ ∼N(¯θ, λI) and zj ∼N(0, v). Then, the solution to argminθ  1 v P j (yj + zj −fθ(xi))2 + 1 λ∥θ −ˆθ∥2 2  is a sample from the posterior of θ∗given (X, y) [14]. This sample can be computed for non-linear fθ as well, although it will not be from the exact posterior. In the concurrent setting, when each agent k draws initial parameter seed ˆθk ∼N(¯θ, λI) and noise seeds zk,1, zk,2, · · · ∼N(0, v) at each time period it can solve this value-function optimization problem to obtain a posterior parameter sample based on the high-dimensional observations gathered by all agents so far. 2. Diversity: The independence of the initial parameter seeds ˆθk and noise seeds zk,j among agents diversifies exploration both when there are no available observations and when the agents have access to the same shared observations. 3. Commitment: Each agent k applies the same perturbation zk,j to each jth observation and uses the same regularization ˆθk throughout learning; this provides the requisite level of commitment. 3.2.1 Seed Least Squares Value Iteration (Seed LSVI) LSVI computes a sequence of value functions parameters reflecting optimal expected rewards over an expanding horizon based on observed data. In seed LSVI, each kth agent’s initial parameter θk,0 is set to ˆθk. Before its mth action, agent k uses the buffer of observations gathered by all K agents up to that time, or a subset thereof, and the random noise terms zk to carry out LSVI, initialized with ˜θH = 0, where H is the LSVI planning horizon: ˜θh = argmin θ  1 v X (sj,aj,rj,s′ j)  rj + max a∈A ˜Qk,˜θh+1(s′ j, a) + zk,j −˜Qk,θ(sj, aj) 2 + ψ(θ, ˆθk)   for h = H −1, . . . , 0, where ψ(θ, ˆθk) is a regularization penalty (e.g. ψ(θ, ˆθk) = 1 λ∥θ −ˆθk∥2 2). After setting θk,m = ˜θ0, agent k applies action ak,m = argmaxa∈A ˜Qk,θk,m(sk,m, a). Note that the agent’s random seed can be viewed as ωk = (ˆθk, zk,1, zk,2, . . .). 3.2.2 Seed Temporal-Difference Learning (Seed TD) When the dimension of θ is very large, significant computational time may be required to produce an estimate with LSVI, and using first-order algorithms in the vein of stochastic gradient descent, such as TD, can be beneficial. In seed TD, each kth agent’s initial parameter θk,0 is set to ˆθk. Before its 5 mth action, agent k uses the buffer of observations gathered by all K agents up to that time to carry out N iterations of stochastic gradient descent, initialized with ˜θ0 = θk,m−1: ˜θn = ˜θn−1 −α∇θL(˜θn−1) L(θ) = 1 v X (sj,aj,rj,s′ j)  rj + γ max a∈A ˜Qk,˜θn−1(s′ j, a) + zk,j −˜Qk,θ(sj, aj) 2 + ψ(θ, ˆθk) for n = 1, . . . , N, where α is the TD learning rate, L(θ) is the loss function, γ is the discount rate and ψ(θ, ˆθk) is a regularization penalty (e.g. ψ(θ, ˆθk) = 1 λ∥θ −ˆθk∥2 2). After setting θk,m = ˜θN, agent k applies action ak,m = argmaxa∈A ˜Qk,θk,m(sk,m, a). Note that the agent’s random seed can be viewed as ωk = (ˆθk, zk,1, zk,2, . . .). 3.2.3 Seed Ensemble When the number of parallel agents is large, instead of having each one of the K agents fit a separate value function model (e.g. K separate neural networks), we can have an ensemble of E models, E < K, to decrease computational requirements. Each model e = 1, . . . , E is initialized with ˆθe ∼N(¯θ, λ) from the common prior belief on parameters θ, which is fixed and specific to model e of the ensemble. Moreover model e is trained on the buffer of observations B according to one of the methods of Section 3.2.1 or 3.2.2. Each observation (sj, aj, rj, s′ j) ∈B is perturbed with noise ze,j, which is also fixed and specific to model e of the ensemble. Note that the agent’s k random seed, ωk, is a randomly drawn index e = 1, . . . , E associated with a model from the ensemble. 3.2.4 Extensions The framework we propose is not necessarily constrained to value function approximation methods. For instance, one could use the same principles for policy function approximation, where each agent k defines a policy function ˜πk(s, a, θ) and before its mth action uses the buffer of observations gathered by all K agents up to that time and its seeds zk to perform policy gradient. 4 Computational Results In this section, we present computational results that demonstrate the robustness and effectiveness of the approach we suggest in Section 3. In Section 4.1, we present results that serve as a sanity check for our approach. We show that in the tabular toy problems considered in [1], seeding with generalized representations performs equivalently with the seed sampling algorithm proposed in [1], which is particularly designed for tabular settings and can benefit from very informative priors. In Section 4.2, we scale-up to a high-dimensional problem, which would be too difficult to address by any tabular approach. We use the concurrent reinforcement learning algorithm of Sections 3.2.2 and 3.2.3 with a neural network value function approximation and we see that our approach explores quickly and achieves high rewards. 4.1 Sanity Checks The authors of [1] considered two toy problems that demonstrate the advantage of seed sampling over Thompson resampling or concurrent UCRL. We compare the performance of seed LSVI (Section 3.2.1) and seed TD (Section 3.2.2), which are designed for generalized representations, with seed sampling, Thompson resampling and concurrent UCRL which are designed for tabular representations. The first toy problem is the “bipolar chain” of figure 2a. The chain has an even number of vertices, N, V = {0, 1, . . . , N −1} and the endpoints are absorbing. From any inner vertex of the chain, there are two edges that lead deterministically to the left or to the right. The leftmost edge eL = (1, 0) has weight θL and the rightmost edge eR = (N −2, N −1) has weight θR, such that |θL| = |θR| = N and θR = −θL. All other edges have weight θe = −0.1. Each one of the K agents starts from vertex N/2, and its goal is to maximize the accrued reward. We let the agents interact with the environment for 2N time periods. As in [1], seed sampling, Thompson resampling and concurrent UCRL, know everything about the environment except from whether θL = N, θR = −N or θL = −N, θR = N 6 1 0 N-1 N/2 ... -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 start ... θ(1,0) θ(Ν-2,Ν-1) (a) Bipolar chain environment C,2 1,2 ... C,1 1,1 C,L 1,L ... ... ... ... ... 0 0 0 0 0 θ1 θC 0 0 (b) Parallel chains environment (c) Bipolar chain mean regret per agent (d) Parallel chains mean regret per agent Figure 2: Comparison of the scalable seed algorithms, seed LSVI and seed TD, with their tabular counterpart seed sampling and the tabular alternatives concurrent UCRL and Thompson resampling in the toy settings considered in [1]. This comparison serves as a sanity check. and they share a common prior that assigns probability p = 0.5 to either scenario. Once an agent reaches either of the endpoints, all K agents learn the true value of θL and θR. Seed LSVI and seed TD use N-dimensional one-hot encoding to represent any of the chain’s states and a linear value function representation. Unlike, the tabular algorithms, seed LSVI and seed TD start with a completely uninformative prior. We run the algorithms with different number of parallel agents K operating on a chain with N = 50 vertices. Figure 2c shows the mean reward per agent achieved as K increases. The “bipolar chain” example aims to highlight the importance of the commitment property. As explained in [1], concurrent UCRL and seed sampling are expected to perform in par because they exhibit commitment, but Thompson resampling is detrimental to exploration because resampling a MDP in every time period leads the agents to oscillation around the start vertex. Seed LSVI and seed TD exhibit commitment and perform almost as well as seed sampling, which not only is designed for tabular problems but also starts with a significantly more informed prior. The second toy problem is the “parallel chains” of figure 2b. Starting from vertex 0, each of the K agents chooses one of the c = 1, . . . , C chains, of length L. Once a chain is chosen, the agent cannot switch to another chain. All the edges of each chain c have zero weights, apart from the edge incoming to the last vertex of the chain, which has weight θc ∼N(0, σ2 0 + c). The objective is to choose the chain with the maximum reward. As in [1], seed sampling, Thompson resampling and concurrent UCRL, know everything about the environment except from θc, ∀c = 1, . . . , C, on which they share a common, well-specified prior. Once an agent traverses the last edge of chain c, all agents learn θc. Seed LSVI and seed TD use N-dimensional one-hot encoding to represent any of the chain’s states and a linear value function representation. As before, seed LSVI and seed TD start with a completely uninformative prior. We run the algorithms with different number of parallel agents K operating on a parallel chain environment with C = 4, L = 4 and σ2 0 = 100. Figure 2d shows the mean reward per agent achieved as K increases. The “parallel chains” example aims to highlight the importance of the diversity property. As explained in [1], Thompson resampling and seed sampling are expected to perform in par because they diversify, but concurrent UCRL is wasteful of the exploratory effort of the agents, because it sends all the agents who have not left the source to the same chain with the most optimistic last edge reward. Seed LSVI and seed TD exhibit diversity and perform identically with seed sampling, which again starts with a very informed prior. 4.2 Scaling Up: Cartpole Swing-Up In this section we extend the algorithms and insights we have developed in the rest of the paper to a complex non-linear control problem. We revisit a variant of the “cartpole” problem of Section 2, but we introduce two additional state variables, the horizontal distance of the cart xt from the center 7 x = 0 and its velocity, ˙xt. The second order differential equation governing the system becomes ¨φt = g sin(φt)−cos(φt)τt l 2( 4 3 − m m+M cos(φt)2), ¨xt = τt −m l 2 ¨φt cos(φt) m+M , τt = Ft+ l 2 ˙φ2 t sin(φt) m+M [11]. We discretize the evolution of this second order differential equation with timescale ∆t = 0.01. The agent receives a reward of 1 if the pole is balanced upright, steady in the middle and the cartpole is centered (precisely when cos(φt) > 0.95, |xt| < 0.1, | ˙xt| < 1 and | ˙φt| < 1), otherwise the reward is 0. We evaluate performance for 30 seconds of interaction, equivalent to 3000 actions. For implementation, we use the DeepMind control suite that imposes a rigid edge at |x| = 2 [22]. Due to the curse of dimensionality, tabular approaches to seed sampling quickly become intractable as we introduce more state variables. For a practical approach to seed sampling in this domain we apply the seed TD-ensemble algorithm of Sections 3.2.2 and 3.2.3, together with a neural network representation of the value function. We pass the neural network six features: cos(φt), sin(φt), ˙φt 10, x 10, ˙xt 10, 1{|xt| < 0.1}. Let fθ : S →RA be a (50, 50)-MLP with rectified linear units and linear skip connection. We initialize each Qe(s, a | θe) = fθe + 3fθe 0  (s)[a] for θe, θe 0 sampled from Glorot initialization [2]. After each action, for each agent we sample a minibatch of 16 transitions uniformly from the shared replay buffer and take gradient steps with respect to θe using the ADAM optimizer with learning rate 10−3 [8]. The parameter θe 0 plays a role similar to the prior regularization ψ when used in conjunction with SGD training [9]. We sample noise ze,j ∼N(0, 0.01) to be used in the shared replay buffer. Figure 3: Comparison of seed sampling varying the number K of agents, with a model ensemble size min(K, 30). As a baseline we use DQN with 100 agents applying ϵ-greedy exploration. Figure 3 presents the results of our seed sampling experiments on this cartpole problem. Each curve is averaged over 10 random instances. As a baseline, we consider DQN with 100 parallel agents each with 0.1-greedy action selection. With this approach, the agents fail to see any reward over the duration of their experience. By contrast, a seed sampling approach is able to explore efficiently, with agents learning to balance the pole remarkably quickly 1. The average reward per agent increases as we increase the number K of parallel agents. To reduce compute time, we use seed ensemble with min(K, 30) models; this seems to not significantly degrade performance. 5 Closing Remarks We have extended the concept of seeding from the non-practical tabular representations to generalized representations and we have proposed an approach for designing scalable concurrent reinforcement learning algorithms that can intelligently coordinate the exploratory effort of agents learning in parallel in potentially enormous state spaces. This approach allows the concurrent agents (1) to adapt to each other’s high-dimensional observations via value function learning, (2) to diversify their experience collection via an intrinsic random seed that uniquely initializes each agent’s generalized representation and uniquely interprets the common history of observations, (3) to commit to sequences of actions revealing useful information by maintaining each agent’s seed constant throughout learning. We envision multiple applications of practical interest, where a number of parallel agents who conform to the proposed framework, can learn and achieve high rewards in short learning periods. Such application areas include web services, the management of a fleet of autonomous vehicles or the management of a farm of networked robots, where each online user, vehicle or robot respectively is controlled by an agent. 1For a demo, see https://youtu.be/kwvhfzbzb0o 8 References [1] Maria Dimakopoulou and Benjamin Van Roy. Coordinated exploration in concurrent reinforcement learning. In ICML, 2018. [2] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256, 2010. [3] Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In arXiv, 2016. [4] Z. Guo and E. Brunskill. Concurrent PAC RL. In AAAI Conference on Artificial Intelligence, pages 2624–2630, 2015. [5] Thomas Jaksch, Ronald Ortner, and Peter Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11:1563–1600, 2010. [6] Michael J. Kearns and Satinder P. Singh. Near-optimal reinforcement learning in polynomial time. Machine Learning, 49(2-3):209–232, 2002. [7] Michael Jong Kim. Thompson sampling for stochastic control: The finite parameter case. IEEE Transactions on Automatic Control, 2017. [8] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [9] Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. arXiv preprint arXiv:1806.03335, 2018. [10] Ian Osband, Daniel Russo, and Benjamin Van Roy. (More) efficient reinforcement learning via posterior sampling. In NIPS, pages 3003–3011. Curran Associates, Inc., 2013. [11] Ian Osband, Daniel Russo, Benjamin Van Roy, and Zheng Wen. Deep exploration via randomized value functions. arXiv preprint arXiv:1608.02731, 2016. [12] Ian Osband and Benjamin Van Roy. On optimistic versus randomized exploration in reinforcement learning. In The Multi-disciplinary Conference on Reinforcement Learning and Decision Making, 2017. [13] Ian Osband and Benjamin Van Roy. Why is posterior sampling better than optimism for reinforcement learning. In ICML, 2017. [14] Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. In Proceedings of The 33rd International Conference on Machine Learning, pages 2377–2386, 2016. [15] Jason Pazis and Ronald Parr. PAC optimal exploration in continuous space Markov decision processes. In AAAI. Citeseer, 2013. [16] Jason Pazis and Ronald Parr. Efficient pac-optimal exploration in concurrent, continuous state mdps with delayed updates. In AAAI. Citeseer, 2016. [17] Daniel Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen. A tutorial on Thompson sampling. arXiv preprint arXiv:1707.02038, 2017. [18] D. Silver, Barker Newnham, L, S. Weller, and J. McFall. Concurrent reinforcement learning from customer interactions. In Proceedings of The 30th International Conference on Machine Learning, pages 924–932, 2013. [19] Malcolm J. A. Strens. A Bayesian framework for reinforcement learning. In ICML, pages 943–950, 2000. [20] Richard Sutton and Andrew Barto. Reinforcement Learning: An Introduction. MIT Press, 2017. [21] Csaba Szepesvári. Algorithms for Reinforcement Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan & Claypool Publishers, 2010. [22] Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018. 9
2018
143
7,301
Bayesian Semi-supervised Learning with Graph Gaussian Processes Yin Cheng Ng1, Nicolò Colombo1, Ricardo Silva1,2 1Statistical Science, University College London 2The Alan Turing Institute {y.ng.12, nicolo.colombo, ricardo.silva}@ucl.ac.uk Abstract We propose a data-efficient Gaussian process-based Bayesian approach to the semisupervised learning problem on graphs. The proposed model shows extremely competitive performance when compared to the state-of-the-art graph neural networks on semi-supervised learning benchmark experiments, and outperforms the neural networks in active learning experiments where labels are scarce. Furthermore, the model does not require a validation data set for early stopping to control over-fitting. Our model can be viewed as an instance of empirical distribution regression weighted locally by network connectivity. We further motivate the intuitive construction of the model with a Bayesian linear model interpretation where the node features are filtered by an operator related to the graph Laplacian. The method can be easily implemented by adapting off-the-shelf scalable variational inference algorithms for Gaussian processes. 1 Introduction Data sets with network and graph structures that describe the relationships between the data points (nodes) are abundant in the real world. Examples of such data sets include friendship graphs on social networks, citation networks of academic papers, web graphs and many others. The relational graphs often provide rich information in addition to the node features that can be exploited to build better predictive models of the node labels, which can be costly to collect. In scenarios where there are not enough resources to collect sufficient labels, it is important to design data-efficient models that can generalize well with few training labels. The class of learning problems where a relational graph of the data points is available is referred to as graph-based semi-supervised learning in the literature [7, 47]. Many of the successful graph-based semi-supervised learning models are based on graph Laplacian regularization or learning embeddings of the nodes. While these models have been widely adopted, their predictive performance leaves room for improvement. More recently, powerful graph neural networks that surpass Laplacian and embedding based methods in predictive performance have become popular. However, neural network models require relatively larger number of labels to prevent over-fitting and work well. We discuss the existing models for graph-based semi-supervised learning in detail in Section 4. We propose a new Gaussian process model for graph-based semi-supervised learning problems that can generalize well with few labels, bridging the gap between the simpler models and the more data intensive graph neural networks. The proposed model is also competitive with graph neural networks in settings where there are sufficient labelled data. While posterior inference for the proposed model is intractable for classification problems, scalable variational inducing point approximation method for Gaussian processes can be directly applied to perform inference. Despite the potentially large number of inducing points that need to be optimized, the model is protected from over-fitting by the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. variational lower bound, and does not require a validation data set for early stopping. We refer to the proposed model as the graph Gaussian process (GGP). 2 Background In this section, we briefly review key concepts in Gaussian processes and the relevant variational approximation technique. Additionally, we review the graph Laplacian, which is relevant to the alternative view of the model that we describe in Section 3.1. This section also introduces the notation used across the paper. 2.1 Gaussian Processes A Gaussian process f(x) (GP) is an infinite collection of random variables, of which any finite subset is jointly Gaussian distributed. Consequently, a GP is completely specified by its mean function m(x) and covariance kernel function kθ(x, x′), where x, x′ ∈X denote the possible inputs that index the GP and θ is a set of hyper-parameters parameterizing the kernel function. We denote the GP as follows f(x) ∼GP m(x), kθ(x, x′)  . (1) GPs are widely used as priors on functions in the Bayesian machine learning literatures because of their wide support, posterior consistency, tractable posterior in certain settings and many other good properties. Combined with a suitable likelihood function as specified in Equation 2, one can construct a regression or classification model that probabilistically accounts for uncertainties and control over-fitting through Bayesian smoothing. However, if the likelihood is non-Gaussian, such as in the case of classification, inferring the posterior process is analytically intractable and requires approximations. The GP is connected to the observed data via the likelihood function yn | f(xn) ∼p(yn|f(xn)) ∀n ∈{1, . . . , N}. (2) The positive definite kernel function kθ(x, x′) : X × X −→R is a key component of GP that specifies the covariance of f(x) a priori. While kθ(x, x′) is typically directly specified, any kernel function can be expressed as the inner product of features maps ⟨φ(x), φ(x′)⟩H in the Hilbert space H. The dependency of the feature map on θ is implicitly assumed for conciseness. The feature map φ(x) : X −→H projects x into a typically high-dimensional (possibly infinite) feature space such that linear models in the feature space can model the target variable y effectively. Therefore, GP can equivalently be formulated as f(x) = φ(x)Tw, (3) where w is assigned a multivariate Gaussian prior distribution and marginalized. In this paper, we assume the index set to be X = RD×1 without loss of generality. For a detailed review of the GP and the kernel functions, please refer to [45]. 2.1.1 Scalable Variational Inference for GP Despite the flexibility of the GP prior, there are two major drawbacks that plague the model. First, if the likelihood function in Equation 2 is non-Gaussian, posterior inference cannot be computed analytically. Secondly, the computational complexity of the inference algorithm is O(N 3) where N is the number of training data points, rendering the model inapplicable to large data sets. Fortunately, modern variational inference provides a solution to both problems by introducing a set of M inducing points Z = [z1, . . . , zM]T, where zm ∈RD×1. The inducing points, which are variational parameters, index a set of random variables u = [f(z1), . . . , f(zM)]T that is a subset of the GP function f(x). Through conditioning and assuming m(x) is zero, the conditional GP can be expressed as f(x) | u ∼GP(kT zxK−1 zz u, kθ(x, x) −kT zxK−1 zz kzx) (4) where kzx = [kθ(z1, x), . . . , kθ(zM, x)] and [Kzz]ij = kθ(zi, zj). Naturally, p(u) = N(0, Kzz). The variational posterior distribution of u, q(u) is assumed to be a multivariate Gaussian distribution with mean m and covariance matrix S. Following the standard derivation of variational inference, the Evidence Lower Bound (ELBO) objective function is L(θ, Z, m, S) = N X n=1 Eq(f(xn))[log p(yn|f(xn))] −KL[q(u)||p(u)]. (5) 2 The variational distribution q(f(xn)) can be easily derived from the conditional GP in Equation 4 and q(u), and its expectation can be approximated effectively using 1-dimensional quadratures. We refer the readers to [30] for detailed derivations and results. 2.2 The Graph Laplacian Given adjacency matrix A ∈{0, 1}N×N of an undirected binary graph G = (V, E) without self-loop, the corresponding graph Laplacian is defined as L = D −A, (6) where D is the N × N diagonal node degree matrix. The graph Laplacian can be viewed as an operator on the space of functions g : V −→R indexed by the graph’s nodes such that Lg(n) = X v∈Ne(n) [g(n) −g(v)], (7) where Ne(n) is the set containing neighbours of node n. Intuitively, applying the Laplacian operator to the function g results in a function that quantifies the variability of g around the nodes in the graph. The Laplacian’s spectrum encodes the geometric properties of the graph that are useful in crafting graph filters and kernels [37, 43, 4, 9]. As the Laplacian matrix is real symmetric and diagonalizable, its eigen-decomposition exists. We denote the decomposition as L = UΛUT, (8) where the columns of U ∈RN×N are the eigenfunctions of L and the diagonal Λ ∈RN×N contains the corresponding eigenvalues. Therefore, the Laplacian operator can also be viewed as a filter on function g re-expressed using the eigenfunction basis. Regularization can be achieved by directly manipulating the eigenvalues of the system [39]. We refer the readers to [4, 37, 9] for comprehensive reviews of the graph Laplacian and its spectrum. 3 Graph Gaussian Processes Given a data set of size N with D-dimensional features X = [x1, . . . , xN]T, a symmetric binary adjacency matrix A ∈{0, 1}N×N that represents the relational graph of the data points and labels for a subset of the data points, Yo = [y1, . . . , yO], with each yi ∈{1, . . . , K}, we seek to predict the unobserved labels of the remaining data points YU = [yO+1, . . . yN]. We denote the set of all labels as Y = YO ∪YU. The GGP specifies the conditional distribution pθ(Y|X, A), and predicts YU via the predictive distribution pθ(YU|YO, X, A). The joint model is specified as the product of the conditionally independent likelihood p(yn|hn) and the GGP prior pθ(h|X, A) with hyper-parameters θ. The latent likelihood parameter vector h ∈RN×1 is defined in the next paragraph. First, the model factorizes as pθ(Y, h|X, A) = pθ(h|X, A) N Y n=1 p(yn|hn), (9) where for the multi-class classification problem that we are interested in, p(yn | hn) is given by the robust-max likelihood [30, 16, 23, 21, 20]. Next, we construct the GGP prior from a Gaussian process distributed latent function f(x) : RD×1 −→ R, f(x) ∼GP 0, kθ(x, x′)  , where the key assumption is that the likelihood parameter hn for data point n is an average of the values of f over its 1-hop neighbourhood Ne(n) as given by A: hn = f(xn) + P l∈Ne(n) f(xl) 1 + Dn (10) where Ne(n) = {l : l ∈{1, . . . , N}, Anl = 1}, Dn = |Ne(n)|. We further motivate this key assumption in Section 3.1. 3 As f(x) has a zero mean function, the GGP prior can be succinctly expressed as a multivariate Gaussian random field pθ(h|X, A) = N(0, PKXXPT), (11) where P = (I + D)−1(I + A) and [KXX]ij = kθ(xi, xj). A suitable kernel function kθ(xi, xj) for the task at hand can be chosen from the suite of well-studied existing kernels, such as those described in [13]. We refer to the chosen kernel function as the base kernel of the GGP. The P matrix is sometimes known as the random-walk matrix in the literatures [9]. A graphical model representation of the proposed model is shown in Figure 1. Figure 1: The figure depicts a relational graph (left) and the corresponding GGP represented as a graphical model (right). The thick circle represents a set of fully connected nodes. The covariance structure specified in Equation 11 is equivalent to the pairwise covariance Cov(hm, hn) = 1 (1 + Dm)(1 + Dn) X i∈{m∪Ne(m)} X j∈{n∪Ne(n)} kθ(xi, xj) = ⟨ 1 1 + Dm X i∈{m∪Ne(m)} φ(xi), 1 1 + Dn X j∈{n∪Ne(n)} φ(xj)⟩H (12) where φ(·) is the feature map that corresponds to the base kernel kθ(·, ·). Equation 12 can be viewed as the inner product between the empirical kernel mean embeddings that correspond to the bags of node features observed in the 1-hop neighborhood sub-graphs of node m and n, relating the proposed model to the Gaussian process distribution regression model presented in e.g. [15]. More specifically, we can view the GGP as a distribution classification model for the labelled bags of node features {({xi|i ∈{n ∪Ne(n)}}, yn)}O n=1, such that the unobserved distribution Pn that generates {xi|i ∈{n ∪Ne(n)}} is summarized by its empirical kernel mean embedding ˆµn = 1 1 + Dn X j∈{n∪Ne(n)} φ(xj). (13) The prior on h can equivalently be expressed as h ∼GP(0, ⟨ˆµm, ˆµn⟩H). For detailed reviews of the kernel mean embedding and distribution regression models, we refer the readers to [32] and [41] respectively. One main assumption of the 1-hop neighbourhood averaging mechanism is homophily - i.e., nodes with similar covariates are more likely to form connections with each others [17]. The assumption allows us to approximately treat the node covariates from a 1-hop neighbourhood as samples drawn from the same data distribution, in order to model them using distribution regression. While it is perfectly reasonable to consider multi-hops neighbourhood averaging, the homophily assumption 4 starts to break down if we consider 2-hop neighbours which are not directly connected. Nevertheless, it is interesting to explore non-naive ways to account for multi-hop neighbours in the future, such as stacking 1-hop averaging graph GPs in a structure similar to that of the deep Gaussian processes [10, 34], or having multiple latent GPs for neighbours of different hops that are summed up in the likelihood functions. 3.1 An Alternative View of GGP In this section, we present an alternative formulation of the GGP, which results in an intuitive interpretation of the model. The alternative formulation views the GGP as a Bayesian linear model on feature maps of the nodes that have been transformed by a function related to the graph Laplacian L. As we reviewed in Section 2.1, the kernel matrix KXX in Equation 11 can be written as the product of feature map matrix ΦXΦT X where row n of ΦX corresponds to the feature maps of node n, φ(xn) = [φn1, . . . , φnQ]T. Therefore, the covariance matrix in Equation 11, PΦXΦT XPT, can be viewed as the product of the transformed feature maps bΦX = PΦX = (I + D)−1DΦX + (I + D)−1(I −L)ΦX. (14) where L is the graph Laplacian matrix as defined in Equation 6. Isolating the transformed feature maps for node n (i.e., row n of bΦX) gives ˆφ(xn) = Dn 1 + Dn φ(xn) + 1 1 + Dn [(I −L)ΦX]T n, (15) where Dn is the degree of node n and [·]n denotes row n of a matrix. The proposed GGP model is equivalent to a supervised Bayesian linear classification model with a feature pre-processing step that follows from the expression in Equation 15. For isolated nodes (Dn = 0), the expression in Equation 15 leaves the node feature maps unchanged (ˆφ = φ). The (I −L) term in Equation 15 can be viewed as a spectral filter U(I −Λ)UT, where U and Λ are the eigenmatrix and eigenvalues of the Laplacian as defined in Section 2.2. For connected nodes, the expression results in new features that are weighted averages of the original features and features transformed by the spectral filter. The alternative formulation opens up opportunities to design other spectral filters with different regularization properties, such as those described in [39], that can replace the (I −L) expression in Equation 15. We leave the exploration of this research direction to future work. In addition, it is well-known that many graphs and networks observed in the real world follow the power-law node degree distributions [17], implying that there are a handful of nodes with very large degrees (known as hubs) and many with relatively small numbers of connections. The nodes with few connections (small Dn) are likely to be connected to one of the handful of heavily connected nodes, and their transformed node feature maps are highly influenced by the features of the hub nodes. On the other hand, individual neighbours of the hub nodes have relatively small impact on the hub nodes because of the large number of neighbours that the hubs are connected to. This highlights the asymmetric outsize influence of hubs in the proposed GGP model, such that a mis-labelled hub node may result in a more significant drop in the model’s accuracy compared to a mis-labelled node with much lower degree of connections. 3.2 Variational Inference with Inducing Points Posterior inference for the GGP is analytically intractable because of the non-conjugate likelihood. We approximate the posterior of the GGP using a variational inference algorithm with inducing points similar to the inter-domain inference algorithm presented in [42]. Implementing the GGP with its variational inference algorithm amounts to implementing a new kernel function that follows Equation 12 in the GPflow Python package.1 We introduce a set of M inducing random variables u = [f(z1), . . . , f(zM)]T indexed by inducing points {zm}M m=1 in the same domain as the GP function f(x) ∼GP 0, kθ(x, x′)  . As a result, the 1https://github.com/markvdw/GPflow-inter-domain 5 inter-domain covariance between hn and f(zm) is Cov(hn, f(zm)) = 1 Dn + 1 h kθ(xn, zm) + X l∈Ne(n) kθ(xl, zm) i . (16) Additionally, we introduce a multivariate Gaussian variational distribution q(u) = N(m, SST) for the inducing random variables with variational parameters m ∈RM×1 and the lower triangular S ∈RM×M. Through Gaussian conditioning, q(u) results in the variational Gaussian distribution q(h) that is of our interest. The variational parameters m, S, {zm}M m=1 and the kernel hyperparameters θ are then jointly fitted by maximizing the ELBO function in Equation 5. 3.3 Computational Complexity The computational complexity of the inference algorithm is O(|Yo|M 2). In the experiments, we chose M to be the number of labelled nodes in the graph |Yo|, which is small relative to the total number of nodes. Computing the covariance function in Equation 12 incurs a computational cost of O(D2 max) per labelled node, where Dmax is the maximum node degree. In practice, the computational cost of computing the covariance function is small because of the sparse property of graphs typically observed in the real-world [17]. 4 Related Work Graph-based learning problems have been studied extensively by researchers from both machine learning and signal processing communities, leading to many models and algorithms that are wellsummarized in review papers [4, 35, 37]. Gaussian process-based models that operate on graphs have previously been developed in the closely related relational learning discipline, resulting in the mixed graph Gaussian process (XGP) [38] and relational Gaussian process (RGP) [8]. Additionally, the renowned Label Propagation (LP)[48] model can also be viewed as a GP with its covariance structure specified by the graph Laplacian matrix [49]. The GGP differs from the previously proposed GP models in that the local neighbourhood structures of the graph and the node features are directly used in the specification of the covariance function, resulting in a simple model that is highly effective. Models based on Laplacian regularization that restrict the node labels to vary smoothly over graphs have also been proposed previously. The LP model can be viewed as an instance under this framework. Other Laplacian regularization based models include the deep semi-supervised embedding [44] and the manifold regularization [3] models. As shown in the experimental results in Table 1, the predictive performance of these models fall short of other more sophisticated models. Additionally, models that extract embeddings of nodes and local sub-graphs which can be used for predictions have also been proposed by multiple authors. These models include DeepWalk [33], node2vec [19], planetoid [46] and many others. The proposed GGP is related to the embedding based models in that it can be viewed as a GP classifer that takes empirical kernel mean embeddings extracted from the 1-hop neighbourhood sub-graphs as inputs to predict node labels. Finally, many geometric deep learning models that operate on graphs have been proposed and shown to be successful in graph-based semi-supervised learning problems. The earlier models including [26, 36, 18] are inspired by the recurrent neural networks. On the other hand, convolution neural networks that learn convolutional filters in the graph Laplacian spectral domain have been demonstrated to perform well. These models include the spectral CNN [5], DCNN [1], ChebNet [12] and GCN [25]. Neural networks that operate on the graph spectral domain are limited by the graph-specific Fourier basis. The more recently proposed MoNet [31] addressed the graph-specific limitation of spectral graph neural networks. The idea of filtering in graph spectral domain is a powerful one that has also been explored in the kernel literatures [39, 43]. We draw parallels between our proposed model and the spectral filtering approaches in Section 3.1, where we view the GGP as a standard GP classifier operating on feature maps that have been transformed through a filter that can be related to the graph spectral domain. Our work has also been inspired by literatures in Gaussian processes that mix GPs via an additive function, such as [6, 14, 42]. 6 5 Experiments We present two sets of experiments to benchmark the predictive performance of the GGP against existing models under two different settings. In Section 5.1, we demonstrate that the GGP is a viable and extremely competitive alternative to the graph convolutional neural network (GCN) in settings where there are sufficient labelled data points. In Section 5.2, we test the models in an active learning experimental setup, and show that the GGP outperforms the baseline models when there are few training labels. 5.1 Semi-supervised Classification on Graphs The semi-supervised classification experiments in this section exactly replicate the experimental setup in [25], where the GCN is known to perform well. The three benchmark data sets, as described in Table 2, are citation networks with bag-of-words (BOW) features, and the prediction targets are the topics of the scientific papers in the citation networks. The experimental results are presented in Table 1, and show that the predictive performance of the proposed GGP is competitive with the GCN and MoNet [31] (another deep learning model), and superior to the other baseline models. While the GCN outperforms the proposed model by small margins on the test sets with 1, 000 data points, it is important to note that the GCN had access to 500 additional labelled data points for early stopping. As the GGP does not require early stopping, the additional labelled data points can instead be directly used to train the model to significantly improve the predictive performance. To demonstrate this advantage, we report another set of results for a GGP trained using the 500 additional data points in Table 1, in the row labelled as ‘GGP-X’. The boost in the predictive performances shows that the GGP can better exploit the available labelled data to make predictions. The GGP base kernel of choice is the 3rd degree polynomial kernel, which is known to work well with high-dimensional BOW features [45]. We re-weighed the BOW features using the popular term frequency-inverse document frequency (TFIDF) technique [40]. The variational parameters and the hyper-parameters were jointly optimized using the ADAM optimizer [24]. The baseline models that we compared to are the ones that were also presented and compared to in [25] and [31]. Cora Citeseer Pubmed GGP 80.9% 69.7% 77.1% GGP-X 84.7% 75.6% 82.4% GCN[25] 81.5% 70.3% 79.0% DCNN[1] 76.8% 73.0% MoNet[31] 81.7% 78.8% DeepWalk[33] 67.2% 43.2% 65.3% Planetoid[46] 75.7% 64.7% 77.2% ICA[27] 75.1% 69.1% 73.9% LP[48] 68.0% 45.3% 63.0% SemiEmb[44] 59.0% 59.6% 71.1% ManiReg[3] 59.5% 60.1% 70.7% Table 1: This table shows the test classification accuracies of the semi-supervised learning experiments described in Section 5.1. The test sets consist of 1, 000 data points. The GGP accuracies are averaged over 10 random restarts. The results for DCNN and MoNet are copied from [31] while the results for the other models are from [25]. Please refer to Section 5.1 for discussions of the results. Type Nnodes Nedges Nlabel_cat. Dfeatures Label Rate Cora Citation 2, 708 5, 429 7 1, 433 0.052 Citeseer Citation 3, 327 4, 732 6 3, 703 0.036 Pubmed Citation 19, 717 44, 338 3 500 0.003 Table 2: A summary of the benchmark data sets for the semi-supervised classification experiment. 7 5.2 Active Learning on Graphs Active learning is a domain that faces the same challenges as semi-supervised learning where labels are scarce and expensive to obtain [47]. In active learning, a subset of unlabelled data points are selected sequentially to be queried according to an acquisition function, with the goal of maximizing the accuracy of the predictive model using significantly fewer labels than would be required if the labelled set were sampled uniformly at random [2]. A motivating example of this problem scenario is in the medical setting where the time of human experts is precious, and the machines must aim to make the best use of the time. Therefore, having a data efficient predictive model that can generalize well with few labels is of critical importance in addition to having a good acquisition function. In this section, we leverage GGP as the semi-supervised classification model of active learner in graph-based active learning problem [47, 28, 11, 22, 29]. The GGP is paired with the proven Σoptimal (SOPT) acquisition function to form an active learner [28]. The SOPT acquisition function is model agnostic in that it only requires the Laplacian matrix of the observed graph and the indices of the labelled nodes in order to identify the next node to query, such that the predictive accuracy of the active learner is maximally increased. The main goal of the active learning experiments is to demonstrate that the GGP can learn better than both the GCN and the Label Propagation model (LP) [48] with very few labelled data points. Starting with only 1 randomly selected labelled data point (i.e., node), the active learner identifies the next data point to be labelled using the acquisition function. Once the label of the said data point is acquired, the classification model is retrained and its test accuracy is evaluated on the remaining unlabelled data points. In our experiments, the process is repeated until 50 labels are acquired. The experiments are also repeated with 10 different initial labelled data points. In addition to the SOPT acquisition function, we show the results of the same models paired with the random acquisition function (RAND) for comparisons. The test accuracies with different numbers of labelled data points are presented as learning curves in Figure 2. In addition, we summarize the results numerically using the Area under the Learning Curve (ALC) metric in Table 3. The ALC is normalized to have a maximum value of 1, which corresponds to a hypothetical learner that can achieve 100% test accuracy with only 1 label. The results show that the proposed GGP model is indeed more data efficient than the baselines and can outperform both the GCN and the LP models when labelled data are scarce. The benchmark data sets for the active learning experiments are the Cora and Citeseer data sets. However, due to technical restriction imposed by the SOPT acquisition function, only the largest connected sub-graph of the data set is used. The restriction reduces the number of nodes in the Cora and Citeseer data sets to 2, 485 and 2, 120 respectively. Both of the data sets were also used as benchmark data sets in [28]. We pre-process the BOW features with TFIDF and apply a linear kernel as the base kernel of the GGP. All parameters are jointly optimized using the ADAM optimizer. The GCN and LP models are trained using the settings recommended in [25] and [28] respectively. Cora Citeseer SOPT-GGP 0.733 ± 0.001 0.678 ± 0.002 SOPT-GCN 0.706 ± 0.001 0.675 ± 0.002 SOPT-LP 0.672 ± 0.001 0.638 ± 0.001 RAND-GGP 0.575 ± 0.007 0.557 ± 0.008 RAND-GCN 0.584 ± 0.011 0.533 ± 0.008 RAND-LP 0.424 ± 0.020 0.490 ± 0.011 Table 3: This table shows the Area under the Learning Curve (ALC) scores for the active learning experiments. ALC refers to the area under the learning curves shown in Figure 2 normalized to have a maximum value of 1. The ALCs are computed by averaging over 10 different initial data points. The results show that the GGP is able to generalize better with fewer labels compared to the baselines. ‘SOPT’ and ‘RAND’ refer to the acquisition functions used. Please refer to Section 5.2 for discussions of the results. 8 0 5 10 15 20 25 30 35 40 45 50 Number of Training Samples 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 Test Accuracy (%) Active Learning - CITESEER Data Set SOPT-GGP SOPT-GCN SOPT-LP RAND-GGP RAND-GCN RAND-LP Figure 2: The sub-figures show the test accuracies from the active learning experiments (y-axis) for the Cora (left) and Citeseer (right) data sets with different number of labelled data points (x-axis). The results are averaged over 10 trials with different initial data points. SOPT and RAND refer to the acquisition functions described in Section 5.2. The smaller error bars of ‘RAND-GGP’ compared to those of ‘RAND-GCN’ demonstrate the relative robustness of the GGP models under random shuffling of data points in the training data set. The tiny error bars of the ‘SOPT-*’ results show that the ‘SOPT’ acquisition function is insensitive to the randomly selected initial labelled data point. Please also refer to Table 3 for numerical summaries of the results. 6 Conclusion We propose a Gaussian process model that is data-efficient for semi-supervised learning problems on graphs. In the experiments, we show that the proposed model is competitive with the state-ofthe-art deep learning models, and outperforms when the number of labels is small. The proposed model is simple, effective and can leverage modern scalable variational inference algorithm for GP with minimal modification. In addition, the construction of our model is motivated by distribution regression using the empirical kernel mean embeddings, and can also be viewed under the framework of filtering in the graph spectrum. The spectral view offers a new potential research direction that can be explored in future work. Acknowledgements This work was supported by The Alan Turing Institute under the EPSRC grant EP/N510129/1. References [1] James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1993–2001, 2016. [2] Maria-Florina Balcan, Steve Hanneke, and Jennifer Wortman Vaughan. The true sample complexity of active learning. Machine learning, 80(2-3):111–139, 2010. [3] Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of machine learning research, 7(Nov):2399–2434, 2006. [4] Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017. [5] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. [6] M Yu Byron, John P Cunningham, Gopal Santhanam, Stephen I Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis 9 of neural population activity. In Advances in neural information processing systems, pages 1881–1888, 2009. [7] Olivier Chapelle, Bernhard Scholkopf, and Alexander Zien. Semi-supervised learning (chapelle, o. et al., eds.; 2006)[book reviews]. IEEE Transactions on Neural Networks, 20(3):542–542, 2009. [8] Wei Chu, Vikas Sindhwani, Zoubin Ghahramani, and S Sathiya Keerthi. Relational learning with gaussian processes. In Advances in Neural Information Processing Systems, pages 289–296, 2007. [9] Fan R. K. Chung. Spectral Graph Theory. American Mathematical Society, 1997. [10] Andreas Damianou and Neil Lawrence. Deep gaussian processes. In Artificial Intelligence and Statistics, pages 207–215, 2013. [11] Gautam Dasarathy, Robert Nowak, and Xiaojin Zhu. S2: An efficient graph based active learning algorithm with application to nonparametric classification. In Conference on Learning Theory, pages 503–522, 2015. [12] 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, pages 3844–3852, 2016. [13] David Duvenaud. Automatic model construction with Gaussian processes. PhD thesis, University of Cambridge, 2014. [14] David K Duvenaud, Hannes Nickisch, and Carl E Rasmussen. Additive gaussian processes. In Advances in neural information processing systems, pages 226–234, 2011. [15] Seth R Flaxman, Yu-Xiang Wang, and Alexander J Smola. Who supported Obama in 2012?: Ecological inference through distribution regression. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 289–298. ACM, 2015. [16] Mark Girolami and Simon Rogers. Variational bayesian multinomial probit regression with gaussian process priors. Neural Computation, 18(8):1790–1817, 2006. [17] Anna Goldenberg, Alice X Zheng, Stephen E Fienberg, Edoardo M Airoldi, et al. A survey of statistical network models. Foundations and Trends R⃝in Machine Learning, 2(2):129–233, 2010. [18] Marco Gori, Gabriele Monfardini, and Franco Scarselli. A new model for learning in graph domains. In Neural Networks, 2005. IJCNN’05. Proceedings. 2005 IEEE International Joint Conference on, volume 2, pages 729–734. IEEE, 2005. [19] 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, pages 855–864. ACM, 2016. [20] James Hensman, Alexander G Matthews, Maurizio Filippone, and Zoubin Ghahramani. Mcmc for variationally sparse gaussian processes. In Advances in Neural Information Processing Systems, pages 1648–1656, 2015. [21] Daniel Hernández-Lobato, José M Hernández-Lobato, and Pierre Dupont. Robust multi-class gaussian process classification. In Advances in neural information processing systems, pages 280–288, 2011. [22] Kwang-Sung Jun and Robert Nowak. Graph-based active learning: A new look at expected error minimization. In Signal and Information Processing (GlobalSIP), 2016 IEEE Global Conference on, pages 1325–1329. IEEE, 2016. [23] Hyun-Chul Kim and Zoubin Ghahramani. Bayesian gaussian process classification with the em-ep algorithm. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(12):1948– 1959, 2006. 10 [24] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [25] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [26] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015. [27] Qing Lu and Lise Getoor. Link-based classification. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pages 496–503, 2003. [28] Yifei Ma, Roman Garnett, and Jeff Schneider. σ-optimality for active learning on gaussian random fields. In Advances in Neural Information Processing Systems, pages 2751–2759, 2013. [29] Oisin Mac Aodha, Neill D.F. Campbell, Jan Kautz, and Gabriel J. Brostow. Hierarchical Subquery Evaluation for Active Learning on a Graph. In CVPR, 2014. [30] A Matthews. Scalable Gaussian process inference using variational methods. PhD thesis, PhD thesis. University of Cambridge, 2016. [31] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, Honolulu, HI, USA, July 21-26, 2017, pages 5425–5434. IEEE Computer Society, 2017. [32] Krikamol Muandet, Kenji Fukumizu, Bharath Sriperumbudur, Bernhard Schölkopf, et al. Kernel mean embedding of distributions: A review and beyond. Foundations and Trends R⃝in Machine Learning, 10(1-2):1–141, 2017. [33] 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, pages 701–710. ACM, 2014. [34] Hugh Salimbeni and Marc Deisenroth. Doubly stochastic variational inference for deep gaussian processes. In Advances in Neural Information Processing Systems, pages 4588–4599, 2017. [35] Aliaksei Sandryhaila and Jose MF Moura. Big data analysis with signal processing on graphs: Representation and processing of massive data sets with irregular structure. IEEE Signal Processing Magazine, 31(5):80–90, 2014. [36] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. [37] 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. [38] Ricardo Silva, Wei Chu, and Zoubin Ghahramani. Hidden common cause relations in relational learning. In Advances in neural information processing systems, pages 1345–1352, 2008. [39] Alexander J Smola and Risi Kondor. Kernels and regularization on graphs. In Learning theory and kernel machines, pages 144–158. Springer, 2003. [40] Karen Sparck Jones. A statistical interpretation of term specificity and its application in retrieval. Journal of documentation, 28(1):11–21, 1972. [41] Zoltán Szabó, Bharath K Sriperumbudur, Barnabás Póczos, and Arthur Gretton. Learning theory for distribution regression. The Journal of Machine Learning Research, 17(1):5272–5311, 2016. [42] Mark van der Wilk, Carl Edward Rasmussen, and James Hensman. Convolutional gaussian processes. In Advances in Neural Information Processing Systems, pages 2845–2854, 2017. [43] S Vichy N Vishwanathan, Nicol N Schraudolph, Risi Kondor, and Karsten M Borgwardt. Graph kernels. Journal of Machine Learning Research, 11(Apr):1201–1242, 2010. 11 [44] Jason Weston, Frédéric Ratle, Hossein Mobahi, and Ronan Collobert. Deep learning via semisupervised embedding. In Neural Networks: Tricks of the Trade, pages 639–655. Springer, 2012. [45] Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. the MIT Press, 2(3):4, 2006. [46] Zhilin Yang, William W. Cohen, and Ruslan Salakhutdinov. Revisiting semi-supervised learning with graph embeddings. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pages 40–48. JMLR.org, 2016. [47] Xiaojin Zhu. Semi-supervised learning literature survey. Technical Report 1530, Computer Sciences, University of Wisconsin-Madison, 2005. [48] Xiaojin Zhu, Zoubin Ghahramani, and John D Lafferty. Semi-supervised learning using gaussian fields and harmonic functions. In Proceedings of the 20th International conference on Machine learning (ICML-03), pages 912–919, 2003. [49] Xiaojin Zhu, John D Lafferty, and Zoubin Ghahramani. Semi-supervised learning: From gaussian fields to gaussian processes. Technical report, Carnegie Mellon University, Computer Science Department, 2003. 12
2018
144
7,302
Simple, Distributed, and Accelerated Probabilistic Programming Dustin Tran⇤ Matthew D. Hoffman† Dave Moore† Christopher Suter† Srinivas Vasudevan† Alexey Radul† Matthew Johnson⇤ Rif A. Saurous† ⇤Google Brain, †Google Abstract We describe a simple, low-level approach for embedding probabilistic programming in a deep learning ecosystem. In particular, we distill probabilistic programming down to a single abstraction—the random variable. Our lightweight implementation in TensorFlow enables numerous applications: a model-parallel variational auto-encoder (VAE) with 2nd-generation tensor processing units (TPUv2s); a data-parallel autoregressive model (Image Transformer) with TPUv2s; and multiGPU No-U-Turn Sampler (NUTS). For both a state-of-the-art VAE on 64x64 ImageNet and Image Transformer on 256x256 CelebA-HQ, our approach achieves an optimal linear speedup from 1 to 256 TPUv2 chips. With NUTS, we see a 100x speedup on GPUs over Stan and 37x over PyMC3.1 1 Introduction Many developments in deep learning can be interpreted as blurring the line between model and computation. Some have even gone so far as to declare a new paradigm of “differentiable programming,” in which the goal is not merely to train a model but to perform general program synthesis.2 In this view, attention [3] and gating [18] describe boolean logic; skip connections [17] and conditional computation [6, 14] describe control flow; and external memory [12, 15] accesses elements outside a function’s internal scope. Learning algorithms are also increasingly dynamic: for example, learning to learn [19], neural architecture search [52], and optimization within a layer [1]. The differentiable programming paradigm encourages modelers to explicitly consider computational expense: one must consider not only a model’s statistical properties (“how well does the model capture the true data distribution?”), but its computational, memory, and bandwidth costs (“how efficiently can it train and make predictions?”). This philosophy allows researchers to engineer deep-learning systems that run at the very edge of what modern hardware makes possible. By contrast, the probabilistic programming community has tended to draw a hard line between model and computation: first, one specifies a probabilistic model as a program; second, one performs an “inference query” to automatically train the model given data [44, 33, 8]. This design choice makes it difficult to implement probabilistic models at truly large scales, where training multibillion parameter models requires splitting model computation across accelerators and scheduling communication [41]. Recent advances such as Edward [48] have enabled finer control over inference procedures in deep learning (see also [28, 7]). However, they all treat inference as a closed 1All code, including experiments and more details from code snippets displayed here, is available at http://bit.ly/2JpFipt. Namespaces: import tensorflow as tf; ed=edward2; tfe=tf.contrib.eager. Code snippets assume tensorflow==1.12.0. 2Recent advocates of this trend include Tom Dietterich (https://twitter.com/tdietterich/ status/948811925038669824) and Yann LeCun (https://www.facebook.com/yann.lecun/posts/ 10155003011462143). It is a classic idea in the programming languages field [4]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. def model(): p = ed.Beta(1., 1., name="p") x = ed.Bernoulli(probs=p, sample_shape=50, name="x") return x Figure 1: Beta-Bernoulli program. In eager mode, model() generates a binary vector of 50 elements. In graph mode, model() returns an op to be evaluated in a TensorFlow session. import neural_net_negative, neural_net_positive def variational(x): eps = ed.Normal(0., 1., sample_shape=2) if eps[0] > 0: return neural_net_positive(eps[1], x) else: return neural_net_negative(eps[1], x) Figure 2: Variational program [35], available in eager mode. Python control flow is applicable to generative processes: given a coin flip, the program generates from one of two neural nets. Their outputs can have differing shape (and structure). system: this makes them difficult to compose with arbitrary computation, and with the broader machine learning ecosystem, such as production platforms [5]. In this paper, we describe a simple approach for embedding probabilistic programming in a deep learning ecosystem; our implementation is in TensorFlow and Python, named Edward2. This lightweight approach offers a low-level modality for flexible modeling—one which deep learners benefit from flexible prototyping with probabilistic primitives, and one which probabilistic modelers benefit from tighter integration with familiar numerical ecosystems. Contributions. We distill the core of probabilistic programming down to a single abstraction—the random variable. Unlike existing languages, there is no abstraction for learning: algorithms may for example be functions taking a model as input (another function) and returning tensors. This low-level design has two important implications. First, it enables research flexibility: a researcher has freedom to manipulate model computation for training and testing. Second, it enables bigger models using accelerators such as tensor processing units (TPUs) [22]: TPUs require specialized ops in order to distribute computation and memory across a physical network topology. We illustrate three applications: a model-parallel variational auto-encoder (VAE) [24] with TPUs; a data-parallel autoregressive model (Image Transformer [31]) with TPUs; and multi-GPU No-U-Turn Sampler (NUTS) [21]. For both a state-of-the-art VAE on 64x64 ImageNet and Image Transformer on 256x256 CelebA-HQ, our approach achieves an optimal linear speedup from 1 to 256 TPUv2 chips. With NUTS, we see a 100x speedup on GPUs over Stan [8] and 37x over PyMC3 [39]. 1.1 Related work To the best of our knowledge, this work takes a unique design standpoint. Although its lightweight design adds research flexibility, it removes many high-level abstractions which are often desirable for practitioners. In these cases, automated inference in alternative probabilistic programming languages (PPLs) [25, 39] prove useful, so both styles are important for different audiences. Combining PPLs with deep learning poses many practical challenges; we outline three. First, with the exception of recent works [49, 36, 39, 42, 7, 34], most languages lack support for minibatch training and variational inference, and most lack critical systems features such as numerical stability, automatic differentiation, accelerator support, and vectorization. Second, existing PPLs restrict learning algorithms to be “inference queries”, which return conditional or marginal distributions of a program. By blurring the line between model and computation, a lighterweight approach allows any algorithm operating on probability distributions; this enables, e.g., risk minimization and the information bottleneck. Third, it has been an open challenge to scale PPLs to 50+ million parameter models, to multi-machine environments, and with data or model parallelism. To the best of our knowledge, this work is the first to do so. 2 Random Variables Are All You Need We outline probabilistic programs in Edward2. They require only one abstraction: a random variable. We then describe how to perform flexible, low-level manipulations using tracing. 2.1 Probabilistic Programs, Variational Programs, and Many More 2 Edward2 reifies any computable probability distribution as a Python function (program). Typically, the function executes the generative process and returns samples.3 Inputs to the program—along with any scoped Python variables—represent values the distribution conditions on. To specify random choices in the program, we use RandomVariables from Edward [49], which has similarly been built on by Zhusuan [42] and Probtorch [34]. Random variables provide methods such as log_prob and sample, wrapping TensorFlow Distributions [10]. Further, Edward random variables augment a computational graph of TensorFlow operations: each random variable x is associated to a sampled tensor x⇤⇠p(x) in the graph. Figure 1 illustrates a toy example: a Beta-Bernoulli model, p(x, p) = Beta(p | 1, 1) Q50 n=1 Bernoulli(xn | p), where p is a latent probability shared across the 50 data points x 2 {0, 1}50. The random variable x is 50-dimensional, parameterized by the tensor p⇤⇠p(p). As part of TensorFlow, Edward2 supports two execution modes. Eager mode simultaneously places operations onto the computational graph and executes them; here, model() calls the generative process and returns a binary vector of 50 elements. Graph mode separately stages graph-building and execution; here, model() returns a deferred TensorFlow vector; one may run a TensorFlow session to fetch the vector. Importantly, all distributions—regardless of downstream use—are written as probabilistic programs. Figure 2 illustrates an implicit variational program, i.e., a variational distribution which admits sampling but may not have a tractable density. In general, variational programs [35], proposal programs [9], and discriminators in adversarial training [13] are computable probability distributions. If we have a mechanism for manipulating these probabilistic programs, we do not need to introduce any additional abstractions to support powerful inference paradigms. Below we demonstrate this flexibility using a model-parallel VAE. 2.2 Example: Model-Parallel VAE with TPUs Figure 4 implements a model-parallel variational auto-encoder (VAE), which consists of a decoder, prior, and encoder. The decoder generates 16-bit audio (a sequence of T values in [0, 216 −1] normalized to [0, 1]); it employs an autoregressive flow, which for training efficiently parallelizes over sequence length [30]. The prior posits latents representing a coarse 8-bit resolution over T/2 steps; it is learnable with a similar architecture. The encoder compresses each sample into the coarse resolution; it is parameterized by a compressing function. A TPU cluster arranges cores in a toroidal network, where for example, 512 cores may be arranged as a 16x16x2 torus interconnect. To utilize the cluster, the prior and decoder apply distributed autoregressive flows (Figure 3). They split compute across a virtual 4x4 topology in two ways: “across flows”, where every 2 flows belong on a different core; and “within a flow”, where 4 independent flows apply layers respecting autoregressive ordering (for space, we omit code for splitting within a flow). The encoder splits computation via compressor; for space, we also omit it. The probabilistic programs are concise. They capture recent advances such as autoregressive flows and multi-scale latent variables, and they enable never-before-tried architectures where with 16x16 TPUv2 chips (512 cores), the model can split across 4.1TB memory and utilize up to 1016 FLOPS. All elements of the VAE—distributions, architectures, and computation placement—are extensible. For training, we use typical TensorFlow ops; we describe how this works next. 2.3 Tracing We defined probabilistic programs as arbitrary Python functions. To enable flexible training, we apply tracing, a classic technique used across probabilistic programming [e.g., 28, 45, 36, 11, 7] as well as automatic differentiation [e.g., 27]. A tracer wraps a subset of the language’s primitive operations so that the tracer can intercept control just before those operations are executed. Figure 5 displays the core implementation: it is 10 lines of code.4 trace is a context manager which, upon entry, pushes a tracer callable to a stack, and upon exit, pops tracer from the stack. traceable is a decorator: it registers functions so that they may be traced according to the stack. 3Instead of sampling, one can also represent a distribution in terms of its density; see Section 3.1. 4Rather than implement tracing, one can also reuse the pre-existing one in an autodiff system. However, our purposes require tracing with user control (tracer functions above) in order to manipulate computation. This is not presently available in TensorFlow Eager or Autograd [27]—which motivated our implementation. 3 import SplitAutoregressiveFlow, masked_network tfb = tf.contrib.distributions.bijectors class DistributedAutoregressiveFlow(tfb.Bijector): def __init__(flow_size=[4]*8): self.flows = [] for num_splits in flow_size: flow = SplitAutoregressiveFlow(masked_network, num_splits) self.flows.append(flow) self.flows.append(SplitAutoregressiveFlow(masked_network, 1)) super(DistributedAutoregressiveFlow, self).__init__() def _forward(self, x): for l, flow in enumerate(self.flows): with tf.device(tf.contrib.tpu.core(l//2)): x = flow.forward(x) return x def _inverse_and_log_det_jacobian(self, y): ldj = 0. for l, flow in enumerate(self.flows[::-1]): with tf.device(tf.contrib.tpu.core(l//2)): y, new_ldj = flow.inverse_and_log_det_jacobian(y) ldj += new_ldj return y, ldj Figure 3: Distributed autoregressive flows. (right) The default length is 8, each with 4 independent flows. Each flow transforms inputs via layers respecting autoregressive ordering. (left) Flows are partitioned across a virtual topology of 4x4 cores (rectangles); each core computes 2 flows and is locally connected; a final core aggregates. The virtual topology aligns with the physical TPU topology: for 4x4 TPUs, it is exact; for 16x16 TPUs, it is duplicated for data parallelism. import upsample, compressor def prior(): """Uniform noise to 8-bit latent, [u1,...,u(T/2)] -> [z1,...,z(T/2)]""" dist = ed.Independent(ed.Uniform(low=tf.zeros([batch_size, T/2]))) return ed.TransformedDistribution(dist, DistributedAutoregressiveFlow(flow_size)) def decoder(z): """Uniform noise + latent to 16-bit audio, [u1,...,uT], [z1,...,z(T/2)] -> [x1,...,xT]""" dist = ed.Independent(ed.Uniform(low=tf.zeros([batch_size, T]))) dist = ed.TransformedDistribution(dist, tfb.Affine(shift=upsample(z))) return ed.TransformedDistribution(dist, DistributedAutoregressiveFlow(flow_size)) def encoder(x): """16-bit audio to 8-bit latent, [x1,...,xT] -> [z1,...,z(T/2)]""" loc, log_scale = tf.split(compressor(x), 2, axis=-1) return ed.Normal(loc=loc, scale=tf.exp(log_scale)) Figure 4: Model-parallel VAE with TPUs, generating 16-bit audio from 8-bit latents. The prior and decoder split computation according to distributed autoregressive flows. The encoder may split computation according to compressor; we omit it for space. 4 STACK = [lambda f, *a, **k: f(*a, **k)] @contextmanager def trace(tracer): STACK.append(tracer) yield STACK.pop() def traceable(f): def f_wrapped(*a, **k): STACK[-1](f, *a, **k) return f_wrapped Figure 5: Minimal implementation of tracing. trace defines a context; any traceable ops executed during it are replaced by calls to tracer. traceable registers these ops; we register Edward random variables. pi log einsum einsum subtract [ 2.3 2.3 2.3 2.3 2.3] add 4.94 add 29.3 z one_hot einsum einsum einsum 5 einsum add tau log einsum einsum einsum add add -11.5 add -9.19 mu -0.05 add add 200 add -368 x subtract -0.5 subtract subtract output Figure 6: A program execution. It is a directed acyclic graph and is traced for various operations such as accumulating log-probabilities or finding conditional independence. def make_log_joint_fn(model): def log_joint_fn(**model_kwargs): def tracer(rv_call, *args, **kwargs): name = kwargs.get("name") kwargs["value"] = model_kwargs.get(name) rv = rv_call(*args, **kwargs) log_probs.append(tf.sum(rv.log_prob(rv))) return rv log_probs = [] with trace(tracer): model(**model_kwargs) return sum(log_probs) return log_joint_fn Figure 7: A higher-order function which takes a model program as input and returns its log-joint density function. def mutilate(model, **do_kwargs): def mutilated_model(*args, **kwargs): def tracer(rv_call, *args, **kwargs): name = kwargs.get("name") if name in do_kwargs: return do_kwargs[name] return rv_call(*args, **kwargs) with trace(tracer): return model(*args, **kwargs) return mutilated_model Figure 8: A higher-order function which takes a model program as input and returns its causally intervened program. Intervention differs from conditioning: it does not change the sampled value but the distribution. Edward2 registers random variables: for example, Normal = traceable(edward1.Normal). The tracing implementation is also agnostic to the numerical backend. Appendix A applies Figure 5 to implement Edward2 on top of SciPy. 2.4 Tracing Applications Tracing is a common tool for probabilistic programming. However, in other languages, tracing primarily serves as an implementation detail to enable inference “meta-programming” procedures. In our approach, we promote it to be a user-level technique for flexible computation. We outline two examples; both are difficult to implement without user access to tracing. Figure 7 illustrates a make_log_joint factory function. It takes a model program as input and returns its joint density function across a trace. We implement it using a tracer which sets random variable values to the input and accumulates its log-probability as a side-effect. Section 3.3 applies make_log_joint in a variational inference algorithm. Figure 8 illustrates causal intervention [32]: it “mutilates” a program by setting random variables indexed by their name to another random variable. Note this effect is propagated to any descendants while leaving non-descendants unaltered: this is possible because Edward2 implicitly traces a dataflow graph over random variables, following a “push” model of evaluation. Other probabilistic operations more naturally follow a “pull” model of evaluation: mean-field variational inference requires evaluating energy terms corresponding to a single factor; we do so by reifying a variational program’s trace (e.g., Figure 6) and walking backwards from that factor’s node in the trace. 3 Examples: Learning with Low-Level Functions We described probabilistic programs and how to manipulate their computation with low-level tracing functions. Unlike existing PPLs, there is no abstraction for learning. Below we provide examples of how this works and its implications. 5 import get_channel_embeddings, add_positional_embedding_nd, local_attention_1d def image_transformer(inputs, hparams): x = get_channel_embeddings(3, inputs, hparams.hidden_size) x = tf.reshape(x, [-1, 32*32*3, hparams.hidden_size]) x = tf.pad(x, [[0, 0], [1, 0], [0, 0]])[:, :-1, :] # shift pixels right x = add_positional_embedding_nd(x, max_length=32*32*3+3) x = tf.nn.dropout(x, keep_prob=0.7) for _ in range(hparams.num_layers): y = local_attention_1d(x, hparams, attention_type="local_mask_right", q_padding="LEFT", kv_padding="LEFT") x = tf.contrib.layers.layer_norm(tf.nn.dropout(y, keep_prob=0.7) + x, begin_norm_axis=-1) y = tf.layers.dense(x, hparams.filter_size, activation=tf.nn.relu) y = tf.layers.dense(y, hparams.hidden_size, activation=None) x = tf.contrib.layers.layer_norm(tf.nn.dropout(y, keep_prob=0.7) + x, begin_norm_axis=-1) logits = tf.layers.dense(x, 256, activation=None) return ed.Categorical(logits=logits).log_prob(inputs) loss = -tf.reduce_sum(image_transformer(inputs, hparams)) # inputs has shape [batch,32,32,3] train_op = tf.contrib.tpu.CrossShardOptimizer(tf.train.AdamOptimizer()).minimize(loss) Figure 9: Data-parallel Image Transformer with TPUs [31]. It is a neural autoregressive model which computes the log-probability of a batch of images with self-attention. Our lightweight design enables representing and training the model as a log-probability function; this is more efficient than the typical representation of programs as a generative process. Embedding and self-attention functions are assumed in the environment; they are available in Tensor2Tensor [50]. 3.1 Example: Data-Parallel Image Transformer with TPUs All PPLs have so far focused on a unifying representation of models, typically as a generative process. However, this can be inefficient in practice for certain models. Because our lightweight approach has no required signature for training, it permits alternative model representations.5 For example, Figure 9 represents the Image Transformer [31] as a log-probability function. The Image Transformer is a state-of-the-art autoregressive model for image generation, consisting of a Categorical distribution parameterized by a batch of right-shifted images, embeddings, a sequence of alternating self-attention and feedforward layers, and an output layer. The function computes log_prob with respect to images and parallelizes over pixel dimensions. Unlike the log-probability, sampling requires programming the autoregressivity in serial, which is inefficient and harder to implement.6 With the log-probability representation, data parallelism with TPUs is also immediate by cross-sharding the optimizer. The train op can be wrapped in a TF Estimator, or applied with manual TPU ops in order to aggregate training across cores. 3.2 Example: No-U-Turn Sampler Figure 10 demonstrates the core logic behind the No-U-Turn Sampler (NUTS), a Hamiltonian Monte Carlo algorithm which adaptively selects the path length hyperparameter during leapfrog integration. Its implementation uses non-tail recursion, following the pseudo-code in Hoffman and Gelman [21, Alg 6]; both CPUs and GPUs are compatible. See source code for the full implementation; Appendix B also implements a grammar VAE [26] using a data-dependent while loop. The ability to integrate NUTS requires interoperability with eager mode: NUTS requires Python control flow, as it is difficult to implement recursion natively with TensorFlow ops. (NUTS is not available, e.g., in Edward 1.) However, eager execution has tradeoffs (not unique to our approach). For example, it incurs a non-negligible overhead over graph mode, and it has preliminary support for TPUs. Our lightweight design supports both modes so the user can select either. 5The Image Transformer provides a performance reason for when density representations may be preferred. Another compelling example are energy-based models p(x) / exp{f(x)}, where sampling is not even available in closed-form; in contrast, the unnormalized density is. 6In principle, one can reify any model in terms of sampling and apply make_log_joint to obtain its density. However, make_log_joint cannot always be done efficiently in practice, such as in this example. In contrast, the reverse program transformation from density to sampling can be done efficiently: in this example, sampling can at best compute in serial order; therefore it requires no performance optimization. 6 def nuts(...): samples = [] for _ in range(num_samples): state = set_up_trajectory(...) depth = 0 while no_u_turn(state): state = extend_trajectory(depth, state) depth += 1 samples.append(state) return samples def extend_trajectory(depth, state): if depth == 0: state = one_leapfrog_step(state) else: state = extend_trajectory(depth-1, state) if no_u_turn(state): state = extend_trajectory(depth-1, state) return state Figure 10: Core logic in No-U-Turn Sampler [21]. This algorithm has data-dependent non-tail recursion. Figure 11: Learning often involves matching two execution traces such as a model program’s (left) and a variational program’s (right), or a model program’s with data tensors (bottom). Red arrows align prior and variational variables. Blue arrows align observed variables and data; edges from data to variational variables represent amortization. 3.3 Example: Alignment of Probabilistic Programs Learning algorithms often involve manipulating multiple probabilistic programs. For example, a variational inference algorithm takes two programs as input—the model program and variational program—and computes a loss function for optimization. This requires specifying which variables refer to each other in the two programs. We apply alignment (Figure 11), which is a dictionary of key-value pairs, each from one string (a random variable’s name) to another (a random variable in the other program). This dictionary provides flexibility over how random variables are aligned, independent of their specifications in each program. For example, this enables ladder VAEs [43] where prior and variational topological orderings are reversed; and VampPriors [46] where prior and variational parameters are shared. Figure 12 shows variational inference with gradient descent using a fixed preconditioner. It applies make_log_joint_fn (Figure 7) and assumes model applies a random variable with name ’x’ (such as the VAE in Section 2.2). Note this extends alignment from Edward 1 to dynamic programs [48]: instead of aligning nodes in static graphs at construction-time, it aligns nodes in execution traces at runtime. It also has applications for aligning model and proposal programs in MetropolisHastings; model and discriminator programs in adversarial training; and even model programs and data infeeding functions (“programs”) in input-output pipelines. 3.4 Example: Learning to Learn by Variational Inference by Gradient Descent A lightweight design is not only advantageous for flexible specification of learning algorithms but flexible composability: here, we demonstrate nested inference via learning to learn. Recall Figure 12 performs variational inference with gradient descent. Figure 13 applies gradient descent on the output of that gradient descent algorithm. It finds the optimal preconditioner [2]. This is possible because learning algorithms are simply compositions of numerical operations; the composition is fully differentiable. This differentiability is not possible with Edward, which manipulates inference objects: taking gradients of one is not well-defined.7 See also Appendix C which illustrates Markov chain Monte Carlo within variational inference. 4 Experiments We introduced a lightweight approach for embedding probabilistic programming in a deep learning ecosystem. Here, we show that such an approach is particularly advantageous for exploiting modern 7Unlike Edward, Edward2 can also specify distributions over the learning algorithm. 7 import model, variational, align, x def train(precond): def loss_fn(x): qz = variational(x) log_joint_fn = make_log_joint_fn(model) kwargs = {align[rv.name]: rv for rv in toposort(qz)} energy = log_joint_fn(x=x, **kwargs) entropy = sum([tf.reduce_sum(rv.entropy()) for rv in toposort(qz)]) return -energy - entropy grad_fn = tfe.implicit_gradients(loss_fn) optimizer = tf.train.AdamOptimizer(0.1) for _ in range(500): grads = tf.tensordot(precond, grad_fn(x), [[1], [0]]) optimizer.apply_gradients(grads) return loss_fn(x) Figure 12: Variational inference with preconditioned gradient descent. Edward2 offers writing the probabilistic program and performing arbitrary TensorFlow computation for learning. grad_fn = tfe.gradients_function(train) optimizer = tf.train.AdamOptimizer(0.1) for _ in range(100): optimizer.apply_gradients(grad_fn()) Figure 13: Learning-to-learn. It finds the optimal preconditioner for train (Figure 12) by differentiating the entire learning algorithm with respect to the preconditioner. 1 16 64 128 256 # TPU v2 chips 0 50 100 150 200 250 300 350 400 Examples / Sec Speedup over TPUs, slope=1.40 Figure 14: Vector-Quantized VAE on 64x64 ImageNet. 1 16 64 128 256 # TPU v2 chips 0 500 1000 1500 2000 Examples / Sec Speedup over TPUs, slope=7.49 Figure 15: Image Transformer on 256x256 CelebA-HQ. hardware for multi-TPU VAEs and autoregressive models, and multi-GPU NUTS. CPU experiments use a six-core Intel E5-1650 v4, GPU experiments use 1-8 NVIDIA Tesla V100 GPUs, and TPU experiments use 2nd generation chips under a variety of topology arrangements. The TPUv2 chip comprises two cores: each features roughly 22 teraflops on mixed 16/32-bit precision (it is roughly twice the flops of a NVIDIA Tesla P100 GPU on 32-bit precision). In all distributed experiments, we cross-shard the optimizer for data-parallelism: each shard (core) takes a batch size of 1. All numbers are averaged over 5 runs. 4.1 High-Quality Image Generation We evaluate models with near state-of-the-art results (“bits/dim”) for non-autoregressive generation on 64x64 ImageNet [29] and autoregressive generation on 256x256 CelebA-HQ [23]. We evaluate wall clock time of the number of examples (data points) processed per second. For 64x64 ImageNet, we use a vector-quantized variational auto-encoder trained with soft EM [37]. It encodes a 64x64x3 pixel image into a 8x8x10 tensor of latents, with a codebook size of 256 and where each code vector has 512 dimensions. The prior is an Image Transformer [31] with 6 layers of local 1D self-attention. The encoder applies 4 convolutional layers with kernel size 5 and stride 2, 2 residual layers, and a dense layer. The decoder applies the reverse of a dense layer, 2 residual layers, and 4 transposed convolutional layers. 8 System Runtime (ms) Stan (CPU) 201.0 PyMC3 (CPU) 74.8 Handwritten TF (CPU) 66.2 Edward2 (CPU) 68.4 Handwritten TF (1 GPU) 9.5 Edward2 (1 GPU) 9.7 Edward2 (8 GPU) 2.3 Table 1: Time per leapfrog step for No-U-Turn Sampler in Bayesian logistic regression. Edward2 (GPU) achieves a 100x speedup over Stan (CPU) and 37x over PyMC3 (CPU); dynamism is not available in Edward. Edward2 also incurs negligible overhead over handwritten TensorFlow code. For 256x256 CelebA-HQ, we use a relatively small Image Transformer [31] in order to fit the model in memory. It applies 5 layers of local 1D self-attention with block length of 256, hidden sizes of 128, attention key/value channels of 64, and feedforward layers with a hidden size of 256. Figure 14 and Figure 15 show that for both models, Edward2 achieves an optimal linear scaling over the number of TPUv2 chips from 1 to 256. In experiments, we also found the larger batch sizes drastically sped up training. 4.2 No-U-Turn Sampler We use the No-U-Turn Sampler (NUTS, [21]) to illustrate the power of dynamic algorithms on accelerators. NUTS implements a variant of Hamiltonian Monte Carlo in which the fixed trajectory length is replaced by a recursive doubling procedure that adapts the length per iteration. We compare Bayesian logistic regression using NUTS implemented in Stan [8] and in PyMC3 [39] to our eager-mode TensorFlow implementation. The model’s log joint density is implemented as “handwritten” TensorFlow code and by a probabilistic program in Edward2; see code in Appendix D. We use the Covertype dataset (581,012 data points, 54 features, outcomes are binarized). Since adaptive sampling may lead NUTS iterations to take wildly different numbers of leapfrog steps, we report the average time per leapfrog step, averaged over 5 full NUTS trajectories (in these experiments, that typically amounted to about a thousand leapfrog steps total). Table 1 shows that Edward2 (GPU) has up to a 37x speedup over PyMC3 with multi-threaded CPU; it has up to a 100x speedup over Stan, which is single-threaded.8 In addition, while Edward2 in principle introduces overhead in eager mode due to its tracing mechanism, the speed differential between Edward2 and handwritten TensorFlow code is neligible (smaller than between-run variation). This demonstrates that the power of the PPL formalism comes with negligible overhead. 5 Discussion We described a simple, low-level approach for embedding probabilistic programming in a deep learning ecosystem. For both a state-of-the-art VAE on 64x64 ImageNet and Image Transformer on 256x256 CelebA-HQ, we achieve an optimal linear speedup from 1 to 256 TPUv2 chips. For NUTS, we see up to 100x speedups over other systems. As current work, we are pushing on this design as a stage for fundamental research in generative models and Bayesian neural networks (e.g., [47, 51, 16]). In addition, our experiments relied on data parallelism to show massive speedups. Recent work has improved distributed programming of neural networks for both model parallelism and parallelism over large inputs such as super-highresolution images [40]. Combined with this work, we hope to push the limits of giant probabilistic models with over 1 trillion parameters and over 4K resolutions (50 million dimensions). Acknowledgements. We thank the anonymous NIPS reviewers, TensorFlow Eager team, PyMC team, Alex Alemi, Samy Bengio, Josh Dillon, Delesley Hutchins, Dick Lyon, Dougal Maclaurin, 8PyMC3 is actually slower with GPU than CPU; its code frequently communicates between Theano on the GPU and NumPy on the CPU. Stan only used one thread as it leverages multiple threads by running HMC chains in parallel, and it requires double precision. 9 Kevin Murphy, Niki Parmar, Zak Stone, and Ashish Vaswani for their assistance in improving the implementation, the benchmarks, and/or the paper. References [1] Amos, B. and Kolter, J. Z. (2017). OptNet: Differentiable optimization as a layer in neural networks. In International Conference on Machine Learning. [2] Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M. W., Pfau, D., Schaul, T., and de Freitas, N. (2016). Learning to learn by gradient descent by gradient descent. In Neural Information Processing Systems. [3] Bahdanau, D., Cho, K., and Bengio, Y. (2015). Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations. [4] Baydin, A. G., Pearlmutter, B. A., Radul, A. A., and Siskind, J. M. (2015). Automatic differentiation in machine learning: a survey. arXiv preprint arXiv:1502.05767. [5] Baylor, D., Breck, E., Cheng, H.-T., Fiedel, N., Foo, C. Y., Haque, Z., Haykal, S., Ispir, M., Jain, V., Koc, L., et al. (2017). TFX: A TensorFlow-based production-scale machine learning platform. In Knowledge Discovery and Data Mining. [6] Bengio, E., Bacon, P.-L., Pineau, J., and Precup, D. (2015). Conditional computation in neural networks for faster models. arXiv preprint arXiv:1511.06297. [7] Bingham, E., Chen, J. P., Jankowiak, M., Obermeyer, F., Pradhan, N., Karaletsos, T., Singh, R., Szerlip, P., Horsfall, P., and Goodman, N. D. (2018). Pyro: Deep Universal Probabilistic Programming. arXiv preprint arXiv:1810.09538. [8] Carpenter, B., Gelman, A., Hoffman, M. D., Lee, D., Goodrich, B., Betancourt, M., Brubaker, M., Guo, J., Li, P., and Riddell, A. (2016). Stan: A probabilistic programming language. Journal of Statistical Software. [9] Cusumano-Towner, M. F. and Mansinghka, V. K. (2018). Using probabilistic programs as proposals. In POPL Workshop. [10] Dillon, J. V., Langmore, I., Tran, D., Brevdo, E., Vasudevan, S., Moore, D., Patton, B., Alemi, A., Hoffman, M., and Saurous, R. A. (2017). TensorFlow Distributions. arXiv preprint arXiv:1711.10604. [11] Ge, H., Xu, K., Scibior, A., Ghahramani, Z., et al. (2018). The Turing language for probabilistic programming. In Artificial Intelligence and Statistics. [12] Giles, C. L., Sun, G.-Z., Chen, H.-H., Lee, Y.-C., and Chen, D. (1990). Higher order recurrent networks and grammatical inference. In Neural Information Processing Systems. [13] Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative Adversarial Nets. In Neural Information Processing Systems. [14] Graves, A. (2016). Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983. [15] Graves, A., Wayne, G., and Danihelka, I. (2014). Neural turing machines. arXiv preprint arxiv:1410.5401. [16] Hafner, D., Tran, D., Irpan, A., Lillicrap, T., and Davidson, J. (2018). Reliable uncertainty estimates in deep neural networks using noise contrastive priors. arXiv preprint. [17] He, K., Zhang, X., Ren, S., and Sun, J. (2016). Deep residual learning for image recognition. In Computer Vision and Pattern Recognition. [18] Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735–1780. [19] Hochreiter, S., Younger, A. S., and Conwell, P. R. (2001). Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pages 87–94. 10 [20] Hoffman, M. D. (2017). Learning deep latent Gaussian models with Markov chain Monte Carlo. In International Conference on Machine Learning. [21] Hoffman, M. D. and Gelman, A. (2014). The No-U-turn sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15(1):1593–1623. [22] Jouppi, N. P., Young, C., Patil, N., Patterson, D., Agrawal, G., Bajwa, R., Bates, S., Bhatia, S., Boden, N., Borchers, A., et al. (2017). In-datacenter performance analysis of a tensor processing unit. In Proceedings of the 44th Annual International Symposium on Computer Architecture. [23] Karras, T., Aila, T., Laine, S., and Lehtinen, J. (2018). Progressive growing of gans for improved quality, stability, and variation. In International Conference on Learning Representations. [24] Kingma, D. P. and Welling, M. (2014). Auto-encoding variational Bayes. In International Conference on Learning Representations. [25] Kucukelbir, A., Tran, D., Ranganath, R., Gelman, A., and Blei, D. M. (2017). Automatic differentiation variational inference. The Journal of Machine Learning Research, 18(1):430–474. [26] Kusner, M. J., Paige, B., and Hernández-Lobato, J. M. (2017). Grammar variational autoencoder. In International Conference on Machine Learning. [27] Maclaurin, D., Duvenaud, D., Johnson, M., and Adams, R. P. (2015). Autograd: Reverse-mode differentiation of native Python. [28] Mansinghka, V., Selsam, D., and Perov, Y. (2014). Venture: A higher-order probabilistic programming platform with programmable inference. arXiv preprint arXiv:1404.0099. [29] Oord, A. v. d., Kalchbrenner, N., and Kavukcuoglu, K. (2016). Pixel recurrent neural networks. arXiv preprint arXiv:1601.06759. [30] Papamakarios, G., Murray, I., and Pavlakou, T. (2017). Masked autoregressive flow for density estimation. In Advances in Neural Information Processing Systems, pages 2335–2344. [31] Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, Ł., Shazeer, N., Ku, A., and Tran, D. (2018). Image transformer. In International Conference on Machine Learning. [32] Pearl, J. (2003). Causality: models, reasoning, and inference. Econometric Theory, 19(675685):46. [33] Pfeffer, A. (2007). The design and implementation of IBAL: A general-purpose probabilistic language. Introduction to Statistical Relational Learning, page 399. [34] Probtorch Developers (2017). Probtorch. https://github.com/probtorch/probtorch. [35] Ranganath, R., Altosaar, J., Tran, D., and Blei, D. M. (2016). Operator variational inference. In Neural Information Processing Systems. [36] Ritchie, D., Horsfall, P., and Goodman, N. D. (2016). Deep Amortized Inference for Probabilistic Programs. arXiv preprint arXiv:1610.05735. [37] Roy, A., Vaswani, A., Neelakantan, A., and Parmar, N. (2018). Theory and experiments on vector quantized autoencoders. arXiv preprint arXiv:1805.11063. [38] Salimans, T., Kingma, D., and Welling, M. (2015). Markov chain Monte Carlo and variational inference: Bridging the gap. In International Conference on Machine Learning. [39] Salvatier, J., Wiecki, T. V., and Fonnesbeck, C. (2016). Probabilistic programming in Python using PyMC3. PeerJ Computer Science, 2:e55. [40] Shazeer, N., Cheng, Y., Parmar, N., Tran, D., Vaswani, A., Koanantakool, P., Hawkins, P., Lee, H., Hong, M., Young, C., Sepassi, R., and Hechtman, B. (2018). Mesh-tensorflow: Deep learning for supercomputers. In Neural Information Processing Systems. [41] Shazeer, N., Mirhoseini, A., Maziarz, K., Davis, A., Le, Q., Hinton, G., and Dean, J. (2017). Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538. 11 [42] Shi, J., Chen, J., Zhu, J., Sun, S., Luo, Y., Gu, Y., and Zhou, Y. (2017). Zhusuan: A library for bayesian deep learning. arXiv preprint arXiv:1709.05870. [43] Sønderby, C. K., Raiko, T., Maaløe, L., Sønderby, S. K., and Winther, O. (2016). Ladder variational autoencoders. In Neural Information Processing Systems. [44] Spiegelhalter, D. J., Thomas, A., Best, N. G., and Gilks, W. R. (1995). BUGS: Bayesian inference using Gibbs sampling, version 0.50. MRC Biostatistics Unit, Cambridge. [45] Tolpin, D., van de Meent, J.-W., Yang, H., and Wood, F. (2016). Design and implementation of probabilistic programming language Anglican. In Proceedings of the 28th Symposium on the Implementation and Application of Functional Programming Languages, page 6. [46] Tomczak, J. M. and Welling, M. (2018). Vae with a vampprior. In Artificial Intelligence and Statistics. [47] Tran, D. and Blei, D. (2018). Implicit causal models for genome-wide association studies. In International Conference on Learning Representations. [48] Tran, D., Hoffman, M. D., Saurous, R. A., Brevdo, E., Murphy, K., and Blei, D. M. (2017). Deep probabilistic programming. In International Conference on Learning Representations. [49] Tran, D., Kucukelbir, A., Dieng, A. B., Rudolph, M., Liang, D., and Blei, D. M. (2016). Edward: A library for probabilistic modeling, inference, and criticism. arXiv preprint arXiv:1610.09787. [50] Vaswani, A., Bengio, S., Brevdo, E., Chollet, F., Gomez, A. N., Gouws, S., Jones, L., Kaiser, L., Kalchbrenner, N., Parmar, N., Sepassi, R., Shazeer, N., and Uszkoreit, J. (2018). Tensor2tensor for neural machine translation. CoRR, abs/1803.07416. [51] Wen, Y., Vicol, P., Ba, J., Tran, D., and Grosse, R. (2018). Flipout: Efficient pseudoindependent weight perturbations on mini-batches. In International Conference on Learning Representations. [52] Zoph, B. and Le, Q. V. (2017). Neural architecture search with reinforcement learning. In International Conference on Learning Representations. 12
2018
145
7,303
When do random forests fail? Cheng Tang George Washington University Washington, DC tangch@gwu.edu Damien Garreau Max Planck Institute for Intelligent Systems T¨ubingen, Germany damien.garreau@tuebingen.mpg.de Ulrike von Luxburg University of T¨ubingen Max Planck Institute for Intelligent Systems T¨ubingen, Germany luxburg@informatik.uni-tuebingen.de Abstract Random forests are learning algorithms that build large collections of random trees and make predictions by averaging the individual tree predictions. In this paper, we consider various tree constructions and examine how the choice of parameters affects the generalization error of the resulting random forests as the sample size goes to infinity. We show that subsampling of data points during the tree construction phase is important: Forests can become inconsistent with either no subsampling or too severe subsampling. As a consequence, even highly randomized trees can lead to inconsistent forests if no subsampling is used, which implies that some of the commonly used setups for random forests can be inconsistent. As a second consequence we can show that trees that have good performance in nearest-neighbor search can be a poor choice for random forests. 1 Introduction Random forests (Breiman, 2001) are considered as one of the most successful general-purpose algorithms in modern-times (Biau and Scornet, 2016). They can be applied to a wide range of learning tasks, but most prominently to classification and regression. A random forest is an ensemble of trees, where the construction of each tree is random. After building an ensemble of trees, the random forest makes predictions by averaging the predictions of individual trees. Random forests often make accurate and robust predictions, even for very high-dimensional problems (Biau, 2012), in a variety of applications (Criminisi and Shotton, 2013; Belgiu and Dr˘agut¸, 2016; D´ıaz-Uriarte and Alvarez de Andr´es, 2006). Recent theoretical works have established a series of consistency results of different variants of random forests, when the forests’ parameters are tuned in certain ways (Scornet, 2016; Scornet et al., 2015; Biau, 2012; Biau et al., 2008). In this paper, however, we ask the question of when do random forests fail. In particular, we examine how varying several key parameters of the algorithm affects the generalization error of forests. When building a random forest, there are several parameters to tune: the choice of the base trees (the randomized algorithm that generates the individual trees), the number of trees in the forest, the size of the leaf nodes, the rate of data subsampling, and sometimes the rate of feature subsampling. Popular variants of random forests usually come with their own default parameter tuning guidelines, often suggested by practice. For example, common wisdom suggests that training a large number of trees and growing deep trees whose leaf sizes are fixed to a small constant lead to better performance. For data subsampling, the original random forest paper (Breiman, 2001) suggests to set the subsampling (with replacement) rate to be 1, while a later popular variant (Geurts et al., 2006) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. proposes to disable data subsampling altogether. For feature subsampling, the consensus is to set the rate to d/3 for regression problems, with d being the dimension (Friedman et al., 2009, Section 15.3). But in D´ıaz-Uriarte and Alvarez de Andr´es (2006), the feature sampling rate is found to be not important, while Genuer et al. (2010) suggests to not subsample the features. Existing analyses of random forests mostly focus on positive results and typically fall into two categories: (1) They show a forest is consistent by showing that its base trees are consistent (Biau et al., 2008; Biau, 2012; Denil et al., 2014). This class of results does not cover the case of deep trees (because individual deep trees are clearly inconsistent), and fails to highlight the advantage of using random forests as opposed to single trees. (2) In the deep tree regime, recent theoretical consistency results require subsampling as a sufficient condition for consistency (Scornet, 2016). We focus on negative results: When are random forests inconsistent? To facilitate our theoretical investigation, we restrict our analysis to unsupervised random forests, that is, random forests whose tree construction does not use label information (Def. 2). We establish two conditions, diversity and locality (Def. 3 and 4), that are necessary for a forest to be consistent. We then examine how parameter tuning affects diversity and locality. Our results highlight the importance of subsampling data points during the tree construction phase: Without subsampling, forests of deep trees can become inconsistent due to violation of diversity; on the other hand, if we subsample too heavily, forests can also become inconsistent due to violation of locality. Our analysis implies two surprising consequences as special cases: (1) When considering partitioning trees that are particularly good for nearest-neighbor search, such as random projection trees, it is natural to expect them to be also good for random forests. Our results disagree with this intuition: Unless we use severe subsampling, they lead to inconsistent forests. (2) In a popular variant of random forests, extremely randomized trees are used and subsampling is disabled (Geurts et al., 2006). The argument in that paper is that when forests use extremely randomized trees, the randomness in the trees already reduces variance and thus subsampling becomes unnecessary. Our results suggest otherwise. 2 Background on random forests Throughout this paper, we consider n i.i.d. samples X1, . . . , Xn of an unknown random variable X that has support included in [0, 1]d. Let η : [0, 1]d →R be a measurable function. The responses Y1, . . . , Yn are R-valued random variables which satisfy ∀1 ≤i ≤n, Yi = η(Xi) + εi , (2.1) where the εi are centered random variables with variance σ2 > 0. We assume that they are independent from the observations. For any integer n, we set [n] := {1, . . . , n}. We denote by X[n] := (Xi)1≤i≤n the training set, Y[n] := (Yi)1≤i≤n the responses, and Dn := (Xi, Yi)1≤i≤n the training sample. We focus on the regression problem, that is, the problem of estimating the unknown regression function η(x) = E [Y |X = x] by constructing an estimator bηn(x) based on the training sample Dn. We define the mean squared error of any estimator bηn as E h |bηn(X) −η(X)|2i , and we say that the estimator is L2-consistent if the mean squared error goes to zero when the sample size grows to infinity, that is, lim n→∞E h |bηn(X) −η(X)|2i = 0 . (2.2) The present paper examines the consistency of random forests as estimators of the regression function. Here and in the rest of this article the expectation E [·] is taken with respect to the random variables X, X1, . . . , Xn, ε1, . . . , εn, and any additional source of randomness coming from the (random) tree construction, unless otherwise specified. Regression trees. A random forest makes predictions by aggregating the predictions of tree-based estimators. To obtain a tree-based estimator, one first uses the training sample to build a “spatial partitioning tree.” Any query x in the ambient space is then routed from the root to a unique leaf node and assigned the mean value of the responses in the corresponding cell. Formally, the j-th tree in the ensemble constructed from training sample Dn induces a hierarchy of finite coverings of the ambient space [0, 1]d: let k denote the height of the tree. Then at every level ℓ∈[k] the tree induces a pℓ-covering of the ambient space, namely subspaces Aj 1, . . . , Aj pℓ⊂ 2 [0, 1]d such that Spℓ i=1 Aj i = [0, 1]d. Each cell Aj i corresponds to a node of the tree. The treeinduced routing of a query to a unique cell in space at level ℓ∈[k] is a function Aj ℓ: [0, 1]d → {Aj 1, . . . , Aj pℓ}; it satisfies ∀x ∈[0, 1]d, ∃! i ∈{1, . . . , pℓ} such that Aj ℓ(x) = Aj i . In the following, we refer to function Aj ℓas the routing function associated with tree j at level ℓ, and we will often identify the trees with their associated functions at level k, Aj k (or simply Aj when there is no ambiguity). Note that this routing function is well-defined even for tree structures that allow overlapping cells. Once a tree Aj has been constructed, it estimates the regression function η(x) for a query point x, using only information on training points contained in cell Aj(x). Formally, given a query point x let N(Aj(x)) denote the number of samples that belong to the cell Aj(x). We define the j-th tree-based estimator bηn,Aj : [0, 1]d →R as bηn,Aj(x) := 1 N(Aj(x)) n X i=1 Yi 1Xi∈Aj(x) , with the convention 0 0 = 0. Intuitively, bηn,Aj(x) is the empirical average of the responses of sample points falling in the same cell as x — see Fig. 1. We refer to Friedman et al. (2009, Section 9.2.2) for a more detailed overview of regression trees. Random forests. A random forest builds an ensemble of T tree estimators that are all constructed based on the same data set and the same tree algorithm, which we call the base tree algorithm. Due to the inherent randomness in the base tree algorithm, which we denote by Θ, each tree Aj will be different; Aj can depend on both the training data Dn, and Θ. For instance, the random variable Θ may encode what feature and threshold are used when splitting a node. An important source of randomness is the one coming from what we simply call “subsampling”: when building each tree Aj, we do not use the entire data set during tree construction, but just a susbsample of the data (which can be with or without replacement). This source of randomness is also encoded by Θ. Formally, the random forest estimator associated to the collection of trees VT =  Aj, 1 ≤j ≤T is defined by bηn,VT (x) := 1 T T X j=1 bηn,Aj(x) = 1 T T X j=1 1 N(Aj(x)) n X i=1 Yi 1Xi∈Aj(x) . (2.3) We refer to Friedman et al. (2009, Chapter 15) and Biau and Scornet (2016) for a more comprehensive introduction to random forests algorithms. Local average estimators and infinite random forests. An important fact about random forest estimators is that they can be seen as local average estimators (Devroye et al., 1996, Section 6.5), a concept that generalizes many nonparametric estimators, including histogram, kernel, nearestneighbor, and tree-based estimators. A local average estimator takes the following generic form: bηn(x) = n X i=1 Wn,i(x)Yi . (2.4) For a given query x, a local average estimator predicts its conditional response by averaging the responses in the training sample that are “close” to x. Wn,i(x) can be thought of as the “weight” or the contribution of the i-th training point in predicting the response value for x. Random forests form a special class of local average estimators: introducing the weights W T n,i(x) := 1 T PT j=1 1Xi∈Aj (x) N(Aj(x)) , we can immediately see from Eq. (2.3) that bηn,VT (x) = n X i=1 1 T T X j=1 1 N(Aj(x)) 1Xi∈Aj(x) Yi = n X i=1 W T n,i(x)Yi . (2.5) It is clear that the weights defined by a random forest are non-negative. To analyze the asymptotic properties of forests, there are different regimes that one can consider: the regime “fixed T, and 3 large n” essentially does not differ from analyzing an individual tree. To see advantages of forests, one needs to let both T and n go to infinity. As it is common in the literature on random forests, we first let T →∞to get rid of the randomness Θ that is inherent to the tree construction: According to the law of large numbers, the estimator defined by Eq. (2.5) behaves approximately as an infinite random forest with associated estimator bηn,V∞(x) := n X i=1 W ∞ n,i(x)Yi , where W ∞ n,i(x) := EΘ h 1Xi∈A(x) N(A(x)) i are the asymptotic weights and A(·) is the routing function associated with a generic random tree. Indeed, Scornet (2016, Theorem 3.1) shows that bηn,V∞(·) is the limiting function of bηn,VT (·) as the number of trees T goes to infinity. The concept of the infinite forest captures the common wisdom that one should use many trees in random forests (see the next paragraph). In the following, we focus on such infinite random forests. Now our question becomes: If we construct infinitely many trees by a particular base tree algorithm, is the forest consistent as the number n of data points goes to infinity? Common beliefs and parameter setups in random forests. Different variants of random forests usually have different parameter tuning principles. However, there are three common beliefs about random forests in general, both in the literature and among practitioners. The first belief is that “many trees are good,” in the sense that adding trees to the ensemble tends to decrease the generalization error of random forests (Biau and Scornet, 2016, Sec. 2.4). For example, the results in Theorem 3.3 of Scornet (2016) and Arlot and Genuer (2014) both corroborate this belief. The second belief is that, in the context of random forests, “it is good to use deep trees” (Breiman, 2000). Definition 1 (Deep trees and fully-grown trees). We say a random forest has deep trees if there exists an integer n0 such that, for any sample size n, the leaf nodes of its base trees have at most n0 points almost surely; a fully-grown tree is a deep tree whose leaves have exactly one data point. The use of deep trees seems counter-intuitive at first glance: They have low bias but extremely high variance that does not vanish as the sample size increases, and thus are destined to overfit. However, while a single deep tree estimator is clearly not consistent in general, it is believed that combining many deep trees can effectively reduce the variance of individual trees. Thus, it is believed that a random forest estimator takes advantage of the low bias of individual deep trees while retaining low variance. Recent work of Scornet (2016) provided theoretical evidence of this belief by showing that forests of fully-grown quantile trees are consistent under certain sufficient conditions. The third belief is that a diverse portfolio of trees helps alleviate overfitting (by reducing variance), and that randomizing the tree construction helps creating a more diverse portfolio. Since the introduction of random forest, “tree diversity,” which has been defined as correlation of fit residuals between base trees in Breiman (2001), has been perceived as crucial for achieving variance reduction. It has also become a folklore knowledge in the random forest community that by introducing “more randomness,” trees in the ensemble become more diverse, and thus less likely to overfit. In practice, many ways of injecting randomness to the tree construction have been explored, for example random feature selection, random projection, random splits, and data subsampling (bootstrapping). Geurts et al. (2006) suggest using extremely randomized trees; taking this idea to the limit yields the totally randomized trees, that is, trees constructed without using information from the responses Y[n]. Our analysis takes into account all three common beliefs, and studies forest consistency under two extreme scenarios of subsampling setup. 2.1 Related Work Random forests were first proposed by Breiman (2001), where the base trees are chosen as Classification And Regression Trees (CART) (Breiman et al., 1984) and subsampling is enabled during tree construction. A popular variant of random forests is called “extremely randomized trees” (extratrees) (Geurts et al., 2006). Forests of extra-trees adopt a different parameter setup than Breiman’s forest: They disable subsampling and use highly randomized trees as compared to CART trees. Besides axis-aligned trees such as CART, oblique trees (trees with non-rectangular cells) such as random projection trees are also used in random forests (Ho, 1998; Menze et al., 2011; Rodriguez et al., 2006; Tomita et al., 2015). On the theoretical side, all previous works that we are aware of investigate forests with axis-aligned base-trees. Most works analyze trees with UW-property (see Def. 2) 4 and focus on establishing consistency results (Scornet (2016); Biau (2012); Biau et al. (2008)). A notable breakthrough was Scornet et al. (2015), who were the first to establish that Breiman’s forest, which do not satisfy the UW-property (Def. 2), is consistent on additive regression models. To our knowledge, few works focus on negative results. An exception is Lin and Jeon (2006), which provides a lower bound on the mean squared error convergence rate of forests. 2.2 Overview of our results Section 3 establishes two notions, “diversity” and “locality,” that are necessary for local average estimators to be consistent. Then, viewing infinite random forests as local average estimators, we establish a series of inconsistency results in Section 4. In Section 4.1, we show that forests of deep trees with either nearest-neighbor-preserving property (Def. 6) or fast-diameter-decreasing property (see condition in Prop. 1) violate the diversity condition, when subsampling is disabled. As a surprising consequence, we show that trees with nearest-neighbor-preserving property (Algorithm 1 and 2) can be inconsistent if we follow a common forest parameter setup (Def. 5). In Section 4.2, we show that when undersampled, forests of deep trees can violate the locality condition. Our analysis applies to trees that are both axis-aligned and irregularly shaped (oblique). 3 Inconsistency of local average estimators A classical result of Stone (1977, Theorem 1) provides a set of sufficient conditions for local average estimators to be consistent. In this section, we derive new inconsistency results for a general class of local average estimator satisfying an additional property, often used in theoretical analyses: Definition 2 (UW-property). A local average estimator defined as in Eq. (2.4) satisfies the “unsupervised-weights” property (UW-property) if the weights Wn,i depend only on the unlabeled data. 3.1 Diversity is necessary to avoid overfitting We first define a condition on local average estimators, which we call diversity, and show that if local average estimators do not satisfy diversity, then they are inconsistent on data generated from a large class of regression models. In fact, from the proof of Lemma 1, it can be seen that violating diversity results in high asymptotic variance, hence inconsistent estimators. Definition 3 (Diversity condition). We say a local average estimator as defined in Eq (2.4) satisfies the diversity condition, if E Pn i=1 W 2 n,i(X)  −→0 as n →∞. Intuitively, the diversity condition says that no single data point in the training set should be given too much weight asymptotically. The following lemma shows that diversity is necessary for a local average estimator (with UW-property) to be consistent on a large class of regression models. Lemma 1 (Local average estimators without diversity are inconsistent). Consider a local average estimator bηn as in Eq. (2.4) that satisfies the UW-property. Suppose the data satisfies Eq. (2.1), and σ be as defined therein. Suppose the diversity condition (Def. 3) is not satisfied: that is, there exists δ > 0 such that E Pn i=1 W 2 n,i(X)  ≥δ for infinitely many n. Then bηn is not consistent. A related result is proved in Stone (1977). It considers the artificial scenario where the data distribution (X, Y ) satisfies that (i) Y is independent of X, and (ii) Y is standard Gaussian. On this particular distribution, Stone (1977, Prop. 8) shows that condition (5) of Stone (1977, Theorem 1) is necessary for a local average estimator to be consistent. In contrast, our Lemma 1 applies to a much larger class of distributions. 3.2 Locality is necessary to avoid underfitting Now we introduce another necessary condition for the consistency of local average estimators, which we call locality. While diversity controls the variance of the risk, locality controls the bias. Definition 4 (Locality condition). We say that a local average estimator bηn with weights Wn,i satisfies the locality condition if, for any a > 0, E Pn i=1 Wn,i(X) 1∥Xi−X∥>a  −→0 as n →∞. The locality condition is one of the conditions of Stone’s theorem for the consistency of local average estimators. In plain words, it requires the estimator to give small weight to sample points located 5 Algorithm 1 Randomized Projection Tree Input: Sample S, maximum leaf size n0; Output: T = RPT(S, n0); 1: T ←empty tree; 2: if |S| > n0 then 3: Sample U uniformly from Sd−1; 4: Sample q uniformly from  1 4, 3 4  ; 5: tq ←empirical q-th quantile of U T · S; 6: SL ←{x ∈S : U T · x ≤tq}; 7: T.graft (RPT(SL, n0)); 8: SR ←S \ SL; 9: T.graft (RPT(SR, n0)); 10: end if Algorithm 2 Randomized Spill Tree Input: S, n0, α ∈(0, 1/2); Output: T = RST(S, n0, α); 1: T ←empty tree; 2: if |S| > n0 then 3: Sample U uniformly from Sd−1; 4: tL ←top 1 2 + α-quantile of U T · S; 5: tR ←bottom 1 2 + α-quantile of U T · S; 6: SL ←{x ∈S : U T · x ≤tL}; 7: T.graft (RST(SL, n0, α)); 8: SR ←{x ∈S : U T · x ≥tR}; 9: T.graft(RST(SR, n0, α)); 10: end if outside a ball of fixed radius centered around a query. Indeed, intuitively, a local average estimator should be able to capture fine-scale changes in the distribution of X in order to be consistent. Our next result shows that there exists a distribution such that, when a local average estimator with non-negative weights violates the locality property, it is inconsistent. Lemma 2 (Local average estimators without locality are inconsistent). In the setting given by Eq. (2.1), let bηn be a local average estimator with non-negative weights Wn,i. Suppose that bηn satisfies the UW-property (Def. 2). Assume furthermore that bηn does not satisfy locality (Def. 4). Then, there exists a continuous bounded regression function η : [0, 1]d →R such that bηn is not consistent. This result is a straightforward application of Prop. 6 of Stone (1977). Intuitively, when locality is violated, a local average estimator can be highly biased when the regression function η has a large amount of local variability. Note that the data models on which we prove locality is necessary in Lemma 2 are more restricted in comparison to that of diversity. 4 Inconsistency of random forests Viewing forests as a special type of local average estimators, we obtain several inconsistency results by considering the choice of subsampling rate in two extreme scenarios: in Section 4.1, we study trees without subsampling, and in Section 4.2, we study trees with constant subsample sizes. 4.1 Forests without subsampling can be inconsistent In this section, we establish inconsistency of some random forests by showing that they violate the diversity condition. In particular, we focus on infinite random forests with the following treeconstruction strategy: Definition 5 (Totally randomized deep trees). We say a random forest has totally randomized deep trees if its base trees (i) have the UW-property (Def. 2), (ii) are deep (Def. 1), and (iii) are grown on the entire dataset (no subsampling). This parameter setup is similar to the one suggested by Geurts et al. (2006), and the term “totally randomized” in Def. 5 follows the naming convention therein. Trees with nearest-neighbor-preserving property. Besides serving as the base algorithms for random forests, spatial partitioning trees are also widely used for other important tasks such as nearest-neighbor search (Yianilos, 1993). We show that, surprisingly, trees that are good for nearestneighbor search can lead to inconsistent forests when we adopt the parameter setup that is widely used in the random forest community. Given X[n] and any x ∈[0, 1]d, we let X(i)(x) denote the i-th nearest neighbor of x from the set  X[n] for the Euclidean distance. We define the nearestneighbor-preserving property of a tree as follows. 6 Definition 6 (Nearest-neighbor-preserving property). Let A(·) be the routing function associated with a generic (randomized) tree. We say that the tree has nearest-neighbor-preserving property if there exists ε > 0 such that, P X(1)(X) ∈A(X)  ≥ε for infinitely many n . Intuitively, Def. 6 means that if we route a query point x through the tree to its leaf cell A(x), then its nearest neighbor is likely to be in the same cell, which is quite appealing when trees are used for nearest-neighbor search. However, via Lemma 1, we can now show that such trees lead to inconsistent forests whenever we grow the trees deep and disable subsampling. Theorem 1 (Forests with deep, nearest-neighbor-preserving trees are inconsistent). Suppose that the data distribution satisfies the condition in Eq (2.1). Suppose that the infinite random forest bηn,V∞is built with totally randomized deep trees that additionally satisfy the nearest-neighborpreserving property, Def. 6. Then bηn,V∞is L2-inconsistent. The intuition behind Theorem 1 is that trees with nearest-neighbor-preserving property are highly homogeneous when subsampling is disabled: given a query point x, each tree in the forest tends to retrieve in its leaf of x a very similar set from the training data, namely those data points that are likely nearest neighbors of x. This in turn implies violation of diversity and leads to overfitting (and inconsistency) of the random forest. Theorem 1 suggests that without subsampling, forests of totally randomized trees can still overfit (that is, subsampling is necessary for some forests to be consistent under the totally randomized deep tree construction regime). On the other hand, we speculate that proper subsampling can make the forests consistent again, while fixing other parameters (that is, subsampling is also sufficient for forests consistency here): with subsampling, the nearest-neighbor-preserving property of the base tree algorithm should still hold, but each time applied on a subsample of the original data; taken together, all nearest neighbors on different subsamples are a much more significant set, hence diversity should work again. If this can be proved, then it would imply that, in contrary to common belief (Geurts et al., 2006), different ways of injecting randomness in the tree construction phase may not be equivalent in reducing overfitting, and that subsampling may be more effective than other ways of injecting randomness to the algorithm. We leave this for future work. Example: Forests of deep random projection trees. Random-projection trees (Dasgupta and Freund, 2008) are a popular data structure, both for nearest-neighbor search (Dasgupta and Sinha, 2015) and regression. In particular in the latter case, random-projection tree based estimators were theoretically shown to be L2-consistent, with a convergence rate that adapts to the intrinsic data dimension for regression problems when they are pruned cleverly (Kpotufe and Dasgupta, 2012). Below we show, however, that two variants of these trees, namely random projection trees (Algorithm 1) and randomized spill trees (Algorithm 2) can make bad candidates as base trees for random forests when tree pruning and data subsampling are disabled. Theorem 2 (Forests of deep random projection trees are inconsistent). Suppose that X is distributed according to a measure µ that has doubling dimension d0 ≥2. Suppose additionally that the responses satisfy Eq. (2.1). Let c0 be a constant such that Dasgupta and Sinha (2015, Theorem 7) holds—we recall this result as Theorem 5 in the Appendix. For any δ ∈(0, 1/3) and ε ∈(0, 1), suppose that we grow the base trees such that each leaf contains at most n0 sample points, where n0 is a constant which does not depend on n and is defined as follows: • (Random projection tree) n0 = max ( 8 log 1/δ  2c0d2 0 1−ε d0 , exp  2c0d3 0(8 log 1/δ)1/d0 1−ε ) . • (Randomized spill tree) n0 = 8 log 1/δ  c0d0 α(1−ε) d0 , with α ≤α0 = α0(c0, d0, ε, δ). Then the random forest estimator bηn,V∞is L2–inconsistent. Theorem 2 is a direct consequence of Theorem 1 and Theorem 5; the latter shows that both Algorithms 1 and 2 are nearest-neighbor-preserving. Trees with fast shrinking cell diameter. Local average estimators such as k-nearest-neighbor (k-NN), kernel, and tree based estimators, often make predictions based on information in a neighborhood around the query point. In all these methods, the number of training data contained in 7 •x • • • • y •x • • • • • • Figure 1: Left: Illustration of the “aggregating” effect of a forest induced local neighborhood; the black dot is a query point x; the blue points are training points; each cell is the leaf cell of a single tree in the forest containing x; the maximal leaf size is n0 = 1. We can see that the aggregated cell (the union of the individual cells) is much larger (less local) than the individual cells. Right: The vertical blue lines represent the response values of the sample points belonging to the same cell as the query x. The predicted value (in black) is the empirical mean of theses values. the local neighborhood controls the bias-variance trade-off of the estimator (Devroye et al., 1996, Sec. 6); for these methods to be consistent, the local neighborhood needs to adapt to the training size. For example, in k-NN methods, the size of the neighborhood is determined by the choice of k, the number of nearest neighbors of the query point. The classical result of Stone (1977) shows that the k-NN classifier is universally consistent if k grows with n and, at the same time, if k does not grow too fast, namely k/n →0. We now present a necessary condition on the local neighborhood size for random forests to be consistent. In a particular tree j, the local neighborhood of a query x is the leaf cell containing it, Aj(x). In a forest, the local neighborhood of a query can be viewed as an aggregation of all possible realizations of tree cells containing x. Intuitively, the aggregated cell in the forest should behave better in the following sense: Consider trees that are fully grown, that is each leaf cell contains only one point. Then the local neighborhood of any query is too small and will result in a tree-based estimator with high variance. Considering the forest, different tree realizations will partition the space differently. This means when fixing a query point x, different training data will end up in the leaf cell containing x in different trees, and the aggregated cell can potentially be much larger than the individual tree cell. See the left panel of Fig. 1 for an illustration of this effect. Based on this observation, one would hope that even forests of deep trees can have low enough variance and eventually become consistent. Our result implies that whether the intuition above holds or not depends on the size of the local neighborhood, controlled by the diameter of the generic (random) function A(·): if the generic tree cell is too small, compared to the data size, then aggregating tree cells will not do much better. Proposition 1 (Forests of fully-grown trees with fast shrinking cells are inconsistent). Suppose that the data satisfy Eq. (2.1). Suppose additionally that (i) the distribution of X has a density f with respect to the Lebesgue measure on [0, 1]d, (ii) there exists constants fmin and fmax such that ∀x ∈[0, 1]d , 0 < fmin ≤f(x) ≤fmax < +∞. Consider the random forest estimator bηn,V∞built with totally randomized deep trees, and in addition, each tree leaf contains exactly one data point. If with positive probability with respect to X, X[n] and Θ, there exists a deterministic sequence an of order 1 n1/d such that diam (A(X)) ≤an, then bηn,V∞is L2–inconsistent. Prop. 1 is similar in spirit to Lin and Jeon (2006, Theorem 3), which is the first result connecting nearest-neighbor methods to random forests. There it was shown that forests with axis-aligned trees can be interpreted to yield sets of “potential nearest neighbors.” Using this insight, the authors show that forests of deep axis-aligned trees without subsampling have very slow convergence rate in mean squared error, of order 1/ (log n)(d−1), which is much worse than the optimal rate for regression, O(1/n2m/(2m+d)) by Stone (1980) (the parameter m controls the smoothness of regression function η). To the best of our knowledge, this is the only previous result applying to non-artificial data models. We adopt a different approach and directly relate the consistency of forests with the diameter of the generic tree cell. Prop. 1 is stronger than Lin and Jeon (2006), since it establishes 8 inconsistency, whereas the latter only provides a lower bound on the convergence rate. In addition, Prop. 1 can be applied to any type of trees, including irregularly shaped trees, whereas the aforementioned result is only applicable to axis-aligned trees. 4.2 Forests with too severe subsampling can be inconsistent In contrast to the “totally randomized tree” setup considered in Section 4.1, where subsampling is disabled, we now consider forests with severe subsampling—when the subsample size remains constant as the data size grows to infinity. Theorem 3 (Forests of undersampled fully-grown trees can be inconsistent). Suppose that the data satisfy Eq. (2.1) and that X has bounded density. Suppose that the random forest estimator bηn,V∞has base trees that satisfy the following properties: • Finite subsample size: each tree is constructed on a subsample (sampling with replacement, that is, bootstrapping) of the data S of size m, such that m does not vary with n; • Fully-grown tree: each tree leaf has exactly one data point. Then bηn,V∞is L2–inconsistent. Theorem 3 applies Lemma 5 in the undersampled setup. The intuition here is that when the sample points are too “sparse,” some cells will have large size when the tree leaves are non-empty (satisfied when trees are fully-grown). Consequently, when a query point falls into a leaf cell, with high probability, it will be far away from the training data in the same cell, violating locality (see the right panel of Fig. 1). It is interesting to compare this result with Prop. 1, which relates the average diameter of a cell in the randomized tree with the tree diversity. 5 Discussion We have shown that random forests with deep trees with either no subsampling or too much subsampling can be inconsistent. One surprising consequence is that trees that work well for nearestneighbor search problems can be bad candidates for forests without sufficient subsampling, due to a lack of diversity. Another implication is that even totally randomized trees can lead to overfitting forests, which disagrees with the conventional belief that injecting more “randomness” will prevent trees from overfitting (Geurts et al., 2006). In summary, our results indicate that subsampling plays an important role in random forests and may need to be tuned more carefully than other parameters. There are interesting future directions to explore: (1) While we consider the extreme case of no subsampling or constant subsample size, it would be interesting to explore whether inconsistency holds in cases in-between. Results in this direction would indicate how to choose the subsampling rate in practice. (2) In our analysis, we first let the number of trees T to infinity, and then analyze the consistency of forests as n grows. In the future, it would also be interesting to study the finer interplay between T and n when both of them grow jointly. (3) Bootstrapping, that is subsampling with replacement with subsample size equal to n, is a common practice in random forests. It differs subtly from the no subsampling scheme and has been a matter of debate in the theory community (Biau, 2012). We believe that some of our inconsistency results can be extended to the bootstrap case. For example, consider Theorem 2 in the bootstrap case: one would expect that the nearest neighbor property of random projection trees holds on bootstrapped samples as well (according to the central limit theorem for bootstrapped empirical measure (Gine and Zinn, 1990)); when the bootstrap sample size equals n, the setup will thus not differ much from the no-subsampling set up, and inconsistency should follow. Acknowledgements The authors thank Debarghya Ghoshdastidar for his careful proofreading of a previous version of this article. This research has been supported by the German Research Foundation via the Research Unit 1735 ”Structural Inference in Statistics: Adaptation and Efficiency” and and the Institutional Strategy of the University of T¨ubingen (DFG ZUK 63). 9 References S. Arlot and R. Genuer. Analysis of purely random forests bias. ArXiv preprint, 2014. Available at https://arxiv.org/abs/1407.3939. M. Belgiu and L. Dr˘agut¸. Random forest in remote sensing: A review of applications and future directions. ISPRS Journal of Photogrammetry and Remote Sensing, 114:24–31, 2016. G. Biau. Analysis of a random forests model. Journal of Machine Learning Research (JMLR), 13 (1):1063–1095, 2012. G. Biau and E. Scornet. A random forest guided tour. Test, 25(2):197–227, 2016. G. Biau, L. Devroye, and G. Lugosi. Consistency of random forests and other averaging classifiers. Journal of Machine Learning Research (JMLR), 9:2015–2033, 2008. P. Billingsley. Probability and Measure. John Wiley & Sons, 2008. S. Boucheron, G. Lugosi, and P. Massart. Concentration inequalities: A nonasymptotic theory of independence. Oxford University Press, 2013. L. Breiman. Some Infinity Theory for Predictor Ensembles. Technical report, University of California, Berkeley, Statistics Department, 2000. L. Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. L. Breiman, J. H. Friedman, R. A. Olshen, and C. J. Stone. Classification and Regression Trees. Wadsworth and Brooks, Monterey, CA, 1984. A. Criminisi and J. Shotton. Decision Forests for Computer Vision and Medical Image Analysis. Springer, 2013. S. Dasgupta and Y. Freund. Random projection trees and low dimensional manifolds. In Proceedings of the 40th ACM Symposium on Theory of Computing (STOC), pages 537–546. ACM, 2008. S. Dasgupta and K. Sinha. Randomized partition trees for nearest neighbor search. Algorithmica, 72(1):237–263, 2015. M. Denil, D. Matheson, and N. D. Freitas. Narrowing the gap: Random forests in theory and in practice. In Proceedings of the 31st International Conference on Machine Learning (ICML), pages 665–673, 2014. L. Devroye, L. Gy¨orfi, and G. Lugosi. A Probabilistic Theory of Pattern Recognition. Springer, 1996. R. D´ıaz-Uriarte and S. Alvarez de Andr´es. Gene selection and classification of microarray data using random forest. BMC Bioinformatics, 7(1):3–15, 2006. J. Friedman, T. Hastie, and R. Tibshirani. The elements of statistical learning. Springer Series in Statistics. Springer (NY), second edition, 2009. R. Genuer, J. Poggi, and C. Tuleau-Malot. Variable selection using random forests. Pattern Recognition Letters, 31(14):2225 – 2236, 2010. P. Geurts, D. Ernst, and L. Wehenkel. Extremely randomized trees. Machine Learning, 63(1):3–42, 2006. E. Gine and J. Zinn. Bootstrapping general empirical measures. The Annals of Probability, 18(2): 851–869, 1990. T. Ho. The random subspace method for constructing decision forests. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(8):832–844, 1998. S. Kpotufe and S. Dasgupta. A tree-based regressor that adapts to intrinsic dimension. Journal of Computer and System Sciences, 78(5):1496 – 1515, 2012. 10 Y. Lin and Y. Jeon. Random forests and adaptive nearest neighbors. Journal of the American Statistical Association, 101(474):578–590, 2006. B. H. Menze, B. M. Kelm, D. N. Splitthoff, U. Koethe, and F. A. Hamprecht. On oblique random forests. In D. Gunopulos, T. Hofmann, D. Malerba, and M. Vazirgiannis, editors, Machine Learning and Knowledge Discovery in Databases, pages 453–469, Berlin, Heidelberg, 2011. Springer Berlin Heidelberg. J. J. Rodriguez, L. I. Kuncheva, and C. J. Alonso. Rotation forest: A new classifier ensemble method. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(10):1619–1630, 2006. E. Scornet. On the asymptotics of random forests. Journal of Multivariate Analysis (JMVA), 146 (Supplement C):72 – 83, 2016. Special Issue on Statistical Models and Methods for High or Infinite Dimensional Spaces. E. Scornet, G. Biau, and J.-P. Vert. Consistency of random forests. The Annals of Statistics, 43(4): 1716–1741, 08 2015. C. Stone. Consistent nonparametric regression. The Annals of Statistics, 5(4):595–620, 1977. C. Stone. Optimal rates of convergence for nonparametric estimators. The Annals of Statistics, 8(6): 1348–1360, 1980. T. Tomita, M. Maggioni, and J. Vogelstein. Randomer Forests. ArXiv preprint, 2015. Available at https://arxiv.org/abs/1506.03410. P. Yianilos. Data structures and algorithms for nearest neighbor search in general metric spaces. In Proceedings of the 4th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 311–321, 1993. 11
2018
146
7,304
Contextual Combinatorial Multi-armed Bandits with Volatile Arms and Submodular Reward Lixing Chen, Jie Xu Department of Electrical and Computer Engineering University of Miami Coral Gables, FL 33146 {lx.chen, jiexu}@miami.edu Zhuo Lu Department of Electrical Engineering University of South Florida Tampa, FL 33620 zhuolu@usf.edu Abstract In this paper, we study the stochastic contextual combinatorial multi-armed bandit (CC-MAB) framework that is tailored for volatile arms and submodular reward functions. CC-MAB inherits properties from both contextual bandit and combinatorial bandit: it aims to select a set of arms in each round based on the side information (a.k.a. context) associated with the arms. By “volatile arms”, we mean that the available arms to select from in each round may change; and by “submodular rewards”, we mean that the total reward achieved by selected arms is not a simple sum of individual rewards but demonstrates a feature of diminishing returns determined by the relations between selected arms (e.g. relevance and redundancy). Volatile arms and submodular rewards are often seen in many real-world applications, e.g. recommender systems and crowdsourcing, in which multi-armed bandit (MAB) based strategies are extensively applied. Although there exist works that investigate these issues separately based on standard MAB, jointly considering all these issues in a single MAB problem requires very different algorithm design and regret analysis. Our algorithm CC-MAB provides an online decision-making policy in a contextual and combinatorial bandit setting and effectively addresses the issues raised by volatile arms and submodular reward functions. The proposed algorithm is proved to achieve O(cT 2α+D 3α+D log(T )) regret after a span of T rounds. The performance of CC-MAB is evaluated by experiments conducted on a realworld crowdsourcing dataset, and the result shows that our algorithm outperforms the prior art. 1 Introduction Multi-armed bandit (MAB) problems are among the most fundamental sequential decision problems with an exploration vs. exploitation trade-off. In such problems, a decision maker chooses one of several “arms”, and observes a realization from an unknown reward distribution. Each decision is made based on past decisions and observed rewards. The objective is to maximize expected cumulative reward [4] over some time horizon by balancing exploration (to learn the average reward of different arms) and exploiting (to select arms that have yielded high reward in the past). The performance of a decision policy is measured by the expected regret, defined as the gap between the expected reward achieved by the algorithm and that achieved by an oracle algorithm always selecting the best arm. Contextual bandit [1] is an extension of the standard MAB framework where there is some side information (also called context) associated with each arm that determines the reward distribution. Contextual bandit also aims to maximize the cumulative reward by selecting one arm in each round, but now the contexts can be leveraged to predict the expected reward of arms. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. However, in many real-world scenarios, e.g. recommender systems [20] and crowdsourcing [21], a decision maker needs to select multiple arms (e.g., recommended items and crowdsourcing workers) in each time slot. Such MAB problems fall into the category of combinatorial bandit where a set of arms rather than one individual arm are chosen in each round. What is more complicated is that the total reward of selected arms is often not a simple sum of the reward of individual arms in the set. For example, in a recommender system, recommending a diverse set of items increases the chance that a user would like at least one item. As such, recommending multiple redundant items would produce little benefit. This notion of diminishing returns due to redundancy is often captured formally using submodularity [14]. Another thorny issue in applying standard MAB frameworks in practice is the assumption on a constant set of arms that are available indefinitely. However, due to the inherent dynamic nature of many real-world applications, the arms available in each round may change dynamically over time. For example, potential crowdsourcing workers vary depending on specific tasks, location, and time. The variation of the arm set over time has been considered by MAB variants known as sleeping bandit [11] and volatile bandit [3] where arms can become available or unavailable in each round. However, these works are developed on the standard MAB framework and little effort has been made to extend volatile arms to the contextual or combinatorial MAB setting. In this paper, we develop a novel online decision-making approach based on contextual and combinatorial bandit to address various challenges caused by volatile arms and submodular reward functions. Although our algorithm inherits concepts from some existing MAB problems, jointly considering these issues in one MAB framework requires very different algorithm design and regret analysis. The main contribution of this paper is summarized as follows: (i) We propose a contextual combinatorial multi-armed bandit algorithm (CC-MAB) framework that is compatible with submodular reward functions and volatile arms. (ii) We rigorously prove the performance guarantee of the proposed CC-MAB, which shows a O(cT 2α+D 3α+D log(T )) regret upper bound after playing T rounds. (iii) We evaluate the proposed algorithm on a real-world dataset as a crowdsourcing problem. The result shows that our approach significantly outperforms other existing MAB algorithms. 1.1 Difference from Existing MAB Frameworks Contextual bandit: Contextual bandit considers the scenario where decision makers can observe the context of arms and infer the rewards of other unseen arms. In general, the contextual bandit framework is more applicable than the non-contextual variants, as it is rare that no context is available [15]. Various contextual bandit algorithms have been proposed, e.g. LinUCB [16], Epoch-Greedy [15] for the stochastic setting and EXP4, EXP4.P [2] for the adversarial setting. However, most of these algorithms only allow the decision makers to pull one single arm in each round. Incorporating combinatorial bandit into a context-aware setting is still an under-studied topic. Combinatorial bandit and submodular reward function: Efforts have been made to generalize the classical MAB problems to combinatorial bandit [6, 8] which allows the decision makers to pull a set of arms in each round. However, most of these works are developed on standard bandit problems and neglect the available context of arms. Moreover, the submodular reward is a special issue often encountered in combinatorial bandit since the total reward of multiple selected arms may depend on the relations between individual arms. There exist works that consider submodular function in combinatorial bandit [9, 21] but they are for the non-contextual setting. Authors in [5] use a bandit framework to learn the submodular utility function. The most related work is probably [18], which investigates contextual combinatorial bandit with submodular reward. However, it considers a special submodular reward function that depends on a linear combination of individual rewards and assumes a constant set of arms which is very different from the volatile arms in our work. Volatile bandit and Sleeping bandit: The key idea of volatile bandit [3] and sleeping bandit [11] is that the arms may “appear” or “disappear” in each round. Volatile and sleeping bandit are beneficial extensions of standard MAB problems and fit many practical applications where the available arms vary over time. While these works only consider volatile arms for standard MAB, our paper considers volatile arms in the contextual combinatorial MAB with submodular rewards. In addition, although volatile and sleeping bandit allow available arms to change over time, they still assume that the arms appear in each round come from an already-known finite arm set. By contrast, we allow infinitely many arms in CC-MAB by taking advantage of the Hölder (Lipschitz) condition on the context space, which also is the basis of works on Lipschitz bandit [12] in continuum bandit [13]. 2 The rest of paper is organized as follows: Section 2 formulates a contextual combinatorial MAB problem (CC-MAB) with volatile arms and submodular functions. Section 3 introduces the algorithm design and analyzes the regret of CC-MAB. Section 4 evaluates the performance of CC-MAB on a real-world crowdsourcing problem, followed by the conclusion in Section 5. 2 Preliminaries and Problem Formulation We consider a sequential decision-making process for a horizon of T time slots (rounds) and formulate it as a contextual combinatorial multi-armed bandit problem. Let Mt = {1, . . . , M t} be the set of arms arrived/available in time slot t. Notice that this formulation captures the volatile arms: arm sets Mt, ∀0 < t ≤T (and their size) in different time slots can be different from each other. For each arrived arm m ∈Mt, its context (side information) xt m ∈X ≜[0, 1]D can be observed, where D is the dimension of observed context vector and X is a bounded context space. Let xt = {xt m}m∈Mt be the context set that collects the contexts of all arms in time slot t. The quality (i.e., the reward of choosing an arm individually) of arm m is a random variable drawn from an unknown distribution parametrized by its context xt m and we denote this random quality by r(xt m) and its expected value by µ(xt m) = E[r(xt m)]. Let rt = {r(xt m)}m∈Mt collect the qualities of arms arrived in time slot t and µt = {µ(xt m)}m∈Mt collect their expected values. Given the available arms Mt to choose from in each time slot, our objective is to pick a subset of arms St ⊆Mt to maximize the total reward. Usually, a decision maker will have a budget B that limits the maximum number of arms that can be selected, i.e., |St| ≤B, ∀t. We assume this budget is a constant across time slots. Nevertheless, our formulation can be easily extended to work with time-varying budgets. As aforementioned, many reward/payoff functions we encounter in real-world applications are submodular. Therefore, we define a submodular reward function u : 2Mt →R+ to measure the reward achieved by an arm set. Let u(rt, St) be the reward of selecting the arm set St, its value is jointly determined by the qualities of individual arms {r(xt m)}m∈St and the relations between arms that create submodularity. The considered submodular reward function is general, and is featured by the diminishing returns property: given the available arm set M and the corresponding quality r in an arbitrary time slot, for all possible arm subsets S ⊆B ⊆M and any arm m /∈B, we have u(r, {m} ∪S) −u(r, S) ≥u(r, {m} ∪B) −u(r, B). (1) We denote the marginal reward of an arm m to a set S by ∆(r, m|S) ≜u(r, {m} ∪S) −u(r, S). Moreover, we also require the reward function to be monotone: for all S ⊆B, it holds that u(r, S) ≤ u(r, B). It is assumed that the reward function is revealed at the beginning of each time slot when observing the arrived arms. For example, in the spatial crowdsourcing application [19], the reward function can be determined by the overlapped sensing area of workers (arms); and in diversified information retrieval [22], the reward function can be determined by the topic of articles (arms). Our goal is selecting a subset of arms St ⊆Mt in each time slot t to maximize the expected cumulative reward up to a finite time horizon T : max S1,...,ST XT t=1 E  u(rt, St)  (2a) s.t. |St| ≤B, St ⊆Mt, ∀t (2b) Obviously, the above problem can be decoupled into T subproblems, one for each time slot t as follow: maxSt∈Mt,|St|≤B E [u(rt, St)]. Let us for now assume that for an arbitrary arm with context x ∈X, its expected quality µ(x) = E [r(x)] is known a priori. Since the relations among arms are observed upon their arrival, E [u(rt, St)] can be written as u(E [rt] , St) = u(µt, St). Now, in each time slot t, we need to select a subset S∗,t(xt) that satisfies: S∗,t(xt) = arg max S⊆Mt,|S|≤B u(µt, S) (3) Clearly, if |Mt| ≤B, then we simply select all arms in Mt. Since S∗,t(xt) is obtained by an omniscient oracle that knows the expected quality of all arrived arms, we call {S∗,t(xt)}T t=1 the oracle solution. However, maximizing a submodular function with cardinality constraint in (3) is NP-hard. Fortunately, the greedy algorithm [17] (in Algorithm 1) offers a polynomial-time solution and guarantees to achieve no less than (1 −1/e) of the optimum as stated in the following Lemma: 3 Algorithm 1 Greedy Algorithm 1: Input: arm set Mt, reward vector rt, submodular reward function u, budget B. 2: Initialization: S0 ←∅, τ ←0; 3: while k ≤B do: 4: k = k + 1; 5: Depend on the expected reward µt, select mk = arg maxmk∈Mt\Sk−1 ∆(µt, {mk}|Sk−1); 6: Sk = Sk−1 ∪{mk} 7: Return: St = Sk Lemma 1. In an arbitrary time slot t, let St be the arm set selected by greedy algorithm and S∗,t be the optimal arm set for the problem in (3), we will have u(µt, St) ≥(1 −1 e)u(µt, S∗,t). The proof for Lemma 1 is omitted here, see [17] for detail. Since there is no polynomial time algorithm that achieves a better approximation in general for submodular function maximization than the greedy algorithm [7], we use it to solve the submodular function maximization problem for each per-slot subproblem in (3) and define the regret of an algorithm up to slot T against this benchmark as follows: R(T ) = (1 −1 e) · XT t=1 E  u(rt, S∗,t)  − XT t=1 E  u(rt, St)  (4) Here, the expectation is taken with respect to the choices made by a learning algorithm and the distributions of qualities. 3 Contextual Combinatorial MAB In practice, the expected quality of an arm is unknown a priori. In this case, the per-slot subproblem cannot be solved as described previously. Therefore, we have to learn the expected qualities of arms over time using a MAB framework. However, learning the quality for volatile arms faces special challenges especially when a universal arm set U (i.e., Mt ⊆U holds true for all t) is not welldefined. Let us consider an extreme case that the arms arrived in every slot are completely new (i.e., the universal arm set is infinitely large), then the decision maker is unable to play an arm several times to learn the expected quality as in standard MAB algorithms and it is meaningless to do that since the arm will not appear again. To tailor our CC-MAB for a general case of volatile arms, we resort to the contextual bandit with similarity information. Basically, we divide the arms into different groups based on their context information and learn the expected quality for each group of arms by assuming that arms with similar context information will have similar qualities. This idea is also used by Lipschitz bandit [12] in continuum bandit to deal with the infinite number of arms. CC-MAB is carefully designed to properly group the volatile arms and define a control policy that makes a good trade-off between exploration (i.e., to learn the expected qualities of arms) and exploitation (i.e., to use the learned qualities to guide the future arm selection) to achieve a sublinear regret. 3.1 Algorithm Structure The pseudo-code of CC-MAB is presented in Algorithm 2. Given the time horizon T , CC-MAB first creates a partition PT which splits the context space X into (hT )D hypercubes of identical size 1 hT × · · · × 1 hT . These hypercubes correspond to possible arm groups whose expected qualities needs to be estimated. The parameter hT is a critical variable that determines the performance of CC-MAB. Its value design will be discussed in detail later. Each hypercube p ∈PT keeps (i) a counter Ct(p) to record the number of times that an arm with x ∈p is chosen and (ii) a collection of observed qualities Et(p) realized by selected arms with context from hypercube p. Then, the quality of arms with context x ∈p can be estimated by the sample mean ˆrt(p) = 1 Ct(p) P r∈Et(p) r. Note that the collection Et(p) does not appear in the algorithm, since ˆrt(p) can be computed based on ˆrt−1(p), Ct−1(p), and realized qualities of selected arms in current slot t. In each time slot t, CC-MAB performs the following steps: the context of arrived arms xt = {xt m}m∈Mt is observed. For each context xt m, the algorithm determines a hypercube pt m ∈PT , such 4 Algorithm 2 CC-MAB 1: Input: T , hT , K(t), X. 2: Initialization: context partition PT ; set C0(p) = 0, ˆr(p) = 0, ∀p ∈PT ; 3: for t = 1, . . . , T do: 4: Observe arrived arms Mt and their contexts xt = (xt m)m∈Mt; 5: Find pt = (pt m)m∈Mt such that xt m ∈pt m, pt m ∈PT , m ∈Mt; 6: Identify under-explored hypercubes Pue,t and the arm set Mue,t; let q = |Mue,t|; 7: if Pue,t ̸= ∅then: ⊲Exploration 8: if q ≥B then : St ←randomly pick B arms from Mue,t; 9: else: St ←pick q arms in Mue,t and other (B −q) as in (6); 10: else: St ←pick B arms as in (7); ⊲Exploitation 11: for each arm m ∈St do: 12: Observe the quality rm of arm m; 13: Update reward estimation: ˆr(pt m) = ˆr(pt m)C(pt m)+rm C(ptm)+1 ; 14: Update counters: C(pt m) = C(pt m) + 1; that xt m ∈pt m holds. The collection of these hypercubes in slot t is denoted by pt = {pt m}m∈Mt. Then the algorithm checks if there exist hypercubes p ∈pt that have not been explored sufficiently often. For this purpose, we define the under-explored hypercubes in slot t as: Pue,t T ≜  p ∈PT | ∃m ∈Mt, xt m ∈p, Ct(p) ≤K(t) (5) where K(t) is a deterministic, monotonically increasing control function that needs to be designed by CC-MAB. In addition, we collect the arms that fall in the under-explored hypercubes in Mue,t ≜ {m ∈Mt | pt m ∈Pue,t T }. Depending on the under-explored arms Mue,t in time slot t, CC-MAB can either be in an exploration phase or exploitation phase. If the set of under-explored arms is non-empty, i.e. Mue,t ̸= ∅, the algorithm enters an exploration phase. Let q = |Mue,t| be the size of under-explored arms. If the set of under-explored arms contains at least B arms, i.e. q ≥B, then CC-MAB randomly selects B arms from Mue,t. If the under-explored arm set contains less than B elements, i.e., q < B, then CC-MAB selects all q arms from Mue,t. Since the budget B is not fully utilized, the rest (B −q) additional arms are selected sequentially using the greedy algorithm by exploiting the estimated qualities ˆrt as follows: mk = arg max mk∈Mt\{Mue,t∪Sk−1} ∆(ˆrt, {mk}|{Sk−1 ∪Mue,t}), k = 1, . . . , (B −q) (6) where Sk−1 = {mi}k−1 i=1 . If the arm defined by (6) in not unique, ties are broken arbitrarily. Note that by this procedure, even in exploration phases, the algorithm exploits whenever the number of under-explored arms is smaller than the budget. If the set of under-explored arms is empty, i.e., Mue,t = ∅, the algorithm enters an exploitation phase. It selects all B arms based on estimated qualities using the greedy algorithm: mk = arg max mk∈Mt\Sk−1 ∆(ˆrt, {mk}|Sk−1), k = 1, . . . , B (7) After selecting the arm set, CC-MAB observes the qualities realized by selected arms and then updates the estimated quality and the counter of each hypercube in pt. It remains to design the input parameter hT and the control policy K(t) in order to achieve a sublinear regret in the time horizon T , i.e., R(T ) = O(T γ) with γ < 1, such that CC-MAB guarantees an asymptotically optimal performance since limT →∞R(T )/T = 0 holds. 3.2 Parameter Design and Regret Analysis In this section, we design the algorithm parameters hT and K(t) and give a corresponding upper bound for the regret incurred by CC-MAB. The regret analysis is carried out based on the natural assumption that the expected qualities of arms are similar if they have similar contexts. This assumption is formalized by the Hölder condition as follows: 5 Assumption 1 (Hölder Condition). There exists L > 0, α > 0 such that for any two contexts x, x′ ∈X, it holds that |µ(x) −µ(x′)| ≤L∥x −x′∥α (8) where ∥· ∥denotes the Euclidean norm in RD. Assumption 1 is needed for the regret analysis, but it should be noted that CC-MAB can also be applied if this assumption does not hold. However, a regret bound might not be guaranteed in this case. Now, we set hT = ⌈T 1 3α+D ⌉(where D is the dimension of the context space) for the context space partition, and K(t) = t 2α 3α+D log(t) in each time slot t for identifying the under-explored hypercubes and arms. Then, we will have a sublinear regret upper bound of CC-MAB as follows: Theorem 1 (Regret Upper Bound). Let K(t) = t 2α 3α+D log(t) and hT = ⌈T 1 3α+D ⌉. If CC-MAB is run with these parameters and Hölder condition holds true, the regret R(T ) is bounded by R(T ) ≤(1 −1 e) · Brmax2D  log(T )T 2α+D 3α+D + T D 3α+D  + (1 −1 e) · B2rmax M max B π2 3 +  3BLDα/2 + 2Brmax + 2BLDα/2 (2α + D)/(3α + D)  T 2α+D 3α+D . The leading order of the regret R(T ) is O(cT 2α+D 3α+D log(T )) where c = (1 −1 e)Brmax2D. Proof. See Appendix A in the supplemental file. The upper bound in Theorem 1 is valid for any finite time horizon, thereby providing a bound on the performance loss for any finite T . This can be used to characterize the convergence speed of the proposed algorithm. The leading order of regret upper bound R(T ) mainly depends on the context dimension D. The role of D here is similar to the role of the number of arms in standard MAB algorithms, e.g. UCB1[4]. Since the arm set considered in CC-MAB is infinitely large, CC-MAB splits these arms into different groups (i.e., hypercubes) based on their context information. The constant (1 −1 e)Brmax2D grows exponentially with the context dimension D, and hence regret tends to be high when the context space is large. However, a learner may apply dimension reduction techniques, e.g., feature selection, based on empirical experience to cut down the context space. In addition, the form of upper regret bound for CC-MAB is very different from that for many existing MAB algorithms, e.g. contextual/combinatorial/volatile MAB, which are developed on a finite arm set. The continuum-armed bandits (CAB), considering a continuum arm set X ∈[0, 1], provides a regret upper bound O(cT 2 3 log 1 3 (T )) with fixed discretization [13]. If CC-MAB is run with one-dimension context space and the parameter α large enough, its regret upper bound reduces to cT 2 3 log(T ), which is slightly looser than the CAB. We note that the regret bound, which although is sublinear in T , is loose when the budget B is close to M max (the maximum number of arms arriving in each time slot). Consider the special case of B = M max, CC-MAB is actually identical to the oracle algorithm, i.e., choosing all arms arriving in each time slot and hence the regret is 0. It is intuitive that when the budget B is large, learning is not very much needed and hence the more challenging regime is when the budget B is small. Furthermore, if we are able to know the specific stochastic pattern of the arm arrival, a sharper regret bound can be derived. For example, consider a case that the number of available arms in each time slot {M t}T t=1 (M t = |Mt|) are i.i.d. random variables and the probability E [Pr(B < M t)] = β, where β ∈[0, 1], is revealed. Then, the regret upper bound of CC-MAB can be derived in the following corollary. Corollary 1. If Assumption 1 and E [Pr(B < M t)] = β hold true, and CC-MAB is run with the parameters defined in Theorem 1. Let Rub be the regret upper bound defined in Theorem 1, the regret R(T ) is bounded by R(T ) ≤βRub. Compared to Theorem 1, the regret is scaled by the parameter β in this case. This is due to the fact that with probability (1 −β) the budget is larger than the number of arrived arms and hence, both CC-MAB and oracle algorithm select all the arrived arms and no regret is incurred. 6 3.3 Complexity Analysis The computational complexity of CC-MAB is mainly determined by the counters C(p) and estimated context-specific qualities ˆr(p) for each hypercube p ∈PT kept by the learner. If CCMAB is run with the parameters in Theorem 1, the number of hypercubes is (hT )D = ⌈T 1 3α+D ⌉D. Hence, the required memory is sublinear in the time horizon T . However, this also means that when T →∞, the algorithm would require infinite memory. Fortunately, in the practical implementations, A learner only needs to keep the counters of hypercubes p to which at least one of appeared arms’ context vectors belongs. Hence the required number of counters that have to be kept is actually much smaller than the analytical requirement. Moreover, the learner may choose to stop splitting the context space after a certain level of granularity so the number of hypercubes will be bounded. 4 Experiments 4.1 Experiment setting We evaluate the performance of CC-MAB in a crowdsourcing application based on the data published by Yelp1. The dataset provides abundant real-world traces for emulating spatial crowdsourcing tasks where Yelp users are assigned with tasks to review local businesses. The dataset contains 61,184 businesses, 36,6715 users and 1,569,264 reviews. 1) Arms and Context: We divide the time span of the dataset into daily instances, and every day (each time slot) a set of users are selected to review businesses. In each time slot, a user can choose one business from a set of reachable businesses to review. Therefore, each user-business pair is an arm in our crowdsourcing problem. Note that the available users vary across the time and the businesses a user can review also change depending on users’ location. This means that the available arms in each round are different. In addition, each user has side information including the number of fans, the number of received votes, and the years a user was elite, which can be used as arm context. 2) System Reward: When soliciting reviews on businesses, the decision maker expects more businesses covered under the budget constraint. Therefore, individual user’s marginal quality is maximized if each of them reviews a distinct business. In the case that a business is reviewed more than once, the value of subsequent reviews will be discounted. In order to capture this property, we use Dixit-Stiglitz preference model [23] to calculate the total reward. Let rij denote the j-th review on the i-th business. The quality of each review record (arm) is calculated based on the text length of the comment, and the number of votes it received (rij = LijN votes ij where Lij is the normalized text length and N votes ij is the vote count). Figure 1 shows the distribution of arm quality over the number of fans context. We see that the reviews from users with a larger number of fans tend to have a higher quality. Figure 2 further depicts the expected quality of user groups in each hypercube on two context dimensions number of years as elite and number of fans, which are used to define the context space in the experiment. We see that the review quality is very related to the users’ context. Figure 1: Arm quality distribution on fans context. 0~25 26~50 51~75 75~100 >100 Number of fans 0~3 3~6 6~9 >9 Number of years as elite 20 40 60 80 100 120 Figure 2: Expected quality for hypercubes. For each business i, its reward is given by the Dixit-Stiglitz model: ui = X j(rij)p1/p , p ≥1. (9) 1Yelp dataset challenge: www.yelp.com/dataset/challenge 7 and the total reward is the sum of rewards of all businesses: u = P i ui. It can be easily verified that the given reward function is submodular for any value of parameter p ≥1. We compare CC-MAB with the following benchmarks: 1) Oracle: Oracle knows precisely the expected quality of each arm. In each time slot, Oracle chooses B arms using the greedy algorithm presented in Algorithm 1. 2) k-LinUCB: LinUCB [16] is a contextual bandit algorithm which recommends exactly one arm in each round. To select a set of k users, we repeat LinUCB algorithm k times in each round. By sequentially removing selected arms, we ensure that the k arms returned by k-LinUCB are distinct in each round. Notice that k-LinUCB is unaware of the submodular reward when selecting users. 3) UCB: UCB algorithm [4] is a classical MAB algorithm (non-contextual and non-combinatorial) that achieves the logarithmic regret bound. Similar to k-LinUCB, we repeat UCB k times to select multiple users in each round. 4) CC-MAB-NS: CC-MAB-NS(Non-Submodular) is a variant of proposed CC-MAB where submodularity of reward function is not considered. It simply selects B (or (B −k)) arms with the highest quality during exploitation (or semi-exploitation). 5) Random: The Random algorithm picks B arms randomly from the available arms in each round. 4.2 Results and Discussions Figure 3 shows the cumulative system rewards achieved by CC-MAB and 5 benchmark algorithms. As expected, Oracle has the highest cumulative reward and gives an upper bound to other algorithms. Among other algorithms, we see that the context-aware algorithms CC-MAB, k-LinUCB and CC-MAB-NS outperform UCB and Random algorithm. This indicates that exploiting the context information of arms helps to better learn the quality of arms. Further, it can be observed that the CC-MAB achieves a close-to-oracle performance while k-LinUCB and CC-MAB-NS incur obvious reward loss since they do not consider the submodularity of the reward function. 0 40 80 120 160 200 Time slot t 0 2 4 6 8 10 12 14 16 18 Cumulative reward 104 CC-MAB Oracle k-LinUCB UCB CC-MAB-NS Random Figure 3: Comparison of cumulative rewards. 10 20 30 40 50 60 70 80 90 100 Budget B 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Cumulative reward in 200 rounds 105 CC-MAB Oracle k-LinUCB UCB CC-MAB-NS Random Figure 4: Cumulative rewards over budgets. Figure 4 shows the cumulative rewards achieved by 6 algorithms in 200 rounds under different budgets. In general, all the algorithms achieve a higher cumulative reward with a larger budget since more arms can be selected. It is worth noticing that the cumulative rewards obtained by Oracle and CC-MAB become saturated at budget B = 50 which is much smaller compared to that of other algorithms that become saturated after B = 90. This is due to the fact that the most beneficial arms can be efficiently identified by Oracle and CC-MAB algorithms by considering the submodularity of the reward function, and therefore the arms that are left out only offer little marginal reward. Note that, in our experiment, the maximum number of arms in each round is set as 100 and hence all algorithms have the same performance at B = 100. In addition, we see that CC-MAB is able to achieve the close-to-oracle performance at all budget levels. In Figure 5, we further depict the regret of CC-MAB across different budgets. It shows that the regret decreases with the increase in budget. This seems contradictory to Theorem 1 where the regret upper bound grows with the budget B. However, the regret upper bound is proved for an arbitrary submodular function and an arbitrarily large arm set in each round. In a setting that the maximum number of arms arriving in each round is fixed, increasing the budget reduces the chance that beneficial arms are left out. We also analyze the impact of submodularity to our algorithm. Figure 6 shows the cumulative reward achieved by CC-MAB and CC-MAB-NS with different levels of submodularity, where the level of submodularity is determined by the parameter p in the reward function (9). A larger p indicates a stronger submodularity. When p = 1, the reward function becomes non-submodular, therefore CC8 10 30 50 70 90 100 Budget B 0 2000 4000 6000 8000 10000 12000 Regret Figure 5: Regret of CC-MAB over budgets. 1 3 5 7 9 Parameter p for submodular function 0 5 10 15 20 45 50 Cumulative reward ( 104) CC-MAB CC-MAB-NS 15.9% 16.6% 17.1% 0.0% 17.1% Figure 6: Impact of submodularity. MAB and CC-MAB-NS achieve the same cumulative reward. Moreover, at this point, the achieved reward is maximized since the diminishing return of submodularity disappears. When the reward function becomes submodular (p > 1), CC-MAB outperforms CC-MAB-NS, and the performance loss incurred by CC-MAB-NS grows as the submodularity becomes stronger. Other extended simulations are given in Appendix B in the supplemental file. 5 Conclusion We presented a framework called contextual combinatorial multi-armed bandit that accommodates combinatorial nature of contextual arms. An efficient algorithm CC-MAB was proposed, which is tailored to volatile arms and submodular reward functions. We rigorously proved that the regret upper bound of the proposed algorithm is sublinear in the time horizon T . Experiments on real-world crowdsourcing data demonstrated that our algorithm helps to explore and exploit arms’ reward by considering the context information and the submodularity of reward function and hence improves the cumulative reward compared to many existing MAB algorithms. CC-MAB currently creates static context partitions during initialization which may be inappropriate in certain cases, a meaningful extension is to generate appropriate partitions dynamically over time based on the distribution of arrived arms on the context space. 6 Acknowledgment L. Chen and J. Xu’s work is supported in part by the Army Research Office under Grant W911NF18-1-0343. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Office or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. References [1] P. Auer. Using confidence bounds for exploitation-exploration trade-offs. Journal of Machine Learning Research, 3(Nov):397–422, 2002. [2] P. Auer, N. Cesa-Bianchi, Y. Freund, and R. E. Schapire. The nonstochastic multiarmed bandit problem. SIAM journal on computing, 32(1):48–77, 2002. [3] Z. Bnaya, R. Puzis, R. Stern, and A. Felner. Volatile multi-armed bandits for guaranteed targeted social crawling. In AAAI (Late-Breaking Developments), 2013. [4] S. Bubeck, N. Cesa-Bianchi, et al. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends R⃝in Machine Learning, 5(1):1–122, 2012. [5] L. Chen, A. Krause, and A. Karbasi. Interactive submodular bandit. In Advances in Neural Information Processing Systems, pages 141–152, 2017. [6] W. Chen, Y. Wang, and Y. Yuan. Combinatorial multi-armed bandit: General framework and applications. In International Conference on Machine Learning, pages 151–159, 2013. 9 [7] U. Feige. A threshold of ln n for approximating set cover. Journal of the ACM (JACM), 45(4):634–652, 1998. [8] Y. Gai, B. Krishnamachari, and R. Jain. Combinatorial network optimization with unknown variables: Multi-armed bandits with linear rewards and individual observations. IEEE/ACM Transactions on Networking (TON), 20(5):1466–1478, 2012. [9] E. Hazan and S. Kale. Online submodular minimization. Journal of Machine Learning Research, 13(Oct):2903–2922, 2012. [10] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [11] R. Kleinberg, A. Niculescu-Mizil, and Y. Sharma. Regret bounds for sleeping experts and bandits. Machine learning, 80(2-3):245–272, 2010. [12] R. Kleinberg, A. Slivkins, and E. Upfal. Multi-armed bandits in metric spaces. In Proceedings of the fortieth annual ACM symposium on Theory of computing, pages 681–690. ACM, 2008. [13] R. D. Kleinberg. Nearly tight bounds for the continuum-armed bandit problem. In Advances in Neural Information Processing Systems, pages 697–704, 2005. [14] A. Krause and C. Guestrin. Beyond convexity: Submodularity in machine learning. ICML Tutorials, 2008. [15] J. Langford and T. Zhang. The epoch-greedy algorithm for multi-armed bandits with side information. In Advances in neural information processing systems, pages 817–824, 2008. [16] L. Li, W. Chu, J. Langford, and R. E. Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661–670. ACM, 2010. [17] G. L. Nemhauser and L. A. Wolsey. Best algorithms for approximating the maximum of a submodular set function. Mathematics of operations research, 3(3):177–188, 1978. [18] L. Qin, S. Chen, and X. Zhu. Contextual combinatorial bandit and its application on diversified online recommendation. In Proceedings of the 2014 SIAM International Conference on Data Mining, pages 461–469. SIAM, 2014. [19] G. Radanovic, A. Singla, A. Krause, and B. Faltings. Information gathering with peers: Submodular optimization with peer-prediction constraints. In Proceedings of the 32nd AAAI Conference on Artificial Intelligence (AAAI’18), 2018. [20] F. Radlinski, R. Kleinberg, and T. Joachims. Learning diverse rankings with multi-armed bandits. In Proceedings of the 25th international conference on Machine learning, pages 784– 791. ACM, 2008. [21] P. Yang, N. Zhang, S. Zhang, K. Yang, L. Yu, and X. Shen. Identifying the most valuable workers in fog-assisted spatial crowdsourcing. IEEE Internet of Things Journal, 4(5):1193– 1203, 2017. [22] Y. Yue and C. Guestrin. Linear submodular bandits and their application to diversified retrieval. In Advances in Neural Information Processing Systems, pages 2483–2491, 2011. [23] Y. Zhang and M. van der Schaar. Information production and link formation in social computing systems. IEEE Journal on selected Areas in communications, 30(11):2136–2145, 2012. 10
2018
147
7,305
Learning to Reconstruct Shapes from Unseen Classes Xiuming Zhang∗ MIT CSAIL Zhoutong Zhang∗ MIT CSAIL Chengkai Zhang MIT CSAIL Joshua B. Tenenbaum MIT CSAIL William T. Freeman MIT CSAIL, Google Research Jiajun Wu MIT CSAIL Abstract From a single image, humans are able to perceive the full 3D shape of an object by exploiting learned shape priors from everyday life. Contemporary single-image 3D reconstruction algorithms aim to solve this task in a similar fashion, but often end up with priors that are highly biased by training classes. Here we present an algorithm, Generalizable Reconstruction (GenRe), designed to capture more generic, class-agnostic shape priors. We achieve this with an inference network and training procedure that combine 2.5D representations of visible surfaces (depth and silhouette), spherical shape representations of both visible and non-visible surfaces, and 3D voxel-based representations, in a principled manner that exploits the causal structure of how 3D shapes give rise to 2D images. Experiments demonstrate that GenRe performs well on single-view shape reconstruction, and generalizes to diverse novel objects from categories not seen during training. 1 Introduction Humans can imagine an object’s full 3D shape from just a single image, showing only a fraction of the object’s surface. This applies to common objects such as chairs, but also to novel objects that we have never seen before. Vision researchers have long argued that the key to this ability may be a sophisticated hierarchy of representations, extending from images through surfaces to volumetric shape, which process different aspects of shape in different representational formats [Marr, 1982]. Here we explore how these ideas can be integrated into state-of-the-art computer vision systems for 3D shape reconstruction. Recently, computer vision and machine learning researchers have made impressive progress on single-image 3D reconstruction by learning a parametric function f2D→3D, implemented as deep neural networks, that maps a 2D image to its corresponding 3D shape. Essentially, f2D→3D encodes shape priors (“what realistic shapes look like”), often learned from large shape repositories such as ShapeNet [Chang et al., 2015]. Because the problem is well-known to be ill-posed—there exist many 3D explanations for any 2D visual observation—modern systems have explored looping in various structures into this learning process. For example, MarrNet [Wu et al., 2017] uses intrinsic images or 2.5D sketches [Marr, 1982] as an intermediate representation, and concatenates two learned mappings for shape reconstruction: f2D→3D = f2.5D→3D ◦f2D→2.5D. Many existing methods, however, ignore the fact that mapping a 2D image or a 2.5D sketch to a 3D shape involves complex, but deterministic geometric projections. Simply using a neural network to approximate this projection, instead of modeling this mapping explicitly, leads to inference models that are overparametrized (and hence subject to overfitting training classes). It also misses valuable inductive biases that can be wired in through such projections. Both of these factors contribute to poor generalization to unseen classes. ∗indicates equal contribution. Project page: http://genre.csail.mit.edu 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Input (Novel Class) Our Reconstruction Our Reconstruction Input (Novel Class) Figure 1: We study the task of generalizable single-image 3D reconstruction, aiming to reconstruct the 3D shape of an object outside training classes. Here we show a table and a bed reconstructed from single RGB images by our model trained on cars, chairs, and airplanes. Our model learns to reconstruct objects outside the training classes. Here we propose to disentangle geometric projections from shape reconstruction to better generalize to unseen shape categories. Building upon the MarrNet framework [Wu et al., 2017], we further decompose f2.5D→3D into a deterministic geometric projection p from 2.5D to a partial 3D model, and a learnable completion c of the 3D model. A straightforward version of this idea would be to perform shape completion in the 3D voxel grid: f2.5D→3D = c3D→3D ◦p2.5D→3D. However, shape completion in 3D is challenging, as the manifold of plausible shapes is sparser in 3D than in 2D, and empirically this fails to reconstruct shapes well. Instead we perform completion based on spherical maps. Spherical maps are surface representations defined on the UV coordinates of a unit sphere, where the value at each coordinate is calculated as the minimal distance travelled from this point to the 3D object surface along the sphere’s radius. Such a representation combines appealing features of 2D and 3D: spherical maps are a form of 2D images, on which neural inpainting models work well; but they have a semantics that allows them to be projected into 3D to recover full shape geometry. They essentially allow us to complete non-visible object surfaces from visible ones, as a further intermediate step to full 3D reconstruction. We now have f2.5D→3D = pS→3D ◦cS→S ◦p2.5D→S, where S stands for spherical maps. Our full model, named Generalizable Reconstruction (GenRe), thus comprises three cascaded, learnable modules connected by fixed geometric projections. First, a single-view depth estimator predicts depth from a 2D image (f2D→2.5D); the depth map is then projected into a spherical map (p2.5D→S). Second, a spherical map inpainting network inpaints the partial spherical map (cS→S); the inpainted spherical map is then projected into 3D voxels (p2.5D→3D). Finally, we introduce an additional voxel refinement network to refine the estimated 3D shape in voxel space. Our neural modules only have to model object geometry for reconstruction, without having to learn geometric projections. This enhances generalizability, along with several other factors: during training, our modularized design forces each module of the network to use features from the previous module, instead of directly memorizing shapes from the training classes; also, each module only predicts outputs that are in the same domain as its inputs (image-based or voxel-based), which leads to more regular mappings. Our GenRe model achieves state-of-the-art performance on reconstructing shapes both within and outside training classes. Figure 1 shows examples of our model reconstructing a table and a bed from single images, after training only on cars, chairs, and airplanes. We also present detailed analyses of how each component contributes to the final prediction. This paper makes three contributions. First, we emphasize the task of generalizable single-image 3D shape reconstruction. Second, we propose to disentangle geometric projections from shape reconstruction, and include spherical maps with differentiable, deterministic projections in an integrated neural model. Third, we demonstrate that the resulting model achieves state-of-the-art performance on single-image 3D shape reconstruction for objects within and outside training classes. 2 Related Work Single-image 3D reconstruction. The problem of recovering the object shape from a single image is challenging, as it requires both powerful recognition systems and prior knowledge of plausible 3D shapes. Large CAD model repositories [Chang et al., 2015] and deep networks have contributed to the significant progress in recent years, mostly with voxel representations [Choy et al., 2016, Girdhar et al., 2016, Häne et al., 2017, Kar et al., 2015, Novotny et al., 2017, Rezende et al., 2016, Tatarchenko et al., 2016, Tulsiani et al., 2017, Wu et al., 2016, 2017, 2018, Zhu et al., 2018, Yan et al., 2016]. Apart from voxels, some researchers have also studied reconstructing objects in point clouds [Fan et al., 2017] or octave trees [Riegler et al., 2017, Tatarchenko et al., 2017]. The shape 2 Final 3D Shape RGB Image Depth Partial Spherical Map Inpainted Spherical Map Geometric Projection Projected Voxels Network Module a b c Figure 2: Our model for generalizable single-image 3D reconstruction (GenRe) has three components: (a) a depth estimator that predicts depth in the original view from a single RGB image, (b) a spherical inpainting network that inpaints a partial, single-view spherical map, and (c) a voxel refinement network that integrates two backprojected 3D shapes (from the inpainted spherical map and from depth) to produce the final output. priors learned in these approaches, however, are in general only applicable to their training classes, with very limited generalization power for reconstructing shapes from unseen categories. In contrast, our system exploits 2.5D sketches and spherical representations for better generalization to objects outside training classes. Spherical projections. Spherical projections have been shown effective in 3D shape retrieval [Esteves et al., 2018], classification [Cao et al., 2017], and finding possible rotational as well as reflective symmetries [Kazhdan et al., 2004, 2002]. Recent papers [Cohen et al., 2018, 2017] have studied differentiable, spherical convolution on spherical projections, aiming to preserve rotational equivariance within a neural network. These designs, however, perform convolution in the spectral domain with limited frequency bands, causing aliasing and loss of high-frequency information. In particular, convolution in the spectral domain is not suitable for shape reconstruction, since the reconstruction quality highly depends on the high-frequency components. In addition, the ringing effects caused by aliasing would introduce undesired artifacts. 2.5D sketch recovery. The origin of intrinsic image estimation dates back to the early years of computer vision [Barrow and Tenenbaum, 1978]. Through years, researchers have explored recovering 2.5D sketches from texture, shading, or color images [Barron and Malik, 2015, Bell et al., 2014, Horn and Brooks, 1989, Tappen et al., 2003, Weiss, 2001, Zhang et al., 1999]. As handy depth sensors get mature [Izadi et al., 2011], and larger-scale RGB-D datasets become available [McCormac et al., 2017, Silberman et al., 2012, Song et al., 2017], many papers start to estimate depth [Chen et al., 2016, Eigen and Fergus, 2015], surface normals [Bansal and Russell, 2016, Wang et al., 2015], and other intrinsic images [Janner et al., 2017, Shi et al., 2017] with deep networks. Our method employs 2.5D estimation as a component, but focuses on reconstructing shapes from unseen categories. Zero- and few-shot recognition. In computer vision, abundant attempts have been made to tackle the problem of few-shot recognition. We refer readers to the review article [Xian et al., 2017] for a comprehensive list. A number of earlier papers have explored sharing features across categories to recognize new objects from a few examples [Bart and Ullman, 2005, Farhadi et al., 2009, Lampert et al., 2009, Torralba et al., 2007]. More recently, many researchers have begun to study zero- or few-shot recognition with deep networks [Akata et al., 2016, Antol et al., 2014, Hariharan and Girshick, 2017, Wang et al., 2017, Wang and Hebert, 2016]. Especially, Peng et al. [2015] explored the idea of learning to recognize novel 3D models via domain adaptation. While these proposed methods are for recognizing and categorizing images or shapes, in this paper we explore reconstructing the 3D shape of an object from unseen classes. This problem has received little attention in the past, possibly due to its considerable difficulty. A few imaging systems have attempted to recover 3D shape from a single shot by making use of special cameras [Proesmans et al., 1996, Sagawa et al., 2011]. Unlike them, we study 3D reconstruction from a single RGB image. Very recently, researchers have begun to look at the generalization power of 3D reconstruction algorithms [Shin et al., 2018, Jayaraman et al., 2018, Rock et al., 2015, Funk and Liu, 2017]. Here we present a novel approach that makes use of spherical representations for better generalization. 3 Approach Single-image reconstruction algorithms learn a parametric function f2D→3D that maps a 2D image to a 3D shape. We tackle the problem of generalization by regularizing f2D→3D. The key regularization we impose is to factorize f2D→3D into geometric projections and learnable reconstruction modules. 3 Input Ground Truth Inpainted RGB Input Inpainted RGB Ground Truth Figure 3: Examples of our spherical inpainting module generalizing to new classes. Trained on chairs, cars, and planes, the module completes the partially visible leg of the table (red boxes) and the unseen cabinet bottom (purple boxes) from partial spherical maps projected from ground-truth depth. Our GenRe model consists of three learnable modules, connected by geometric projections as shown in Figure 2. The first module is a single-view depth estimator f2D→2.5D (Figure 2a), taking a color image as input and estimates its depth map. As the depth map can be interpreted as the visible surface of the object, the reconstruction problem becomes predicting the object’s complete surface given this partial estimate. As 3D surfaces are hard to parametrize efficiently, we use spherical maps as a surrogate representation. A geometric projection module (p2.5D→S) converts the estimated depth map into a spherical map, referred to as the partial spherical map. It is then passed to the spherical map inpainting network (cS→S, Figure 2b) to predict an inpainted spherical map, representing the object’s complete surface. Another projection module (pS→3D) projects the inpainted spherical map back to the voxel space. As spherical maps only capture the outermost surface towards the sphere, they cannot handle selfocclusion along the sphere’s radius. We use a voxel refinement module (Figure 2c) to tackle this problem. It takes two 3D shapes as input, one projected from the inpainted spherical map and the other from the estimated depth map, and outputs a final 3D shape. 3.1 Single-View Depth Estimator The first component of our network predicts a depth map from an image with a clean background. Using depth as an intermediate representation facilitates the reconstruction process by distilling essential geometric information from the input image [Wu et al., 2017]. Further, depth estimation is a class-agnostic task: shapes from different classes often share common geometric structure, despite distinct visual appearances. Take beds and cabinets as examples. Although they are of different anatomy in general, both have perpendicular planes and hence similar patches in their depth images. We demonstrate this both qualitatively and quantitatively in Section 4.4. 3.2 Spherical Map Inpainting Network With spherical maps, we cast the problem of 3D surface completion into 2D spherical map inpainting. Empirically we observe that networks trained to inpaint spherical maps generalize well to new shape classes (Figure 3). Also, compared with voxels, spherical maps are more efficient to process, as 3D surfaces are sparse in nature; quantitatively, as we demonstrate in Section 4.5 and Section 4.6, using spherical maps results in better performance. As spherical maps are signals on the unit sphere, it is tempting to use network architectures based on spherical convolution [Cohen et al., 2018]. They are however not suitable for our task of shape reconstruction. This is because spherical convolution is conducted in the spectral domain. Every conversion to and from the spectral domain requires capping the maximum frequency, causing extra aliasing and information loss. For tasks such as recognition, the information loss may be negligible compared with the advantage of rotational invariance offered by spherical convolution. But for reconstruction, the loss leads to blurred output with only low-frequency components. We empirically find that standard convolution works much better than spherical convolution under our setup. 3.3 Voxel Refinement Network Although an inpainted spherical map provides a projection of an object’s surface onto the unit sphere, the surface information is lost when self-occlusion occurs. We use a refinement network that operates 4 in the voxel space to recover the lost information. This module takes two voxelized shapes as input, one projected from the estimated depth map and the other from the inpainted spherical map, and predicts the final shape. As the occluded regions can be recovered from local neighboring regions, this network only needs to capture local shape priors and is therefore class-agnostic. As shown in the experiments, when provided with ground-truth depth and spherical maps, this module performs consistently well across training and unseen classes. 3.4 Technical Details Single-view depth estimator. Following Wu et al. [2017], we use an encoder-decoder network for depth estimation. Our encoder is a ResNet-18 [He et al., 2015], encoding a 256×256 RGB image into 512 feature maps of size 1×1. The decoder is a mirrored version of the encoder, replacing all convolution layers with transposed convolution layers. In addition, we adopt the U-Net structure [Ronneberger et al., 2015] and feed the intermediate outputs of each block of the encoder to the corresponding block of the decoder. The decoder outputs the depth map in the original view at the resolution of 256×256. We use an ℓ2 loss between predicted and target images. Spherical map inpainting network. The spherical map inpainting network has a similar architecture as the single-view depth estimator. To reduce the gap between standard and spherical convolutions, we use periodic padding to both inputs and training targets in the longitude dimension, making the network aware of the periodic nature of spherical maps. Voxel refinement network. Our voxel refinement network takes as input voxels projected from the estimated, original-view depth and from the inpainted spherical map, and recovers the final shape in voxel space. Specifically, the encoder takes as input a two-channel 128×128×128 voxel (one for coarse shape estimation and the other for surface estimation), and outputs a 320-D latent vector. In decoding, each layer takes an extra input directly from the corresponding level of the encoder. Geometric projections. We make use of three geometric projections: a depth to spherical map projection, a depth map to voxel projection, and a spherical map to voxel projection. For the depth to spherical map projection, we first convert depth into 3D point clouds using camera parameters, and then turn them into surfaces with the marching cubes algorithm [Lewiner et al., 2003]. Then, the spherical representation is generated by casting rays from each UV coordinate on the unit sphere to the sphere’s center. This process is not differentiable. To project depth or spherical maps into voxels, we first convert them into 3D point clouds. Then, a grid of voxels is initialized, where the value of each voxel is determined by the average distance between all the points inside it to its center. Then, for all the voxels that contain points, we negate its value and add it by 1. This projection process is fully differentiable. Training. We train our network with viewer-centered 3D supervision, where the 3D shape is rotated to match the object’s pose in the input image. This is in contrast to object-centered approaches, where the 3D supervision is always in a predefined pose regardless of the object’s pose in the input image. Object-centered approaches are less suitable for reconstructing shapes from new categories, as predefined poses are unlikely to generalize across categories. We first train the 2.5D sketch estimator with RGB images and their corresponding depth images, all rendered with ShapeNet [Chang et al., 2015] objects (see Section 4.2 and the supplemental material for details). We then train the spherical map inpainting network with single-view (partial) spherical maps and the ground-truth full spherical maps as supervision. Finally, we train the voxel refinement network on coarse shapes predicted by the inpainting network as well as 3D surfaces backprojected from the estimated 2.5D sketches, with the corresponding ground-truth shapes as supervision. We then jointly fine-tune the spherical inpainting module and the voxel refinement module with both 3D shape and 2D spherical map supervision. 4 Experiments 4.1 Baselines We organize baselines based on the shape representation they use. Voxels. Voxels are arguably the most common representation for 3D shapes in the deep learning era due to their amenability to 3D convolution. For this representation, we consider DRC [Tulsiani et al., 2017] and MarrNet [Wu et al., 2017] as baselines. Our model uses 1283 voxels of [0, 1] occupancy. Mesh and point clouds. Considering the cubic complexity of the voxel representation, recent papers have explored meshes [Groueix et al., 2018, Yao et al., 2018] and point clouds [Fan et al., 5 2017] in the context of neural networks. In this work, we consider AtlasNet [Groueix et al., 2018] as a baseline. Multi-view maps. Another way of representing 3D shapes is to use a set of multi-view depth images [Soltani et al., 2017, Shin et al., 2018, Jayaraman et al., 2018]. We compare with the model from Shin et al. [2018] in this regime. Spherical maps. As introduced in Section 1, one can also represent 3D shapes as spherical maps. We include two baselines with spherical maps: first, a one-step baseline that predicts final spherical maps directly from RGB images (GenRe-1step); second, a two-step baseline that first predicts singleview spherical maps from RGB images and then inpaints them (GenRe-2step). Both baselines use the aforementioned U-ResNet image-to-image network architecture. To provide justification for using spherical maps, we provide a baseline (3D Completion) that directly performs 3D shape completion in voxel space. This baseline first predicts depth from an input image; it then projects the depth map into the voxel space. A completion module takes the projected voxels as input and predicts the final result. To provide a performance upper bound for our spherical inpainting and voxel refinement networks (b and c in Figure 2), we also include the results when our model has access to ground-truth depth in the original view (GenRe-Oracle) and to ground-truth full spherical maps (GenRe-SphOracle). 4.2 Data We use ShapeNet [Chang et al., 2015] renderings for network training and testing. Specifically, we render each object in 20 random views. In addition to RGB images, we also render their corresponding ground-truth depth maps. We use Mitsuba [Jakob, 2010], a physically-based rendering engine, for all our renderings. Please see the supplementary material for details on data generation and augmentation. For all models, we train them on the three largest ShapeNet classes (cars, chairs, and airplanes), and test them on the next 10 largest classes: bench, vessel, rifle, sofa, table, phone, cabinet, speaker, lamp, and display. Besides ShapeNet renderings, we also test these models, trained only on synthetic data, on real images from Pix3D [Sun et al., 2018], a dataset of real images and the ground-truth shape of every pictured object. In Section 5, we also test our model on non-rigid shapes such as humans and horses [Bronstein et al., 2008] and on highly regular shape primitives. 4.3 Metrics Because neither depth maps nor spherical maps provide information inside shapes, our model predicts only surface voxels that are not guaranteed watertight. Consequently, intersection over union (IoU) cannot be used as an evaluation metric. We hence evaluate reconstruction quality using Chamfer distance (CD) [Barrow et al., 1977], defined as CD(S1, S2) = 1 |S1| X x∈S1 min y∈S2∥x −y∥2 + 1 |S2| X y∈S2 min x∈S1∥x −y∥2, (1) where S1 and S2 are sets of points sampled from surfaces of the 3D shape pair. For models that output voxels, including DRC and our GenRe model, we sweep voxel thresholds from 0.3 to 0.7 with a step size of 0.05 for isosurfaces, compute CD with 1,024 points sampled from all isosurfaces, and report the best average CD for each object class. Shin et al. [2018] reports that object-centered supervision produces better reconstructions for objects from the training classes, whereas viewer-centered supervision is advantaged in generalizing to novel classes. Therefore, for DRC and AtlasNet, we train each network with both types of supervision. Note that AtlasNet, when trained with viewer-centered supervision, tends to produce unstable predictions that render CD meaningless. Hence, we only present CD for the object-centered AtlasNet. 4.4 Results on Depth Estimation We show qualitative and quantitative results on depth estimation quality across categories. As shown in Figure 4, our depth estimator learns effectively the concept of near and far, generalizes well to unseen categories, and does not show statistically significant deterioration as the novel test class gets increasingly dissimilar to the training classes, laying the foundation for the generalization power of our approach. Formally, the dissimilarity from test class Ctest to training classes Ctrain is defined as (1/|Ctest|) P x∈Ctest miny∈Ctrain CD(x, y). 6 Input Ground Truth Prediction Training Classes Novel Test Classes Non-zero slope: <latexit sha1_base64="mynLrqQGfbDsDPdnYc36dFEQ4C4=">ACAHicdVA9SwNBEN3zM8avqIWFzWIQbAx3MRi1CtpYiYJRI QlhbzPRJXu7x+6cGI80/hUbC0Vs/Rl2/hv3NIKPh4vDfDzLwlsKi795I6Nj4xOTuan89Mzs3HxhYfHU6sRwqHMtTkPmQUpFNRoITz2ACLQglnYW8/8+uwFih1Qn2Y2hF7EKJruAMndQuLDcRrjE91GrjBoymVuoYdumgXSj6pZ3trXJli/ol368G5SAj5Wpls 0IDp2QokiGO2oXZkfzJAKFXDJrG4EfYytlBgWXMg3Ewsx4z12AQ1HFYvAtKPBwZ0zSkd2tXGlUL6oX6fSFlkbT8KXWfE8NL+9jLxL6+RYHe7lQoVJwiKfy7qJpKiplkatCMcJR9Rxg3wt1K+SUzjKPLO9C+PqU/k9Oy6XALwXHlWJtbxhHjqyQVbJOAlIlNXJAjk idcDIgd+SBPHq3r35D1/to54w5kl8gPeyzv0sJah</latexit> <latexit sha1_base64="mynLrqQGfbDsDPdnYc36dFEQ4C4=">ACAHicdVA9SwNBEN3zM8avqIWFzWIQbAx3MRi1CtpYiYJRI QlhbzPRJXu7x+6cGI80/hUbC0Vs/Rl2/hv3NIKPh4vDfDzLwlsKi795I6Nj4xOTuan89Mzs3HxhYfHU6sRwqHMtTkPmQUpFNRoITz2ACLQglnYW8/8+uwFih1Qn2Y2hF7EKJruAMndQuLDcRrjE91GrjBoymVuoYdumgXSj6pZ3trXJli/ol368G5SAj5Wpls 0IDp2QokiGO2oXZkfzJAKFXDJrG4EfYytlBgWXMg3Ewsx4z12AQ1HFYvAtKPBwZ0zSkd2tXGlUL6oX6fSFlkbT8KXWfE8NL+9jLxL6+RYHe7lQoVJwiKfy7qJpKiplkatCMcJR9Rxg3wt1K+SUzjKPLO9C+PqU/k9Oy6XALwXHlWJtbxhHjqyQVbJOAlIlNXJAjk idcDIgd+SBPHq3r35D1/to54w5kl8gPeyzv0sJah</latexit> <latexit sha1_base64="mynLrqQGfbDsDPdnYc36dFEQ4C4=">ACAHicdVA9SwNBEN3zM8avqIWFzWIQbAx3MRi1CtpYiYJRI QlhbzPRJXu7x+6cGI80/hUbC0Vs/Rl2/hv3NIKPh4vDfDzLwlsKi795I6Nj4xOTuan89Mzs3HxhYfHU6sRwqHMtTkPmQUpFNRoITz2ACLQglnYW8/8+uwFih1Qn2Y2hF7EKJruAMndQuLDcRrjE91GrjBoymVuoYdumgXSj6pZ3trXJli/ol368G5SAj5Wpls 0IDp2QokiGO2oXZkfzJAKFXDJrG4EfYytlBgWXMg3Ewsx4z12AQ1HFYvAtKPBwZ0zSkd2tXGlUL6oX6fSFlkbT8KXWfE8NL+9jLxL6+RYHe7lQoVJwiKfy7qJpKiplkatCMcJR9Rxg3wt1K+SUzjKPLO9C+PqU/k9Oy6XALwXHlWJtbxhHjqyQVbJOAlIlNXJAjk idcDIgd+SBPHq3r35D1/to54w5kl8gPeyzv0sJah</latexit> <latexit sha1_base64="mynLrqQGfbDsDPdnYc36dFEQ4C4=">ACAHicdVA9SwNBEN3zM8avqIWFzWIQbAx3MRi1CtpYiYJRI QlhbzPRJXu7x+6cGI80/hUbC0Vs/Rl2/hv3NIKPh4vDfDzLwlsKi795I6Nj4xOTuan89Mzs3HxhYfHU6sRwqHMtTkPmQUpFNRoITz2ACLQglnYW8/8+uwFih1Qn2Y2hF7EKJruAMndQuLDcRrjE91GrjBoymVuoYdumgXSj6pZ3trXJli/ol368G5SAj5Wpls 0IDp2QokiGO2oXZkfzJAKFXDJrG4EfYytlBgWXMg3Ewsx4z12AQ1HFYvAtKPBwZ0zSkd2tXGlUL6oX6fSFlkbT8KXWfE8NL+9jLxL6+RYHe7lQoVJwiKfy7qJpKiplkatCMcJR9Rxg3wt1K+SUzjKPLO9C+PqU/k9Oy6XALwXHlWJtbxhHjqyQVbJOAlIlNXJAjk idcDIgd+SBPHq3r35D1/to54w5kl8gPeyzv0sJah</latexit> p > 0.05 <latexit sha1_base64="QadlIXs0puMS5l+5QVDS/k6eQpQ=">AB7XicdVDLSgMxFM3UV62vqks3wSK4GjLj2NaNFN24rG BroR1KJs20sZnMkGSEMvQf3LhQxK3/486/MdNWUNEDgZNz7uXe4KEM6UR+rAKS8srq2vF9dLG5tb2Tnl3r63iVBLaIjGPZSfAinImaEszWknkRHAae3wfgy92/vqVQsFjd6klA/wkPBQkawNlI7OUc2Ou2XK8g+q1drwrNH9Uc18mJW/NOPOgYJUcFLNDs l97g5ikERWacKxU10GJ9jMsNSOcTku9VNEkzEe0q6hAkdU+dls2yk8MsoAhrE0T2g4U793ZDhSahIFpjLCeqR+e7n4l9dNdVj3MyaSVFNB5oPClEMdw/x0OGCSEs0nhmAimdkVkhGWmGgTUMmE8HUp/J+0XdtBtnPtVRoXiziK4AcgmPgBpogCvQBC1AwB 14AE/g2YqtR+vFep2XFqxFz74AevtE3yljmk=</latexit> <latexit sha1_base64="QadlIXs0puMS5l+5QVDS/k6eQpQ=">AB7XicdVDLSgMxFM3UV62vqks3wSK4GjLj2NaNFN24rG BroR1KJs20sZnMkGSEMvQf3LhQxK3/486/MdNWUNEDgZNz7uXe4KEM6UR+rAKS8srq2vF9dLG5tb2Tnl3r63iVBLaIjGPZSfAinImaEszWknkRHAae3wfgy92/vqVQsFjd6klA/wkPBQkawNlI7OUc2Ou2XK8g+q1drwrNH9Uc18mJW/NOPOgYJUcFLNDs l97g5ikERWacKxU10GJ9jMsNSOcTku9VNEkzEe0q6hAkdU+dls2yk8MsoAhrE0T2g4U793ZDhSahIFpjLCeqR+e7n4l9dNdVj3MyaSVFNB5oPClEMdw/x0OGCSEs0nhmAimdkVkhGWmGgTUMmE8HUp/J+0XdtBtnPtVRoXiziK4AcgmPgBpogCvQBC1AwB 14AE/g2YqtR+vFep2XFqxFz74AevtE3yljmk=</latexit> <latexit sha1_base64="QadlIXs0puMS5l+5QVDS/k6eQpQ=">AB7XicdVDLSgMxFM3UV62vqks3wSK4GjLj2NaNFN24rG BroR1KJs20sZnMkGSEMvQf3LhQxK3/486/MdNWUNEDgZNz7uXe4KEM6UR+rAKS8srq2vF9dLG5tb2Tnl3r63iVBLaIjGPZSfAinImaEszWknkRHAae3wfgy92/vqVQsFjd6klA/wkPBQkawNlI7OUc2Ou2XK8g+q1drwrNH9Uc18mJW/NOPOgYJUcFLNDs l97g5ikERWacKxU10GJ9jMsNSOcTku9VNEkzEe0q6hAkdU+dls2yk8MsoAhrE0T2g4U793ZDhSahIFpjLCeqR+e7n4l9dNdVj3MyaSVFNB5oPClEMdw/x0OGCSEs0nhmAimdkVkhGWmGgTUMmE8HUp/J+0XdtBtnPtVRoXiziK4AcgmPgBpogCvQBC1AwB 14AE/g2YqtR+vFep2XFqxFz74AevtE3yljmk=</latexit> <latexit sha1_base64="QadlIXs0puMS5l+5QVDS/k6eQpQ=">AB7XicdVDLSgMxFM3UV62vqks3wSK4GjLj2NaNFN24rG BroR1KJs20sZnMkGSEMvQf3LhQxK3/486/MdNWUNEDgZNz7uXe4KEM6UR+rAKS8srq2vF9dLG5tb2Tnl3r63iVBLaIjGPZSfAinImaEszWknkRHAae3wfgy92/vqVQsFjd6klA/wkPBQkawNlI7OUc2Ou2XK8g+q1drwrNH9Uc18mJW/NOPOgYJUcFLNDs l97g5ikERWacKxU10GJ9jMsNSOcTku9VNEkzEe0q6hAkdU+dls2yk8MsoAhrE0T2g4U793ZDhSahIFpjLCeqR+e7n4l9dNdVj3MyaSVFNB5oPClEMdw/x0OGCSEs0nhmAimdkVkhGWmGgTUMmE8HUp/J+0XdtBtnPtVRoXiziK4AcgmPgBpogCvQBC1AwB 14AE/g2YqtR+vFep2XFqxFz74AevtE3yljmk=</latexit> Figure 4: Left: Our single-view depth estimator, trained on cars, chairs, and airplanes, generalizes to novel classes: buses, trains, and tables. Right: As the novel test class gets increasingly dissimilar to the training classes (left to right), depth prediction does not show statistically significant degradation (p > 0.05). Models Seen Unseen Bch Vsl Rfl Sfa Tbl Phn Cbn Spk Lmp Dsp Avg ObjectCentered DRC [Tulsiani et al., 2017] .072 .112 .100 .104 .108 .133 .199 .168 .164 .145 .188 .142 AtlasNet [Groueix et al., 2018] .059 .102 .092 .088 .098 .130 .146 .149 .158 .131 .173 .127 ViewerCentered DRC [Tulsiani et al., 2017] .092 .120 .109 .121 .107 .129 .132 .142 .141 .131 .156 .129 MarrNet [Wu et al., 2017] .070 .107 .094 .125 .090 .122 .117 .125 .123 .144 .149 .120 Multi-View [Shin et al., 2018] .065 .092 .092 .102 .085 .105 .110 .119 .117 .142 .142 .111 3D Completion .076 .102 .099 .121 .095 .109 .122 .131 .126 .138 .141 .118 GenRe-1step .063 .104 .093 .114 .084 .108 .121 .128 .124 .126 .151 .115 GenRe-2step .061 .098 .094 .117 .084 .102 .115 .125 .125 .118 .118 .110 GenRe (Ours) .064 .089 .092 .112 .082 .096 .107 .116 .115 .124 .130 .106 GenRe-Oracle .045 .050 .048 .031 .059 .057 .054 .076 .077 .060 .060 .057 GenRe-SphOracle .034 .032 .030 .021 .044 .038 .037 .044 .045 .031 .040 .036 Table 1: Reconstruction errors (in CD) of the training classes and 10 novel classes, ordered from the most to the least similar to the training classes. Our model is viewer-centered by design, but achieves performance on par with the object-centered state of the art (AtlasNet) in reconstructing the seen classes. As for generalization to novel classes, our model outperforms the state of the art across 9 out of the 10 classes. 4.5 Reconstructing Novel Objects from Training Classes We present results on generalizing to novel objects from the training classes. All models are trained on cars, chairs, and airplanes, and tested on unseen objects from the same three categories. As shown in Table 1, our GenRe model is the best-performing viewer-centered model. It also outperforms most object-centered models except AtlasNet. GenRe’s preformance is impressive given that object-centered models tend to perform much better on objects from seen classes [Shin et al., 2018]. This is because object-centered models, by exploiting the concept of canonical views, actually solve an easier problem. The performance drop from object-centered DRC to viewer-centered DRC supports this empirically. However, for objects from unseen classes, the concept of canonical views is no longer well-defined. As we will see in Section 4.6, this hurts the generalization power of object-centered methods. 4.6 Reconstructing Objects from Unseen Classes We study how our approach enables generalization to novel shape classes unseen during training. Synthetic renderings. We use the 10 largest ShapeNet classes other than chairs, cars, and airplanes as our test set. Table 1 shows that our model consistently outperforms the state of the art, except for the class of rifles, in which AtlasNet performs the best. Qualitatively, our model produces reconstructions that are much more consistent with input images, as shown in Figure 5. In particular, on unseen classes, our results still attain good consistency with the input images, while the competitors either lack structural details present in the input (e.g., 5) or retrieve shapes from the training classes (e.g., 4, 6, 7, 8, 9). 7 Input Best Baseline GenRe (Ours) Ground Truth 1 2 3 4 5 Input Best Baseline GenRe (Ours) Ground Truth 6 7 8 10 9 Figure 5: Single-image 3D reconstructions of objects within and beyond training classes. Each row from left to right: the input image, two views from the best-performing baseline for each testing object (1-4, 6-9: AtlasNet; 5, 10: Shin et al. [2018]), two views of our GenRe predictions, and the ground truth. All models are trained on the same dataset of cars, chairs, and airplanes. Comparing our model with its variants, we find that the two-step approaches (GenRe-2step and GenRe) outperform the one-step approach across all novel categories. This empirically supports the advantage of our two-step modeling strategy that disentangles geometric projections from shape reconstruction. Real images. We further compare how our model, AtlasNet, and Shin et al. [2018] perform on real images from Pix3D. Here, all models are trained on ShapeNet cars, chairs, and airplanes, and tested on real images of beds, bookcases, desks, sofas, tables, and wardrobes. Quantitatively, Table 2 shows that our model outperforms the two competitors across all novel classes except beds, for which Shin et al. [2018] performs the best. For chairs, one of the training classes, the object-centered AtlasNet leverages the canonical view and outperforms the two viewer-centered approaches. Qualitatively, our reconstructions preserve the details present in the input (e.g., the hollow structures in the second row of Figure 6). AtlasNet Shin et al. GenRe Chair .080 .089 .093 Bed .114 .106 .113 Bookcase .140 .109 .101 Desk .126 .121 .109 Sofa .095 .088 .083 Table .134 .124 .116 Wardrobe .121 .116 .109 Table 2: Reconstruction errors (in CD) for seen (chairs) and unseen classes (the rest) on real images from Pix3D. GenRe outperforms the two baselines across all unseen classes except beds. For chairs, object-centered AtlasNet performs the best by leveraging the canonical view. Input Best Baseline GenRe (Ours) Ground Truth Figure 6: Reconstructions on real images from Pix3D by GenRe and AtlasNet or Shin et al. [2018]. All models are trained on cars, chairs, and airplanes. 5 Analyses 5.1 The Effect of Viewpoints on Generalization The generic viewpoint assumption states that the observer is not in a special position relative to the object [Freeman, 1994]. This makes us wonder if the “accidentalness” of the viewpoint affects the quality of reconstructions. As a quantitative analysis, we test our model trained on ShapeNet chairs, cars, and airplanes on 100 randomly sampled ShapeNet tables, each rendered in 200 different views sampled uniformly on a sphere. We then compute, for each of the 200 views, the median CD of the 100 reconstructions. Finally, in Figure 7, we visualize these median CDs as a heatmap over an elevation-azimuth view 8 Azimuth ✓= 2⇡ <latexit sha1_base64="qxzGJ2kQ5UCyzYfSDYkSRigEGo=">ACBHicbVDJSgNBEO1xjXGLesylMQiewkwQ9CJEvXiMYBbIDKGnU5M06VnorhHjkIMXf8WLB0W8+hH e/Bs7y0ETHxQ83quiqp6fSKHRtr+tpeWV1bX13EZ+c2t7Z7ewt9/Qcao41HksY9XymQYpIqijQAmtRAELfQlNf3A19pt3oLSIo1scJuCFrBeJQHCGRuoUi7CPWYXDyJMsU9H1MU+IDuvuInoFEp2Z6ALhJnRkpkhlqn8OV2Y56GECGXTOu2YyfoZUyh4BJGeTfVkDA+YD1oGxqxELSXTZ4Y0SOjdGkQK1MR0on6eyJjodbD0DedIcO+nvfG4n9eO8Xg zMtElKQIEZ8uClJMabjRGhXKOAoh4YwroS5lfI+U4yjyS1vQnDmX14kjUrZscvOzUmpejmLI0eK5JAcE4eckiq5JjVSJ5w8kmfySt6sJ+vFerc+pq1L1mzmgPyB9fkDmoaYCg=</latexit> <latexit sha1_base64="qxzGJ2kQ5UCyzYfSDYkSRigEGo=">ACBHicbVDJSgNBEO1xjXGLesylMQiewkwQ9CJEvXiMYBbIDKGnU5M06VnorhHjkIMXf8WLB0W8+hH e/Bs7y0ETHxQ83quiqp6fSKHRtr+tpeWV1bX13EZ+c2t7Z7ewt9/Qcao41HksY9XymQYpIqijQAmtRAELfQlNf3A19pt3oLSIo1scJuCFrBeJQHCGRuoUi7CPWYXDyJMsU9H1MU+IDuvuInoFEp2Z6ALhJnRkpkhlqn8OV2Y56GECGXTOu2YyfoZUyh4BJGeTfVkDA+YD1oGxqxELSXTZ4Y0SOjdGkQK1MR0on6eyJjodbD0DedIcO+nvfG4n9eO8Xg zMtElKQIEZ8uClJMabjRGhXKOAoh4YwroS5lfI+U4yjyS1vQnDmX14kjUrZscvOzUmpejmLI0eK5JAcE4eckiq5JjVSJ5w8kmfySt6sJ+vFerc+pq1L1mzmgPyB9fkDmoaYCg=</latexit> <latexit sha1_base64="qxzGJ2kQ5UCyzYfSDYkSRigEGo=">ACBHicbVDJSgNBEO1xjXGLesylMQiewkwQ9CJEvXiMYBbIDKGnU5M06VnorhHjkIMXf8WLB0W8+hH e/Bs7y0ETHxQ83quiqp6fSKHRtr+tpeWV1bX13EZ+c2t7Z7ewt9/Qcao41HksY9XymQYpIqijQAmtRAELfQlNf3A19pt3oLSIo1scJuCFrBeJQHCGRuoUi7CPWYXDyJMsU9H1MU+IDuvuInoFEp2Z6ALhJnRkpkhlqn8OV2Y56GECGXTOu2YyfoZUyh4BJGeTfVkDA+YD1oGxqxELSXTZ4Y0SOjdGkQK1MR0on6eyJjodbD0DedIcO+nvfG4n9eO8Xg zMtElKQIEZ8uClJMabjRGhXKOAoh4YwroS5lfI+U4yjyS1vQnDmX14kjUrZscvOzUmpejmLI0eK5JAcE4eckiq5JjVSJ5w8kmfySt6sJ+vFerc+pq1L1mzmgPyB9fkDmoaYCg=</latexit> <latexit sha1_base64="qxzGJ2kQ5UCyzYfSDYkSRigEGo=">ACBHicbVDJSgNBEO1xjXGLesylMQiewkwQ9CJEvXiMYBbIDKGnU5M06VnorhHjkIMXf8WLB0W8+hH e/Bs7y0ETHxQ83quiqp6fSKHRtr+tpeWV1bX13EZ+c2t7Z7ewt9/Qcao41HksY9XymQYpIqijQAmtRAELfQlNf3A19pt3oLSIo1scJuCFrBeJQHCGRuoUi7CPWYXDyJMsU9H1MU+IDuvuInoFEp2Z6ALhJnRkpkhlqn8OV2Y56GECGXTOu2YyfoZUyh4BJGeTfVkDA+YD1oGxqxELSXTZ4Y0SOjdGkQK1MR0on6eyJjodbD0DedIcO+nvfG4n9eO8Xg zMtElKQIEZ8uClJMabjRGhXKOAoh4YwroS5lfI+U4yjyS1vQnDmX14kjUrZscvOzUmpejmLI0eK5JAcE4eckiq5JjVSJ5w8kmfySt6sJ+vFerc+pq1L1mzmgPyB9fkDmoaYCg=</latexit> Elevation φ = ⇡ <latexit sha1_base64="Zv+82o4CtFUAlRlOBY9VuEYFsXo=">ACA3icbVDLSg NBEJyNrxhfUW96GQyCp7Argl6EoAgeI5gHZEOYnfQmQ2YfzPQGwxLw4q948aCIV3/Cm3/jZJODJhY0FXdHd5sRQabfvbyi0tr6yu5dcLG5tb2zvF3b26jhLFocYjGam xzRIEUINBUpoxgpY4EloeIPrid8YgtIiCu9xFEM7YL1Q+IzNFKneOAiPGB6I2GYKXRM3bgvLt1YdIolu2xnoIvEmZESmaHaKX653YgnAYTIJdO65dgxtlOmUHAJ4KbaIg ZH7AetAwNWQC6nWY/jOmxUbrUj5SpEGm/p5IWaD1KPBMZ8Cwr+e9ifif10rQv2inIowThJBPF/mJpBjRSC0KxRwlCNDGFfC3Ep5nynG0cRWMCE48y8vkvp2bHLzt1ZqX I1iyNPDskROSEOScVckuqpEY4eSTP5JW8WU/Wi/VufUxbc9ZsZp/8gfX5Awewl74=</latexit> <latexit sha1_base64="Zv+82o4CtFUAlRlOBY9VuEYFsXo=">ACA3icbVDLSg NBEJyNrxhfUW96GQyCp7Argl6EoAgeI5gHZEOYnfQmQ2YfzPQGwxLw4q948aCIV3/Cm3/jZJODJhY0FXdHd5sRQabfvbyi0tr6yu5dcLG5tb2zvF3b26jhLFocYjGam xzRIEUINBUpoxgpY4EloeIPrid8YgtIiCu9xFEM7YL1Q+IzNFKneOAiPGB6I2GYKXRM3bgvLt1YdIolu2xnoIvEmZESmaHaKX653YgnAYTIJdO65dgxtlOmUHAJ4KbaIg ZH7AetAwNWQC6nWY/jOmxUbrUj5SpEGm/p5IWaD1KPBMZ8Cwr+e9ifif10rQv2inIowThJBPF/mJpBjRSC0KxRwlCNDGFfC3Ep5nynG0cRWMCE48y8vkvp2bHLzt1ZqX I1iyNPDskROSEOScVckuqpEY4eSTP5JW8WU/Wi/VufUxbc9ZsZp/8gfX5Awewl74=</latexit> <latexit sha1_base64="Zv+82o4CtFUAlRlOBY9VuEYFsXo=">ACA3icbVDLSg NBEJyNrxhfUW96GQyCp7Argl6EoAgeI5gHZEOYnfQmQ2YfzPQGwxLw4q948aCIV3/Cm3/jZJODJhY0FXdHd5sRQabfvbyi0tr6yu5dcLG5tb2zvF3b26jhLFocYjGam xzRIEUINBUpoxgpY4EloeIPrid8YgtIiCu9xFEM7YL1Q+IzNFKneOAiPGB6I2GYKXRM3bgvLt1YdIolu2xnoIvEmZESmaHaKX653YgnAYTIJdO65dgxtlOmUHAJ4KbaIg ZH7AetAwNWQC6nWY/jOmxUbrUj5SpEGm/p5IWaD1KPBMZ8Cwr+e9ifif10rQv2inIowThJBPF/mJpBjRSC0KxRwlCNDGFfC3Ep5nynG0cRWMCE48y8vkvp2bHLzt1ZqX I1iyNPDskROSEOScVckuqpEY4eSTP5JW8WU/Wi/VufUxbc9ZsZp/8gfX5Awewl74=</latexit> <latexit sha1_base64="Zv+82o4CtFUAlRlOBY9VuEYFsXo=">ACA3icbVDLSg NBEJyNrxhfUW96GQyCp7Argl6EoAgeI5gHZEOYnfQmQ2YfzPQGwxLw4q948aCIV3/Cm3/jZJODJhY0FXdHd5sRQabfvbyi0tr6yu5dcLG5tb2zvF3b26jhLFocYjGam xzRIEUINBUpoxgpY4EloeIPrid8YgtIiCu9xFEM7YL1Q+IzNFKneOAiPGB6I2GYKXRM3bgvLt1YdIolu2xnoIvEmZESmaHaKX653YgnAYTIJdO65dgxtlOmUHAJ4KbaIg ZH7AetAwNWQC6nWY/jOmxUbrUj5SpEGm/p5IWaD1KPBMZ8Cwr+e9ifif10rQv2inIowThJBPF/mJpBjRSC0KxRwlCNDGFfC3Ep5nynG0cRWMCE48y8vkvp2bHLzt1ZqX I1iyNPDskROSEOScVckuqpEY4eSTP5JW8WU/Wi/VufUxbc9ZsZp/8gfX5Awewl74=</latexit> .076 .157 Accidental Views Generic Views Error(φ, ✓) <latexit sha1_base64="kXfNM1n/0U5V4psYcJyvnjzZSRU=">ACBHicbVBNS8 NAEN34WetX1WMvi0WoICURQY9FETxWsB/QlLZTpqlm2zYnYgl9ODFv+LFgyJe/RHe/DemHwdtfTDweG+GmXleLIVB2/62lpZXVtfWcxv5za3tnd3C3n7DqERzqHMlW5 zIAUEdRoIRWrIGFnoSmN7ga+8170Eao6A6HMXRC1o+ELzjDTOoWi7CA6bXWis9KrtxIE6oiwEgO853CyW7Yk9AF4kzIyUyQ61b+HJ7ichRMglM6bt2DF2UqZRcAmjvJs YiBkfsD60MxqxEwnTwxokeZ0qO+0lFSCfq74mUhcYMQy/rDBkGZt4bi/957QT9i04qojhBiPh0kZ9IioqOE6E9oYGjHGaEcS2yWykPmGYcs9zGITjzLy+SxmnFsSvO7V mpejmLI0eK5JCUiUPOSZXckBqpE04eyTN5JW/Wk/VivVsf09YlazZzQP7A+vwB5DmXkg=</latexit> <latexit sha1_base64="kXfNM1n/0U5V4psYcJyvnjzZSRU=">ACBHicbVBNS8 NAEN34WetX1WMvi0WoICURQY9FETxWsB/QlLZTpqlm2zYnYgl9ODFv+LFgyJe/RHe/DemHwdtfTDweG+GmXleLIVB2/62lpZXVtfWcxv5za3tnd3C3n7DqERzqHMlW5 zIAUEdRoIRWrIGFnoSmN7ga+8170Eao6A6HMXRC1o+ELzjDTOoWi7CA6bXWis9KrtxIE6oiwEgO853CyW7Yk9AF4kzIyUyQ61b+HJ7ichRMglM6bt2DF2UqZRcAmjvJs YiBkfsD60MxqxEwnTwxokeZ0qO+0lFSCfq74mUhcYMQy/rDBkGZt4bi/957QT9i04qojhBiPh0kZ9IioqOE6E9oYGjHGaEcS2yWykPmGYcs9zGITjzLy+SxmnFsSvO7V mpejmLI0eK5JCUiUPOSZXckBqpE04eyTN5JW/Wk/VivVsf09YlazZzQP7A+vwB5DmXkg=</latexit> <latexit sha1_base64="kXfNM1n/0U5V4psYcJyvnjzZSRU=">ACBHicbVBNS8 NAEN34WetX1WMvi0WoICURQY9FETxWsB/QlLZTpqlm2zYnYgl9ODFv+LFgyJe/RHe/DemHwdtfTDweG+GmXleLIVB2/62lpZXVtfWcxv5za3tnd3C3n7DqERzqHMlW5 zIAUEdRoIRWrIGFnoSmN7ga+8170Eao6A6HMXRC1o+ELzjDTOoWi7CA6bXWis9KrtxIE6oiwEgO853CyW7Yk9AF4kzIyUyQ61b+HJ7ichRMglM6bt2DF2UqZRcAmjvJs YiBkfsD60MxqxEwnTwxokeZ0qO+0lFSCfq74mUhcYMQy/rDBkGZt4bi/957QT9i04qojhBiPh0kZ9IioqOE6E9oYGjHGaEcS2yWykPmGYcs9zGITjzLy+SxmnFsSvO7V mpejmLI0eK5JCUiUPOSZXckBqpE04eyTN5JW/Wk/VivVsf09YlazZzQP7A+vwB5DmXkg=</latexit> <latexit sha1_base64="kXfNM1n/0U5V4psYcJyvnjzZSRU=">ACBHicbVBNS8 NAEN34WetX1WMvi0WoICURQY9FETxWsB/QlLZTpqlm2zYnYgl9ODFv+LFgyJe/RHe/DemHwdtfTDweG+GmXleLIVB2/62lpZXVtfWcxv5za3tnd3C3n7DqERzqHMlW5 zIAUEdRoIRWrIGFnoSmN7ga+8170Eao6A6HMXRC1o+ELzjDTOoWi7CA6bXWis9KrtxIE6oiwEgO853CyW7Yk9AF4kzIyUyQ61b+HJ7ichRMglM6bt2DF2UqZRcAmjvJs YiBkfsD60MxqxEwnTwxokeZ0qO+0lFSCfq74mUhcYMQy/rDBkGZt4bi/957QT9i04qojhBiPh0kZ9IioqOE6E9oYGjHGaEcS2yWykPmGYcs9zGITjzLy+SxmnFsSvO7V mpejmLI0eK5JCUiUPOSZXckBqpE04eyTN5JW/Wk/VivVsf09YlazZzQP7A+vwB5DmXkg=</latexit> 0 <latexit sha1_base64="6ZTwbptvK0HUiMuNsEoeJPkc=">AB6HicbVBNS8 NAEJ3Ur1q/qh69LBbBU0lEqMeiF48t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm/GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CN gktsGW4EdhOFNAoEdoLJ3dzvPKHSPJYPZpqgH9GR5CFn1Fip6Q7KFbfqLkDWiZeTCuRoDMpf/WHM0gilYJq3fPcxPgZVYzgbNSP9WYUDahI+xZKmE2s8Wh87IhVWGJIy VLWnIQv09kdFI62kU2M6ImrFe9ebif14vNeGNn3GZpAYlWy4KU0FMTOZfkyFXyIyYWkKZ4vZWwsZUWZsNiUbgrf68jpX1U9t+o1ryv12zyOIpzBOVyCBzWowz0oAUMEJ 7hFd6cR+fFeXc+lq0FJ585hT9wPn8AeRmMtA=</latexit> <latexit sha1_base64="6ZTwbptvK0HUiMuNsEoeJPkc=">AB6HicbVBNS8 NAEJ3Ur1q/qh69LBbBU0lEqMeiF48t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm/GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CN gktsGW4EdhOFNAoEdoLJ3dzvPKHSPJYPZpqgH9GR5CFn1Fip6Q7KFbfqLkDWiZeTCuRoDMpf/WHM0gilYJq3fPcxPgZVYzgbNSP9WYUDahI+xZKmE2s8Wh87IhVWGJIy VLWnIQv09kdFI62kU2M6ImrFe9ebif14vNeGNn3GZpAYlWy4KU0FMTOZfkyFXyIyYWkKZ4vZWwsZUWZsNiUbgrf68jpX1U9t+o1ryv12zyOIpzBOVyCBzWowz0oAUMEJ 7hFd6cR+fFeXc+lq0FJ585hT9wPn8AeRmMtA=</latexit> <latexit sha1_base64="6ZTwbptvK0HUiMuNsEoeJPkc=">AB6HicbVBNS8 NAEJ3Ur1q/qh69LBbBU0lEqMeiF48t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm/GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CN gktsGW4EdhOFNAoEdoLJ3dzvPKHSPJYPZpqgH9GR5CFn1Fip6Q7KFbfqLkDWiZeTCuRoDMpf/WHM0gilYJq3fPcxPgZVYzgbNSP9WYUDahI+xZKmE2s8Wh87IhVWGJIy VLWnIQv09kdFI62kU2M6ImrFe9ebif14vNeGNn3GZpAYlWy4KU0FMTOZfkyFXyIyYWkKZ4vZWwsZUWZsNiUbgrf68jpX1U9t+o1ryv12zyOIpzBOVyCBzWowz0oAUMEJ 7hFd6cR+fFeXc+lq0FJ585hT9wPn8AeRmMtA=</latexit> <latexit sha1_base64="6ZTwbptvK0HUiMuNsEoeJPkc=">AB6HicbVBNS8 NAEJ3Ur1q/qh69LBbBU0lEqMeiF48t2A9oQ9lsJ+3azSbsboQS+gu8eFDEqz/Jm/GbZuDtj4YeLw3w8y8IBFcG9f9dgobm1vbO8Xd0t7+weFR+fikreNUMWyxWMSqG1CN gktsGW4EdhOFNAoEdoLJ3dzvPKHSPJYPZpqgH9GR5CFn1Fip6Q7KFbfqLkDWiZeTCuRoDMpf/WHM0gilYJq3fPcxPgZVYzgbNSP9WYUDahI+xZKmE2s8Wh87IhVWGJIy VLWnIQv09kdFI62kU2M6ImrFe9ebif14vNeGNn3GZpAYlWy4KU0FMTOZfkyFXyIyYWkKZ4vZWwsZUWZsNiUbgrf68jpX1U9t+o1ryv12zyOIpzBOVyCBzWowz0oAUMEJ 7hFd6cR+fFeXc+lq0FJ585hT9wPn8AeRmMtA=</latexit> Figure 7: Reconstruction errors (CD) for different input viewpoints. The vertical (horizontal) axis represents elevation (azimuth). Accidental views (blue box) lead to large errors, while generic views (green box) result in smaller errors. Errors are computed for 100 tables; these particular tables are for visualization purposes only. grid. As the heatmap shows, our model makes better predictions when the input view is generic than when it is accidental, consistent with our intuition. 5.2 Reconstructing Non-Rigid Shapes We probe the generalization limit of our model by testing it with unseen non-rigid shapes, such as horses and humans. As the focus is mainly on the spherical map inpainting network (Figure 2b) and the voxel refinement network (Figure 2c), we assume our model has access to the ground-truth single-view depth (i.e., GenRe-Oracle) in this experiment. As demonstrated in Figure 8, our model not only retains the visible details in the original view, but also completes the unseen surfaces using the generic shape priors learned from rigid objects (cars, chairs, and airplanes). Input GenRe (Ours) Ground Truth Figure 8: Single-view completion of non-rigid shapes from depth maps by our model trained on cars, chairs, and airplanes. Input GenRe (Ours) Ground Truth Figure 9: Single-view completion of highly regular shapes (primitives) from depth maps by our model trained on cars, chairs, and airplanes. 5.3 Reconstructing Highly Regular Shapes We further explore whether our model captures global shape attributes by testing it on highly regular shapes that can be parametrized by only a few attributes (such as cones and cubes). Similar to Section 5.2, the model has only seen cars, chairs, and airplanes during training, and we assume our model has access to the ground-truth single-view depth (i.e., GenRe-Oracle). As Figure 9 shows, although our model hallucinates the unseen parts of these shape primitives, it fails to exploit global shape symmetry to produce correct predictions. This is not surprising given that our network design does not explicitly model such regularity. A possible future direction is to incorporate priors that facilitate learning high-level concepts such as symmetry. 6 Conclusion We have studied the problem of generalizable single-image 3D reconstruction. We exploit various image and shape representations, including 2.5D sketches, spherical maps, and voxels. We have proposed GenRe, a novel viewer-centered model that integrates these representations for generalizable, high-quality 3D shape reconstruction. Experiments demonstrate that GenRe achieves state-of-the-art performance on shape reconstruction for both seen and unseen classes. We hope our system will inspire future research along this challenging but rewarding research direction. 9 Acknowledgements We thank the anonymous reviewers for their constructive comments. This work is supported by NSF #1231216, NSF #1447476, ONR MURI N00014-16-1-2007, Toyota Research Institute, Shell, and Facebook. References Zeynep Akata, Mateusz Malinowski, Mario Fritz, and Bernt Schiele. Multi-cue zero-shot learning with strong supervision. In CVPR, 2016. 3 Stanislaw Antol, C Lawrence Zitnick, and Devi Parikh. Zero-shot learning via visual abstraction. In ECCV, 2014. 3 Aayush Bansal and Bryan Russell. Marr revisited: 2D-3D alignment via surface normal prediction. In CVPR, 2016. 3 Jonathan T Barron and Jitendra Malik. Shape, illumination, and reflectance from shading. IEEE TPAMI, 37(8): 1670–1687, 2015. 3 Harry G Barrow and Jay M Tenenbaum. Recovering intrinsic scene characteristics from images. Computer Vision Systems, 1978. 3 Harry G Barrow, Jay M Tenenbaum, Robert C Bolles, and Helen C Wolf. Parametric correspondence and chamfer matching: two new techniques for image matching. In IJCAI, 1977. 6 Evgeniy Bart and Shimon Ullman. Cross-generalization: learning novel classes from a single example by feature replacement. In CVPR, 2005. 3 Sean Bell, Kavita Bala, and Noah Snavely. Intrinsic images in the wild. ACM TOG, 33(4):159, 2014. 3 Alexander M Bronstein, Michael M Bronstein, and Ron Kimmel. Numerical geometry of non-rigid shapes. Springer Science & Business Media, 2008. 6 Zhangjie Cao, Qixing Huang, and Karthik Ramani. 3D object classification via spherical projections. In 3DV, 2017. 3 Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: an information-rich 3D model repository. arXiv:1512.03012, 2015. 1, 2, 5, 6 Weifeng Chen, Zhao Fu, Dawei Yang, and Jia Deng. Single-image depth perception in the wild. In NeurIPS, 2016. 3 Christopher B Choy, Danfei Xu, JunYoung Gwak, Kevin Chen, and Silvio Savarese. 3D-R2N2: a unified approach for single and multi-view 3D object reconstruction. In ECCV, 2016. 2 Taco Cohen, Mario Geiger, and Max Welling. Convolutional networks for spherical signals. In ICML Workshop, 2017. 3 Taco S Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In ICLR, 2018. 3, 4 David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In ICCV, 2015. 3 Carlos Esteves, Christine Allen-Blanchette, Ameesh Makadia, and Kostas Daniilidis. Learning SO(3) equivariant representations with spherical CNNs. In ECCV, 2018. 3 Haoqiang Fan, Hao Su, and Leonidas Guibas. A point set generation network for 3D object reconstruction from a single image. In CVPR, 2017. 2, 5 Ali Farhadi, Ian Endres, Derek Hoiem, and David Forsyth. Describing objects by their attributes. In CVPR, 2009. 3 William T Freeman. The generic viewpoint assumption in a framework for visual perception. Nature, 368(6471): 542, 1994. 8 Christopher Funk and Yanxi Liu. Beyond planar symmetry: modeling human perception of reflection and rotation symmetries in the wild. In ICCV, 2017. 3 Rohit Girdhar, David F Fouhey, Mikel Rodriguez, and Abhinav Gupta. Learning a predictable and generative vector representation for objects. In ECCV, 2016. 2 10 Thibault Groueix, Matthew Fisher, Vladimir G Kim, Bryan C Russell, and Mathieu Aubry. AtlasNet: a Papier-Mache approach to learning 3D surface generation. In CVPR, 2018. 5, 6, 7 Christian Häne, Shubham Tulsiani, and Jitendra Malik. Hierarchical surface prediction for 3D object reconstruction. In 3DV, 2017. 2 Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In ICCV, 2017. 3 Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2015. 5 Berthold KP Horn and Michael J Brooks. Shape from shading. MIT press, 1989. 3 Shahram Izadi, David Kim, Otmar Hilliges, David Molyneaux, Richard A Newcombe, Pushmeet Kohli, Jamie Shotton, Steve Hodges, Dustin Freeman, Andrew J Davison, and Andrew W Fitzgibbon. KinectFusion: real-time 3D reconstruction and interaction using a moving depth camera. In UIST, 2011. 3 Wenzel Jakob. Mitsuba renderer, 2010. 6 Michael Janner, Jiajun Wu, Tejas Kulkarni, Ilker Yildirim, and Joshua B Tenenbaum. Self-supervised intrinsic image decomposition. In NeurIPS, 2017. 3 Dinesh Jayaraman, Ruohan Gao, and Kristen Grauman. ShapeCodes: self-supervised feature learning by lifting views to viewgrids. In ECCV, 2018. 3, 6 Abhishek Kar, Shubham Tulsiani, Joao Carreira, and Jitendra Malik. Category-specific object reconstruction from a single image. In CVPR, 2015. 2 Michael Kazhdan, Bernard Chazelle, David Dobkin, Adam Finkelstein, and Thomas Funkhouser. A reflective symmetry descriptor. In ECCV, 2002. 3 Michael Kazhdan, Thomas Funkhouser, and Szymon Rusinkiewicz. Symmetry descriptors and 3D shape matching. In SGP, 2004. 3 Christoph H Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In CVPR, 2009. 3 Thomas Lewiner, Hélio Lopes, Antônio Wilson Vieira, and Geovan Tavares. Efficient implementation of marching cubes’ cases with topological guarantees. Journal of Graphics Tools, 8(2):1–15, 2003. 5 David Marr. Vision. W. H. Freeman and Company, 1982. 1 John McCormac, Ankur Handa, Stefan Leutenegger, and Andrew J Davison. SceneNet RGB-D: can 5M synthetic images beat generic imagenet pre-training on indoor segmentation? In ICCV, 2017. 3 David Novotny, Diane Larlus, and Andrea Vedaldi. Learning 3D object categories by looking around them. In ICCV, 2017. 2 Xingchao Peng, Baochen Sun, Karim Ali, and Kate Saenko. Learning deep object detectors from 3D models. In ICCV, 2015. 3 Marc Proesmans, Luc Van Gool, and André Oosterlinck. One-shot active 3D shape acquisition. In ICPR, 1996. 3 Danilo Jimenez Rezende, S M Ali Eslami, Shakir Mohamed, Peter Battaglia, Max Jaderberg, and Nicolas Heess. Unsupervised learning of 3D structure from images. In NeurIPS, 2016. 2 Gernot Riegler, Ali Osman Ulusoys, and Andreas Geiger. OctNet: learning deep 3D representations at high resolutions. In CVPR, 2017. 2 Jason Rock, Tanmay Gupta, Justin Thorsen, JunYoung Gwak, Daeyun Shin, and Derek Hoiem. Completing 3D object shape from one depth image. In CVPR, 2015. 3 Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: convolutional networks for biomedical image segmentation. In MICCAI, 2015. 5 Ryusuke Sagawa, Hiroshi Kawasaki, Shota Kiyota, and Ryo Furukawa. Dense one-shot 3D reconstruction by detecting continuous regions with parallel line projection. In ICCV, 2011. 3 11 Jian Shi, Yue Dong, Hao Su, and Stella X Yu. Learning non-lambertian object intrinsics across shapenet categories. In CVPR, 2017. 3 Daeyun Shin, Charless C Fowlkes, and Derek Hoiem. Pixels, voxels, and views: a study of shape representations for single view 3D object shape prediction. In CVPR, 2018. 3, 6, 7, 8 Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from RGBD images. In ECCV, 2012. 3 Amir Arsalan Soltani, Haibin Huang, Jiajun Wu, Tejas D Kulkarni, and Joshua B Tenenbaum. Synthesizing 3D shapes via modeling multi-view depth maps and silhouettes with deep generative networks. In CVPR, 2017. 6 Shuran Song, Fisher Yu, Andy Zeng, Angel X Chang, Manolis Savva, and Thomas Funkhouser. Semantic scene completion from a single depth image. In CVPR, 2017. 3 Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and William T Freeman. Pix3D: dataset and methods for single-image 3D shape modeling. In CVPR, 2018. 6 Marshall F Tappen, William T Freeman, and Edward H Adelson. Recovering intrinsic images from a single image. In NeurIPS, 2003. 3 Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Multi-view 3D models from single images with a convolutional network. In ECCV, 2016. 2 Maxim Tatarchenko, Alexey Dosovitskiy, and Thomas Brox. Octree generating networks: Efficient convolutional architectures for high-resolution 3D outputs. In ICCV, 2017. 2 Antonio Torralba, Kevin P Murphy, and William T Freeman. Sharing visual features for multiclass and multiview object detection. IEEE TPAMI, 29(5), 2007. 3 Shubham Tulsiani, Tinghui Zhou, Alexei A Efros, and Jitendra Malik. Multi-view supervision for single-view reconstruction via differentiable ray consistency. In CVPR, 2017. 2, 5, 7 Peng Wang, Lingqiao Liu, Chunhua Shen, Zi Huang, Anton van den Hengel, and Heng Tao Shen. Multi-attention network for one shot learning. In CVPR, 2017. 3 Xiaolong Wang, David Fouhey, and Abhinav Gupta. Designing deep networks for surface normal estimation. In CVPR, 2015. 3 Yu-Xiong Wang and Martial Hebert. Learning to learn: Model regression networks for easy small sample learning. In ECCV, 2016. 3 Yair Weiss. Deriving intrinsic images from image sequences. In ICCV, 2001. 3 Jiajun Wu, Chengkai Zhang, Tianfan Xue, William T Freeman, and Joshua B Tenenbaum. Learning a probabilistic latent space of object shapes via 3D generative-adversarial modeling. In NeurIPS, 2016. 2 Jiajun Wu, Yifan Wang, Tianfan Xue, Xingyuan Sun, William T Freeman, and Joshua B Tenenbaum. MarrNet: 3D shape reconstruction via 2.5D sketches. In NeurIPS, 2017. 1, 2, 4, 5, 7 Jiajun Wu, Chengkai Zhang, Xiuming Zhang, Zhoutong Zhang, William T Freeman, and Joshua B Tenenbaum. Learning 3D shape priors for shape completion and reconstruction. In ECCV, 2018. 2 Yongqin Xian, Bernt Schiele, and Zeynep Akata. Zero-shot learning-the good, the bad and the ugly. In CVPR, 2017. 3 Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective transformer nets: Learning single-view 3D object reconstruction without 3D supervision. In NeurIPS, 2016. 2 Shunyu Yao, Tzu Ming Harry Hsu, Jun-Yan Zhu, Jiajun Wu, Antonio Torralba, William T Freeman, and Joshua B Tenenbaum. 3D-aware scene manipulation via inverse graphics. In NeurIPS, 2018. 5 Ruo Zhang, Ping-Sing Tsai, James Edwin Cryer, and Mubarak Shah. Shape-from-shading: a survey. IEEE TPAMI, 21(8):690–706, 1999. 3 Jun-Yan Zhu, Zhoutong Zhang, Chengkai Zhang, Jiajun Wu, Antonio Torralba, Joshua B. Tenenbaum, and William T. Freeman. Visual object networks: image generation with disentangled 3D representations. In NeurIPS, 2018. 2 12
2018
148
7,306
Mixture Matrix Completion Daniel Pimentel-Alarcón Department of Computer Science Georgia State University Atlanta, GA, 30303 pimentel@gsu.edu Abstract Completing a data matrix X has become an ubiquitous problem in modern data science, with motivations in recommender systems, computer vision, and networks inference, to name a few. One typical assumption is that X is low-rank. A more general model assumes that each column of X corresponds to one of several lowrank matrices. This paper generalizes these models to what we call mixture matrix completion (MMC): the case where each entry of X corresponds to one of several low-rank matrices. MMC is a more accurate model for recommender systems, and brings more flexibility to other completion and clustering problems. We make four fundamental contributions about this new model. First, we show that MMC is theoretically possible (well-posed). Second, we give its precise information-theoretic identifiability conditions. Third, we derive the sample complexity of MMC. Finally, we give a practical algorithm for MMC with performance comparable to the state-of-the-art for simpler related problems, both on synthetic and real data. 1 Introduction Matrix completion aims to estimate the missing entries of an incomplete data matrix X. One of its main motivations arises in recommender systems, where each row represents an item, and each column represents a user. We only observe an entry in X whenever a user rates an item, and the goal is to predict unseen ratings in order to make good recommendations. Related Work. In 2009, Candès and Recht [1] introduced low-rank matrix completion (LRMC), arguably the most popular model for this task. LRMC assumes that each column (user) can be represented as a linear combination of a few others, whence X is low-rank. Later in 2012, Eriksson et. al. [2] introduced high-rank matrix completion (HRMC), also known as subspace clustering with missing data. This more general model assumes that each column of X comes from one of several low-rank matrices, thus allowing several types of users. Since their inceptions, both LRMC and HRMC have attracted a tremendous amount of attention (see [1–27] for a very incomplete list). Paper contributions. This paper introduces an even more general model: mixture matrix completion (MMC), which assumes that each entry in X (rather than column) comes from one out of several low-rank matrices, and the goal is to recover the matrices in the mixture. Figure 1 illustrates the generalization from LRMC to HRMC and to MMC. One of the main motivations behind MMC is that users often share the same account, and so each column in X may contain ratings from several users. Nonetheless, as we show in Section 2, MMC is also a more accurate model for many other contemporary applications, including networks inference, computer vision, and metagenomics. This paper makes several fundamental contributions about MMC: – Well posedness. First, we show that MMC is theoretically possible if we observe the right entries and the mixture is generic (precise definitions below). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Figure 1: In LRMC, X is a low-rank matrix. In HRMC, each column of X comes from one of several low-rank matrices. In MMC, each entry comes from one of several low-rank matrices X1, . . . , XK; we only observe XΩ, and our goal is to recover the columns of X1, . . . , XK that have observations in XΩ. – Identifiability conditions. We provide precise information-theoretical conditions on the entries that need to be observed such that a mixture of K low-rank matrices is identifiable. These extend similar recent results of LRMC [3] and HRMC [4] to the setting of MMC. The subtlety in proving these results is that there could exist false mixtures that agree with the observed entries, even if the sampling is uniquely completable for LRMC and HRMC (see Example 1). In other words, there exits samplings that are identifiable for LRMC (and HRMC) but are not identifiable for MMC, and so in general it is not enough to simply have K times more samples. Hence, it was necessary to derive identifiability conditions for MMC, similar to those of LRMC in [3] and HRMC in [4]. We point out that in contrast to typical completion theory [1, 2, 5–20], these type of identifiability conditions are deterministic (not restricted to uniform sampling), and make no coherence assumptions. – Sample complexity. If X ∈Rd×n is a mixture of K rank-r matrices, we show that with high probability, our identifiability conditions will be met if each entry is observed with probability O( K d max{r, log d}), thus deriving the sample complexity of MMC, which is the same as the sample complexity of HRMC [4], and simplifies to O( 1 d max{r, log d}) in the case of K = 1, which corresponds to the sample complexity of LRMC [3]. Intuitively, this means that informationtheoretically, we virtually pay no price for mixing low-rank matrices. – Practical algorithm. Our identifiability results follow from a combinatorial analysis that is infeasible in practice. To address this, we give a practical alternating algorithm for MMC whose performance (in the more difficult problem of MMC) is comparable to state-of-the-art algorithms for the much simpler problems of HRMC and LRMC. 2 Motivating Applications Besides recommender systems, there are many important applications where data can be modeled as a mixture of low-rank matrices. Here are a few examples motivated by current data science challenges. Networks Inference. Estimating the topology of a network (internet, sensor networks, biological networks, social networks) has been the subject of a large body of research in recent years [28–34]. To this end, companies routinely collect distances between nodes (e.g., computers) that connect with monitors (e.g., Google, Amazon, Facebook) in a data matrix X. In a simplified model, if node j is in subnet k, then the jth column can be modeled as the sum of (i) the distance between node j and router k, and (ii) the distance between router k and each of the monitors. Hence, the columns (nodes) corresponding to each subnet form a low-rank matrix, which is precisely the model assumed by HRMC. However, depending on the network’s traffic, each node may use different routes to communicate at different times. Consequently, the same column in X may contain measurements from different low-rank matrices. In other words, distance matrices of networks are a mixture of low-rank matrices. Computer Vision. Background segmentation is one of the most fundamental and crucial tasks in computer vision, yet it can be tremendously challenging. The vectorized frames of a video can be modeled as columns with some entries (pixels) in a low-rank background, and some outlier entries, corresponding to the foreground. Typical methods, like the acclaimed Robust PCA (principal component analysis) [35–46], assume that the foreground is sparse and has no particular structure. However, in many situations this is not the case. For instance, since the location of an object in consecutive frames is highly correlated, the foreground can be highly structured. Similarly, the foreground may not be sparse, specially if there are foreground objects moving close to the camera 2 (e.g., in a selfie). Even state-of-the-art methods fail in scenarios like these, which are not covered by current models (see Figure 3 for an example). In contrast, MMC allows to use one matrix in the mixture to represent the background, other matrices to represent foreground objects (small or large, even dominant), and even other matrices to account for occlusions and other illumination/visual artifacts. Hence, MMC can be a more accurate model for video segmentation and other image processing tasks, including inpainting [47] and face clustering, which we explore in our experiments. Metagenomics. One contemporary challenge in Biology is to quantify the presence of different types of bacteria in a system (e.g., the human gut microbiome) [48–52]. The main idea is to collect several DNA samples from such a system, and use their genomic information to count the number of bacteria of each type (the genome of each bacterium determines its type). In practice, to obtain an organism’s genome (e.g., a person’s genome), biologists feed a DNA sample (e.g., blood or hair) to a sequencer machine that produces a series of reads, which are short genomic sequences that can later be assembled and aligned to recover the entire genome. The challenge arises when the sequencer is provided a sample with DNA from multiple organisms, as is the case in the human gut microbiome, where any sample will contain a mixture of DNA from multiple bacteria that cannot be disentangled into individual bacterium. In this case, each read produced by the sequencer may correspond to a different type of bacteria. Consequently, each DNA sample (column) may contain genes (rows) from different types of bacteria, which is precisely the model that MMC describes. 3 Problem Statement Let X1, . . . , XK ∈Rd×n be a set of rank-r matrices, and let Ω1, . . . , Ωk ∈{0, 1}d×n indicate disjoint sets of observed entries. Suppose X1, . . . , XK and Ω1, . . . , ΩK are unknown, and we only observe XΩ, defined as follows: – If the (i, j)th entry of Ωk is 1, then the (i, j)th entry of XΩis equal to the (i, j)th entry of Xk. – If the (i, j)th entry of Ωk is 0 for every k = 1, . . . , K, then the (i, j)th entry of XΩis missing. This way Ωk indicates the entries of XΩthat correspond to Xk, and Ω:= PK k=1 Ωk indicates the set of all observed entries. Since Ω1, . . . , ΩK are disjoint, Ω∈{0, 1}d×n. Equivalently, each observed entry of XΩcorresponds to an entry in either X1 or X2 or . . . or XK (i.e., there are no collisions). In words, XΩcontains a mixture of entries from several low-rank matrices. The goal of MMC is to recover all the columns of X1, . . . , XK that have observations in XΩ(see Figure 1 to build some intuition). In our recommendations example, a column xω ∈XΩwill contain entries from Xk whenever xω contains ratings from a user of the kth type. Similarly, the same column will contain entries from Xℓwhenever it also contains ratings from a user of the ℓth type. We would like to predict the preferences of both users, or more generally, all users that have ratings in xω. On the other hand, if xω has no entries from Xk, then xω involves no users of the kth type, and so it would be impossible (and futile) to try to recover such column of Xk. In MMC, the matrices Ω1, . . . , ΩK play the role of the hidden variables constantly present in mixture problems. Notice that if we knew Ω1, . . . , ΩK, then we could partition XΩaccordingly, and estimate X1, . . . , XK using standard LRMC. The challenge is that we do not know Ω1, . . . , ΩK. 3.1 The Subtleties of MMC The main theoretical difficulty of MMC is that depending on the pattern of missing data, there could exist false mixtures. That is, matrices ˜X1, . . . , ˜XK, other than X1, . . . , XK, that agree with XΩ, even if X1, . . . , XK are observed on uniquely completable patterns for LRMC. Example 1. Consider the next rank-1 matrices X1, X2, and their partially observed mixture XΩ: X1 =   1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4  , X2 =   1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16 5 10 15 20  , XΩ=   1 · 3 4 1 2 · 8 3 2 3 · 4 8 3 4 · 10 15 4  . 3 We can verify that X1 and X2 are observed on uniquely completable sampling patterns for LRMC [3]. Nonetheless, we can construct the following false rank-1 matrices that agree with XΩ: ˜X1 =   60 40 15 4 1 2/3 1/4 1/15 3 2 3/4 1/5 12 8 3 4/5 60 40 15 4  , ˜X2 =   1 1/4 3 1 8 2 24 8 1 1/4 3 1 4 1 12 4 40 10 120 40  . This shows that even with unlimited computational power, if we exhaustively search all the identifiable patterns for LRMC, we can end up with false mixtures. Hence the importance of studying the identifiable patterns for MMC. False mixtures arise because we do not know a priori which entries of XΩcorrespond to each Xk. Hence, it is possible that a rank-r matrix ˜X agrees with some entries from X1, other entries from X2, and so on. Furthermore, ˜X may even be the only rank-r matrix that agrees with such combination of entries, as in Example 1. Remark 1. Recall that LRMC and HRMC are tantamount to identifying the subspace(s) containing the columns of X [3, 4]. In fact, if we knew such subspaces, LRMC and HRMC become almost trivial problems (see Appendix A for details). Similarly, if no data is missing, HRMC simplifies to subspace clustering, which has been studied extensively, and is now reasonably well-understood [53–62]. In contrast, MMC remains challenging even if the subspaces corresponding to the low-rank matrices in the mixture are known, and even X is fully observed. We refer the curious reader to Appendix A, and point out the bottom row and the last column in Figure 2, which show the MMC error when the underlying subspaces are known, and when X is fully observed. 4 Main Theoretical Results Example 1 shows the importance of studying the identifiable patterns for MMC, which we do now. First recall that r + 1 samples per column are necessary for LRMC [3]. This implies that even if an oracle told us Ω1, . . . , ΩK, if we intend to recover a column of Xk, we need to observe it on at least r + 1 entries. Hence we assume without loss of generality that: (A1) Each column of Ωk has either 0 or r + 1 non-zero entries. In words, A1 requires that each column of Xk to be recovered is observed on exactly r + 1 entries. Of course, observing more entries may only aid completion. Hence, rather than an assumption, A1 describes the most difficult scenario where we have the bare minimum amount of information required for completion. We use A1 to ease notation, exposition and analysis. All our results can be easily extended to the case where A1 is droped (see Remark 2). Without further assumptions on X, completion (of any kind) may be impossible. To see this consider the simple example where X is only supported on the ith row. Then it would be impossible to recover X unless all columns were observed on the ith row. In most completion applications this would be unlikely. For example, in a movies recommender system like Netflix, this would require that all the users watched (and rated) the same movie. To rule out scenarios like these, typical completion theory requires incoherence and uniform sampling. Incoherence guarantees that the information is well-spread over the matrix. Uniform sampling guarantees that all rows and columns are sufficiently sampled. However, it is usually unclear (and generally unverifiable) whether an incomplete matrix is coherent. Furthermore, observations are hardly ever uniformly distributed. For instance, we do not expect children to watch adults movies. To avoid these issues, instead of incoherence we will assume that X is a generic mixture of low-rank matrices. More precisely, we assume that: (A2) X1, . . . , XK are drawn independently according to an absolutely continuous distribution with respect to the Lebesgue measure on the determinantal variety (set of all d × n, rank-r matrices). 4 A2 essentially requires that each Xk is a generic rank-r matrix. This type of genericity assumptions are becoming increasingly common in studies of LRMC, HRMC, and related problems [3, 4, 23– 27, 46]. See Appendix C for a further discussion on A2, and its relation to other common assumptions from the literature. With this, we are ready to present our main theorem. It gives a deterministic condition on Ω to guarantee that X1, . . . , XK can be identified from XΩ. This provides information-theoretic requirements for MMC. The proof is in Appendix B. Theorem 1. Let A1-A2 hold. Suppose there exist matrices {Ωτ}r+1 τ=1 formed with disjoint subsets of (d −r + 1) columns of Ωk, such that for every τ: (†) Every matrix Ω′ formed with a proper subset of the columns in Ωτ has at least r fewer columns than non-zero rows. Then all the columns of Xk that have observations in XΩare identifiable. In words, Theorem 1 states that MMC is possible as long as we observe the right entries in each Xk. The intuition is that each of these entries imposes a constraint on what X1, . . . , XK may be, and the pattern in Ωdetermines whether these constraints are redundant. Patterns satisfying the conditions of Theorem 1 guarantee that X1, . . . , XK is the only mixture that satisfies the constraints produced by the observed entries. Remark 2. Recall that r + 1 samples per column are strictly necessary for completion. A1 requires that we have exactly that minimum number of samples. If Xk is observed on more than r + 1 entries per column, it suffices that Ωk contains a pattern satisfying the conditions of Theorem 1. Theorem 1 shows that MMC is possible if the samplings satisfy certain combinatorial conditions. Our next result shows that if each entry of Xk is observed on XΩwith probability O( 1 d max{r, log d}), then with high probability Ωk will satisfy such conditions. The proof is in Appendix B. Theorem 2. Suppose r ≤d 6 and n ≥(r + 1)(d −r + 1). Let ǫ > 0 be given. Suppose that an entry of XΩis equal to the corresponding entry of Xk with probability p ≥ 2 d max  2r, 12 log( d ǫ ) + 1  . Then Ωk satisfies the sampling conditions of Theorem 1 with probability ≥1 −2(r + 1)ǫ. Theorem 2 shows that the sample complexity of MMC is O(K max{r, log d}) observations per column of XΩ. This is exactly the same as the sample complexity of HRMC [4], and simplifies to O(max{r, log d}) if K = 1, corresponding to the sample complexity of LRMC [3]. Intuitively, this means that information-theoretically, we virtually pay no price for mixing low-rank matrices. 5 Alternating Algorithm for MMC Theorems 1 and 2 show that MMC is theoretically possible under reasonable conditions (virtually the same as LRMC and HRMC). However, these results follow from a combinatorial analysis that is infeasible in practice (see Appendix B for details). To address this, we derive a practical alternating algorithm for MMC, which we call AMMC (alternating mixture matrix completion). The main idea is that MMC, like most mixture problems, can be viewed as a clustering task: if we could determine the entries of XΩthat correspond to each Xk, then we would be able to partition XΩ into K incomplete low-rank matrices, and then complete them using standard LRMC. The question is how to determine which entries of XΩcorrespond to each Xk, i.e., how to determine Ω1, . . . , ΩK. To address this, let Uk ∈Rd×r be a basis for the subspace containing the columns of Xk, and let xω denote the jth column of XΩ, observed only on the entries indexed by ω ⊂{1, . . . , d}. For any subspace, matrix or vector that is compatible with a set of indices ·, we use the subscript · to denote 5 its restriction to the coordinates/rows in ·. For example, Uk ω ∈R|ω|×r denotes the restriction of Uk to the indices in ω. Suppose xω contains entries from Xk, and let ωk ⊂ω index such entries. Then our goal is to determine ωk, as that would tell us the jth column of Ωk. Since xωk ∈span{Uk ωk}, we can restate our goal as finding the set ωk ⊂ω such that xωk ∈span{Uk ωk}. To find ωk, let υ ⊂ω, and let Pk υ := Uk υ(UkT υ Uk υ)−1UkT υ denote the projection operator onto span{Uk υ}. Recall that ∥Pk υxυ∥≤∥xυ∥, with equality if and only if xυ ∈span{Uk υ}. It follows that ωk is the largest set υ such that ∥Pk υxυ∥= ∥xυ∥. In other words, ωk is the solution to arg max υ⊂ω ∥Pk υxυ∥−∥xυ∥+ |υ|. (1) However, (1) is non-convex. Hence, in order to find the solution to (1), we propose the following erasure strategy. The main idea is to start our search with υ = ω, and then iteratively remove the entries (coordinates) of υ that most increase the gap between ∥Pk υxυ∥and ∥xυ∥(hence the term erasure). We stop this procedure when ∥Pk υxυ∥is equal to ∥xυ∥(or close enough). More precisely, we initialize υ = ω, and then iteratively redefine υ as the set υ = υ\i, where i = arg max i∈υ ∥Pk υ\ixυ\i∥−∥xυ\i∥. (2) In words, i is the coordinate of the vector xυ such that if ignored, the gap between the remaining vector xυ\i and its projection Pk υ\ixυ\i is reduced the most. At each iteration we remove (erase) such coordinate i from υ. The intuition behind this approach is that the coordinates of xυ that do not correspond to Xk are more likely to increase the gap between ∥Pk υxυ∥and ∥xυ∥. Notice that if Uk is in general position (guaranteed by A2) and |υ| ≤r, then Uk υ = R|υ| (because Uk is r-dimensional). In such case, it is trivially true that xυ ∈span{Uk υ}, whence ∥Pk υxυ∥= ∥xυ∥. Hence the procedure above is guaranteed to terminate after at most ∥ω∥−r iterations. At such point, |υ| = r, and we know that we were unable to find ωk (or a subset of it). One alternative is to start with a different υ0 ⊊ω, and search again. This procedure may remove some entries from ωk along the way, so in general, the output of this process will be a set υ ⊂ωk. However, finding a subset of ωk is enough to find ωk. To see this, recall that since xωk ∈span{Uk ωk}, there is a coefficient vector θk ∈Rr such that xωk = Uk ωkθk. Since υ ⊂ωk, it follows that xυ = Uk υθk. Furthermore, since |υ| ≥r, we can find θk as θk = (UkT υ Uk υ)−1UkT υ xυ. Since xωk = Uk ωkθk, at this point we can identify ωk by simple inspection (the matching entries in xω and Uk ωθk). Recall that ωk determines the jth column of Ωk. Hence, if we repeat the procedure above for each column in XΩand each k, we can recover Ω1, . . . , ΩK. After this, we can use standard LRMC on XΩ1, . . . , XΩK to recover X1, . . . XK (which is the ultimate goal of MMC). The catch here is that this procedure requires knowing Uk, which we do not know. So essentially we have a chicken and egg problem: (i) if we knew Uk, we would be able to find Ωk. (ii) If we knew Ωk we would be able to find Uk (and Xk, using standard LRMC on XΩk). Since we know neither, we use a common technique for these kind of problems: alternate between finding Ωk and Uk. More precisely, we start with some initial guesses ˆU1, . . . , ˆUK, and then alternate between the following two steps until convergence: (i) Cluster. Let xω be the jth column in XΩ. For each k = 1, . . . , K, we first erase entries from ω to obtain a set υ ⊂ω indicating entries likely to correspond to Xk. This erasure procedure initializes υ = ω, and then repeats (2), (replacing Pk with ˆPk, which denotes the projection operator onto span{ ˆUk}) until we to obtain a set υ ⊂ω such that the projection ∥ˆPk υxυ∥is close to ∥xυ∥. This way, the entries of xυ are likely to correspond to Xk. Using these entries, we can estimate the coefficient of the jth column of Xk with respect to Uk, given by ˆθk = ( ˆUkT υk ˆUk υk)−1 ˆUkT υkxυk. With ˆθk we can also estimate the jth column of Xk as ˆxk := ˆUkˆθk. Notice that both υ and ˆxk are obtained using ˆUk, which may be different from Uk. It follows that υ may contain some entries that do not correspond to Xk, and ˆxk may be inaccurate. Hence, in general, xω and ˆxk ω will have no matching entries, and so we cannot identify ωk by simple inspection, as before. However, we can repeat our procedure for each k to obtain estimates ˆx1 ω, . . . , ˆxK ω, and then assign each entry of xω to its closest match. More 6 0 10−8 10−5 10−2 1 0.4 0.6 0.8 1 Sampling rate (p) Initialization Error (δ) AMMC (this paper) 0 0.5 1 0.1 0.2 0.3 0.4 0.5 Sampling rate per matrix (p/K) Success rate LMaFit (LRMC) GSSC (HRMC) AMMC (MMC, this paper) Figure 2: Left: Success rate (average over 100 trials) of AMMC as a function of the fraction of observed entries p and the distance δ between the true subspaces Uk and their initial estimates. Lightest represents 100% success rate; darkest represents 0%. Right: Comparison of state-of-the-art algorithms for LRMC, HRMC, and MMC (in their respective settings; see Figure 1). The performance of AMMC (in the more difficult problem of MMC) is comparable to the performance of state-of-the-art algorithms in the simpler problems of LRMC and HRMC. precisely, our estimate ˆωk ⊂ω (indicating the entries of xω that we estimate that correspond to Xk) will contain entry i ∈ω if |xi −ˆxk i | ≤|xi −ˆxℓ i | for every ℓ= 1, . . . , K. Repeating this procedure for each column of XΩwill produce estimates ˆΩ1, . . . , ˆΩK. Specifically, the jth column of ˆΩk ∈{0, 1}d×n will contain a 1 in the rows indicated by ˆωk. (ii) Complete. For each k, complete XˆΩk using your favorite LRMC algorithm. Then compute a new estimate ˆUk given by the leading r left singular vectors of the completion of XˆΩk. The entire procedure is summarized in Algorithm 1, in Appendix D, where we also discuss initialization, generalizations to noise and outliers, and other simple extensions to improve performance. 6 Experiments Simulations. We first present a series of synthetic experiments to study the performance of AMMC (Algorithm 1). In our simulations we first generate matrices Uk ∈Rd×r and Θk ∈Rr×n with i.i.d. N(0, 1) entries to use as bases and coefficients of the low-rank matrices in the mixture, i.e., Xk = UkΘk ∈Rd×n. Here d = n = 100, r = 5 and K = 2. With probability (1 −p), the (i, j)th entry of XΩwill be missing, and with probability p/K it will be equal to the corresponding entry in Xk. Recall that similar to EM and other alternating approaches, AMMC depends on initialization. Hence, we study the performance of AMMC as a function of both p and the distance δ ∈[0, 1] between {Uk} and their initial estimates (measured as the normalized Frobenius norm of the difference between their projection operators). We measure accuracy using the normalized Frobenius norm of the difference between each Xk and its completion. We considered a success if this quantity was below 10−8. The results of 100 trials are summarized in Figure 2. Notice that the performance of AMMC decays nicely with the distance δ between the true subspaces Uk and their initial estimates. We can see this type of behavior in similar state-of-the-art alternating algorithms for the simpler problem of HRMC [19]. Since MMC is highly non-convex, it is not surprising that if the initial estimates are poor (far from the truth), then AMMC may converge to a local minimum. Similarly, the performance of AMMC decays nicely with the fraction of observed entries p. Notice that even if X is fully observed (p = 1), if the initial estimates are very far from the true subspaces (δ = 1), then AMMC performs poorly. This shows, consistent with our discussing in Remark 1, that in practice MMC is a challenging problem even if X is fully observed. Hence, it is quite remarkable that AMMC works most of the time with as little as p ≈0.6, corresponding to observing ≈0.3 of the entries in each Xk. To put this under perspective, notice (Figure 2) that this is comparable the amount of missing data tolerated by GSSC [19] and LMaFit [11], which are state-of-the-art for the simpler problems of HRMC (special case of MMC where all entries in each column of X correspond to the same Xk) and LRMC (special case where there is only one Xk). 7 Mixture —— Reconstructions —— Original Robust PCA MMC (this paper) Figure 3: Left 3: Reconstructed images from a mixture. Right 3: Original frame and segmented foreground. To obtain Figure 2 we replicated the same setup as above, but with data generated according to the HRMC and LRMC models. Hence, we conclude that the performance of AMMC (in the more difficult problem of MMC) is comparable to the performance of state-of-the-art algorithms for the much simpler problems of HRMC and LRMC. We point out that according to Theorems 1 and 2, MMC is theoretically possible with p ≥1/2. However, we can see that (even if U1, . . . , UK are known, corresponding to δ = 0 in Figure 2) the performance of AMMC is quite poor if p < 0.6. This shows two things: (i) MMC is challenging even if U1, . . . , UK are known (as discussed in Remark 1), and (ii) there is a gap between what is information-theoretically possible and what is currently possible in practice (with AMMC). In future work we will explore algorithms that can approach the information-theoretic limits. Real Data: Face Clustering and Inpainting. It is well-known that images of an individual’s face are approximately low-rank [63]. Natural images, however, usually contain faces of multiple individuals, often partially occluding each other, resulting in a mixture of low-rank matrices. In this experiment we demonstrate the power of MMC in two tasks: first, classifying partially occluded faces in an image, and second, image inpainting [47]. To this end, we use the Yale B dataset [64], containing 2432 photos of 38 subjects (64 photos per subject), each photo of size 48 × 42. We randomly select two subjects, and vectorize and concatenate their images to obtain two approximately rank-10 matrices X1, X2 ∈R2016×64. Next we combine them into X ∈R2016×64, whose each entry is equal to the corresponding entry in X1 or X2 with equal probability. This way, each column of X contains a mixed image with pixels from multiple individuals. We aim at two goals: (i) classify the entries in X according to X1 and X2, which in turn means locating and classifying the face of each individual in each image, and (ii) recover X1 and X2 from X, thus reconstructing the unobserved pixels in each image (inpainting). We repeat this experiment 30 times using AMMC (with gaussian random initialization, known to produce near-orthogonal subspaces with high probability), obtaining a pixel classification error of 2.98%, and a reconstruction error of 4.1%, which is remarkable in light that the ideal rank-10 approximation (no mixture, and full data) achieves 1.8%. Figure 3 shows an example, with more in Figure 4 in Appendix E. Notice that in this case we cannot compare against other methods, as AMMC is the first, and currently the only method for MMC. Real Data: MMC for Background Segmentation. As discussed in Section 2, Robust PCA models a video as the superposition of a low-rank background plus a sparse foreground with no structure. MMC brings more flexibility, allowing multiple low-rank matrices to model background, structured foreground objects (sparse or abundant) and illumination artifacts, while at the same time also accounting for outliers (the entries/pixels that were assigned to no matrix in the mixture). In fact, contrary to Robust PCA, MMC allows a very large (even dominant) fraction of outliers. In this experiment we test AMMC in the task of background segmentation, using the Wallflower [65] and the I2R [66] datasets, containing videos of traffic cameras, lobbies, and pedestrians in the street. For each video, we compare AMMC (with gaussian random initialization) against the best result amongst the following state-of-the-art algorithms for Robust PCA: [35–39]. We chose these methods based on the comprehensive review in [40], and previous reports [41–43] indicating that these algorithms typically performed as well or better than several others, including [44, 45]. In most cases, both Robust PCA and AMMC perform quite similarly (see Figure 5 in Appendix E). However, in one case AMMC achieves 87.67% segmentation accuracy (compared with the ground truth, manually segmented), while Robust PCA only achieves 74.88% (Figure 3). Our hypothesis is that this is due to the large portion of outliers (foreground). It is out of the scope of this paper, but of interest for future work, to collect real datasets with similar properties, where AMMC can be further tested. We point out, however, that AMMC is orders of magnitude slower than Robust PCA. Our future work will also focus on developing faster methods for MMC. 8 References [1] E. Candès and B. Recht, Exact matrix completion via convex optimization, Foundations of Computational Mathematics, 2009. [2] B. Eriksson, L. Balzano and R. Nowak, High-rank matrix completion and subspace clustering with missing data, Artificial Intelligence and Statistics, 2012. [3] D. Pimentel-Alarcón, N. Boston and R. Nowak, A characterization of deterministic sampling patterns for low-rank matrix completion, IEEE Journal of Selected Topics in Signal Processing, 2016. [4] D. Pimentel-Alarcón and R. Nowak, The information-theoretic requirements of subspace clustering with missing data, International Conference on Machine Learning, 2016. [5] E. Candès and T. Tao, The power of convex relaxation: near-optimal matrix completion, IEEE Transactions on Information Theory, 2010. [6] J. Cai, E. Candès and Z. Shen, A singular value thresholding algorithm for matrix completion, SIAM Journal on Optimization, 2010. [7] R. Keshavan, A. Montanari and S. Oh, Matrix completion from a few entries, IEEE Transactions on Information Theory, 2010. [8] L. Balzano, R. Nowak, and B. Recht, Online identification and tracking of subspaces from highly incomplete information, Allerton Conference on Communication, Control and Computing, 2010. [9] B. Recht, A simpler approach to matrix completion, Journal of Machine Learning Research, 2011. [10] S. Ma, D. Goldfarb, L. Chen, Fixed point and Bregman iterative methods for matrix rank minimization, Mathematical Programming, 2011. [11] Z. Wen, W. Yin and Y. Zhang, Solving a low-rank factorization model for matrix completion by a non-linear successive over-relaxation algorithm, Mathematical Programming Computation, 2012. [12] Y. Shen, Z. Wen and Y. Zhang, Augmented lagrangian alternating direction method for matrix separation based on low-rank factorization, International Conference on Numerical Optimization and Numerical Linear Algebra, 2014. [13] E. Chunikhina, R. Raich and T. Nguyen, Performance analysis for matrix completion via iterative hard-thresholded SVD, IEEE Statistical Signal Processing, 2014. [14] Y. Chen, S. Bhojanapalli, S. Sanghavi and R. Ward, Coherent matrix completion, International Conference on Machine Learning, 2014. [15] Y. Chen, Incoherence-optimal matrix completion, IEEE Transactions on Information Theory, 2015. [16] P. Jain, P. Netrapalli and S. Sanghavi, Low-rank matrix completion using alternating minimization, ACM symposium on Theory of computing, 2013. [17] L. Balzano, A. Szlam, B. Recht and R. Nowak, K-subspaces with missing data, IEEE Statistical Signal Processing, 2012. [18] D. Pimentel-Alarcón, L. Balzano and R. Nowak, On the sample complexity of subspace clustering with missing data, IEEE Statistical Signal Processing, 2014. [19] D. Pimentel-Alarcón, L. Balzano, R. Marcia, R. Nowak and R. Willett, Group-sparse subspace clustering with missing data, IEEE Statistical Signal Processing, 2016. [20] C. Yang, D. Robinson and R. Vidal, Sparse subspace clustering with missing entries, International Conference on Machine Learning, 2015. [21] E. Elhamifar, High-rank matrix completion and clustering under self-expressive models, Advances in Neural Information Processing Systems, 2016. [22] G. Ongie, R. Willett, R. Nowak and L. Balzano, Algebraic variety models for high-rank matrix completion, International Conference on Machine Learning, 2017. [23] D. Pimentel-Alarcón, N. Boston and R. Nowak, Deterministic conditions for subspace identifiability from incomplete sampling, IEEE International Symposium on Information Theory, 2015. 9 [24] F. Király, L. Theran and R. Tomioka, The algebraic combinatorial approach for low-rank matrix completion, Journal of Machine Learning Research, 2015. [25] D. Pimentel-Alarcón and R. Nowak, A converse to low-rank matrix completion, IEEE International Symposium on Information Theory, 2016. [26] M. Ashraphijuo, X. Wang and V. Aggarwal, A characterization of sampling patterns for lowrank multiview data completion problem, IEEE International Symposium on Information Theory, 2017. [27] M. Ashraphijuo, V. Aggarwal and X. Wang, A characterization of sampling patterns for lowtucker-rank tensor completion problem, IEEE International Symposium on Information Theory, 2017. [28] R. Govindan and H. Tangmunarunkit, Heuristics for Internet Map Discovery, IEEE INFOCOM 2000. [29] P. Barford, A. Bestavros, J. Byers and M. Crovella, On the marginal utility of network topology measurements, Proceedings of ACM Internet Measurement Workshop, 2001. [30] N. Spring, R. Mahajan, D. Wetherall and T. Anderson, Measuring ISP topologies with rocketfuel, IEEE/ACM Transactions on Networking, 2004. [31] D. Alderson, L. Li, W. Willinger and J. Doyle, Understanding internet topology: Principles, models and validation, IEEE/ACM Transactions on Networking, 2005. [32] R. Sherwood, A. Bender and N. Spring, DisCarte: A disjunctive Internet cartographer, ACM SIGCOMM, 2008. [33] B. Eriksson, P. Barford and R. Nowak, Network Discovery from Passive Measurements, ACM SIGCOMM, 2008. [34] B. Eriksson, P. Barford, J. Sommers and R. Nowak, DomainImpute: inferring unseen components in the Internet, IEEE INFOCOM, 2011. [35] Z. Lin, M. Chen, L. Wu, and Y. Ma, The augmented Lagrange multiplier method for exact recovery of corrupted low-rank matrices, University of Illinois at Urbana-Champaign Technical Report, 2009. [36] Z. Lin, R. Liu and Z. Su, Linearized alternating direction method with adaptive penalty for low rank representation, Advances in Neural Information Processing Systems, 2011. [37] X. Ding, L. He and L. Carin, Bayesian robust principal component analysis, IEEE Transactions on Image Processing, 2011. [38] X. Shu, F. Porikli and N. Ahuja, Robust orthonormal subspace learning: Efficient recovery of corrupted low-rank matrices, International Conference on Computer Vision and Pattern Recognition, 2014. [39] Y. Yang, Y. Feng and J. Suykens, A nonconvex relaxation approach to robust matrix completion, Preprint, 2014. [40] T. Bouwmans, A. Sobral, S. Javed, S. Jung and E. Zahzah, Decomposition into low-rank plus additive matrices for background/foreground separation: A review for a comparative evaluation with a large-scale dataset, Computer Science Review, 2016. [41] E. Candès, X. Li, Y. Ma and J. Wright, Robust principal component analysis?, Journal of the ACM, 2011. [42] T. Bouwmans and E. Zahzah, Robust PCA via principal component pursuit: a review for a comparative evaluation in video surveillance, Computer Vision and Image Understanding, 2014. [43] Y. Ma, Low-rank matrix recovery and completion via convex optimization, avaiable at http: //perception.csl.illinois.edu/matrix-rank/home.html. [44] X. Yuan and J. Yang, Sparse and low-rank matrix decomposition via alternating direction methods, available at http://www.optimization-online.org/DB_HTML/2009/11/2447. html, 2009. [45] Z. Lin, A. Ganesh, J. Wright, L. Wu, M. Chen and Y. Ma, Fast convex optimization algorithms for exact recovery of a corrupted low-rank matrix, Computational Advances in Multi-Sensor Adaptive Processing, 2009. 10 [46] D. Pimentel-Alarcón and R. Nowak, Random consensus robust PCA, Electronic Journal of Statistics, 2017. [47] J. Mairal, F. Bach, J. Ponce and G. Sapiro, Online dictionary learning for sparse coding, International Conference on Machine Learning, 2009. [48] S. Highlander, High throughput sequencing methods for microbiome profiling: application to food animal systems, Animal Health Research Reviews, 2012. [49] S. Mande, M. Mohammed and T. Ghosh, Classification of metagenomic sequences: methods and challenges, Briefings in Bioinformatics, 2012. [50] R. Ranjan, A. Rani, A. Metwally, H. McGee and D. Perkins, Analysis of the microbiome: Advantages of whole genome shotgun versus 16S amplicon sequencing, Biochemical and Biophysical Research Communications, 2016. [51] N. Nguyen, T. Warnow, M. Pop and B. White, A perspective on 16S rRNA operational taxonomic unit clustering using sequence similarity, Biofilms and Microbiomes, 2016. [52] G. Marçais, A. Delcher, A. Phillippy, R. Coston, S. Salzberg and A. Zimin, MUMmer4: A fast and versatile genome alignment system, PLoS Computational Biology, 2018. [53] R. Vidal, Subspace clustering, IEEE Signal Processing Magazine, 2011. [54] G. Liu, Z. Lin and Y. Yu, Robust subspace segmentation by low-rank representation, International Conference on Machine Learning, 2010. [55] G. Liu, Z. Lin, S. Yan, J. Sun, Y. Yu and Y. Ma, Robust recovery of subspace structures by low-rank representation, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013. [56] M. Soltanolkotabi, E. Elhamifar and E. Candès, Robust subspace clustering, Annals of Statistics, 2014. [57] C. Qu and H. Xu, Subspace clustering with irrelevant features via robust Dantzig selector, Advances in Neural Information Processing Systems, 2015. [58] X. Peng, Z. Yi and H. Tang, Robust subspace clustering via thresholding ridge regression, AAAI Conference on Artificial Intelligence, 2015. [59] Y. Wang and H. Xu, Noisy sparse subspace clustering, International Conference on Machine Learning, 2013. [60] Y. Wang, Y. Wang and A. Singh, Differentially private subspace clustering, Advances in Neural Information Processing Systems, 2015. [61] H. Hu, J. Feng and J. Zhou, Exploiting unsupervised and supervised constraints for subspace clustering, IEEE Pattern Analysis and Machine Intelligence, 2015. [62] E. Elhamifar and R. Vidal, Sparse subspace clustering: algorithm, theory, and applications, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013. [63] R. Basri and D. Jacobs, Lambertian reflectance and linear subspaces, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2003. [64] A. Georghiades, P. Belhumeur and D. Kriegman, From few to many: Illumination cone models for face recognition under variable lighting and pose, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2001. [65] K. Toyama, J. Krumm, B. Brumitt and B. Meyers, Wallflower: principles and practice of background maintenance, IEEE International Conference on Computer Vision, 1999. Dataset available at: http://research.microsoft.com/en-us/um/people/jckrumm/wallflower/ testimages.htm [66] L. Li, W. Huang, I. Gu and Q. Tian, Statistical modeling of complex backgrounds for foreground object detection, IEEE Transactions on Image Processing, 2004. Dataset available at: http: //perception.i2r.a-star.edu.sg/bk_model/bk_index.html [67] A. Dempster, N. Laird and D. Rubin, Maximum likelihood from incomplete data via the EM algorithm, Journal of the royal statistical society, 1977. [68] M. Tipping and C. Bishop, Mixtures of probabilistic principal component analysers, Neural Computation, 1999. [69] X. Yi, C. Caramanis and S. Sanghavi, Alternating Minimization for Mixed Linear Regression, International Conference on Machine Learning, 2014. 11
2018
149
7,307
Learning SMaLL Predictors Vikas K. Garg CSAIL, MIT vgarg@csail.mit.edu Ofer Dekel Microsoft Research oferd@microsoft.com Lin Xiao Microsoft Research lin.xiao@microsoft.com Abstract We introduce a new framework for learning in severely resource-constrained settings. Our technique delicately amalgamates the representational richness of multiple linear predictors with the sparsity of Boolean relaxations, and thereby yields classifiers that are compact, interpretable, and accurate. We provide a rigorous formalism of the learning problem, and establish fast convergence of the ensuing algorithm via relaxation to a minimax saddle point objective. We supplement the theoretical foundations of our work with an extensive empirical evaluation. 1 Introduction Modern advances in machine learning have produced models that achieve unprecedented accuracy on standard prediction tasks. However, this remarkable progress in model accuracy has come at a significant cost. Many state-of-the-art models have ballooned in size and applying them to a new point can require tens of GFLOPs, which renders these methods ineffectual on resource-constrained platforms like smart phones and wearables [1, 2]. Indeed, in these settings, inference with a compact learner that can fit on the small device becomes an overarching determinant even if it comes at the expense of slightly worse accuracy. Moreover, large models are often difficult to interpret, simply because humans are not good at reasoning about large, complex objects. Modern machine learning models are also more costly to train, but we sidestep that problem in this paper by assuming that we can train our models on powerful servers in the cloud. In our pursuit of compact and interpretable models, we take inspiration from the classic problem of learning disjunctive normal forms (DNFs) [3]. Specifically, a p-term k-DNF is a DNF with p terms, where each term contains exactly k Boolean variables. Small DNFs are a natural starting point for our research, because they pack a powerful nonlinear descriptive capacity in a succinct form. The DNF structure is also known to be intuitive and interpretable by humans [4, 5]. However, with the exception of a few practical heuristics [4, 5, 6], an overwhelming body of work [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] theoretically characterizes the difficulty of learning a k-DNF under various restricted models of learning. Our method, Sparse Multiprototype Linear Learner (SMaLL), bypasses this issue by crafting a continuous relaxation that amounts to a form of improper learning of the k-DNFs in the sense that the hypothesis space subsumes p-term k-DNF classifiers, and thus is at least as powerful as the original k-DNF family. Armed with our technical paraphernalia, we design a practical algorithm that yields small and interpretable models. Our work may also be viewed as a delicate fusion of multiple prototypes [1, 18, 19, 20, 21, 22] with Boolean relaxations [23]. The richness of models with multiple prototypes overcomes the representational limitations of sparse linear models like Lasso and Elastic-Net [24, 25, 26] that are typically not expressive enough to achieve state-of-the-art accuracy. Boolean relaxations afford us the ability to control the degree of sparsity explicitly in our predictors akin to exploiting an `0 regularization, unlike the `1 based methods that may require extensive tuning. Thus, our approach harnesses the best of both worlds. Moreover, folding sparsity in the training objective obviates the costs that would otherwise be incurred in compressing a large model via methods like pruning [27, 28, 29], low-rank approximation [30, 31], hashing [32], or parameter quantization [27, 33]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Additionally, we overcome some significant limitations of other methods that use a small number of prototypes, such as [1, 19, 34]. These techniques invariably require solving highly non-convex or combinatorially hard mixed integer optimization problems, which makes it difficult to guarantee their convergence and optimality. We derive a minimax saddle-point relaxation that provably admits O.1=t/ convergence via our customized Mirror-Prox algorithm. We provide detailed empirical results that demonstrate the benefits of our approach on a large variety of OpenML datasets. Specifically, on many of these datasets, our algorithm either surpasses the accuracy of the state-of-the-art baselines, or provides more compact models while being competent in terms of accuracy. In Section 2, we formulate the problem of learning a k-sparse p-prototype linear predictor as a mixed integer nonlinear optimization problem. Then, in Section 3, we relax this optimization problem to a saddle-point problem, which we solve using a Mirror-Prox algorithm. Finally, we present empirical results in Section 4. All the proofs are provided in the Supplementary to keep the exposition focused. 2 Problem Formulation We first derive a convex loss function for multiprototype binary classification. Let f.xi; yi/gm iD1 be a training set of instance-label pairs, where each xi 2 Rn and each yi 2 f1; 1g. Let ` W R 7! R be a convex surrogate for the error indicator function 1f .xi/¤yi D 1 if yif .xi/ < 0 and 0 otherwise. We also assume that ` upper bounds the error indicator function and is monotonically non-increasing. In particular, the popular hinge-loss and log-loss functions satisfy these properties. Let fwj gp j D1 be a set of linear prototypes. We consider a binary classifier of the form f .x/ D sign  max j 2Œp wj  x  : Our decision rule is motivated by the following result. Proposition 1. Consider the class Ck D f.w1; w2; : : : ; wp/j8j 2 Œp; wj 2 Rn; jjwj jj0 D kg of p prototypes, where each prototype is k-sparse for k  0. For any x 2 Rn, let the predictors f D .w1; w2; : : : ; wp/ 2 Ck take the following form: f .x/ D 1 if max j2Œp wj  x  k; and 1 otherwise: Learning Ck amounts to improper learning of p-term k-DNF Boolean formulae. Thus, our search space contains the family of k-DNF classifiers, though owing to the hardness of learning k-DNF, we may not always find a k-DNF classifier. Nonetheless, due to improper learning, the value of the objective returned will be a lower bound on the cost objective achieved by the space of p-term k-DNF classifiers (much like the relation between an integer program and its relaxation). We handle the negative and positive examples separately. For each negative training example .xi; 1/, the classifier makes a correct prediction if and only if maxj 2Œp wj  xi < 0. Under our assumptions on `, the error indicator function can be upper bounded as 1f .xi/¤1  `  max j 2Œp wj  xi  D max j 2Œp `.wj  xi/; where the equality holds because we assume that ` is monotonically non-increasing. We note that the upper bound maxj 2Œp `.wj  xi/ is jointly convex in fwj gp j D1 [35, Section 3.2.3]. For each positive example .xi; C1/, the classifier makes a correct prediction if and only if maxj2Œp wj  xi > 0. By our assumptions on `, we have 1f .xi/¤C1  `  max j 2Œp wj  xi  D min j 2Œp `.wj  xi/: (1) Again, the equality above is due to the monotonic non-increasing property of `. Here the right-hand side minj2Œp `.wj  xi/ is not convex in fwj gp jD1. We resolve this by designating a dedicated prototype wj.i/ for each positive training example .xi; C1/, and using the upper bound 1f .xi/¤C1  `.wj.i/  xi/: 2 In the extreme case, we can associate each positive example with a distinct prototype. Then there will be no loss of using `.wj.i/  xi/ compared with the upper bound in (1) when we set j.i/ D arg maxj 2Œp wj  xi. However, in this case, the number of prototypes p is equal to the number of positive examples, which can be excessively large for storage and computation as well as cause overfitting. In practice, we may cluster the positive examples into p groups, where p is much smaller than the number of positive examples, and assign all positive examples in each group with a common prototype. In other words, we have j.i/ D j.k/ if xi and xk belong to the same cluster. This clustering step helps us provide a fast parametric alternative to the essentially non-parametric setting that assumes one prototype per positive example. Overall, we have the following convex surrogate for the total number of training errors: h.w1; : : : ; wp/ D X i2IC ` wj.i/  xi  C X i2Imax j 2Œp `.wj  xi/; (2) where IC D fi W yi D C1g and I D fi W yi D 1g. In the rest of this paper, we let W 2 Rpn be the matrix formed by stacking the vectors wT 1 ; : : : ; wT p vertically, and denote the above loss function by h.W /. In order to train a multi-prototype classifier, we minimize the regularized surrogate loss: min W 2Rpn 1 mh.W / C  2 kW k2 F ; (3) where k  kF denotes the Frobenius norm of a matrix. 2.1 Smoothing the Loss via Soft-Max In this paper, we focus on the log-loss `.z/ D log.1Cexp.z//. Although this ` is a smooth function, the overall loss h defined in (2) is non-smooth, due to the max operator in the sum over the set I. In order to take advantage of fast algorithms for smooth convex optimization, we smooth the loss function using soft-max. More specifically, we replace the non-smooth terms maxj 2Œp `.tj / in (2) with the soft-max operator over p items: u.t/ ≜log  1 C X j2Œp exp.tj /  ; (4) where t D .t1; : : : ; tp/ 2 Rp. Then we obtain the smoothed loss function Qh.W / D X i2IC ` wj.i/  xi  C X i2Iu.W xi/; (5) around which we will customize our algorithm design. Next, we incorporate sparsity constraints explicitly for the prototypes w1; : : : ; wp. 2.2 Incorporating Sparsity via Binary Variables With some abuse of notation, we let kwj k0 denote the number of non-zero entries of the vector wj , and define kW k0;1 ≜max j2Œp kwj k0: The requirement that each prototype be k-sparse translates into the constraint kW k0;1  k. Therefore the problem of training a SMaLL model with budget k (for each prototype) can be formulated as min W 2Rpn jjW jj0;1k 1 m Qh.W / C  2 jjW jj2 F ; (6) where Qh is defined in (5). This is a very hard optimization problem due to the nonconvex sparsity constraint. In order to derive a convex relaxation, we follow the approach of [23] (cf. [36]) to introduce a binary matrix  2 f0; 1gpn and rewrite (6) as min W 2Rpn 2f0;1gpn; kk1;1k 1 m Qh.W ˇ / C  2 jjW ˇ jj2 F ; 3 where ˇ denotes the Hadamard (i.e. entry-wise) product of two matrices. Here we have kk1;1 D max j2Œp kj k1 ; where j is the j th row of . Since all entries of  belong to f0; 1g, the constraint kk1;1  k is the same as kk0;1  k. Noting that we can take Wij D 0 when ij D 0 and vice-versa, this problem is equivalent to min W 2Rpn 2f0;1gpn; jjjj1;1k 1 m Qh.W ˇ / C  2 jjW jj2 F : (7) Using (5), the objective function can be written as 1 m  X i2IC ` .W ˇ /j.i/xi  C X i2Iu .W ˇ /xi  C  2 kW k2 F ; where .W ˇ /j.i/ denotes the j.i/th row of W ˇ . So far our transformations have not changed the nature of the optimization problem with sparsity constraints — it is still a hard mixed-integer nonlinear optimization problem. However, as we will show in the next section, the introduction of the binary matrix  allows us to derive a saddle-point formulation of problem (7), which in turn admits a convex-concave relaxation that can be solved efficiently by the Mirror-Prox algorithm [37, 38]. 3 Saddle-Point Relaxation We first show that the problem in (7) is equivalent to the following minimax saddle-point problem: min W 2Rpn 2f0;1gpn; jjjj1;1k max SDŒs1sm si2Si; i2Œm ˆ.W; ; S/; (8) where S 2 Rpm, each of its column si belongs to a set Si  Rp (which will be given in Proposition 2), and the function ˆ is defined as ˆ.W; ; S/D 1 m X i2Œm  yisT i .W ˇ /xi u?.si/  C  2 jjW jj2 F : In the above definition, u? is the convex conjugate of u defined in (4): u?.si/ D sup t2Rp ˚ sT i t u.t/ (9) D  Pp j D1.si;j / log.si;j / C .1C1T si/ log.1C1T si/; if si;j  0 8j 2 Œp and 1T si  1; 1; otherwise : The equivalence between (7) and (8) is a direct consequence of the following proposition. Proposition 2. Let `.z/ D log.1 C exp.z// where z 2 R and u.t/ D log 1 C P j 2Œp exp.tj /  where t 2 Rp. Then for i 2 IC, we have ` .W ˇ /j.i/xi  D max si2Si yisT i .W ˇ /xi u?.si/  ; where yi D C1 and Si D ˚ si 2 Rp W si;j.i/ 2Œ1; 0; si;j D0 8j ¤j.i/ : For i 2 I, we have u .W ˇ /xi  D max si2Si yisT i .W ˇ /xi u?.si/  ; where yi D 1 and Si D ˚ si 2 Rp W 1T s  1; si;j  0 8j 2 Œp : We can further eliminate the variable W in (8). This is facilitated by the following result. Proposition 3. For any given  2 f0; 1gpn and S 2 S1      Sm, the solution to min W 2Rpn ˆ.W; ; S/ is unique and given by W.; S/ D 1 m X i2Œm yi sixT i  ˇ : (10) 4 Figure 1: Decision surfaces of different classifier types on a run of the two-dimensional chscase funds toy dataset. Test classification accuracy is shown at the bottom right of each plot. Now we substitute W.; S/ into (8) to obtain min 2f0;1gpn kk1;1k max SDŒs1sm si2Si; i2Œm .; S/ ; (11) where .; S/ D 1 m X i2Œm yi sixT i  ˇ  2 F X i2Œm u?.si/ : We note that .; S/ is concave in S (which is to be maximized), but not convex in  (which is to be minimized). However, because  2 f0; 1gpn, we have  ˇ  D  and thus X i2Œm yi sixT i  ˇ  2 F D X i2Œm yisT i  X i2Œm yi sixT i  ˇ  ˇ   xi D X i2Œm yisT i  X i2Œm yi sixT i  ˇ   xi: Therefore the objective function  in (11) can be written as .; S/ D 1 m X i2Œm yisT i  X i2Œm yi sixT i  ˇ   xi X i2Œm u?.si/; (12) which is concave in S and linear (thus convex) in . Finally, we relax the integrality constraint on  to its convex hull, i.e.,  2 Œ0; 1pn, and consider min 2Œ0;1pn kk1;1k max SDŒs1sm si2Si; i2Œm .; S/; (13) where .; S/ is given in (12). This is a convex-concave saddle-point problem, which can be solved efficiently, for example, by the Mirror-Prox algorithm [37, 38]. After finding a solution .; S/ of the relaxed problem (13), we can round the entries of  to f0; 1g, while respecting the constraint kk1;1  k (e.g., by rounding the largest k entries of each row to 1 and the rest entries to 0, or randomized rounding). Then we can recover the prototypes using (10). 3.1 The Mirror-Prox Algorithm Algorithm 1 lists the Mirror-Prox algorithm customized for solving the convex-concave saddle-point problem (13), which enjoys a O.1=t/ convergence rate [37, 38]. 5 Table 1: Comparison of test accuracy on low dimensional (n < 20) OpenML datasets. K, in SMaLL, was set to n for these datasets. LSVM RF AB LR DT kNN RSVM GB GP SMaLL bankruptcy .84˙.07 .83˙.08 .82˙.05 .90˙.05 .80˙.05 .78˙.07 .89˙.06 .81˙.05 .90˙.05 .92˙.06 vineyard .79˙.10 .72˙.06 .68˙.04 .82˙.08 .69˙.13 .70˙.11 .82˙.07 .68˙.09 .71˙.12 .83˙.07 sleuth1714 .82˙.03 .82˙.04 .81˙.14 .83˙.04 .83˙.06 .82˙.04 .76˙.03 .82˙.06 .80˙.03 .83˙.05 sleuth1605 .66˙.09 .70˙.07 .64˙.08 .70˙.07 .63˙.09 .66˙.05 .65˙.09 .65˙.09 .72˙.07 .72˙.05 sleuth1201 .94˙.05 .94˙.03 .92˙.05 .93˙.03 .91˙.05 .90˙.04 .89˙.09 .88˙.06 .91˙.08 .94˙.05 rabe266 .93˙.04 .90˙.03 .91˙.04 .92˙.04 .91˙.03 .92˙.03 .93˙.04 .90˙.04 .95˙.04 .94˙.02 rabe148 .95˙.04 .93˙.04 .91˙.08 .95˙.04 .89˙.07 .92˙.05 .91˙.06 .91˙.08 .95˙.02 .96˙.04 vis_env .66˙.04 .68˙.05 .66˙.03 .65˙.08 .62˙.04 .57˙.03 .69˙.06 .64˙.03 .65˙.09 .69˙.03 hutsof99 .74˙.07 .66˙.04 .64˙.09 .73˙.07 .60˙.10 .66˙.11 .66˙.14 .67˙.05 .70˙.05 .75˙.04 human_dev .88˙.03 .85˙.04 .85˙.03 .89˙.04 .85˙.03 .87˙.03 .88˙.03 .86˙.03 .88˙.02 .89˙.04 c0_100_10 .77˙.04 .74˙.03 .76˙.03 .77˙.03 .64˙.07 .71˙.05 .79˙.03 .71˙.05 .78˙.01 .77˙.06 elusage .90˙.05 .84˙.06 .84˙.06 .89˙.04 .84˙.06 .87˙.05 .89˙.04 .84˙.06 .89˙.04 .92˙.04 diggle_table .65˙.14 .61˙.07 .57˙.08 .65˙.11 .60˙.09 .58˙.07 .57˙.13 .57˙.06 .60˙.13 .68˙.07 baskball .70˙.02 .68˙.04 .68˙.02 .71˙.03 .71˙.03 .63˙.02 .66˙.05 .69˙.04 .68˙.02 .72˙.06 michiganacc .72˙.06 .67˙.06 .71˙.05 .71˙.04 .67˙.06 .66˙.07 .71˙.05 .69˙.04 .71˙.05 .73˙.05 election2000 .92˙.04 .90˙.04 .91˙.03 .92˙.02 .91˙.03 .92˙.01 .90˙.07 .92˙.02 .92˙.03 .94˙.02 Algorithm 1 Customized Mirror-Prox algorithm for solving the saddle-point problem (13) Initialize .0/ and S.0/ for t D 0; 1; : : : ; T do Gradient step: O.t/ D ProjE .t/ ˛tr..t/; S.t//  Os.t/ i D ProjSi s.t/ i C ˇtrsi ..t/; S.t//  for all i 2 Œm Extra-gradient step: .tC1/ D ProjE .t/ ˛tr.O.t/; OS.t//  s.tC1/ i D ProjSi s.t/ i C ˇtrsi .O.t/; OS.t//  for all i 2 Œm end for O D PT tD1 ˛t O.t/ı PT tD1 ˛t OS D PT tD1 ˇt OS.t/ı PT tD1 ˇt Round O to f0; 1gpn OW D 1 m P i2Œm yi.OsixT i / ˇ O Algorithm 2 .ProjE/ Projection onto the set Ej ≜ ˚ j 2 Rn W ji 2 Œ0; 1; kj k1  k Input: j 2 Rn and a small tolerance tol. Clip j;i to Œ0; 1 for all i 2 Œn Return j if 1T j  k Binary search to find tol-solution Set low D 1T j k  =n Set high D maxi2Œn j;i k=n while low  high do Set  D .low C high/=2 Compute Oj W 8i 2 Œn; Oj;i D j;i  Clip Oj to Œ0; 1n if j1T Oj kj < tol then return Oj else if 1T Oj > k then Set low D .low C high/=2 else Set high D .low C high/=2 end if end while In order to use Algorithm 1, we need to find the partial gradients of .; S/, which are given as r.; S/ D 1 m  X i2Œm yi sixT i  ˇ  X i2Œm yi sixT i  ; rsi .; S/ D 1 myi  X i2Œm yi sixT i  ˇ   xi; i 2 Œm: There are two projection operators in Algorithm 1. The first one projects some  2 Rpn onto E ≜f 2 Rpn W  2 Œ0; 1pn; kk1;1  kg : This can be done efficiently by Algorithm 2. Essentially, we perform p independent projections, each for one row of  using a bi-section type of algorithm [39, 40, 41]. We have the following result. 6 Figure 2: SMaLL applied to the Breast Cancer dataset with k D 3 and p D 2. The blue and orange dots represent the test instances from the two classes. The plots show the kernel density estimates and the actual values of the non-zero features in each prototype, as well at the final predictor result. Proposition 4. Algorithm 2 computes, up to a specified tolerance tol, the projection of any  2 Rpn onto E in O .log2.1=tol// time, where tol is the input precision for bisection. There are two cases for the projection of si 2 Rp onto the set Si. For i 2 IC, we only need to project si;j.i/ onto the interval Œ1; 0 and set si;j D 0 for all j ¤ j.i/. For i 2 I, the projection algorithm is similar to Algorithm 2, and we omit the details here. The step sizes ˛t and ˇt can be set according to the guidelines described in [37, 38], based on the smoothness properties of the function .; S/. In practice, we follow the adaptive tuning procedure developed in [42]. 4 Experiments We demonstrate the merits of SMaLL via an extensive set of experiments. We start with an intuition into how the class of sparse multiprototype linear predictors differs from standard model classes. Figure 1 is a visualization of the decision surface of different types of classifiers on the 2-dimensional chscase funds toy dataset, obtained from OpenML. The two classes are shown in red and blue, with training data in solid shade and test data in translucent shade. The color of each band indicates the gradation in the confidence of prediction - each classifier is more confident in the darker regions and less confident in the lighter regions. The 2-prototype linear predictor attains the best test accuracy on this toy problem (0:73). Note that some of the examples are highlighted by a black rectangle - the linear classifiers (logistic regression and linear SVM) could not distinguish between these examples, whereas the 2-prototype linear predictor was able to segregate and assign them to different bands. 4.1 Low-dimensional Datasets Without Sparsity We now compare the accuracy of SMaLL with k D n (no sparsity) to the accuracy of other standard classification algorithms, on several low-dimensional (n  20) binary classification datasets from the OpenML repository. We experimented with OpenML data for two main reasons: (a) it contains many preprocessed binary datasets, and (b) the datasets come from diverse domains. The methods that we compare against are linear SVM (LSVM), SVM with non-linear kernels such as radial 7 Figure 3: Comparison on high dimensional (n >D 50) OpenML data from the Fri series. Each stacked bar shows average test accuracy on left, and the total number of selected features on right. basis function, polynomial, and sigmoid (RSVM), Logistic Regression (LR), Decision Trees (DT), Random Forest (RF), k-Nearest Neighbor (kNN), Gaussian Process (GP), Gradient Boosting (GB), and AdaBoost (AB). All the datasets were normalized to make each feature have zero mean and unit variance. Since the datasets do not specify separate train, validation, and test sets, we measure test accuracy by averaging over five random train-test splits. Since we are interested in extreme sparsity, we pre-clustered the positive examples into p D 2 clusters, and initialized the prototypes with the cluster centers. We determined hyperparameters by 5-fold cross-validation. The coefficient of the error term C in LSVM and `2-regularized LR was selected from f0:1; 1; 10; 100g. In the case of RSVM, we also added 0:01 to the search set for C, and chose the best kernel between a radial basis function (RBF), polynomials of degree 2 and 3, and sigmoid. For the ensemble methods (RF, AB, GB), the number of base predictors was selected from the set f10; 20; 50g. The maximum number of features for RF estimators was optimized over the square root and the log selection criteria. We also found best validation parameters for DT (gini or entropy for attribute selection), kNN (1, 3, 5 or 7 neighbors), and GP (RBF kernel scaled with scaled by a coefficient in the set f0:1; 1:0; 5g and dot product kernel with inhomogeneity parameter  set to 1). Finally, for our method SMaLL, we fixed  D 0:1 and ˛t D 0:01, and searched over ˇt D ˇ 2 f0:01; 0:001g. Table 1 shows the test accuracy for the different algorithms on different datasets. As seen from the table, SMaLL with k D n generally performed extremely well on most of these datasets. This substantiates the practicality of SMaLL in the low dimensional regime. 4.2 Higher-dimensional Datasets with Sparsity We now describe results with higher dimensional data, where feature selection becomes especially critical. To substantiate our claim that SMaLL produces an interpretable model, we ran SMaLL on the Breast Cancer dataset with k D 3 and p D 2 (two prototypes, three non-zero elements in each). Figure 2 shows the kernel density estimates and the actual values of the selected features in each prototype, and the summary of our predictor. Note that the feature perimeter_worst appears in both prototypes. As the rightmost plot shows, the predictor output provides a good separation of the test data, and SMaLL registered a test accuracy of over 94%. It is straightforward to understand how the resulting classifier reaches its decisions: which features it relies on and how those features interact. Next, we compare SMaLL with 8 other methods. Six of these methods induce sparsity by minimizing an `1-regularized loss function. These methods minimize one of the three empirical loss functions (hinge loss, log loss, and the binary-classification Huber loss), regularized by either an `1 or an elastic net penalty (i.e. `1 and `2). We refer to these as L1Hi (`1, hinge), L1L (`1, log), L1Hu (`1, Huber), EnHi (elastic net, hinge), ENL (elastic net, log) and ENHu (elastic net, huber). We also compare 8 Figure 4: The big picture. The plot depicts the performance of SMaLL compared to both the standard classification algorithms and the sparse baselines on the fri_c0_1000_50 dataset. The number atop each bar is the average number of features selected by that algorithm across 5 runs. with two state-of-the-art methods for the scarce-resource setting. ProtoNN [1] is a modern take on nearest neighbor classifiers, while Bonsai [2] is a sophisticated enhancement of a small decision tree. Note that while we can explicitly control the amount of sparsity in SMaLL, ProtoNN, and Bonsai, the methods that use `1 or elastic net regularization do not have this flexibility. Therefore, in order to get the different baselines on the same footing, we devised the following empirical methodology. We specified p  k D 6 features as the desired sparsity, and modulated each linear baseline to yield nearly these many features. We trained each of the linear baselines by setting a high value of the `1 coefficient and selected the features with the largest absolute values. Then, we retrained the classifier using only the selected features, using the same loss (hinge, loss, or log) and an `2 regularization. Our procedure ensured that each baseline benefited, in effect, from an elastic net-like regularization while having the most important features at its disposal. For the SMaLL classifier, we fixed k D 3 and p D 2. In practice, this setting will be application specific (e.g., it would likely depend on the budget). As before, since the original dataset did not specify a train-test split, our results were averaged over five random splits. The parameters for each method were tuned using 5-fold cross-validation. We fixed  D 0:1 and performed a joint search over ˛t 2 f0:1; 1e 2; 1e 3g and ˇt 2 f1e 3; 1e 4g. For all the baselines, we optimized the cross validation error over the `1 regularization coefficients in the set f1e 1; 1e 2; 1e 3; 1e 4g. Moreover, in case of elastic net, the ratio of the `1 coefficient to the `2 coefficient was set to 1. The depth of the estimators in Bonsai was selected from f2; 3; 4g. Finally, the dimensionality of projection in ProtoNN was searched over f5; 10; 15; 20g. Figure 3 provides strong empirical evidence that SMaLL compares favorably to the baselines on several high dimensional OpenML datasets belonging to the Fri series. Specifically, the first number in each dataset name indicates the number of examples, and the second the dimensionality of the dataset. Note that in case of SMaLL, some features might be selected in more than one prototype. Therefore, to be fair to the other methods, we included the multiplicity while computing the total feature count. We observe that, on all but one of these datasets, SMaLL outperformed the ProtoNN and Bonsai models at the same level of sparsity, and the gap between SMaLL and these methods generally turned out to be huge. Moreover, compared to the linear baselines, SMaLL achieved consistently better performance at much sparser levels. This shows the promise of SMaLL toward achieving succinct yet accurate predictors in the high dimensional regime. The merits of SMaLL are further reinforced in Fig. 4 that shows the accuracy-sparsity trade-offs. We observe that just with 6 features, SMaLL provides better test accuracy compared to all the baselines but GB and AB. This shows the potential of SMaLL as a practical algorithm for resource deficient environments. 9 References [1] C. Gupta, A. S. Suggala, A. Goyal, H. V. Simhadri, B. Paranjape, A. Kumar, S. Goyal, R. Udupa, M. Varma, and P. Jain. ProtoNN: compressed and accurate kNN for resource-scarce devices. In ICML, pages 1331–1340, 2017. [2] A. Kumar, S. Goyal, and M. Varma. Resource-efficient machine learning in 2 kb ram for the internet of things. In ICML, pages 1935–1944, 2017. [3] L. G. Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984. [4] J. R. Hauser, O. Toubia, T. Evgeniou, R. Befurt, and D. Dzyabura. Disjunctions of conjunctions, cognitive simplicity, and consideration sets. Journal of Marketing Research, 47(3):485–496, 2010. [5] T. Wang, C. Rudin, F. Doshi, Y. Liu, E. Klampfl, and P. MacNeille. Bayesian rule sets for interpretable classification, with application to context-aware recommender systems. JMLR, 18(70):1–37, 2017. [6] O. Cord. Genetic fuzzy systems: evolutionary tuning and learning of fuzzy knowledge bases, volume 19. World Scientific, 2001. [7] A. Blum, M. Furst, J. Jackson, M. Kearns, Y. Mansour, and S. Rudich. Weakly learning dnf and characterizing statistical query learning using fourier analysis. In Proceedings of the Twenty-sixth Annual ACM Symposium on Theory of Computing (STOC), pages 253–262, 1994. [8] Y. Mansour. An o (nlog log n) learning algorithm for dnf under the uniform distribution. Journal of Computer and System Sciences, 50(3):543–550, 1995. [9] J. C. Jackson. An efficient membership-query algorithm for learning dnf with respect to the uniform distribution. Journal of Computer and System Sciences, 55(3):414–440, 1997. [10] K. Verbeurgt. Learning suc-classes of monotone dnf on the uniform distribution. In Proceedings of the Ninth Conference on Algorithmic Learning Theory, pages 385–399, 1998. [11] N. H. Bshouty, J. C. Jackson, and C. Tamon. More efficient pac-learning of dnf with membership queries under the uniform distribution. In Computational Learning Theory (COLT), pages 286–295, 1999. [12] Y. Sakai and A. Maruoka. Learning monotone log-term dnf formulas under the uniform distribution. Theory of Computing Systems, 33(1):17–33, 2000. [13] R. A. Servedio. On learning monotone dnf under product distributions. Information and Computation, 193(1):57–74, 2004. [14] N. H. Bshouty, E. Mossel, R. O’Donnell, and R. A. Servedio. Learning dnf from random walks. Journal of Computer and System Sciences, 71(3):250–265, 2005. [15] V. Feldman. Learning DNF expressions from fourier spectrum. In Conference on Learning Theory (COLT), pages 17.1–17.19, 2012. [16] A. R. Klivans and R. A. Servedio. Learning dnf in time 2o (n1/3). Journal of Computer and System Sciences, 68(2):303–318, 2004. [17] S. Khot and R. Saket. Hardness of minimizing and learning dnf expressions. In Foundations of Computer Science (FOCS), pages 231–240, 2008. [18] F. Aiolli and A. Sperduti. Multiclass classification with multi-prototype support vector machines. JMLR, 6:817–850, 2005. [19] O. Dekel, S. Shalev-Shwartz, and Y. Singer. The Forgetron: A kernel-based perceptron on a budget. SIAM Journal on Computing, 37(5):1342–1372, 2008. [20] O. Dekel and Y. Singer. Support vector machines on a budget. In NIPS, pages 345–352, 2007. 10 [21] M. Kusner, S. Tyree, K. Q. Weinberger, and K. Agrawal. Stochastic neighbor compression. In ICML, pages 622–630, 2014. [22] K. Zhong, R. Guo, S. Kumar, B. Yan, D. Simcha, and I. Dhillon. Fast Classification with Binary Prototypes. In AISTATS, pages 1255–1263, 2017. [23] M. Pilanci and M. J. Wainwright. Sparse learning via Boolean relaxations. Mathematical Programming, 151:63–87, 2015. [24] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (methodological), 58(1):267–288, 1996. [25] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society. Series B (methodological), 67(2):301–320, 2005. [26] V. K. Garg, L. Xiao, and O. Dekel. Sparse Multiprototype Classification. In UAI, 2018. [27] S. Han, H. Mao, and W. J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In ICLR, 2016. [28] F. Nan, J. Wang, and V. Saligrama. Pruning random forests for prediction on a budget. In NIPS, pages 2334–2342, 2016. [29] J.-H. Luo, J. Wu, and W. Lin. Thinet: A filter level pruning method for deep neural network compression. In ICCV, pages 5068–5076, 2017. [30] T. Sainath, B. Kingsbury, V. Sindhwani, E. Arisoy, and B. Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In ICASSP, pages 6655–6659, 2013. [31] P. Nakkiran, R. Alvarez, R. Prabhavalkar, and C. Parada. Compressing deep neural networks using a rank-constrained topology. In Sixteenth Annual Conference of the International Speech Communication Association, 2015. [32] W. Chen, J. Wilson, S. Tyree, K. Weinberger, and Y. Chen. Compressing neural networks with the hashing trick. In ICML, pages 2285–2294, 2015. [33] I. Hubara, M. Courbariaux, D. Soudry, R. El-Yaniv, and Y. Bengio. Binarized neural networks. In NIPS, pages 4107–4115, 2016. [34] D. Bertsimas and R. Shioda. Classification and regression via integer optimization. Operations Research, 55(2):252–271, 2007. [35] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [36] M. Tan, I. W. Tsang, and Li Wang. Towards ultrahigh dimensional feature selection for big data. JMLR, 15(1):1371–1429, 2014. [37] A. Nemirovski. Prox-method with rate of convergence O.1=t/ for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 15(1):229–251, 2004. [38] A. Juditsky and A. Nemirovski. First-order methods for nonsmooth convex large-scale optimization, II: Utilizing problems’s structure. In S. Sra, S. Nowozin, and S. J. Wright, editors, Optimization for Machine Learning, chapter 6, pages 149–184. The MIT Press, Cambridge, MA., 2011. [39] P. Brucker. An O.n/ algorithm for quadratic Knapsack problems. Operations Research Letters, 3(3):163–166, 1984. [40] P. M. Pardalos and N. Kovoor. An algorithm for a singly constrained class of quadratic programs subject to upper and lower bounds. Mathematical Programming, 46:321–328, 1990. [41] J. Duchi, S. Shalev-Shwartz, Y. Singer, and T. Chandra. Efficient projection onto the `1-ball for learning in high dimensions. In ICML, pages 272–279, 2008. [42] A. Jalali, M. Fazel, and L. Xiao. Variational Gram functions: Convex analysis and optimization. SIAM Journal on Optimization, 27(4):2634–2661, 2017. 11
2018
15
7,308
Fighting Boredom in Recommender Systems with Linear Reinforcement Learning Romain Warlop fifty-five, Paris, France SequeL Team, Inria Lille, France romain@fifty-five.com Alessandro Lazaric Facebook AI Research Paris, France lazaric@fb.com Jérémie Mary Criteo AI Lab Paris, France j.mary@criteo.com Abstract A common assumption in recommender systems (RS) is the existence of a best fixed recommendation strategy. Such strategy may be simple and work at the item level (e.g., in multi-armed bandit it is assumed one best fixed arm/item exists) or implement more sophisticated RS (e.g., the objective of A/B testing is to find the best fixed RS and execute it thereafter). We argue that this assumption is rarely verified in practice, as the recommendation process itself may impact the user’s preferences. For instance, a user may get bored by a strategy, while she may gain interest again, if enough time passed since the last time that strategy was used. In this case, a better approach consists in alternating different solutions at the right frequency to fully exploit their potential. In this paper, we first cast the problem as a Markov decision process, where the rewards are a linear function of the recent history of actions, and we show that a policy considering the long-term influence of the recommendations may outperform both fixed-action and contextual greedy policies. We then introduce an extension of the UCRL algorithm (LINUCRL) to effectively balance exploration and exploitation in an unknown environment, and we derive a regret bound that is independent of the number of states. Finally, we empirically validate the model assumptions and the algorithm in a number of realistic scenarios. 1 Introduction Consider a movie recommendation problem, where the recommender system (RS) selects the genre to suggest to a user. A basic strategy is to estimate user’s preferences and then recommend movies of the preferred genres. While this strategy is sensible in the short term, it overlooks the dynamics of the user’s preferences caused by the recommendation process. For instance, the user may get bored of the proposed genres and then reduce her ratings. This effect is due to the recommendation strategy itself and not by an actual evolution of user’s preferences, as she would still like the same genres, if only they were not proposed so often.1 The existence of an optimal fixed strategy is often assumed in RS using, e.g., matrix factorization to estimate users’ ratings and the best (fixed) item/genre [16]. Similarly, multi-armed bandit (MAB) algorithms [4] effectively trade off exploration and exploitation in unknown environments, but still assume that rewards are independent from the sequence of arms selected over time and they try to select the (fixed) optimal arm as often as possible. Even when comparing more sophisticated recommendation strategies, as in A/B testing, we implicitly assume that once the better option (either A or B) is found, it should be constantly executed, thus ignoring how its performance may deteriorate if used too often. An alternative approach is to estimate the state of the user (e.g., her 1In this paper, we do not study non-stationarity preferences, as it is a somehow orthogonal problem to the issue that we consider. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. level of boredom) as a function of the movies recently watched and estimate how her preferences are affected by that. We could then learn a contextual strategy that recommends the best genre depending on the actual state of the user (e.g., using LINUCB [17]). While this could partially address the previous issue, we argue that in practice it may not be satisfactory. As the preferences depend on the sequence of recommendations, a successful strategy should “drive” the user’s state in the most favorable condition to gain as much reward as possible in the long term, instead selecting the best “instantaneous” action at each step. Consider a user with preferences 1) action, 2) drama, 3) comedy. After showing a few action and drama movies, the user may get bored. A greedy contextual strategy would then move to recommending comedy, but as soon as it estimates that action or drama are better again (i.e., their potential value reverts to its initial value as they are not watched), it would immediately switch back to them. On the other hand, a more farsighted strategy may prefer to stick to comedy for a little longer to increase the preference of the user for action to its higher level and fully exploit its potential. In this paper, we propose to use a reinforcement learning (RL) [23] model to capture this dynamical structure, where the reward (e.g., the average rating of a genre) depends on a state that summarizes the effect of the recent recommendations on user’s preferences. We introduce a novel learning algorithm that effectively trades off exploration and exploitation and we derive theoretical guarantees for it. Finally, we validate our model and algorithm in synthetic and real-data based environments. Related Work. While in the MAB model, regret minimization [2] and best-arm identification algorithms [11, 22] have been often proposed to learn effective RS, they all rely on the assumption that one best fixed arm exists. [8] study settings with time-varying rewards, where each time an arm is pulled, its reward decreases due to loss of interest, but, unlike our scenario, it never increases again, even if not selected for a long time. [14] also consider rewards that continuously decrease over time whether the arm is selected or not (e.g., modeling novelty effects, where new products naturally loose interest over time). This model fits into the more general case of restless bandit [e.g., 6, 25, 20], where each arm has a partially observable internal state that evolves as a Markov chain independently from the arms selected over time. Time-varying preferences has also been widely studied in RS. [25, 15] consider a time-dependent bias to capture seasonality and trends effect, but do not consider the effects on users’ state. More related to our model is the setting proposed by [21], who consider an MDP-based RS at the item level, where the next item reward depends on the previously k selected items. Working at the item level without any underlying model assumption prevents their algorithm from learning in large state spaces, as every single combination of k items should be considered (in their approach this is partially mitigated by state aggregation). Finally, they do not consider the exploration-exploitation trade-off and they directly solve an estimated MDP. This may lead to an overall linear regret, i.e., failing to learn the optimal policy. Somewhat similar, [12] propose a semi-markov model to decide what item to recommend to a user based on her latent psychological state toward this item. They assumed two possible states: sensitization, state during which she is highly engaged with the item, and boredom, state during which she is not interested in the item. Thanks to the use of a semi-markov model, the next state of the user depends on how long she has been in the current state. Our work is also related to the linear bandit model [17, 1], where rewards are a linear function of a context and an unknown target vector. Despite producing context-dependent policies, this model does not consider the influence that the actions may have on the state and thus overlook the potential of long-term reward maximization. 2 Problem Formulation We consider a finite set of actions a ∈{1, . . . , K} = [K]. Depending on the application, actions may correspond to simple items or complex RS. We define the state st at time t as the history of the last w actions, i.e., st = (at−1, · · · , at−w), where for w = 0 the state reduces to the empty history. As described in the introduction, we expect the reward of an action a to depend on how often a has been recently selected (e.g., a user may get bored the more a RS is used). We introduce the recency function ρ(st, a) = Pw τ=1 1{at−τ = a}/τ, where the effect of an action fades as 1/τ, so that the recency is large if an action is often selected and it decreases as it is not selected for a while. We define the (expected) reward function associated to an action a in state s as r(st, a) = d X j=0 θ∗ a,jρ(st, a)j = xT s,aθ∗ a, (1) 2 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 prediction historical ratings 0.0 0.5 1.0 1.5 2.0 2.5 3.0 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 prediction historical ratings 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 prediction historical ratings 0.0 0.5 1.0 1.5 2.0 2.5 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 prediction historical ratings Figure 1: Average rating as a function of the recency for different genre of movies (w = 10) and predictions of our model for d=5 in red. From left to right, drama, comedy, action and thriller. The confidence intervals are constructed based on the amount of samples available at each state s and the red curves are obtained by fitting the data with the model in Eq. 1. where xs,a = [1, ρ(s, a), · · · , ρ(s, a)d] ∈Rd+1 is the context vector associated to action a in state s and θ∗ a ∈Rd+1 is an unknown vector. In practice, the reward observed when selecting a at st is rt = r(st, a) + εt, with εt a zero-mean noise. For d = 0 or w = 0, this model reduces to the standard MAB setting, where θ∗ a,0 is the expected reward of action a. Eq. 1 extends the MAB model by summing the “stationary” component θ∗ a,0 to a polynomial function of the recency ρ(st, a). While alternative and more complicated functions of st may be used to model the reward, in the next section we show that a small degree polynomial of the recency is rich enough to model real data. The formulation in Eq. 1 may suggest that this is an instance of a linear bandit problem, where xst,a is the context for action a at time t and θ∗ a is the unknown vector. Nonetheless, in linear bandit the sequence of contexts {xst,a}t is independent from the actions selected over time and the optimal action at time t is a∗ t = arg maxa∈[K] xT st,aθ∗ a,2 while in our model, xst,a actually depends on the state st, that summarizes the last w actions. As a result, an optimal policy should take into account its effect on the state to maximize the long-term average reward. We thus introduce the deterministic Markov decision process (MDP) M = ⟨S, [K], f, r⟩with state space S enumerating the possible sequences of w actions, action space [K], noisy reward function in Eq. 1, and a deterministic transition function f : S × [K] →S that simply drops the action selected w steps ago and appends the last action to the state. A policy π : S →[K] is evaluated according to its long-term average reward as ηπ = limn→∞E  1/n Pn t=1 rt  , where rt is the (random) reward of state st and action at = π(st). The optimal policy is thus π∗= arg maxπ ηπ, with optimal average reward η∗= ηπ∗. While an explicit form for π∗cannot be obtained in general, an optimal policy may select an action with suboptimal instantaneous reward (i.e., action at = π(st) is s.t. r(st, at) < maxa r(st, a)) so as to let other (potentially more rewarding) actions “recharge” and select them later on. This results into a policy that alternates actions with a fixed schedule (see Sec. 5 for more insights).3 If the parameters θ∗ a were known, we could compute the optimal policy by using value iteration where a value function u0 ∈RS is iteratively updated as ui+1(s) = max a∈[K] h r(s, a) + ui f(s, a) i , (2) and a nearly-optimal policy is obtained after n iterations as π(s) = maxa∈[K][r(s, a) + un(f(s, a))]. Alternatively, algorithms to compute the maximum reward cycle for deterministic MDPs could be used [see e.g., 13, 5]. The objective of a learning algorithm is to approach the performance of the optimal policy as quickly as possible. This is measured by the regret, which compares the reward cumulated over T steps by a learning algorithm and by the optimal policy, i.e., ∆(T) = Tη∗− T X t=1 r(st, at), (3) where (st, at) is the sequence of states and actions observed and selected by the algorithm. 3 Model Validation on Real Data In order to provide a preliminary validation of our model, we use the movielens-100k dataset [9, 7]. We consider a simple scenario where a RS directly recommends a genre to a user. In practice, one 2We will refer to this strategy as “greedy” policy thereafter. 3In deterministic MDPs the optimal policy is a recurrent sequence of actions inducing a maximum-reward cycle over states. 3 Genre d = 1 d = 2 d = 3 d = 4 d = 5 d = 6 action 0.55 0.74 0.79 0.81 0.81 0.82 comedy 0.77 0.85 0.88 0.90 0.90 0.91 drama 0.0 0.77 0.80 0.83 0.86 0.87 thriller 0.74 0.81 0.83 0.91 0.91 0.91 Table 1: R2 for the different genres and values of d on movielens-100k and a window w = 10. may prefer to use collaborative filtering algorithms (e.g., matrix factorisation) and apply our proposed algorithm on top of them to find the optimal cadence to maximize long term performances. However, when dealing with very sparse information like in retargeting, it may happen that a RS just focuses on performing recommendations from a very limited set of items.4 Once applied to this scenario, our model predicts that user’s preferences change with the number of movies of the same genre a user have recently watched (e.g., she may get bored after seeing too many movies of a genre and then getting interested again as time goes by without watching that genre). In order to verify this intuition, we sort ratings for each user using their timestamps to produce an ordered sequence of ratings.5 For different genres observed more than 10, 000 times, we compute the average rating for each value of the recency function ρ(st, a) at the states st encountered in the dataset. The charts of Fig. 1 provide a first qualitative support for our model. The rating for comedy, action, and thriller genres is a monotonically decreasing function of the recency, hinting to the existence of a boredom-effect, so that the rating of a genre decreases with how many movies of that kind have been recently watched. On the other hand, drama shows a more sophisticated behavior where users “discover” the genre and increase the ratings as they watch more movies, but get bored if they recently watched “too many” drama movies. This suggests that in this case there is a critical frequency at which users enjoy movies of this genre. In order to capture the dependency between rating and recency for different genres, in Eq. 1 we defined the reward as a polynomial of ρ(st, a) with coefficients that are specific for each action a. In Table 1 we report the coefficient of determination R2 of fitting the model of Eq. 1 to the dataset for different genres and values of d. The results show how our model becomes more and more accurate as we increase its complexity. We also notice that even polynomials of small degree (from d = 4 the R2 tends to plateau) actually produce accurate reward predictions, suggesting that the recency does really capture the key elements of the state s and that a relatively simple function of ρ is enough to accurately predict the rating. This result also suggests that standard approaches in RS, such as matrix factorization, where the rating is contextual (as it depends on features of both users and movies/genres) but static, potentially ignore a critical dimension of the problem that is related to the dynamics of the recommendation process itself. 4 Linear Upper-Confidence bound for Reinforcement Learning The Learning Algorithm. LINUCRL directly builds on the UCRL algorithm [10] and exploits the linear structure of the reward function and the deterministic and known transition function f. The core idea of LINUCRL is to construct confidence intervals on the reward function and apply the optimism-in-face-of-uncertainty principle to compute an optimistic policy. The structure of LINUCRL is illustrated in Alg. 1. Let us consider an episode k starting at time t, LINUCRL first uses the current samples collected for each action a separately to compute an estimate bθt,a by regularized least squares, i.e., bθt,a = min θ X τ<t:aτ =a xT sτ ,aθ −rτ 2 + λ∥θ∥2, (4) where xsτ ,a is the context vector corresponding to state sτ and rτ is the (noisy) reward observed at time τ. Let be Ra,t the vector of rewards obtained up to time t when a was executed and Xa,t the feature matrix corresponding to the contexts observed so far, then Vt,a = XT t,aXt,a + λI  ∈ R(d+1)×(d+1) is the design matrix. The closed-form solution of the estimate is bθt,a = V −1 t,a XT t,aRt,a, which gives an estimated reward function brt(s, a) = xT s,abθt,a. Instead of computing the optimal 4See Sect. 5 for further discussion on the difficulty of finding suitable datasets for the validation of timevarying models. 5In the movielens dataset a timestamp does not correspond to the moment the user saw the movie but when the rating is actually submitted. Yet, this does not cancel potential dependencies of future rewards on past actions. 4 Algorithm 1 The LINUCRL algorithm. Init: Set t = 0, Ta = 0, bθa = 0 ∈Rd+1, Va = λI for rounds k = 1, 2, · · · do Set tk = t, νa = 0 Compute bθa = V −1 a XT a Ra Set optimistic reward erk(s, a) = xT s,abθa + ct,a∥xs,a∥V −1 a Compute optimal policy eπk for MDP (S, [K], f, ert) while ∀a ∈[K], Ta < νa do Choose action at = eπk(st) Observe reward rt and next state st+1 Update Xat ←[Xat, xst,at], Rat ←[Rat, rt], Vat ←Vat + xst,atxT st,at Set νat ←νat + 1, t ←t + 1 end while Set Ta ←Ta + νa, ∀a ∈[K] end for policy according to the estimated reward, we compute the upper-confidence bound ert(s, a) = brt(s, a) + ct,a∥xs,a∥V −1 t,a , (5) where ct,a is a scaling factor whose explicit form is provided in Eq. 6. Since the transition function f is deterministic and known, we then simply apply the value iteration scheme in Eq. 2 to the MDP f Mk = ⟨S, [K], f, erk⟩and compute the corresponding optimal (optimistic) policy eπk. It is simple to verify that (f Mk, eπk) is the pair of MDP and policy that maximizes the average reward over all “plausible” MDPs that are within the confidence intervals over the reward function. More formally, let Mk = {M = ⟨S, [A], f, r⟩, |r(s, a) −brt(s, a)| ≤ct,a∥xs,a∥V −1 t,a , ∀s, a}, then with high probability we have that ηeπk(f Mk) ≥ max π,M∈Mk ηπ(M). Finally, LINUCRL execute eπk until the number of samples for an action is doubled w.r.t. the beginning of the episode. The specific structure of the problem makes LINUCRL more efficient than UCRL, since each iteration of Eq. 2 has O(dSK) computational complexity compared to O(S2K) of extended value iteration (used in UCRL) due to the randomness of the transitions and the optimism over f. Theoretical Analysis. We prove that LINUCRL successfully exploits the structure of the problem to reduce its cumulative regret w.r.t. basic UCRL. We first make explicit the confidence interval in Eq. 5. Let assume that there exist (known) constants B and R such that ∥θ∗ a∥2 ≤B for all actions a ∈[K] and the noise is sub-Gaussian with parameter R. Let ℓw = log(w) + 1, where w is the length of the window in the state definition, and L2 w = 1−ℓd+1 w 1−ℓw , where d is the degree of the polynomial describing the reward function. Then, we run LINUCRL with the scaling factor ct,a = R s (d + 1) log  Ktα  1 + Tt,aL2w λ  + λ1/2B (6) where Tt,a is the number of samples collected from action a up to t. Then we can prove the following. Theorem 1. If LINUCRL runs with the scaling factor in Eq. 6 over T rounds, then its cumulative regret is ∆(LINUCRL, T) ≤Kw log2 8T K  + 2cmax s 2KT(d + 1) log  1 + TL2w λ(d + 1)  , where cmax = maxt,a ct,a. We first notice that the per-step regret ∆/T decreases to zero as 1/ √ T, showing that as time increases, the reward approaches the optimal average reward. Furthermore, by leveraging the specific structure of our problem, LINUCRL greatly improves the dependency on other elements characterizing the MDP. In the general MDP case, UCRL suffers from a regret O(DS √ KT), where D is the diameter of the MDP, which in our case is equal to the history window w. In the regret bound of LINUCRL the 5 0 10 20 30 40 50 60 1 2 optimal policy 0 10 20 30 40 50 60 1 2 greedy policy optimal policy greedy policy best single arm 0.1 0.2 0.3 0.4 0.5 0 10 20 30 40 50 60 1 2 optimal policy 0 10 20 30 40 50 60 1 2 greedy policy optimal policy greedy policy best single arm 0.46 0.48 0.50 0.52 (a) sequence of actions (b) average reward (c) sequence of actions (d) average reward Figure 2: Optimal policy vs. greedy and fixed-action. The fixed-action policy selects the action with the largest “constant” reward (i.e., ignoring the effects of the recommendation). The greedy policy selects the action with the highest immediate reward (depending on the state). The optimal policy is computed with value iteration. (a-b): parameters c1 = 0.3, c2 = 0.4, α = 1.5 (limited boredom effect). (c-d): parameters c1 = 2, c2 = 0.01, α = 2 (strong boredom effect). dependency on the number of states (which is exponential in the history window S = Kw) disappears and it is replaced by the number of parameters d + 1 in the reward model. Furthermore, since the dynamics is deterministic and known, the only dependency on the diameter w is in a lower-order logarithmic term. This result suggests that we can take a large window w and a complex polynomial expression for the reward (i.e., large d) without compromising the overall regret. Let note that in MDPs, the worst-case regret lower bound also exhibits a p (T) dependency ([10]), so there is not much hope to improve it. The interesting part of these bounds is actually in the problem-specific terms. Furthermore, LINUCRL compares favorably with a linear bandit approach. First, η∗is in general much larger than the optimal average reward of a greedy policy selecting the best instantanous action at each step. Second, apart from the log(T) term, the regret is the same of a linear bandit algorithm (e.g., LINUCB). This means that LINUCRL approaches a better target performance η∗almost at the same speed as linear bandit algorithms reach a worse greedy policy. Finally, [19] developed a specific instance of UCRL for deterministic MDPs, whose final regret is of order O(λA log(T)/∆), where λ is the length of the largest simple cycle that can be generated in the MDP and ∆is the gap between the reward of the optimal and second-optimal policy. While the regret in this bound only scales as O(log T), in our setting λ can be as large as S = Kw, which is exponentially worse than the diameter w, and ∆can be arbitrarily small, thus making a O( √ T) bound often preferable. We leave the integration of our linear reward assumption into the algorithm proposed by [19] as future work. 5 Experiments In order to validate our model on real datasets, we need persistent information about a user identification number to follow the user through time and evaluate how preferences evolve over time in response to the recommendations. This also requires datasets where several RSs are used for the same user with different cadence and for which it is possible to associate a user-item feedback with the system that actually performed that recommendation. Unfortunately, these requirements make most of publicly available datasets not suitable for this validation. As a result, we propose to use both synthetic and dataset-based experiments to empirically validate our model and compare LINUCRL to existing baselines. We consider three different scenarios. Toy experiment: A simulated environment with two actions and different parameters, with the objective of illustrating when the optimal policy could outperform fixed-action and greedy strategies. Movielens: We derive model parameters from the movielens dataset and we compare the learning performance (i.e., cumulative reward) of LINUCRL to baseline algorithms. Real-world data from A/B testing: this dataset provides enough information to test our algorithm and although our model assumptions are no longer satisfied, we can still investigate how a long-term policy alternating A and B on the basis of past choices can outperform each solution individually. Optimal vs. fixed-action and greedy policy. We first illustrate the potential improvement coming from a non-static policy that takes into consideration the recent sequence of actions and maximizes the long-term reward, compared to a greedy policy that selects the action with the higher immediate reward at each step. Intuitively, the gap may be large whenever an action has a large instantaneous reward that decreases very fast as it is selected (e.g., boredom effect). A long-term strategy may prefer to stick to selecting a sub-optimal action for a while, until the better action goes back to its 6 0 5 10 15 20 25 30 35 40 Action Comedy Adventure Thriller Drama Children Crime Horror SciFi Animation oracle greedy 0 5 10 15 20 25 30 35 40 Action Comedy Adventure Thriller Drama Children Crime Horror SciFi Animation linUCRL 0 5 10 15 20 25 30 35 40 Action Comedy Adventure Thriller Drama Children Crime Horror SciFi Animation linUCB 0 5 10 15 20 25 30 35 40 Action Comedy Adventure Thriller Drama Children Crime Horror SciFi Animation oracle optimal linUCB UCRL linUCRL oracle greedy oracle optimal 3.1 3.2 3.3 3.4 3.5 3.6 3.284 3.33 3.486 3.538 3.551 UCRL linUCB oracle greedy linUCRL oracle optimal 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.327 3.43 3.536 3.54 3.555 (a) Last 40 actions (b) Avg. rwd. at T = 200 (c) Avg. rwd. at the end Figure 3: Results of learning experiment based on movielens dataset. initial value. We consider the simple case K = 2 and d = 1. Let θ∗ 1 = (1, c1), θ∗ 2 = (1/α, c2). We study the optimal policy maximizing the average reward η, a greedy policy that always selects at = arg maxa r(st, a), and a fixed-action policy at = arg max{1, 1/α}. We first set c1 = 0.3 ≈ c2 = 0.4 and α = 1.5, for which the “boredom” effect (i.e., the decrease in reward) is very mild. In this case (see Fig. 2-(left)), the fixed-action policy performs very poorly, while greedy and optimal policy smartly alternates between actions so as to avoid decreasing the reward of the “best” action too much. In this case, the difference between greedy and optimal policy is very narrow. However in Fig. 2-(right), with c1 = 2 ≫c2 = 0.01 and α = 2, we see that the greedy policy switches to action 1 too soon to gain immediate reward (plays action 1 for 66% of the time) whereas the optimal policy stick to action 2 longer (plays action 1 for 57% of the time) so as to allow action 1 to regain reward and then go back to select it again. As a result, the optimal policy exploits the full potential of action 1 better and eventually gains higher average reward. While here we only illustrate the “boredom” effect (i.e., the reward linearly decreases with the recency), we can imagine a large range of scenarios where the greedy policy is highly suboptimal compared to the optimal policy. Learning on movielens dataset. In order to overcome the difficulty of creating full complex RS and evaluate them on offline datasets, we focus on a relatively simple scenario where a RS directly recommends movies from one chosen genre, for which we have already validated our model in Sec. 3. One strategy could be to apply a bandit algorithm to find the optimal genre and then always recommend movies of this genre. On the other hand, our algorithm tries to identify an optimal sequence of those genres to keep the user interested. The standard offline evaluation of a learning algorithm on historical data is to use a replay or counterfactual strategy [18, 24], which consists in updating the model whenever the learning algorithm takes the same action as in the logged data, and only update the state (but not the model) otherwise. In our case this replay strategy cannot be applied because the reward depends on the history of selected actions and we could not evaluate the reward of an action if the algorithm generated a sequence that is not available in the dataset (which is quite likely). Thus in order to compare the learning performance of LINUCRL to existing baselines, we use the movielens100k dataset to estimate the parameters of our model and construct the corresponding “simulator”. Unlike a fully synthetic experiment, this gives a configuration which is “likely” to appear in practice, as the parameters are directly estimated from real data. We choose K = 10 actions corresponding to different genres of movies, and we set d = 5 and w = 5, which results into Kw = 105 states. We recall that w has a mild impact on the learning performance of LINUCRL as it does not need to repeatedly try the same action in each state (as UCRL) to be able to estimate its reward. This is also confirmed by the regret analysis that shows that the regret only depends on w in the lower-order logarithmic term of the regret. Given this number of states, UCRL would need at least one million iteration to observe each state 10 times which is dramatically too large for the application we consider. The parameters that describe the dependency of the reward function on the recency (i.e., θ∗ j,a) are computed by using the ratings averaged over all users for each state encountered and for ten different genres in the dataset. The first component of the vectors θ∗ a is chosen to simulate different user’s preferences and to create complex dynamics in the reward functions. The resulting parameters and reward functions are reported in App. B. Finally, the observed reward is obtained by adding a small random Gaussian noise to the linear function. In this setting, a constant strategy would always pull the comedy genre since it is the one with the highest “static” reward, while other genres are also highly rewarding and a suitable alternation between them may provide a much higher reward. We compare LINUCRL to the following algorithms: oracle optimal (π∗), oracle greedy (greedy contextual policy), LINUCB [1] (learn the parameters using LINUCB for each action and select the 7 Algorithm on the T steps on the last steps only B 46.0% 46.0% UCRL 46.5% 46.0% LINUCRL 66.7% 75.8% oracle greedy 61.3% 61.3% oracle optimal 95.2% 95.2% Table 2: Relative improvement over only A of learning experiment based on large scale A/B testing dataset. one with largest instantaneous reward), UCRL [3] (considering each action and state independently). The results are obtained by averaging 4 independent runs. Fig. 3(b-c) shows the average reward at T = 200 and after T = 2000 steps. We first notice that as in the previous experiment the oracle greedy policy is suboptimal compared to the optimal policy that maximizes the long-term reward. Despite the fact that UCRL targets this better performance, the learning process is very slow as the number of states is too large. Indeed this number of steps is lower than the number of states so UCRL did not have the chance to update its policy since in average no states has been visited twice. On the other hand, at early learning stages LINUCRL is already better than LINUCB, and its performance keeps improving until, at 2000 steps, it actually performs better than the oracle greedy strategy and it is close to the optimal policy. Large scale A/B testing dataset. We also validate our approach on a real-world A/B testing dataset. We collected 15 days of click on ads history of a CRITEO’s test, where users have been proposed two variations on the display denoted as A and B. Each display is actually the output of two real-world collaborative-filtering recommender strategies; precise information on how these algorithms are constructed is not relevant for our analysis. Unlike a classical A/B testing each unique user has been exposed to both A and B but with different frequencies. This dataset is formed of 350M tuples (user id, timestamp, version, click) and will be released publicly as soon as possible. Remark that the system is already heavily optimized and that even a small improvement in the click-rate is very desirable. As in the movielens experiment, we do not have enough data to evaluate a learning algorithm on the historical events (not enough samples per state would be available), so we first compute a simulator based on the data and then run LINUCRL- that does not know the parameters of the simulator and must try to estimate them - and compare it to simple baselines. Unlike the previous experiment, we do not impose any linear assumption on the simulator (as in Eq. 1) and we compute the click probability for actions A and B independently in each state (we set w = 10, for a total of 210 = 1024 states) and whenever that state-action pair is executed we draw a Bernoulli with the corresponding probability. Using this simulator we compute oracle greedy and optimal policies and we compare LINUCB, LINUCRL, which is no longer able to learn the “true” model, since it does not satisfy the linear assumption, and UCRL, which may suffer from the large number of state but targets a model with potentially better performance (as it can correctly estimate the actual reward function and not just a linear approximation of it). We report the results (averaged over 5 runs) as a relative improvement over the worst fixed option (i.e., in this case A). Tab. 2 shows the average reward over T = 2, 000 steps and of the learned policy at the end of the experiment. Despite the fact that the simulator does not satisfy our modeling assumptions, LINUCRL is still the most competitive algorithm as it achieves the best performance among the learning algorithms and it outperforms the oracle greedy policy. 6 Conclusion We showed that estimating the influence of the recommendation strategy on the reward and computing a policy maximizing the long-term reward may significantly outperform fixed-action or greedy contextual policies. We introduced a novel learning algorithm, LINUCRL, to effectively learn such policy and we prove that its regret is much smaller than for standard reinforcement learning algorithms (UCRL). We validated our model and its usefulness on the movielens dataset and on a novel A/B testing dataset. Our results illustrate how the optimal policy effectively alternates between different options, in order to keep the interest of the users as high as possible. Furthermore, we compared LINUCRL to a series of learning baselines on simulators satisfying our linearity assumptions (movielens) or not (A/B testing). A venue for future work is to extend the current model to take into consideration correlations between actions. Furthermore, given its speed of convergence, it could be interesting to run a different instance of LINUCRL per user - or group of users - in order to offer personalized “boredom” curves. Finally, using different models of the reward as a function of the recency (e.g., logistic regression) could be used in case of binary rewards. 8 References [1] Y. Abbasi-yadkori, D. Pál, and C. Szepesvári. Improved algorithms for linear stochastic bandits. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 2312–2320. Curran Associates, Inc., 2011. [2] P. Auer. Using confidence bounds for exploitation-exploration trade-offs. J. Mach. Learn. Res., 3:397–422, mar 2003. [3] P. Auer, T. Jaksch, and R. Ortner. Near-optimal regret bounds for reinforcement learning. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou, editors, Advances in Neural Information Processing Systems 21, pages 89–96. Curran Associates, Inc., 2009. [4] S. Bubeck and N. Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends R⃝in Machine Learning, 5(1):1–122, 2012. [5] A. Dasdan, S. S. Irani, and R. K. Gupta. Efficient algorithms for optimum cycle mean and optimum cost to time ratio problems. In Proceedings of the 36th Annual ACM/IEEE Design Automation Conference, DAC ’99, pages 37–42, New York, NY, USA, 1999. ACM. [6] S. Filippi, O. Cappé, and A. Garivier. Optimally Sensing a Single Channel Without Prior Information: The Tiling Algorithm and Regret Bounds. IEEE Journal of Selected Topics in Signal Processing, 5(1):68 – 76, Feb. 2010. [7] F. M. Harper and J. A. Konstan. The movielens datasets: History and context. ACM Trans. Interact. Intell. Syst., 5(4):19:1–19:19, Dec. 2015. [8] H. Heidari, M. Kearns, and A. Roth. Tight policy regret bounds for improving and decaying bandits. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence, IJCAI’16, pages 1562–1570. AAAI Press, 2016. [9] J. Herlocker, J. Konstan, A. Borchers, and J. Riedl. An algorithmic framework for performing collaborative filtering. In Proceedings of the 1999 Conference on Research and Development in Information Retrieval, 1999. [10] T. Jaksch, R. Ortner, and P. Auer. Near-optimal regret bounds for reinforcement learning. J. Mach. Learn. Res., 11:1563–1600, Aug. 2010. [11] K. G. Jamieson and A. Talwalkar. Non-stochastic best arm identification and hyperparameter optimization. In AISTATS, 2016. [12] K. Kapoor, K. Subbian, J. Srivastava, and P. Schrater. Just in time recommendations: Modeling the dynamics of boredom in activity streams. In Proceedings of the Eighth ACM International Conference on Web Search and Data Mining, WSDM ’15, pages 233–242, New York, NY, USA, 2015. ACM. [13] R. M. Karp. A characterization of the minimum cycle mean in a digraph. 23:309–311, 12 1978. [14] J. Komiyama and T. Qin. Time-Decaying Bandits for Non-stationary Systems, pages 460–466. Springer International Publishing, Cham, 2014. [15] Y. Koren. Collaborative filtering with temporal dynamics. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’09, pages 447–456, New York, NY, USA, 2009. ACM. [16] Y. Koren, R. Bell, and C. Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, Aug. 2009. [17] L. Li, W. Chu, J. Langford, and R. E. Schapire. A contextual-bandit approach to personalized news article recommendation. In M. Rappa, P. Jones, J. Freire, and S. Chakrabarti, editors, WWW, pages 661–670. ACM, 2010. 9 [18] L. Li, W. Chu, J. Langford, and X. Wang. Unbiased offline evaluation of contextual-bandit-based news article recommendation algorithms. In Proceedings of the Fourth ACM International Conference on Web Search and Data Mining, WSDM ’11, pages 297–306, New York, NY, USA, 2011. ACM. [19] R. Ortner. Online regret bounds for markov decision processes with deterministic transitions. In Y. Freund, L. Györfi, G. Turán, and T. Zeugmann, editors, Algorithmic Learning Theory, pages 123–137, Berlin, Heidelberg, 2008. Springer Berlin Heidelberg. [20] R. Ortner, D. Ryabko, P. Auer, and R. Munos. Regret bounds for restless markov bandits. Theor. Comput. Sci., 558:62–76, 2014. [21] G. Shani, D. Heckerman, and R. I. Brafman. An mdp-based recommender system. J. Mach. Learn. Res., 6:1265–1295, Dec. 2005. [22] M. Soare, A. Lazaric, and R. Munos. Best-Arm Identification in Linear Bandits. In NIPS Advances in Neural Information Processing Systems 27, Montreal, Canada, Dec. 2014. [23] R. S. Sutton and A. G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. [24] A. Swaminathan and T. Joachims. Batch learning from logged bandit feedback through counterfactual risk minimization. J. Mach. Learn. Res., 16(1):1731–1755, Jan. 2015. [25] C. Tekin and M. Liu. Online Learning of Rested and Restless Bandits. IEEE Transactions on Information Theory 58(8), Aug. 2012. 10 A Proof of Theorem 1 Proof. In order to prove Thm. 1, we first need the following proposition about the confidence intervals used in computing the optimistic reward er(s, a). Proposition 2. Let assume ∥θ∗ a∥2 ≤B. If bθt,a is computed as in Eq. 4 and ct,a is defined as in Eq. 6, then P  r(s, a) ≤br(s, a) + ct,a∥xs,a∥V −1 t,a  ≤t−α K . Proof. By definition of ρ(s, a) we have 0 ≤ρ(s, a) ≤Pw τ=1 1 τ < log(w) + 1 .= ℓw. Thus 1 ≤∥xs,a∥2 2 ≤ Pd j=0 ℓj w = 1−ℓd+1 w 1−ℓw = L2 w. Using Thm. 2 of [1], we have with probability 1 −δ, ∥bθt,a −θ∗ a∥Vt,a ≤R s (d + 1) log 1 + Tt,aL2w/λ δ  + λ1/2B. Thus for all s ∈S we have, |r(s, a) −br(s, a)| = |xT s,abθt,a −xT s,aθ∗ a| ≤∥xs,a∥V −1 t,a ∥bθa −θ∗ a∥Vt,a. Using δ = t−α K concludes the proof. An immediate result of Prop. 2 is that the estimated average reward of eπk in the optimistic MDP f Mk is an upper-confidence bound on the optimal average reward, i.e., for any t (the probability follows by a union bound over actions) P η∗> ηeπk(f Mk)  ≤t−α. (7) We are now ready to prove the main result. Proof of Thm. 1. We follow similar steps as in [10]. We split the regret over episodes as ∆(A, T) = m X k=1 tk+1−1 X t=tk η∗−r(st, at)  = m X k=1 ∆k. Let Tk,a = {tk ≤t < tk+1 : at = a} be the steps when action a is selected during episode k. We upper bound the per-episode regret as ∆k = X a∈[K] X t∈Tk,a η∗−r(st, a)  ≤ tk+1−1 X t=tk eηk −erk(st, a)  + X a∈[K] X t∈Tk,a erk(st, a) −r(st, a)  , where the inequality directly follows from the event that eηk ≥η∗(Eq. 7) with probability 1 −T −α. Notice that the low-probability event of failing confidence intervals can be treated as in [10]. We proceed by bounding the first term of Eq. 8. Unlike in the general online learning scenario, in our setting the transition function f is known and thus the regret incurred from bad estimates of the dynamics is reduced to zero. Furthermore, since we are dealing with deterministic MDPs, the optimal policy converges to a loop over states. When starting a new policy, we may start from a state outside its loop. Nonetheless, it is easy to verify that starting from any state s, it is always possible to reach any desired state s′ in at most w steps (i.e., the size of the history window). As a result, within each episode k the difference between the cumulative reward (P t erk(st, a)) and the (optimistic) average reward ((tk+1 −tk)eηk) in the loop never exceeds w. Furthermore, since episodes terminate when one action doubles its number of samples, using a similar proof as [10], we have that the number of episodes is bounded as m ≤K log2( 8T K ). As a result, the contribution of the first term of Eq. 8 to the overall regret is bounded as m X k=1 tk+1−1 X t=tk eηk −erk(st, a)  ≤Kw log2 8T K  . (8) 11 The second term in Eq. 8 refers to the (cumulative) reward estimation error and it can be decomposed as |erk(st, a) −r(st, a)| ≤|erk(st, a) −brk(st, a)| + |brk(st, a) −r(st, a)|. We can bound the cumulative sum of the second term as (similar for the first, since erk belongs to the confidence interval of brk by construction) m X k=1 X a∈[K] X t∈Tk,a |brk(st, a) −r(st, a)| ≤ m X k=1 X a∈[K] X t∈Tk,a ct,a∥xst,a∥V −1 a,t ≤cmax X a∈[K] v u u t m X k=1 X t∈Tk,a ∥xst,a∥2 V −1 a,t √ Ta, where the first inequality follows from Prop. 2 with probability 1 −T −α, and Ta is the total number of times a has been selected at step T. Let Ta = ∪kTk,a, then using Lemma 11 of [1], we have X t∈Ta ∥xst,a||2 V −1 t,a ≤2 log det(VT,a) det(λI) , and by Lem. 10 of [1], we have det(Vt,a) ≤(λ + tL2 w/(d + 1))d+1, which leads to m X k=1 X a∈[K] X t∈Tk,a |brk(st, a) −r(st, a)| ≤cmax X a∈[K] √ Ta s 2(d + 1) log  λ + tL2w λ(d + 1)  ≤cmax s 2KT(d + 1) log  λ + tL2w λ(d + 1)  . Bringing all the terms together gives the regret bound. B Experiments Details Genre θ∗ a,0 θ∗ a,1 θ∗ a,2 θ∗ a,3 θ∗ a,4 θ∗ a,5 Action 3.1 0.54 -1.08 0.78 -0.22 0.02 Comedy 3.34 0.54 -1.08 0.78 -0.22 0.02 Adventure 3.51 0.86 -2.7 3.06 -1.46 0.24 Thriller 3.4 1.26 -2.9 2.76 -1.14 0.16 Drama 2.75 1.0 0.94 -1.86 0.94 -0.16 Children 3.52 0.1 0.0 -0.3 0.2 -0.04 Crime 3.37 0.32 1.12 -3.0 2.26 -0.54 Horror 3.54 -0.68 1.84 -2.04 0.82 -0.12 SciFi 3.3 0.64 -1.32 1.1 -0.38 0.02 Animation 3.4 1.38 -3.44 3.62 -1.62 0.24 Table 3: Reward parameters of each genre for the movielens experiment. The parameters used in the MovieLens experiment are reported in Table 3. 12
2018
150
7,309
Diffusion Maps for Textual Network Embedding Xinyuan Zhang, Yitong Li, Dinghan Shen, Lawrence Carin Department of Electrical and Computer Engineering Duke University Durham, NC 27707 {xy.zhang, yitong.li, dinghan.shen, lcarin}@duke.edu Abstract Textual network embedding leverages rich text information associated with the network to learn low-dimensional vectorial representations of vertices. Rather than using typical natural language processing (NLP) approaches, recent research exploits the relationship of texts on the same edge to graphically embed text. However, these models neglect to measure the complete level of connectivity between any two texts in the graph. We present diffusion maps for textual network embedding (DMTE), integrating global structural information of the graph to capture the semantic relatedness between texts, with a diffusion-convolution operation applied on the text inputs. In addition, a new objective function is designed to efficiently preserve the high-order proximity using the graph diffusion. Experimental results show that the proposed approach outperforms state-of-the-art methods on the vertex-classification and link-prediction tasks. 1 Introduction The K-D-B-Tree: A Search Structure For Large Multidimensional Dynamic Indexes. Segment Indexes: Dynamic Indexing Techniques for MultiDimensional Interval Data. Efficiently Processing Queries on Interval-andValue Tuples in Relational Databases. A B C Citation Citation Figure 1: Three sentences from the DBLP dataset. Vertices A and C are second neighbors, i.e., two vertices that are not on the same edge but share at lease one common neighbor (vertex B). The alignment words are colored. Learning effective vectorial embeddings to represent text can lead to improvements in many natural language processing (NLP) tasks. However, most text embedding models do not embed the semantic relatedness between different texts. Graphical text networks address this problem by adding edges between correlated text vertices. For example, paper citation networks contain rich textual information and the citation relationships provide structural information to reflect the similarity between papers. Graphical text embedding naturally extends the problem to network embedding (NE), mapping vertices of a graph into a low-dimensional space. The learned representations containing structure and textual information can be used as features for network tasks, such as vertex classification [22], link prediction [14], and tag recommendation [31]. Learning network embeddings is a challenging research problem, due to the sparsity, non-linearity and high dimensionality of the graph data. In order to exploit textual information associated with each vertex, some NE models [13, 33, 19, 26] embed texts with a variety of NLP approaches, ranging from bag-of-words models to deep neural models. However these text embedding methods fail to consider the semantic distance indicated from the graph. In [30, 24] it was recently proposed to simultaneously embed two texts on the same edge using a mutual-attention mechanism. But in real-world sparse networks, it is intuitive that two connected vertices do not necessarily share more similarities than two unconnected vertices. Figure 1 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. presents three examples from the DBLP dataset. By aligning dynamic index and multi-dimensional, the sentences of vertex A and vertex C are closer than the sentence of their common first neighbor, vertex B. The relatedness between two vertices that are not linked by an edge cannot be preserved by only capturing the local pairwise proximity. We propose a flexible approach for textual network embedding, including global structural information without increasing model complexity. Global structure information serves to capture the long-distance relationship between two texts, incorporating connection paths within different steps. The diffusionconvolution operation [2] is employed to build a latent representation of the graph-structured text inputs, by scanning a diffusion map across each vertex. The graph diffusion, comprised of a normalized adjacency matrix and its power series, provides the probability of random walks from one vertex to another within a certain number of steps in the graph. The idea is to measure the level of connectivity between any two texts when considering all paths between them. In this study, we consider text-based information networks, but our model can be flexibly extended to other types of content. We further use the graph diffusion to redesign the objective function, capturing high-order proximity. Unlike some NE models [27], that calculate the probability of vertex vi being generated by vj, we preserve high-order proximity by calculating the probability of vertex vi given the diffusion map of vj. Compared to GraRep [5], the proposed objective function is more computationally efficient, especially for large-scale networks, because it does not need matrix factorization during training. This objective function is able to scale to directed or undirected, and weighted or unweighted graphs. To demonstrate the effectiveness of our model, we focus on two common tasks in analysis of textual information networks: (i) multi-label classification, where we predict the labels of each text; and (ii) link prediction, where we predict the existence of an edge given a pair of vertices. The experiments are conducted on several real-world datasets of information networks. Experimental results show that the DMTE model outperforms all other methods considered. The superiority of the proposed approach indicates that the diffusion process helps to incorporate long-distance relationship between texts and thus to achieve more informative textual network embeddings. 2 Related Work Text Embedding Many existing methods embed text messages into a vector space for various NLP tasks. Early approaches include bag-of-words models or topic models [4]. The Skip-gram model [16], which learns distributed word vectors by utilizing word co-occurrences in a local context, has been further extended to the document level via a paragraph vector [13] to learn text latent representations. To exploit the internal structure of text, more-complicated text embedding models have emerged, adopting deep neural network architectures. For example, convolutional neural networks (CNNs) [10, 6, 34] have been considered to apply a convolution kernel over different positions of the text, followed by max-pooling to obtain a fixed-length vectorial representation. Recursive neural tensor networks (RNTNs) [25] have applied a tensor-based composition function over parse trees to obtain sentence representations. LSTM-based recurrent neural networks (RNNs) [12] capture long-term dependencies in the text, using long short-term memory cells. However, deep neural architectures usually assume the availability of a large dataset, unrealistic for many information networks. When the data size is small, some methods [18, 9] avoid over-fitting by simply averaging embeddings of each word in the text, achieving competitive empirical results. Network Embedding Earlier works including IsoMap [29], LLE [21], and Laplacian Eigenmaps [3] transform feature vectors of vertices into an affinity graph, and then solve for the leading eigenvectors as the embedding. Recent NE models focus on learning the vectorial representation of existing networks. For example, DeepWalk [20] uses the Skip-gram model [16] on vertex sequences generated by truncated random walks, learning vertex embeddings. In node2vec [8], the random walk strategy of DeepWalk is modified for multi-scale representation learning. To exploit the distance between vertices, LINE [27] designed objective functions to preserve the first-order and second-order proximity, while [5] integrates global structure information by expanding the proximity into k-order. In [32] deep models are employed to capture the nonlinear network structure. However, all these methods only consider structural information of the network, without leveraging rich heterogeneous information associated with vertices; this may result in less informative representations, especially when the edges are sparse. 2 To address this issue, some recent works combine structure and content information to learn better embeddings. For example, TADW [33] shows that DeepWalk is equivalent to matrix factorization, and text features can be incorporated into the framework. TriDNR [19] uses information from structure, content and labels in a coupled neural network architecture, to learn the vertex representation. CENE [26] integrates text modeling and structure modeling by regarding the content information as a special kind of vertex. CANE [30] learns two embedding vectors for each vertex where the context-aware text embedding is obtained using a mutual attention mechanism. However, none of these methods takes into account the similarities of context influenced by global structural information. 3 Problem Definition Definition 1. A textual information network is G = (V, E, T), where V = {vi}i=1,··· ,N is the set of vertices, E = {ei,j}N i,j=1 is the set of edges, and T = {ti}i=1,··· ,N is the set of texts associated with vertices. Each edge ei,j has a weight si,j representing the relationship between vertices vi and vj. If vi and vj are not linked, si,j = 0. If there exists an edge between vi and vj, si,j = 1 for an unweighted graph, and si,j > 0 for a weighted graph. A path is a sequence of edges that connect two vertices. The text of vertex vi, ti, is comprised of a word sequence < w1, · · · , w|ti| >. Definition 2. Let S ∈RN×N be the adjacency matrix of a graph whose entry si,j ≥0 is the weight of edge ei,j. The transition matrix P ∈RN×N is obtained by normalizing rows of S to sum to one, with pi,j representing the transition probability from vertex vi to vertex vj within one step. Then an h-step transition matrix can be computed with P to the h-th power, i.e., Ph. The entry ph i,j refers to the transition probability from vertex vi to vertex vj within exactly h steps. Definition 3. A network embedding aims to learn a low-dimensional vector vi ∈Rd for vertex vi ∈V , where d ≪|V | is the dimension of the embedding. The embedding matrix V for the complete graph is the concatenation of {v1, v2, · · · , vN}. The distance between vertices on the graph and context similarity should be preserved in the representation space. Definition 4. The diffusion map of vertex vi is ui, the i-th row of the diffusion embedding matrix U, which maps from vertices and their embeddings to the results of a diffusion process that begins at vertex vi. U is computed by U = H−1 X h=0 λhPhV, (1) where λh is the importance coefficient that typically decreases as the value of h increases. The high-order proximity in the network is preserved in diffusion maps. 4 Method We employ a diffusion process to build long-distance semantic relatedness in text embeddings, and global structural information in the objective function. To incorporate both the structure and textual information of the network, we adopt two types of embeddings vs i and vt i for each vi vertex, as proposed in [30]. The structure-based embedding vector vs i is obtained by feeding the i-th row of a learned structure embedding table Es ∈RN×ds into a function. The text-based embedding vector vt i is obtained by applying the diffusion convolutional operation on the text inputs (see Section 4.2). Here dimensions of the structure embedding and the text embedding satisfy ds + dt = d. The embedding of vertex vi is simply the concatenation of vt i and vs i, i.e., vi = vt i ⊕vs i. In this work, vi is learned by an unsupervised approach, and it can be used directly as a feature vector of vertex vi for various tasks. The objective function consists of four parts, which measure both the structure and text embeddings. The high-order proximity is preserved during training without increasing computational complexity. The entire framework for textual network embedding is illustrated in Figure 3 where each vertex is associated with a text. 4.1 Diffusion Process 3 1 2 3 4 1.0 0.42 0.38 0.62 0.89 0.11 0.08 0.5 (a) Original graph 1 2 3 4 0.05 0.11 0.54 0.02 0.32 0.10 0.51 0.33 0.42 0.07 0.40 0.11 0.10 0.23 0.07 0.59 (b) Forth order diffusion graph. Figure 2: (Left) Original graph only have connected edge e1,2, e1,3, e3,4 and e1,4. Here we plot it as directed graph because we normalize the outgoing edges weight. (Right) Forth power diffusion graph. on the graph. Figure 2 gives an example of the smoothing effect of diffusion graph. This example only 137 contains four nodes. The edges are normalized so the graph becomes directed. The original graph 138 only have edge pair e1,2, e1,3, e3,4 and e1,4. However, the indirect relationship between other edge 139 pairs are not considered. Diffusion graph can smoothing the whole graph with higher order. Thus 140 those indirect relationships, like (n2, n4), can also be considered. As we can see from figure 2(b), the 141 forth order diffusion graph becomes fully connected. When the order goes to infinity, it corresponds 142 to the convergence point of a random walk. 143 4.2 Text Embedding 144 A word sequence t =< w1, · · · , w|t| > is mapped into a set of dt-dimensional real-valued vectors 145 < w1, · · · , w|t| > by looking up the word embedding matrix Ew. Here Ew ∈R|w|×dt is randomly 146 initialized and further learned during training and |w| is the vocabulary size of the dataset. We can 147 obtain a simple text representation xi ∈Rdt of vertice vi by taking the average of word vectors. 148 Although the word order is not preserved in such representation, [5] has shown that word embedding 149 average models can perform surprisingly well and avoid over-fitting efficiently in many NLP tasks. 150 Given the fixed-length vectors of each text, the input texts can be represented by matrix X ∈RN×dt 151 where the i-th row is xi. 152 x = 1 c |t|  i=1 wi, X = x1 ⊕x2 ⊕· · · ⊕xN. However, in this text representation matrix each embedding is completely independent without 153 leveraging the semantic relatedness indicated from the graph. To address this issue, we employ 154 diffusion convolutional operator [1] to measure the level of connectivity between any of two texts in 155 the netwrok. 156 Let P∗∈RN×H×N be a tensor containing H hops of power series of P, i.e., the concatenation of 157 {P0, P1, · · · , PH−1}. V∗ t ∈RN×H×d is the tensor version of text embedding represention after 158 diffusion convolutional operation. The activation V∗(i,j,k) t for node i, hop j, and feature k is given by 159 V∗(i,j,k) t = f(W(j,k) · N  n=1 P∗(i,j,n)X(n,k)) (2) where W ∈RH×d is the weight matrix and f is a non-linear differentiable function. The activations 160 can be expressed equavalently using tensor notations. 161 V∗ t = f(W ⊙P∗X) (3) where ⊙represents element-wise multiplication. This tensor representation considers all paths 162 between two texts in the network and thus includes long-distance semantic relationship. With longer 163 4 Figure 2: A simple example of diffusion process in a directed graph. Initially the network only has a few active vertices, due to sparsity. Through the diffusion process, information is delivered from active vertices to inactive ones by filling information gaps between vertices [1]; vertices may be connected by indirect, multi-step paths. This process is the same as the molecular diffusion in a fluid, where particles move from high-concentration areas to low-concentration areas. We introduce the transition matrix P and its power series for the diffusion process. The directed graph with four vertices and normalized weights in Figure 2 shows the smoothing effect of the high order of P in diffusion process. The original graph only has edges e1,2, e1,3, e3,4 and e1,4, while the information gaps between other vertices are not depicted. The diffusion process can smooth the whole graph with the higher order of P, so that indirect relationships, such as (n2, n4), can be connected (via a multi-step diffusion process). As we can see from Figure 2(b), the fourth-order diffusion graph is fully connected. The number associated with each edge represents the transition probability from one vertex to another within exactly 4 steps. The network will be stable when information is eventually evenly distributed. 4.2 Text Embedding A word sequence t =< w1, · · · , w|t| > is mapped into a set of dt-dimensional real-valued vectors < w1, · · · , w|t| > by looking up the word embedding matrix Ew. Here Ew ∈R|w|×dt is initialized randomly, and learned during training, and |w| is the vocabulary size of the dataset. We can obtain a simple text representation xi ∈Rdt of vertex vi by taking the average of word vectors. Although the word order is not preserved in such a representation, taking the average of word embeddings can avoid over-fitting efficiently, especially when the data size is small [23]. Given the fixed-length vectors of each text, the input texts can be represented by matrix X ∈RN×dt, where the i-th row is xi. x = 1 |t| |t| X i=1 wi, X = x1 ⊕x2 ⊕· · · ⊕xN. (2) Alternatively, we can use the bi-directional LSTM [7] which processes a text from both directions to capture long-term dependencies. Text inputs are represented by the mean of all hidden states. −→ h i = LSTM(wi, hi−1), ←− h i = LSTM(wi, hi+1) (3) x = 1 |t| |t| X i=1 (−→ h i ⊕←− h i), X = x1 ⊕x2 ⊕· · · ⊕xN. (4) However, in this text representation matrix for both approaches, the embeddings are completely independent, without leveraging the semantic relatedness indicated from the graph. To address this issue, we employ the diffusion convolutional operator [2] to measure the level of connectivity between any of two texts in the network. Let P∗∈RN×H×N be a tensor containing H hops of power series of P, i.e., the concatenation of {P0, P1, · · · , PH−1}. V∗ t ∈RN×H×d is the tensor version of the text embedding representation, after the diffusion convolutional operation. The activation V∗(i,j,k) t for vertex i, hop j, and feature k is given by V∗(i,j,k) t = f(W(j,k) · N X n=1 P∗(i,j,n)X(n,k)), (5) where W ∈RH×d is the weight matrix and f is a nonlinear differentiable function. The activations can be expressed equivalently using tensor notation V∗ t = f(W ⊙P∗X), (6) 4 1 2 3 4 … 𝑷𝑷𝟎𝟎 𝑷𝑷𝟏𝟏 𝑷𝑷𝑯𝑯−𝟏𝟏 * Structure Embedding Table 𝑬𝑬𝒔𝒔 Word Embedding Table 𝑬𝑬𝒘𝒘 𝒙𝒙1 𝒙𝒙2 𝒙𝒙3 𝒙𝒙4 𝜆𝜆0 𝜆𝜆1 𝜆𝜆𝐻𝐻−1 𝒗𝒗𝟏𝟏 𝒕𝒕𝒗𝒗𝟐𝟐 𝒕𝒕𝒗𝒗𝟑𝟑 𝒕𝒕𝒗𝒗𝟒𝟒 𝒕𝒕 𝒗𝒗𝟏𝟏 𝒔𝒔𝒗𝒗𝟐𝟐 𝒔𝒔 𝒗𝒗𝟒𝟒 𝒔𝒔 𝒗𝒗𝟑𝟑 𝒔𝒔 Figure 3: An illustration of our framework for textual network embedding. where ⊙represents element-wise multiplication. This tensor representation considers all paths between two texts in the network, and thus includes long-distance semantic relationship. With longer paths discounted more than shorter paths, the text embedding matrix Vt is given by Vt = H−1 X h=0 λhV∗(:,h,:) t . (7) Through the diffusion process, text representations, i.e., rows of Vt are not embedded independently. With the whole graph being smoothed, indirect relationships between texts that are not on the same edge can be considered to learn embeddings. 4.3 Objective Function Given the set of edges E, the goal of DMTE is to maximize the following overall objective function: L = X e∈E L(e) = X e∈E αttLtt(e) + αssLss(e) + αstLst(e) + αtsLts(e) (8) where αtt, αss, αst, and αts control the weight of corresponding objectives. The overall objective consists of four parts: Ltt(e) denotes the objective for text embeddings, Lss(e) denotes the objective for structure embeddings, Lst(e) and Lts(e) denote the objectives that consider both structure and text embeddings to map them into the same representation space. We assume the network is directed, since the undirected edge can be considered as two opposite-directed edges with equal weights. Then each objective is to measure the log-likelihood of generating vi conditioned on vj, where vi and vj are on the same directed edge: Ltt(e) = si,j log p(vt i|vt j) = si,j log exp(vt i · vt j) P vt k∈Vt exp(vt k · vt j), (9) Lss(e) = si,j log p(vs i|us j) = si,j log exp(vs i · us j) P vs k∈Vs exp(vs k · us j), (10) Lst(e) = si,j log p(vs i|vt j) = si,j log exp(vs i · vt j) P vs k∈Vs exp(vs k · vt j), (11) Lts(e) = si,j log p(vt i|us j) = si,j log exp(vt i · us j) P vt k∈Vt exp(vt k · us j). (12) Note that p(·|us j) computes the probability conditioned on the diffusion map of vertex vj, and p(·|vt j) computes the probability conditioned on the text embedding of vertex vj. Compared to using vs j to compute the conditional probability, the diffusion map us j utilizes both local information and global relations of vertex vj in the graph. We use vt j instead of the diffusion map ut j because the global structural information is included during text embedding, with the diffusion convolutional operation. Moreover the high-order proximity is preserved without using matrix factorization, which may be computationally inefficient for large-scale networks. 5 4.4 Optimization Optimizing (8) is computationally expensive, since the conditional probability requires the summation over the entire vertex set. In [17] negative sampling was proposed to solve this problem. For each edge ei,j, we sample multiple negative edges according to some noisy distribution. Then during training the conditional function p(vi|vj) can be replaced by log σ(vi · vj) + K X k=1 Evk∼Pn(v)[log σ(−vk · vj)], (13) where σ(·) is the sigmoid function, K is the number of negative samples, and Pn(v) ∝d3/4 v is the distribution of vertices with dv being the out-degree of vertex v. All parameters are jointly trained. Adam [11] is adopted for stochastic optimization. In each step, Adam samples a mini-batch of edges and then updates the model parameters. 5 Experiments We evaluate the proposed method for the multi-label classification and link prediction tasks. We design four versions of DMTE in our experiments: (i) DMTE without diffusion process; (ii) DMTE with text embedding only; (iii) DMTE with bidirectional LSTM (Bi-LSTM); (iv) DMTE with word average embedding (WAvg). In DMTE without diffusion process, the diffusion convolutional operation is not added on top of the text inputs, i.e., the text embedding matrix Vt is directly replaced by X in Eq. 2. In DMTE with text embedding only, the embedding of vertex vi is only vt i instead of the concatenation of vt i and vs i. In DMTE with Bi-LSTM, the input texts embedding matrix Xt is obtained using Eq. 4. In DMTE with WAvg, the input texts embedding matrix Xt is obtained using Eq. 2. We compare the four versions of DMTE model with seven competitive network embedding algorithms. Experimental results for multi-label classification are evaluated by Macro F1 scores and experimental results for link prediction are evaluated by Area Under the Curve (AUC). Datasets We conduct experiments on three real-world datasets: DBLP, Cora, and Zhihu. • DBLP [28] is a citation network that consists of bibliography data in computer science. In our experiments, 60744 papers are collected in 4 research areas: database, data mining, artificial intelligence, and computer vision. The network has 52890 edges indicating the citation relationship between papers. • Cora [15] is a citation network that consists of 2277 machine learning papers in 7 classes. The network has 5214 edges indicating the citation relationship between papers. • Zhihu [26] is a Q&A based community social network in China. In our experiments, 10000 active users are collected as vertices and 43894 edges indicating the relationship. The description of their interested topics are used as text information. Baselines The following baselines are compared with our DMTE model: • Structure-Based Methods: DeepWalk [20], LINE [27], node2vec [8]. • Structure and Text Combined Methods: TADW [33], Tri-DNR [19], CENE [26], CANE [30]. Evaluation and Parameter Settings For link prediction, we evaluate the performance with AUC, which is widely used for a ranking list. Since the testing set only contains existing edges as positive instances, we randomly sample the same number of non-existing edges as negative instances. Positive and negative edges are ranked according to a prediction function and AUC is employed to measure the probability that vertices on a positive edge are more similar than those on a negative edge. The experiment for each training ratio is executed 10 times and the mean AUC scores are reported, where the higher value indicates a better performance. For multi-label classification, we evaluate the performance with Macro-F1 scores. We first learn embeddings with all edges and vertices in an unsupervised way. Once the vertex embeddings are obtained, we feed them into a classifier. The experiment for each training ratio is executed 10 times and the mean Macro-F1 scores are reported where the higher value indicates a better performance. 6 Table 1: AUC scores for link prediction on Cora. % of edges 15% 25% 35% 45% 55% 65% 75% 85% 95% Deep Walk 56.0 63.0 70.2 75.5 80.1 85.2 85.3 87.8 90.3 LINE 55.0 58.6 66.4 73.0 77.6 82.8 85.6 88.4 89.3 node2vec 55.9 62.4 66.1 75.0 78.7 81.6 85.9 87.3 88.2 TADW 86.6 88.2 90.2 90.8 90.0 93.0 91.0 93.4 92.7 TriDNR 85.9 88.6 90.5 91.2 91.3 92.4 93.0 93.6 93.7 CENE 72.1 86.5 84.6 88.1 89.4 89.2 93.9 95.0 95.9 CANE 86.8 91.5 92.2 93.9 94.6 94.9 95.6 96.6 97.7 DMTE (w/o diffusion) 87.4 91.2 92.0 93.2 93.9 94.6 95.5 95.9 96.7 DMTE (text only) 82.6 84.0 85.7 87.3 89.1 91.1 92.0 92.9 94.2 DMTE (Bi-LSTM) 86.3 88.2 90.7 92.7 94.1 94.8 96.0 97.3 98.1 DMTE (WAvg) 91.3 93.1 93.7 95.0 96.0 97.1 97.4 98.2 98.8 Table 2: AUC scores for link prediction on Zhihu. % of edges 15% 25% 35% 45% 55% 65% 75% 85% 95% Deep Walk 56.6 58.1 60.1 60.0 61.8 61.9 63.3 63.7 67.8 LINE 52.3 55.9 59.9 60.9 64.3 66.0 67.7 69.3 71.1 node2vec 54.2 57.1 57.3 58.3 58.7 62.5 66.2 67.6 68.5 TADW 52.3 54.2 55.6 57.3 60.8 62.4 65.2 63.8 69.0 TriDNR 53.8 55.7 57.9 59.5 63.0 64.6 66.0 67.5 70.3 CENE 56.2 57.4 60.3 63.0 66.3 66.0 70.2 69.8 73.8 CANE 56.8 59.3 62.9 64.5 68.9 70.4 71.4 73.6 75.4 DMTE (w/o diffusion) 56.2 58.4 61.3 64.0 68.5 69.7 71.5 73.3 75.1 DMTE (text only) 55.9 57.2 58.8 61.6 65.3 67.6 69.5 71.0 74.1 DMTE (Bi-LSTM) 56.3 60.3 64.9 69.8 73.2 76.4 78.7 80.3 82.2 DMTE (WAvg) 58.4 63.2 67.5 71.6 74.0 76.7 78.5 79.8 81.5 We set the embedding of dimension d to 200 with ds and dt both equal to 100. The number of hops H is set to 4 and the importance coefficients λh’s are tuned for different datasets and different tasks with λ0 > λ1 > · · · > λH. αtt, αss, αts, and αst are set to 1, 1, 0.3 and 0.3 respectively. The number of negative samples K is set to 1 to speed up the training process. The word embedding matrix Ew, the structure embedding table Es,and the diffusion weight matrix W are all randomly initialized with a truncated Gaussian distribution. All models are implemented in Tensorflow using a NVIDIA Titan X GPU with 12 GB memory. 5.1 Link Prediction H=1 H=2 H=3 H=4 H=5 H=6 0.87 0.88 0.89 0.9 0.91 0.92 AUC 15% H=1 H=2 H=3 H=4 H=5 H=6 0.92 0.925 0.93 0.935 0.94 AUC 35% H=1 H=2 H=3 H=4 H=5 H=6 0.935 0.94 0.945 0.95 0.955 0.96 0.965 AUC 55% H=1 H=2 H=3 H=4 H=5 H=6 0.955 0.96 0.965 0.97 0.975 0.98 AUC 75% Figure 4: Performance over H. Given a pair of vertices, link prediction seeks to predict the existence of an unobserved edge using the trained representations. We use Cora and Zhihu datasets for link prediction. We randomly hold out a portion of edges (%e) for training in an unsupervised way with the rest of edges for testing. Tables 1 and 2 show the AUC scores of different models for %e from 15% to 95% on Cora and Zhihu. The best performance is highlighted in bold. As can be seen from both tables, our proposed method performs better than all other baseline methods. The AUC gains of DMTE model over the stateof-the-art CANE model can be as much as 4.5 and 6.8 on Cora and Zhihu respectively. These results demonstrate the effectiveness of the learned embeddings using the proposed method on link prediction task. We observe that baselines incorporating both structure and text 7 Table 3: Top-5 similar vertex search based on embeddings learned by DMTE. Query: The K-D-B-Tree: A Search Structure For Large Multidimensional Dynamic Indexes. 1. The R+-Tree: A Dynamic Index for Multi-Dimensional Objects. 2. The SR-tree: An Index Structure for High-Dimensional Nearest Neighbor Queries. 3. Segment Indexes: Dynamic Indexing Techniques for Multi-Dimensional Interval Data. 4. Generalized Search Trees for Database Systems. 5. High Performance Clustering Based on the Similarity Join. information perform better than those only utilizes structure information, which indicates that text associated with each vertex helps to achieve more informative embeddings. The proposed approach shows flexibility and robustness in various training ratios. As the portion of training edges gets larger, the performance of our DMTE model steadily increases while other approaches suffer under either low training ratio (such as CENE) or high training ratio (such as TADW). Comparing the four versions of DMTE, DMTE with word embedding average as the text inputs has the best performance on Cora at all training ratios and on Zhihu at low training ratios, while DMTE with bidirectional LSTM as the text inputs has the best performance on Zhihu at high training ratios. This is because when the training data is limited, the model with less parameters can successfully avoid over-fitting and thus achieve better results. For larger networks like Zhihu with high training data ratios, deep models (such as Bi-LSTM) with more parameters can be a good choice to encode input texts. The model with the diffusion convolutional operation applied on text inputs performs better than the model without the diffusion process, verifying our assumption that the diffusion process can help include long-distance semantic relationship and thus achieves better embeddings. We also observe that DMTE with text embeddings only performs better than some baseline methods but worse than the other three DMTE variations, demonstrating the effectiveness of text embeddings and the necessity of adding structure embeddings. Furthermore, DMTE with only the word-embedding average as the text representation has comparable performance over baselines, demonstrating the effectiveness of the redesigned objective function, which calculates the conditional probability of generating vi given the diffusion map of vj. Parameter Sensitivity Figure 4 shows the link prediction results w.r.t. the number of hops H at different training ratios. The model we use here is DMTE(WAvg). Note that when H = 1 the model is equivalent to DMTE without diffusion precess. As H gets larger, the performance of DMTE increases initially then stops increasing when H is big enough. This observation indicates that the diffusion process can help exploit the relatedness of any two vertices in the graph, however this relatedness is neglectable when the distance between two vertices is too long. 5.2 Multi-Label Classification 10% 30% 50% 70% Label Percentage 0.3 0.4 0.5 0.6 0.7 0.8 0.9 F1-Macro Score DeepWalk LINE TADW TriDNR CANE DMTE Figure 5: F1-Macro scores for multi-label classification on DBLP. Multi-label classification seeks to classify each vertex into a set of labels using the learned vertex representation as features. We use DBLP dataset for multi-label classification. Here DMTE refers to DMTE(WAvg). To maximally reduce the impact of complicated learning approaches on the classification performance, a linear SVM is employed instead of a sophisticated deep classifier. We randomly sample a portion of labeled vertices with embeddings (%l = {10%, 30%, 50%, 70%}) to train the classifier with the rest vertices for testing. Figure 5 shows the AUC scores of different models on DBLP. Compared to baselines, the proposed DMTE model consistently achieves performance improvement at all training ratios, demonstrating that DMTE learns high-quality embeddings which can be used directly as features for multi-label vertex classification. The F1-Macro score gains of DMTE over baseline 8 CANE indicates that the embeddings learned using global structure information is more informative than only considering local pairwise proximity. We also observe that structure-based methods perform much worse than methods based on structure and text combined, which further shows the importance of integrating both structure and text information in textual network embeddings. 5.3 Case Study To visualize the effectiveness of the learned embeddings, we retrieve the most similar vertices and their corresponding texts for a given query vertex. The distance is evaluated by cosine similarity based on the vectorial representations learned by DMTE. Table 3 shows the texts of the top 5 closest vertex embeddings of a query paper in DBLP dataset. In the graph, vertices 1, 2, 4, and 5 are all neighbors of the query while vertex 3 is not directly connected with the query vertex. As observed, direct neighbors vertices 1 and 2 are not only structurally but also textually similar to the query vertex with multiple words aligned such as tree, index and multi-dimensional. Although vertex 3 is not on the same edge with the query vertex, the semantic relatedness makes it closer than the query’s direct neighbors such as vertex 4 and 5. This is an illustration that the embeddings learned by DMTE successfully incorporate both structure and text information, helping to explain the quality of the aforementioned results. 6 Conclusions We have proposed a new DMTE model for textual network embedding. Unlike existing embedding methods, that neglect semantic relatedness between texts or only exploit local pairwise relationship, the proposed method integrates global structural information of the graph to capture the level of connectivity between any two texts, by applying a diffusion convolutional operation on the text inputs. Furthermore, we designed a new objective that preserves high-order proximity, by including a diffusion map in the conditional probability. We conducted experiments on three real-word networks for multi-label classification and link prediction, and the associated results demonstrate the superiority of the proposed DMTE model. Acknowledgments The authors would like to thank the anonymous reviewers for their insightful comments. This research was supported in part by DARPA, DOE, NIH, ONR and NSF. References [1] E. Abrahamson and L. Rosenkopf. Social network effects on the extent of innovation diffusion: A computer simulation. Organization science, 1997. [2] J. Atwood and D. Towsley. Diffusion-convolutional neural networks. In NIPS, 2016. [3] M. Belkin and P. Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. In Advances in neural information processing systems, 2002. [4] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent dirichlet allocation. Journal of machine Learning research, 2003. [5] S. Cao, W. Lu, and Q. Xu. Grarep: Learning graph representations with global structural information. In Proceedings of the 24th ACM International on Conference on Information and Knowledge Management. ACM, 2015. [6] Z. Gan, Y. Pu, R. Henao, C. Li, X. He, and L. Carin. Learning generic sentence representations using convolutional neural networks. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, 2017. [7] A. Graves, N. Jaitly, and A.-r. Mohamed. Hybrid speech recognition with deep bidirectional lstm. In Automatic Speech Recognition and Understanding (ASRU), 2013 IEEE Workshop on. IEEE, 2013. 9 [8] A. Grover and J. Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2016. [9] M. Iyyer, V. Manjunatha, J. Boyd-Graber, and H. Daumé III. Deep unordered composition rivals syntactic methods for text classification. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), volume 1, 2015. [10] N. Kalchbrenner, E. Grefenstette, and P. Blunsom. A convolutional neural network for modelling sentences. arXiv preprint arXiv:1404.2188, 2014. [11] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [12] R. Kiros, Y. Zhu, R. R. Salakhutdinov, R. Zemel, R. Urtasun, A. Torralba, and S. Fidler. Skip-thought vectors. In Advances in neural information processing systems, 2015. [13] Q. Le and T. Mikolov. Distributed representations of sentences and documents. In International Conference on Machine Learning, 2014. [14] L. Lü and T. Zhou. Link prediction in complex networks: A survey. Physica A: statistical mechanics and its applications, 2011. [15] A. K. McCallum, K. Nigam, J. Rennie, and K. Seymore. Automating the construction of internet portals with machine learning. Information Retrieval, 2000. [16] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [17] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, 2013. [18] J. Mitchell and M. Lapata. Composition in distributional models of semantics. Cognitive science, 2010. [19] S. Pan, J. Wu, X. Zhu, C. Zhang, and Y. Wang. Tri-party deep network representation. Network, 2016. [20] B. Perozzi, R. Al-Rfou, and S. Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2014. [21] S. T. Roweis and L. K. Saul. Nonlinear dimensionality reduction by locally linear embedding. science, 2000. [22] P. Sen, G. Namata, M. Bilgic, L. Getoor, B. Galligher, and T. Eliassi-Rad. Collective classification in network data. AI magazine, 2008. [23] D. Shen, G. Wang, W. Wang, M. Renqiang Min, Q. Su, Y. Zhang, C. Li, R. Henao, and L. Carin. Baseline needs more love: On simple word-embedding-based models and associated pooling mechanisms. In ACL, 2018. [24] D. Shen, X. Zhang, R. Henao, and L. Carin. Improved semantic-aware network embedding with fine-grained word alignment. arXiv preprint arXiv:1808.09633, 2018. [25] R. Socher, A. Perelygin, J. Wu, J. Chuang, C. D. Manning, A. Ng, and C. Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, 2013. [26] X. Sun, J. Guo, X. Ding, and T. Liu. A general framework for content-enhanced network representation learning. arXiv preprint arXiv:1610.02906, 2016. 10 [27] J. Tang, M. Qu, M. Wang, M. Zhang, J. Yan, and Q. Mei. Line: Large-scale information network embedding. In Proceedings of the 24th International Conference on World Wide Web. International World Wide Web Conferences Steering Committee, 2015. [28] J. Tang, J. Zhang, L. Yao, J. Li, L. Zhang, and Z. Su. Arnetminer: extraction and mining of academic social networks. In Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2008. [29] J. B. Tenenbaum, V. De Silva, and J. C. Langford. A global geometric framework for nonlinear dimensionality reduction. science, 2000. [30] C. Tu, H. Liu, Z. Liu, and M. Sun. Cane: Context-aware network embedding for relation modeling. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), volume 1, 2017. [31] C. Tu, Z. Liu, and M. Sun. Inferring correspondences from multiple sources for microblog user tags. In Chinese National Conference on Social Media Processing. Springer, 2014. [32] D. Wang, P. Cui, and W. Zhu. Structural deep network embedding. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2016. [33] C. Yang, Z. Liu, D. Zhao, M. Sun, and E. Y. Chang. Network representation learning with rich text information. In IJCAI, 2015. [34] X. Zhang, R. Henao, Z. Gan, Y. Li, and L. Carin. Multi-label learning from medical plain text with convolutional residual models. arXiv preprint arXiv:1801.05062, 2018. 11
2018
151
7,310
Out-of-Distribution Detection using Multiple Semantic Label Representations Gabi Shalev Bar-Ilan University, Israel shalev.gabi@gmail.com Yossi Adi Bar-Ilan University, Israel yossiadidrum@gmail.com Joseph Keshet Bar-Ilan University, Israel jkeshet@cs.biu.ac.il Abstract Deep Neural Networks are powerful models that attained remarkable results on a variety of tasks. These models are shown to be extremely efficient when training and test data are drawn from the same distribution. However, it is not clear how a network will act when it is fed with an out-of-distribution example. In this work, we consider the problem of out-of-distribution detection in neural networks. We propose to use multiple semantic dense representations instead of sparse representation as the target label. Specifically, we propose to use several word representations obtained from different corpora or architectures as target labels. We evaluated the proposed model on computer vision, and speech commands detection tasks and compared it to previous methods. Results suggest that our method compares favorably with previous work. Besides, we present the efficiency of our approach for detecting wrongly classified and adversarial examples. 1 Introduction Deep Neural Networks (DNNs) have gained lots of success after enabling several breakthroughs in notably challenging problems such as image classification [12], speech recognition [1] and machine translation [4]. These models are known to generalize well on inputs that are drawn from the same distribution as of the examples that were used to train the model [43]. In real-world scenarios, the input instances to the model can be drawn from different distributions, and in these cases, DNNs tend to perform poorly. Nevertheless, it was observed that DNNs often produce high confidence predictions for unrecognizable inputs [33] or even for a random noise [13]. Moreover, recent works in the field of adversarial examples generation show that due to small input perturbations, DNNs tend to produce high probabilities while being greatly incorrect [11, 6, 17]. When considering AI Saftey, it is essential to train DNNs that are aware of the uncertainty in the predictions [2]. Since DNNs are ubiquitous, present in nearly all segments of technology industry from self-driving cars to automated dialog agents, it becomes critical to design classifiers that can express uncertainty when predicting out-of-distribution inputs. Recently, several studies proposed different approaches to handle this uncertainty [13, 25, 23, 19]. In [13] the authors proposed a baseline method to detect out-of-distribution examples based on the models’ output probabilities. The work in [25] extended the baseline method by using temperature scaling of the softmax function and adding small controlled perturbations to inputs [14]. In [23] it was suggested to add another term to the loss so as to minimize the Kullback-Leibler (KL) divergence between the models’ output for out-of-distribution samples and the uniform distribution. Ensemble of classifiers with optional adversarial training was proposed in [19] for detecting out-ofdistribution examples. Despite their high detection rate, ensemble methods require the optimization of several models and therefore are resource intensive. Additionally, each of the classifiers participated in the ensemble is trained independently and the representation is not shared among them. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In this work, we replace the traditional supervision during training by using several word embeddings as the model’s supervision, where each of the embeddings was trained on a different corpus or with a different architecture. More specifically, our classifier is composed of several regression functions, each of which is trained to predict a word embedding of the target label. At inference time, we gain robustness in the prediction by making decision based on the output of the regression functions. Additionally, we use the L2-norm of the outputs as a score for detecting out-of-distribution instances. We were inspired by several studies. In [26] the authors presented a novel technique for robust transfer learning, where they proposed to optimize multiple orthogonal predictors while using a shared representation. Although being orthogonal to each other, according to their results, the predictors were likely to produce identical softmax probabilities. Similarly, we train multiple predictors that share a common representation, but instead of using the same supervision and forcing orthogonality between them, we use different supervisions based on word representations. The idea of using word embeddings as a supervision was proposed in [8] for the task of zero-shot learning. As opposed to ours, their model was composed of a single predictor. Last, [39] found a link between the L2-norm of the input representation and the ability to discriminate in a target domain. We continue this thread here, where we explore the use of the L2-norm for detecting out-of-distribution samples. The contributions of this paper are as follows: • We propose using several different word embeddings as a supervision to gain diversity and redundancy in an ensemble model with a shared representation. • We propose utilizing the semantic structure between word embeddings to produce semantic quality predictions. • We propose using the L2-norm of the output vectors for detecting out-of-distribution inputs. • We examined the use of the above approach for detecting adversarial examples and wrongly classified examples. The outline of this paper is as follows. In Section 2, we formulate the notations in the paper. In Section 3 we describe our approach in detail. Section 4 summarizes our empirical results. In Sections 5 and Section 6 we explore the use of our method for detecting adversarial examples and wrongly classified examples. In Section 7 we list the related works, and we conclude the paper in Section 8. 2 Notations and Definitions We denote by X ⊆Rp the set of instances, which are represented as p-dimensional feature vectors, and we denote by Y = {1, . . . , N} the set of class labels. Each label can be referred as a word, and the set Y can be considered as a dictionary. We assume that each training example (x, y) ∈X × Y is drawn from a fixed but unknown distribution ρ. Our goal is to train a classifier that performs well on unseen examples that are drawn from the distribution ρ, and can also identify out-of-distribution examples, which are drawn from a different distribution, µ. Our model is based on word embedding representations. A word embedding is a mapping of a word or a label in the dictionary Y to a real vector space Z ⊆RD, so that words that are semantically closed have their corresponding vectors close in Z. Formally, the word embedding is a function e : Y →Z from the set of labels Y to an abstract vector space Z. We assume that distances in the embedding space Z are measured using the cosine distance which is defined for two vectors u, v ∈Z as follows: dcos(u, v) = 1 2  1 − u · v ∥u∥∥v∥  . (1) Two labels are considered semantically similar if and only if their corresponding embeddings are close in Z, namely, when dcos(e(y1), e(y2)) is close to 0. When the cosine distance is close to 1, the corresponding labels are semantically far apart. 3 Model Our goal is to build a robust classifier that can identify out-of-distribution inputs. In communication theory, robustness is gained by adding redundancy in different levels of the transmission encoding [20]. 2 x <latexit sha1_base64="5wjrnOk 9QryL9pe/o3mQy34hyA=">ADi3icbZLdbtMwFMfPGj5GYbDBJTcWF dKuqgQkQGjSJiEkLsdKt25NVTmOs1nzR2Q7pZWVN+AWnoYLXoMH4R6nK WqaciRLx+d3Pv62TpJzZmwY/t7pBHfu3ru/+6D78NHe4yf7B0/PjSo0o UOiuNKjBvKmaRDyno1xTLBJOL5LbDxW/mFtmJf7CKnE4GvJcsYw daHzuL5dL8X9sOloW0nWjm945+Hf34BwOn0oGPiVJFCUGkJx8aMozC3E 4e1ZYTshsXhuaY3OJrOvauxIKaiVtKLdFLH0lRprQ/0qJltFnhsDBmI RKfKbC9MW1WBf/HxoXN3k0ck3lhqST1oKzgyCpUvRulTFNi+cI7mGjmt SJygzUm1v9ON5b0K1FCYJm6eF6uBqQZG5elpuMrhlts8yzRPG0q+4y yquaTOjWFcX23S2pjNP0Ubz0QoSzN2oPfmyAS/b8KoBr7anDhp40K71q 8TNP1mJO2vzlCiP02mdoYWr7u0krkzVI8Ha/x/nbTywGjO5oWLdr2Zl6 dc0ai/ltnP+qh+F/ehz2Dt5A7XtwnN4AYcQwVs4gU9wCkMgkME3+A4/g r3gdfA+OKpTOzurmewYcHvyeiORY=</latexit> <latexit sha1_base64="uVP+j1J wXQcs2UtoXpFx1Oi8FWA=">ADi3icbZLdahNBFMenWT9qtNrqpTeLQ ag3YVdBRQLInhZG9OmzYwM3u2HTofy8xsTBj2DQSv9Gm8i18EO+dz Uay2Xhg4Mz5nY/DIfknBkbRb93OsGNm7du797p3r23d/B/sHDU6MKT WFIFVd6RLABziQMLbMcRrkGLAiHM3L9vuJnM9CGKfnZLnKYCHwpWcYot j50ksyn+72oHy0t3HbildN79/Pwz69vybPj6UHJKmihQBpKcfGjOMot xOHtWUQ9lNCgM5ptf4EsbelViAmbil1DJ86iNpmCntj7ThMtqscFgYs xDEZwpsr0ybVcH/sXFhs9cTx2ReWJC0HpQVPLQqrN4dpkwDtXzhHUw18 1pDeoU1ptb/TjeR8IUqIbBMXTIvXVINIJmbl+UmgzWDNs8I4qnlX7FX VZxDc2MYl1dbNPZms48DTeaj1aQYu5G7cnDXjehcNeLE9dDAg3atX yVu/ski7qTNU6o8Tqd1haureTuDJVD4K1/z/O23hgNWZyQ8W6X83K0 q9p3F7Kbef0eT+O+vGnqHf0EtW2ix6jJ+gQxegVOkIf0TEaIoy9BV9R z+CveBF8CZ4W6d2dlY1j9CGBR/+AmGJOiw=</latexit> <latexit sha1_base64="uVP+j1J wXQcs2UtoXpFx1Oi8FWA=">ADi3icbZLdahNBFMenWT9qtNrqpTeLQ ag3YVdBRQLInhZG9OmzYwM3u2HTofy8xsTBj2DQSv9Gm8i18EO+dz Uay2Xhg4Mz5nY/DIfknBkbRb93OsGNm7du797p3r23d/B/sHDU6MKT WFIFVd6RLABziQMLbMcRrkGLAiHM3L9vuJnM9CGKfnZLnKYCHwpWcYot j50ksyn+72oHy0t3HbildN79/Pwz69vybPj6UHJKmihQBpKcfGjOMot xOHtWUQ9lNCgM5ptf4EsbelViAmbil1DJ86iNpmCntj7ThMtqscFgYs xDEZwpsr0ybVcH/sXFhs9cTx2ReWJC0HpQVPLQqrN4dpkwDtXzhHUw18 1pDeoU1ptb/TjeR8IUqIbBMXTIvXVINIJmbl+UmgzWDNs8I4qnlX7FX VZxDc2MYl1dbNPZms48DTeaj1aQYu5G7cnDXjehcNeLE9dDAg3atX yVu/ski7qTNU6o8Tqd1haureTuDJVD4K1/z/O23hgNWZyQ8W6X83K0 q9p3F7Kbef0eT+O+vGnqHf0EtW2ix6jJ+gQxegVOkIf0TEaIoy9BV9R z+CveBF8CZ4W6d2dlY1j9CGBR/+AmGJOiw=</latexit> <latexit sha1_base64="irjMf6A I3iH2bTbZS+MwUqDa7yU=">ADi3icbZLdbtMwFMe9BtgoDa45MaiQ uKqSkAa07SLSQhpl2OlW7emqhznZLPmj8h2Sisrb7BbeDfeBqcNapyJ EvH5/c/H7ZOknNmbBj+2ekET54+29173n3xcv/V64PDN1dGFZrCkCqu9 CghBjiTMLTMchjlGohIOFwnD18rfj0DbZiSP+wih4kgd5JljBLrQ5fxf HrQC/vh0vC2E9VOD9V2MT3smDhVtBAgLeXEmHEU5nbiLaMci7cWEgJ /SB3MHYu5IMBO3HLXEH3wkxZnS/kiLl9FmhiPCmIVIvFIQe2/arAr+j 40Lmx1PHJN5YUHSVaOs4NgqXL0bp0wDtXzhHUI187Niek80odb/TjeW8 JMqIYhMXTwvXVw1SDI3L8tNBmsGbZ5lieVvMr7rKa2gqinV2sU1na zrzFG8UH9WQEu5G7c43DXjThrcNeLvdDAg3auXyVu/o2VuMs2T6nyO J2uFq46t4WcWqGgnR/v84b+OB1YTJjSnW9VasLP2aRu2l3HauPvWjs B9D3tnR/XC7qF36D36iCL0BZ2hc3SBhoiD2iX+h3sB98Dk6C05W0s 1PnvEUbFnz7C6u2Nj4=</latexit> ✓shared <latexit sha1_base64="YAQrKWj 1GCueT3QFCnq/dDhMRvw=">ADnicbZJLb9NAEMe3MY+S8kjpkcuKC olTZHMAjpWQgAuiNKRNG0fWej1uVt2HtbsOjVb+IJy4wkfi23QdB8VxG Gml/85vXhpNWnBmbBj+3esF9+4/eLj/qH/w+MnTZ4PD5+dGlZrCmCqu9 CQlBjiTMLbMcpgUGohIOVykNx9qfrEAbZiS3+2ygJkg15LljBLrXcngK LZzsCRxsRbYzImGrEoGx+EwXBneFdFaHJ8cfPqJvJ0mhz0TZ4qWAqSln BgzjcLCzhzRlEOVT8uDRSE3pBrmHopiQAzc6vpK/zKezKcK+2ftHjlb Wc4IoxZitRHCmLnpstq5/YtLT5+5ljsigtSNo0ykuOrcL1KnDGNFDLl 14QqpmfFVO/AUKtX1g/lvCDKiGIzFx8W7m4bpDm7raqthlsGHRZ7lmqe FbPr7jLa6hHVFustdutjQhad4q/hkDSnhbtLtfNmCl141YJXu1HL Tzq5vr4ubfWKk76/KMKo+zpInQwtX/bhBXpq6REu3x3kXj6wmTG5Ns anXsKo+06h7lLvi/M0wCofRN3+vb1Fj+gFeoleowi9QyfoMzpFY0TRE v1Cv9GfAcfgy/B1ya0t7fOUJbFkzuAP7yPws=</latexit> <latexit sha1_base64="Qz1Eq4z FzajuxUDxqvOwrSu0Jw=">ADnicbZLbtNAFIanMZeScknpspsRF RKryGYBLCshARtEIaR1G0fWeHzcjDoXa2YcGo38IKzYwoPwELwN4zgoi cORvrnfOemo5OVnBkbhn/2esGdu/fu7z/oHzx89PjJ4PDpuVGVpjCmi isdZ8QAZxLGlkOcamBiIzDRXbztuEXc9CGKfnVLkqYCnItWcEosd6VD o4SOwNLUpdogc2MaMjrdHASDsOl4V0RrcTJ6cH78e/4/wsPeyZJFe0E iAt5cSYSRSWduqItoxyqPtJZaAk9IZcw8RLSQSYqVtOX+Pn3pPjQmn/p MVL72aGI8KYhch8pCB2Zrqscf6PTSpbvJk6JsvKgqRto6Li2CrcrALnT AO1fOEFoZr5WTH1GyDU+oX1EwnfqBKCyNwlt7VLmgZ4W7repvBmkGXF Z5liufN/Iq7ouEaNiOqdXa1S+drOvcUbxWPV5AS7uJu58sNeNmFVxvwa rfraAOPurn+urj5N1bmvnR5TpXHedpGaOGafzeIK9PUyIj2+O8i0dWE ya3pljXa1ndnGnUPcpdcf5yGIXD6LO/1eotX10jJ6hFyhCr9Ep+oDO0 BhRtEA/0E/0K8DBu+Bj8KkN7e2tco7QlgXxX8b0QKc=</latexit> <latexit sha1_base64="Qz1Eq4z FzajuxUDxqvOwrSu0Jw=">ADnicbZLbtNAFIanMZeScknpspsRF RKryGYBLCshARtEIaR1G0fWeHzcjDoXa2YcGo38IKzYwoPwELwN4zgoi cORvrnfOemo5OVnBkbhn/2esGdu/fu7z/oHzx89PjJ4PDpuVGVpjCmi isdZ8QAZxLGlkOcamBiIzDRXbztuEXc9CGKfnVLkqYCnItWcEosd6VD o4SOwNLUpdogc2MaMjrdHASDsOl4V0RrcTJ6cH78e/4/wsPeyZJFe0E iAt5cSYSRSWduqItoxyqPtJZaAk9IZcw8RLSQSYqVtOX+Pn3pPjQmn/p MVL72aGI8KYhch8pCB2Zrqscf6PTSpbvJk6JsvKgqRto6Li2CrcrALnT AO1fOEFoZr5WTH1GyDU+oX1EwnfqBKCyNwlt7VLmgZ4W7repvBmkGXF Z5liufN/Iq7ouEaNiOqdXa1S+drOvcUbxWPV5AS7uJu58sNeNmFVxvwa rfraAOPurn+urj5N1bmvnR5TpXHedpGaOGafzeIK9PUyIj2+O8i0dWE ya3pljXa1ndnGnUPcpdcf5yGIXD6LO/1eotX10jJ6hFyhCr9Ep+oDO0 BhRtEA/0E/0K8DBu+Bj8KkN7e2tco7QlgXxX8b0QKc=</latexit> <latexit sha1_base64="wc3erbP 5Dh01pgdrwpLGKifKxc=">ADnicbZJLb9NAEMe3MY8SXik9clkRI XGKbA6UYyWkiguiENKmjSNrvR43q+7D2l2njVb+LFzhI/FtWCdGcRxGW um/85uXRpMWnBkbhn8OesGDh48eHz7pP32/MXLwdGrC6NKTWFCFVd6m hIDnEmYWGY5TAsNRKQcLtPbTzW/XI2TMkfdlXAXJAbyXJGifWuZHAc2 wVYkrhYC2wWRENWJYNhOArXhvdF1Ighauw8OeqZOFO0FCAt5cSYWRQWd u6ItoxyqPpxaAg9JbcwMxLSQSYuVtPX+G3pPhXGn/pMVrbzvDEWHMS qQ+UhC7MF1WO/HZqXNP84dk0VpQdJNo7zk2CpcrwJnTAO1fOUFoZr5W TH1GyDU+oX1Ywl3VAlBZObi+8rFdYM0d/dVtctgy6DLcs9SxbN6fsVdX nMN7Yhym13u0+WLj3FO8WnDaSEu2m381ULXnXhdQte73cdt/C4m+uvi 5t/Y6Xue5dnVHmcJZsILVz97wZxZeoaKdF+f5x38dhqwuTOFNt6G1bVZ xp1j3JfXLwfReEo+hYOTz80B3uIXqM36B2K0Ak6RZ/ROZogilboJ/qFf gc4OAu+BF83ob2DJucY7Vgw/QuCfz3g</latexit> ✓1 excl <latexit sha1_base64="4J5pV5+06gHdt98S1WuhiZzWIQI=">ADn nicbZLbtNAFIanMZcSbimV2LAZUSGximwWhWlShUbRCGkdRsHazw+bkadizUzDolGlngTtvBIPAMvwTgJSuJwpJH+Od+56ehkJWfGhuHvU5w5 +69+/sPug8fPX7ytHfw7MKoSlMYUsWVjNigDMJQ8sh7jUQETG4TK7PW345RS0YUp+sfMSxoLcSFYwSqx3pb3DxE7Akq9R6hItMwor9PeUdgPF 4Z3RbQSRyfPoz/fEULn6UHJLmilQBpKSfGjKwtGNHtGWUQ91NKgMlobfkBkZeSiLAjN1i+hq/8p4cF0r7Jy1eDczHBHGzEXmIwWxE9NmjfN/b FTZ4t3YMVlWFiRdNioqjq3CzSpwzjRQy+deEKqZnxXTCdGEWr+wbiLhG1VCEJm7ZFa7pGmQFW5W19sM1gzarPAsUzxv5lfcFQ3XsBlRrbOrXTpd0 6mneKt4vIKUcBe3O19twKs2vN6A17tdBxt40M718XNv7Ey97nNc6o8ztNlhBau+beDuDJNjYxovz/O23hgNWFya4p1vSWrmzON2ke5Ky7e9KOwH 3y93qMlraPXqCX6DWK0Ft0gt6jczREFM3RD/QT/QpwcBZ8CD4uQzt7q5xDtGVB/BeQSj+W</latexit> <latexit sha1_base64="zqn2ayt59GS5dw5y5pZlanBQl5w=">ADn nicbZLdahNBFMenWT9q/EoteCPIYBG8CrteqJcFQbwRa2PatNm4zM6ebYbOxzIzGxOGvfQ5vNU38FV8Bl/C2WwkycYDA/85v/PF4aQFZ8aG4e+9T nDj5q3b+3e6d+/df/Cwd/DozKhSUxhSxZUepcQAZxKGlkOo0IDESmH8/T6bc3PZ6ANU/KzXRQwEeRKspxRYr0r6R3GdgqWfIkSF2uBYU5lfSOw n64NLwropU4On4c/fn29NfpSXLQMXGmaClAWsqJMeMoLOzEW0Z5VB149JAQeg1uYKxl5IMBO3nL7Cz70nw7nS/kmLl97NDEeEMQuR+khB7NS0W e38HxuXNn8zcUwWpQVJm0Z5ybFVuF4FzpgGavnC0I187NiOiWaUOsX1o0lfKVKCIzF8rF9cN0tzNq2qbwZpBm+WepYpn9fyKu7zmGjYjynV2u UtnazrzFG8VH60gJdyN2p0vNuBFG15uwMvdroMNPGjn+uvi5t9YqTt84wqj7OkidDC1f92EFemrpES7fHeRsPrCZMbk2xrtewqj7TqH2Uu+LsZ T8K+9Enf6+vUGP76Al6hl6gCL1Gx+g9OkFDRNECfUc/0M8AB+CD8HJrSzt8o5RFsWjP4CDfRAw=</latexit> <latexit sha1_base64="zqn2ayt59GS5dw5y5pZlanBQl5w=">ADn nicbZLdahNBFMenWT9q/EoteCPIYBG8CrteqJcFQbwRa2PatNm4zM6ebYbOxzIzGxOGvfQ5vNU38FV8Bl/C2WwkycYDA/85v/PF4aQFZ8aG4e+9T nDj5q3b+3e6d+/df/Cwd/DozKhSUxhSxZUepcQAZxKGlkOo0IDESmH8/T6bc3PZ6ANU/KzXRQwEeRKspxRYr0r6R3GdgqWfIkSF2uBYU5lfSOw n64NLwropU4On4c/fn29NfpSXLQMXGmaClAWsqJMeMoLOzEW0Z5VB149JAQeg1uYKxl5IMBO3nL7Cz70nw7nS/kmLl97NDEeEMQuR+khB7NS0W e38HxuXNn8zcUwWpQVJm0Z5ybFVuF4FzpgGavnC0I187NiOiWaUOsX1o0lfKVKCIzF8rF9cN0tzNq2qbwZpBm+WepYpn9fyKu7zmGjYjynV2u UtnazrzFG8VH60gJdyN2p0vNuBFG15uwMvdroMNPGjn+uvi5t9YqTt84wqj7OkidDC1f92EFemrpES7fHeRsPrCZMbk2xrtewqj7TqH2Uu+LsZ T8K+9Enf6+vUGP76Al6hl6gCL1Gx+g9OkFDRNECfUc/0M8AB+CD8HJrSzt8o5RFsWjP4CDfRAw=</latexit> <latexit sha1_base64="ad5rXwNAa/LW+gDXIs2HtKBhuAI=">ADn nicbZJLj9MwEMe9DY+lvLrskYtFhcSpSjgAx5WQEBfEQulud5sSOc5ka60fke2UVlY+C1f4SHwbnDaoacpIlv6e37w0mrTgzNgw/HPUC+7cvXf/+ EH/4aPHT54OTp5dGFVqChOquNLTlBjgTMLEMsthWmgIuVwmd6+r/nlErRhSn6z6wLmgtxIljNKrHclg9PYLsCS71HiYi0wrCivksEwHIUbw4cia sQNXaenPRMnClaCpCWcmLMLAoLO3dEW0Y5VP24NFAQektuYOalJALM3G2mr/BL78lwrR/0uKNt53hiDBmLVIfKYhdmC6rnf9js9Lm7+aOyaK0I Om2UV5ybBWuV4EzpoFavaCUM38rJguiCbU+oX1Ywk/qBKCyMzFq8rFdYM0d6uq2mewY9BluWep4lk9v+Iur7mGdkS5y4P6XJHl57iveLTBlLC3 bTb+aoFr7rwugWvD7uOW3jczfXxc2/sVL3tcszqjzOkm2EFq7+d4O4MnWNlGi/P867eGw1YXJvil29LavqM426R3koLl6PonAUfQmHZ2+agz1Gz 9EL9ApF6C06Qx/ROZogitboJ/qFfgc4+B8Cj5vQ3tHTc4p2rNg+hfDT2k</latexit> ✓2 excl <latexit sha1_base64="L7MZMrF13/wJcd1gsYREjZr7DAc=">ADn nicbZLbtNAFIanMZcSbimV2LAZUSGxiuwugGUlpIoNohDSuo2DNR4fN6POxZoZp4lGlngTtvBIPAMvwTgJSuJwpJH+Od+56ehkJWfGhuHvU5w5 +69+/sPug8fPX7ytHfw7NyoSlMYUsWVjNigDMJQ8sh7jUQETG4SK7ed/wiylow5T8aucljAW5lqxglFjvSnuHiZ2AJd+OU5dogWFGeZ32jsJ+u DC8K6KVODp5Hv35jhA6Sw86JskVrQRISzkxZhSFpR07oi2jHOpuUhkoCb0h1zDyUhIBZuwW09f4lfkuFDaP2nxwruZ4YgwZi4yHymInZg2a5z/Y 6PKFu/GjsmysiDpslFRcWwVblaBc6aBWj73glDN/KyYTogm1PqFdRMJt1QJQWTuklntkqZBVrhZXW8zWDNos8KzTPG8mV9xVzRcw2ZEtc6udul0T ae4q3i8QpSwl3c7ny5AS/b8GoDXu12HWzgQTvXxc3/8bK3Jc2z6nyOE+XEVq45t8O4so0NTKi/f4b+OB1YTJrSnW9Zasbs40ah/lrjg/7kdhP /rs7/UNWto+eoFeotcoQm/RCfqAztAQUTRHP9BP9CvAwWnwMfi0DO3srXIO0ZYF8V+Tez+X</latexit> <latexit sha1_base64="7MpCRnJhGiU8gxhNPAXOXrcEg0w=">ADn nicbZLdahNBFMenWbU1fqUWvBFksAhehd1e1F4WBPFGrI1p02ZjmJ092wydj2VmNiYMe+lzeKtv4Kv4DL6Es9lIko0HBv5zfueLw0lyzowNw987r eDO3Xu7e/fbDx4+evyks/0wqhCU+hTxZUeJMQAZxL6lkOg1wDEQmHy+T2bcUvp6ANU/KznecwEuRGsoxRYr1r3DmI7Qs+XI0drEWGaUl+POY dgNF4a3RbQUh6fPoj/fXvw6Pxvt0ycKloIkJZyYswCnM7ckRbRjmU7bgwkBN6S25g6KUkAszILaYv8SvSXGmtH/S4oV3PcMRYcxcJD5SEDsxT VY5/8eGhc1ORo7JvLAgad0oKzi2ClerwCnTQC2fe0GoZn5WTCdE2r9wtqxhK9UCUFk6uJZ6eKqQZK5WVluMlgxaLMs0TxtJpfcZdVXMN6RLHKL rbpdEWnuKN4oMlpIS7QbPz1Rq8asLrNXi93bW3hnvNXH9d3PwbK3HnTZ5S5XE6riO0cNW/GcSVqWokRPv9cd7EPasJkxtTrOrVrKzONGoe5ba4O OpGYTf65O/1GNW2h56jl+g1itAbdIreozPURxTN0Xf0A/0McPAu+B8rENbO8ucA7RhweAvESVAxA=</latexit> <latexit sha1_base64="7MpCRnJhGiU8gxhNPAXOXrcEg0w=">ADn nicbZLdahNBFMenWbU1fqUWvBFksAhehd1e1F4WBPFGrI1p02ZjmJ092wydj2VmNiYMe+lzeKtv4Kv4DL6Es9lIko0HBv5zfueLw0lyzowNw987r eDO3Xu7e/fbDx4+evyks/0wqhCU+hTxZUeJMQAZxL6lkOg1wDEQmHy+T2bcUvp6ANU/KznecwEuRGsoxRYr1r3DmI7Qs+XI0drEWGaUl+POY dgNF4a3RbQUh6fPoj/fXvw6Pxvt0ycKloIkJZyYswCnM7ckRbRjmU7bgwkBN6S25g6KUkAszILaYv8SvSXGmtH/S4oV3PcMRYcxcJD5SEDsxT VY5/8eGhc1ORo7JvLAgad0oKzi2ClerwCnTQC2fe0GoZn5WTCdE2r9wtqxhK9UCUFk6uJZ6eKqQZK5WVluMlgxaLMs0TxtJpfcZdVXMN6RLHKL rbpdEWnuKN4oMlpIS7QbPz1Rq8asLrNXi93bW3hnvNXH9d3PwbK3HnTZ5S5XE6riO0cNW/GcSVqWokRPv9cd7EPasJkxtTrOrVrKzONGoe5ba4O OpGYTf65O/1GNW2h56jl+g1itAbdIreozPURxTN0Xf0A/0McPAu+B8rENbO8ucA7RhweAvESVAxA=</latexit> <latexit sha1_base64="v4xnB8HI7o4PgV7wWFi4UdmEKk=">ADn nicbZJLb9NAEMe3MY8SXik9clkRIXGK7B4ox0pIVS+IQkjrNg7Wej1uVt2HtbsOiVb+LFzhI/FtWCdBSRxGWum/85uXRpOVnBkbhn8OsGDh48eH z7pPn32/MXL3tGrK6MqTWFEFVc6zogBziSMLMc4lIDERmH6+z+Y8OvZ6ANU/KbXZQwEeROsoJRYr0r7R0ndgqWfD9JXaIFhjnldrh4NwaXhfR GvR2u7TI86JskVrQRISzkxZhyFpZ04oi2jHOpuUhkoCb0ndzD2UhIBZuKW09f4rfkuFDaP2nx0rud4YgwZiEyHymInZo2a5z/Y+PKFh8mjsmys iDpqlFRcWwVblaBc6aBWr7wglDN/KyYTokm1PqFdRMJP6gSgsjcJfPaJU2DrHDzut5lsGHQZoVnmeJ5M7/irmi4hu2IapNd7dPZhs48xTvF4zWkh Lu43flmC9604e0WvN3vOtzCw3auvy5u/o2Vua9tnlPlcZ6uIrRwzb8dxJVpamRE+/1x3sZDqwmTO1Ns6q1Y3Zxp1D7KfXF1MojCQfQl7J+9Xx/sI XqN3qB3KEKn6AxdoEs0QhQt0E/0C/0OcHAefAo+r0I7B+ucY7RjQfwXxj49pQ=</latexit> ✓K excl <latexit sha1_base64="tj079oxGL0tvEhaqG8UfH0l5SLs=">ADn nicbZJbaxNBFMenWS9tvKUWfPFlsAg+hV0f1MeCIKI1Zh2xcZmfPNkPnszMxoRhwW/iq34kP0O/hLNJMnGAwP/Ob9z43CykjNjw/DPXie4d fvO3f2D7r37Dx4+6h0+PjOq0hSGVHGl4wY4EzC0DLIS41EJFxOM+u3zb8fAraMCW/2nkJY0GuJCsYJda70t5RYidgybcPqUu0wDCjvE57x2E/X BjeFdFKHJ8iW5+IRO08OSXJFKwHSUk6MGUVhaceOaMsoh7qbVAZKQq/JFYy8lESAGbvF9DV+7j05LpT2T1q8G5mOCKMmYvMRwpiJ6bNGuf/2 KiyxZuxY7KsLEi6bFRUHFuFm1XgnGmgls+9IFQzPyumE6IJtX5h3UTCd6qEIDJ3yax2SdMgK9ysrcZrBm0WeFZpnjezK+4KxquYTOiWmdXu3S6p lNP8VbxeAUp4S5ud7YgBdteLkBL3e7DjbwoJ3r4ubf2Nl7kub51R5nKfLC1c828HcWaGhnRfn+ct/HAasLk1hTrektWN2catY9yV5y97EdhP /rs7/UVWto+eoqeoRcoQq/RCXqPTtEQUTRHP9Ev9DvAwbvgY/BpGdrZW+UcoS0L4r/jRD+w</latexit> <latexit sha1_base64="fmKrGb0LxROBthB9UEsEm24r+EA=">ADn nicbZLdahNBFMenWbU1fqUWvBFksAhehd1eqJeFgi1sa0abMxzM6ebYbOxzIzGxOGvfQ5vNU38FV8Bl/C2SzcYDA/85v/PF4SQ5Z8aG4e+dV nDr9p3dvbvte/cfPHzU2X98blShKfSp4koPEmKAMwl9yHQa6BiITDRXJzUvGLKWjDlPxs5zmMBLmWLGOUWO8adw5iOwFLvrwfu1gLDPKy3HnM OyGC8PbIlqJw+Mn0Z9vz36dnY73WyZOFS0ESEs5MWYhbkdOaItoxzKdlwYyAm9Idcw9FISAWbkFtOX+IX3pDhT2j9p8cJbz3BEGDMXiY8UxE5Mk 1XO/7FhYbM3I8dkXliQdNkoKzi2ClerwCnTQC2fe0GoZn5WTCdE2r9wtqxhK9UCUFk6uJZ6eKqQZK5WVluMlgzaLMs0TxtJpfcZdVXEM9olhnF 9t0uqZT/FG8cEKUsLdoNn5sgYvm/CqBq+2u/ZquNfM9dfFzb+xEnfW5ClVHqfjZYQWrvo3g7gyVY2EaL8/zpu4ZzVhcmOKdb0lK6szjZpHuS3Oj 7pR2I0+Xt9hZa2h56i5+glitBrdIzeoVPURxTN0Xf0A/0McPA2+B8XIa2dlY5B2jDgsFfYO5A3Q=</latexit> <latexit sha1_base64="fmKrGb0LxROBthB9UEsEm24r+EA=">ADn nicbZLdahNBFMenWbU1fqUWvBFksAhehd1eqJeFgi1sa0abMxzM6ebYbOxzIzGxOGvfQ5vNU38FV8Bl/C2SzcYDA/85v/PF4SQ5Z8aG4e+dV nDr9p3dvbvte/cfPHzU2X98blShKfSp4koPEmKAMwl9yHQa6BiITDRXJzUvGLKWjDlPxs5zmMBLmWLGOUWO8adw5iOwFLvrwfu1gLDPKy3HnM OyGC8PbIlqJw+Mn0Z9vz36dnY73WyZOFS0ESEs5MWYhbkdOaItoxzKdlwYyAm9Idcw9FISAWbkFtOX+IX3pDhT2j9p8cJbz3BEGDMXiY8UxE5Mk 1XO/7FhYbM3I8dkXliQdNkoKzi2ClerwCnTQC2fe0GoZn5WTCdE2r9wtqxhK9UCUFk6uJZ6eKqQZK5WVluMlgzaLMs0TxtJpfcZdVXEM9olhnF 9t0uqZT/FG8cEKUsLdoNn5sgYvm/CqBq+2u/ZquNfM9dfFzb+xEnfW5ClVHqfjZYQWrvo3g7gyVY2EaL8/zpu4ZzVhcmOKdb0lK6szjZpHuS3Oj 7pR2I0+Xt9hZa2h56i5+glitBrdIzeoVPURxTN0Xf0A/0McPA2+B8XIa2dlY5B2jDgsFfYO5A3Q=</latexit> <latexit sha1_base64="4BFOsL05clzxtIs/Lp6AxvYs2EM=">ADn nicbZJb9MwFMe9hsot498mJRIfFUJTwHichTZMQYlC6ZWtK5DgnqzVfItsprax8Fl7hI/FtcNqitilHsvT3+Z2bjk5WcmZsGP456AT37j94e Pio+/jJ02fPe0cvLo2qNIURVzpOCMGOJMwsxyiEsNRGQcrK7Dw2/moE2TMlvdlHCRJBbyQpGifWutHec2ClY8v1j6hItMwpr9NePxyES8P7I lqLPlrbRXrUMUmuaCVAWsqJMeMoLO3EW0Z5VB3k8pASegduYWxl5IMBO3nL7Gr70nx4XS/kmLl97tDEeEMQuR+UhB7NS0WeP8HxtXtng/cUyWl QVJV42KimOrcLMKnDMN1PKF4Rq5mfFdEo0odYvrJtI+EGVETmLpnXLmkaZIWb1/Uugw2DNis8yxTPm/kVd0XDNWxHVJvsap/ONnTmKd4pHq8hJ dzF7c7XW/C6DW+24M1+1+EWHrZz/XVx82+szH1t85wqj/N0FaGFa/7tIK5MUyMj2u+P8zYeWk2Y3JliU2/F6uZMo/ZR7ovLt4MoHERfwv7pu/XBH qKX6BV6gyJ0gk7RObpAI0TRAv1Ev9DvAdnwafg8yq0c7DOUY7FsR/ARYWPb4=</latexit> f K ✓K <latexit sha1_base64="Gx7V+LPC+gaLkbPTAdCgGshmQuY=">ADm nicbZJLb9NAEMe3MdASHk3hOBgUSFximwOwLEqF1AuhTRt2ji1utxs+o+rN1aLTyJ+EKH6o3znwK1nFQHIeRVvrv/Oal0SQ5o9oEwd1Ox7t3/ 8Hu3sPuo8dPnu73Dp6daVkoAiMimVTjBGtgVMDIUMNgnCvAPGFwntx8qvj5HJSmUpyaRQ5Tjq8FzSjBxrni3n6UXQ1iG5kZGHw1KOPeYdAPluZvi 3AlDo9e3P35jRA6iQ86OkolKTgIQxjWehIGuZlarAwlDMpuVGjIMbnB1zBxUmAOemqXk5f+G+dJ/Uwq94Txl95mhsVc6wVPXCTHZqbrHL+j0Kk 32cWirywoAgdaOsYL6RfrUGP6UKiGELJzBR1M3qkxlWmBi3rG4k4DuRnGOR2ui2tFHVIMnsbVluMlgzaLPMsUSytJpfMptVXEzolhnF9t0vqZzR /2N4uMVJjZcbvzRQNetOFlA15udx028LCd6y6L6X9jJfZbm6dEOpzGdYTitvq3g5jUVY0EK7c/xtp4aBSmYmOKdb2aldWZhu2j3BZn7/ph0A+/u nt9j2rbQy/Ra/QWhegDOkKf0QkaIYIK9AP9RL+8V96x98Ub1KGdnVXOc7Rh3ulfNXk+9g=</latexit> <latexit sha1_base64="5qJ8/fZ3engjkGTeHbfNcMioxU=">ADm nicbZLNbtNAEMe3MdCSFprCcHBokLiFNkcgGNVLqBcCmnapHFqrdfjZtX9sHbXodHKT8IVHqoHXoCnYJ0ExXEYaX/zm+NJokZ1SbILjfaXkPH j7a3Xvc3j948vSwc/TsQstCERgQyaQaJlgDowIGhoGw1wB5gmDy+T2U8UvZ6A0leLczHOYcHwjaEYJNs4Vdw6j7LoX28hMweDrXhl3joNusDB/W 4QrcXzy4v7P79HB/l81NJRKknBQRjCsNbjMjNxGJlKGFQtqNCQ47JLb6BsZMCc9ATu5i89N84T+pnUrknjL/w1jMs5lrPeIiOTZT3WSV839sX Jjs48RSkRcGBFk2ygrmG+lXa/BTqoAYNncCE0XdrD6ZYoWJctqRwK+E8k5FqmN7kobVQ2SzN6V5SaDNYMmyxLJEur+SWzWcUV1COKdXaxTWdrO nPU3yg+XEGCmR02O49qcNSEVzV4td21X8P9Zq67LKb/jZXYb02eEulwGi8jFLfVvxnEpK5qJFi5/THWxH2jMBUbU6zrLVlZnWnYPMptcfGuGwbd8 Ku71/doaXvoJXqN3qIQfUAn6DM6QwNEUIF+oJ/ol/fKO/W+eL1laGtnlfMcbZh3/hd5aD9j</latexit> <latexit sha1_base64="5qJ8/fZ3engjkGTeHbfNcMioxU=">ADm nicbZLNbtNAEMe3MdCSFprCcHBokLiFNkcgGNVLqBcCmnapHFqrdfjZtX9sHbXodHKT8IVHqoHXoCnYJ0ExXEYaX/zm+NJokZ1SbILjfaXkPH j7a3Xvc3j948vSwc/TsQstCERgQyaQaJlgDowIGhoGw1wB5gmDy+T2U8UvZ6A0leLczHOYcHwjaEYJNs4Vdw6j7LoX28hMweDrXhl3joNusDB/W 4QrcXzy4v7P79HB/l81NJRKknBQRjCsNbjMjNxGJlKGFQtqNCQ47JLb6BsZMCc9ATu5i89N84T+pnUrknjL/w1jMs5lrPeIiOTZT3WSV839sX Jjs48RSkRcGBFk2ygrmG+lXa/BTqoAYNncCE0XdrD6ZYoWJctqRwK+E8k5FqmN7kobVQ2SzN6V5SaDNYMmyxLJEur+SWzWcUV1COKdXaxTWdrO nPU3yg+XEGCmR02O49qcNSEVzV4td21X8P9Zq67LKb/jZXYb02eEulwGi8jFLfVvxnEpK5qJFi5/THWxH2jMBUbU6zrLVlZnWnYPMptcfGuGwbd8 Ku71/doaXvoJXqN3qIQfUAn6DM6QwNEUIF+oJ/ol/fKO/W+eL1laGtnlfMcbZh3/hd5aD9j</latexit> <latexit sha1_base64="fo5KiR9c19JAmR0wVTldwTVI2nU=">ADm nicbZJLb9NAEMe3MdASHk3hCAeLCIlTZHOAHiu4gHIpTdOmjVNrvR43q+7D2l2HRit/Eq7wofg2XSdGcRxGWum/85uXRpPkjGoTBH/3Ot6jx0/2D 52nz1/8fKwd/TqQstCERgTyaSaJFgDowLGhoGk1wB5gmDy+Tua8UvF6A0leLcLHOYcXwraEYJNs4V9w6j7GY28jMweCbYRn3+sEgWJm/K8Ja9 Ftp/FR0epJAUHYQjDWk/DIDczi5WhEHZjQoNOSZ3+BamTgrMQc/savLSf+8qZ9J5Z4w/srbzLCYa73kiYvk2Mx1m1XO/7FpYbLjmaUiLwIs m6UFcw30q/W4KdUATFs6QmirpZfTLHChPjltWNBPwknMsUhvdlzaqGiSZvS/LbQYbBm2WOZIlbzS2azitoRhSb7GKXLjZ04ai/VXxSQ4KZn bQ7XzXgVRteN+D1btdRA4/aue6ymP43VmLP2jwl0uE0Xkcobqt/O4hJXdVIsHL7Y6yNR0ZhKram2NRbs7I607B9lLvi4uMgDAbhj6B/8qk+2AP0B r1DH1CIPqMT9A2dojEiqEC/0G/0x3vrfG+e8N1aGevznmNtsw7fwBO8zv6</latexit> f 2 ✓2 <latexit sha1_base64="BVvO1YdpYTEOVHgbilQJFhA20BE=">ADm nicbZJLb9NAEMe3MY8SHk3hgQHiwiJU2TnAByr9gLiUkjTpo1Ta70eN6vuw9pdh0YrfxKu8JkQ34Z1HBTHYaSV/ju/eWk0Sc6oNkHwZ6/j3bv/4 OH+o+7jJ0+fHfQOn59rWSgCYyKZVJMEa2BUwNhQw2CSK8A8YXCR3J5U/GIBSlMpzswyhxnHN4JmlGDjXHvIMquh7GNzBwMvh6Wca8fDIKV+bsiX Iv+0cv+bx8hdBofdnSUSlJwEIYwrPU0DHIzs1gZShiU3ajQkGNyi29g6qTAHPTMriYv/bfOk/qZVO4J46+8zQyLudZLnrhIjs1ct1nl/B+bFib7O LNU5IUBQepGWcF8I/1qDX5KFRDlk5goqib1SdzrDAxblndSMB3IjnHIrXRXWmjqkGS2buy3GawYdBmWOJZGk1v2Q2q7iCZkSxyS526WJDF476W 8Una0gws5N258sGvGzDqwa82u06auBRO9dFtP/xkrstzZPiXQ4jesIxW31bwcxqasaCVZuf4y18cgoTMXWFJt6NSurMw3bR7krzoeDMBiEX929v ke17aNX6A16h0L0AR2hT+gUjRFBfqBfqJf3mv2PvsfalDO3vrnBdoy7yzvwBQPTo=</latexit> <latexit sha1_base64="7pyYROFbxRTiMb2nS3NAdIWIOwc=">ADm nicbZJLb9NAEMe3MY8SHk3hgQHiwiJU2TnAFyQKriAuBTStGnj1Fqvx82q+7B216HRyp+Ea/lMiG/DOg6K4zDSv+d37w0miRnVJsg+LPX8e7cv Xd/0H34aPHTw56h09PtSwUgTGRTKpJgjUwKmBsqGEwyRVgnjA4S64/VfxsAUpTKU7MocZx1eCZpRg41x7yDKLoexjcwcDL4clnGvHwyClfm7I lyL/tHz/u/uh/z2OD7s6CiVpOAgDGFY62kY5GZmsTKUMCi7UaEhx+QaX8HUSYE56JldTV76r50n9TOp3BPGX3mbGRZzrZc8cZEcm7lus8r5PzYtT PZ+ZqnICwOC1I2ygvlG+tUa/JQqIYtncBEUTerT+ZYWLcsrqRgB9Eco5FaqOb0kZVgySzN2W5zWDoM0yxLJ0mp+yWxWcQXNiGKTXezSxYuH PW3ik/WkGBmJ+3O5w143oYXDXix23XUwKN2rspv+NldjvbZ4S6XAa1xGK2+rfDmJSVzUSrNz+GvjkVGYiq0pNvVqVlZnGraPclecDgdhMAi/u Xt9i2rbRy/QK/QGhegdOkKf0TEaI4IK9BPdol/eS+j98X7Wod29tY5z9CWeSd/AacSPnU=</latexit> <latexit sha1_base64="7pyYROFbxRTiMb2nS3NAdIWIOwc=">ADm nicbZJLb9NAEMe3MY8SHk3hgQHiwiJU2TnAFyQKriAuBTStGnj1Fqvx82q+7B216HRyp+Ea/lMiG/DOg6K4zDSv+d37w0miRnVJsg+LPX8e7cv Xd/0H34aPHTw56h09PtSwUgTGRTKpJgjUwKmBsqGEwyRVgnjA4S64/VfxsAUpTKU7MocZx1eCZpRg41x7yDKLoexjcwcDL4clnGvHwyClfm7I lyL/tHz/u/uh/z2OD7s6CiVpOAgDGFY62kY5GZmsTKUMCi7UaEhx+QaX8HUSYE56JldTV76r50n9TOp3BPGX3mbGRZzrZc8cZEcm7lus8r5PzYtT PZ+ZqnICwOC1I2ygvlG+tUa/JQqIYtncBEUTerT+ZYWLcsrqRgB9Eco5FaqOb0kZVgySzN2W5zWDoM0yxLJ0mp+yWxWcQXNiGKTXezSxYuH PW3ik/WkGBmJ+3O5w143oYXDXix23XUwKN2rspv+NldjvbZ4S6XAa1xGK2+rfDmJSVzUSrNz+GvjkVGYiq0pNvVqVlZnGraPclecDgdhMAi/u Xt9i2rbRy/QK/QGhegdOkKf0TEaI4IK9BPdol/eS+j98X7Wod29tY5z9CWeSd/AacSPnU=</latexit> <latexit sha1_base64="ZkZJ7HwRYMNb0oQzgwVdVg+OUJY=">ADm nicbZJLb9NAEMe3MdASHk3hCAeLCIlTZOcAPVZwAXFpSdOmjVNrvR43q+7D2l2HRit/Eq7wofg2XSdGcRxGWum/85uXRpPkjGoTBH/3Ot6jx0/2D 52nz1/8fKwd/TqQstCERgTyaSaJFgDowLGhoGk1wB5gmDy+TuS8UvF6A0leLcLHOYcXwraEYJNs4V9w6j7GY28jMweCbYRn3+sEgWJm/K8Ja9 Ftp/FR0epJAUHYQjDWk/DIDczi5WhEHZjQoNOSZ3+BamTgrMQc/savLSf+8qZ9J5Z4w/srbzLCYa73kiYvk2Mx1m1XO/7FpYbLjmaUiLwIs m6UFcw30q/W4KdUATFs6QmirpZfTLHChPjltWNBPwknMsUhvdlzaqGiSZvS/LbQYbBm2WOZIlbzS2azitoRhSb7GKXLjZ04ai/VXxSQ4KZn bQ7XzXgVRteN+D1btdRA4/aue6ymP43VmJ/tHlKpMNpvI5Q3Fb/dhCTuqRYOX2x1gbj4zCVGxNsam3ZmV1pmH7KHfFxXAQBoPwLOifKwP9gC9Q e/QBxSiT+gEfUWnaIwIKtAv9Bv98d56n71v3vd1aGevznmNtsw7fwCwTDvI</latexit> f 1 ✓1 <latexit sha1_base64="5CApFcHOIFrHTDJPxdBgpa4+jNw=">ADm nicbZJLb9NAEMe3MY8SHk3hgSHFRESp8juAThWcAFxKaRp08aptV6Pm1X3Ye2uQ6OVPwlX+EyIb8M6DkriMNJK/53fvDSatODM2D8s9cJ7ty9d 3/Qfho8dPDnqHT8+MKjWFEVc6XFKDHAmYWSZ5TAuNBCRcjhPbz7W/HwO2jAlT+2igKkg15LljBLrXUnvIM6vosTFdgaWXEV0uHg3BpeFdEK 9E/ft7/jRFCJ8lhx8SZoqUAaSknxkyisLBTR7RlEPVjUsDBaE35BomXkoiwEzdcvIKv/aeDOdK+yctXno3MxwRxixE6iMFsTPTZrXzf2xS2vz91 DFZlBYkbRrlJcdW4XoNOGMaqOULwjVzM+K6YxoQq1fVjeW8J0qIYjMXHxbubhukObutq2GawZtFnuWap4Vs+vuMtrmEzolxnl7t0vqZzT/FW8 fEKUsLduN35YgNetOHlBrzc7TrcwMN2r8sbv6NlbpvbZ5R5XGWNBFauPrfDuLK1DVSov3+OG/jodWEya0p1vUaVtVnGrWPclecHQ2icB9f6F jW2j16gV+gNitA7dIw+oRM0QhSV6Af6iX4FL4MPwefgSxPa2VvlPENbFpz+BfnpPTg=</latexit> <latexit sha1_base64="ae4b/6UTZkw265Bunik0BonFqv0=">ADm nicbZJLb9NAEMe3MY8SHk3hgQHiwiJU2T3AFwqVeUC4lJI06aNU2u9Hjer7sPaXYdGK38SruUzIb4N6zgojsNIK/13fvPSaJKcUW2C4M9Ox7t3/ 8HD3Ufdx0+ePtvr7T8/07JQBEZEMqnGCdbAqICRoYbBOFeAecLgPLn5VPHzOShNpTg1ixymHF8LmlGCjXPFvb0ouwpjG5kZGHwVlnGvHwyCpfnbI lyJ/tHL/u/uYX53Eu93dJRKUnAQhjCs9SQMcjO1WBlKGJTdqNCQY3KDr2HipMAc9NQuJy/9t86T+plU7gnjL73NDIu51gueuEiOzUy3WeX8H5sUJ vs4tVTkhQFB6kZwXwj/WoNfkoVEMWTmCiqJvVJzOsMDFuWd1IwA8iOcitdFtaOqQZLZ27LcZLBm0GaZY4lkaTW/ZDaruIJmRLHOLrbpfE3nj vobxcrSDCz43bniwa8aMPLBrzc7jps4GE710W0/GSuz3Nk+JdDiN6wjFbfVvBzGpqxoJVm5/jLXx0ChMxcYU63o1K6szDdtHuS3ODgZhMAi/u Xt9j2rbRa/QG/QOhegDOkKf0QkaIYIK9BPdoV/ea+/Y+J9rUM7O6ucF2jDvNO/oLo+cw=</latexit> <latexit sha1_base64="ae4b/6UTZkw265Bunik0BonFqv0=">ADm nicbZJLb9NAEMe3MY8SHk3hgQHiwiJU2T3AFwqVeUC4lJI06aNU2u9Hjer7sPaXYdGK38SruUzIb4N6zgojsNIK/13fvPSaJKcUW2C4M9Ox7t3/ 8HD3Ufdx0+ePtvr7T8/07JQBEZEMqnGCdbAqICRoYbBOFeAecLgPLn5VPHzOShNpTg1ixymHF8LmlGCjXPFvb0ouwpjG5kZGHwVlnGvHwyCpfnbI lyJ/tHL/u/uYX53Eu93dJRKUnAQhjCs9SQMcjO1WBlKGJTdqNCQY3KDr2HipMAc9NQuJy/9t86T+plU7gnjL73NDIu51gueuEiOzUy3WeX8H5sUJ vs4tVTkhQFB6kZwXwj/WoNfkoVEMWTmCiqJvVJzOsMDFuWd1IwA8iOcitdFtaOqQZLZ27LcZLBm0GaZY4lkaTW/ZDaruIJmRLHOLrbpfE3nj vobxcrSDCz43bniwa8aMPLBrzc7jps4GE710W0/GSuz3Nk+JdDiN6wjFbfVvBzGpqxoJVm5/jLXx0ChMxcYU63o1K6szDdtHuS3ODgZhMAi/u Xt9j2rbRa/QG/QOhegDOkKf0QkaIYIK9BPdoV/ea+/Y+J9rUM7O6ucF2jDvNO/oLo+cw=</latexit> <latexit sha1_base64="QrHBFByEPXCN9qRvTYkdahrwFOs=">ADm nicbZJLT9tAEMeXuA+aPgjtsRysRpV6iuweaI+oXFr1QhsCgThY6/WYrNiHtbsORCt/Eq70Q/XbdJ0YxXE60kr/nd+8NJokZ1SbIPi70/GePH32f PdF9+Wr12/2evtvz7QsFIERkUyqcYI1MCpgZKhM4VYJ4wOE9ujit+PgelqRSnZpHDlONrQTNKsHGuLcXZVdhbCMzA4OvwjLu9YNBsDR/W4S16 KPaTuL9jo5SQoOwhCGtZ6EQW6mFitDCYOyGxUackxu8DVMnBSYg57a5eSl/9F5Uj+Tyj1h/KW3mWEx13rBExfJsZnpNquc/2OTwmRfp5aKvDAgy KpRVjDfSL9ag59SBcSwhROYKOpm9ckMK0yMW1Y3EnBLJOdYpDa6K21UNUgye1eWmwzWDNoscyRLK3ml8xmFVfQjCjW2cU2na/p3F/o/i4hgQzO 253vmjAiza8bMDL7a7DBh62c91lMf04VmJ/t3lKpMNpvIpQ3Fb/dhCTuqRYOX2x1gbD43CVGxMsa63YmV1pmH7KLfF2edBGAzCX0H/6LA+2F30H n1An1CIvqAj9B2doBEiqED36AH98Q68b94P7+cqtLNT57xDG+ad/gOp9DvG</latexit> e1(y) <latexit sha1_base64="0ONiBXpeCcQFypW0U5C7rHw3EI=">ADk HicbZJLbxMxEMfdLNASXm2RuHBZUSGVS7TLAXprERfEqRDSpM2GyOudba34sbK9oZG1H4IrSIivxbfBmw3KxmEkS+P5/edha9KCUW2i6M9OJ7hz9 97u3v3ug4ePHj/ZPzi80LJUBAZEMqlGKdbAqICBoYbBqFCAecpgmM7e13w4B6WpF/MoAJx9eC5pRg40LDBL7Gx4tX0/2jqBctLdx24pVzdPas+ PUbIXQ+PejoJOk5CAMYVjrcRwVZmKxMpQwqLpJqaHAZIavYexcgTnoiV3OW4UvXSQLc6ncESZcRtsZFnOtFzx1So7NjfZHfwfG5cmP5lYKorSg CBNo7xkoZFh/fgwowqIYQvnYKomzUkN1hYtwXdRMB34jkHIvMJreVTeoGaW5vq2qTwZqBz3LHUsmyen7JbF5zBW1Fuc4ut+l8TeOhvFRytIM LMjv/NlC1768KoFr7a79lu47+e6fWL631ip/ezjEiHs2mjUNzWd1/EpK5rpFi5/2PMx32jMBUbU6zrNayq3JrG/lJuOxeve3HUiz+5fX2DGtDz 9ELdIxi9BadoQ/oHA0QTP0Hf1AP4PD4CQ4Dd410s7OKucp2rDg4194vDm6</latexit> <latexit sha1_base64="Qnv5yYiVE9fYANkM28gLKOWtyCI=">ADk HicbZJLb9NAEMe3MdASXm2RuHCxqJDKJbI5QG4t6qXqRDSpI1DtF6P21X2Ye2uQ6OVP0RvCS+F4IPwzoOiuMw0kqz8/vPY1cTZ4xqEwS/tlrev fsPtnceth89fvL02e7e/oWuSLQJ5JNYyxBkYF9A01DIaZAsxjBoN4elLywQyUplJ8NvMxhxfC5pSgo0LDSL4Eh7O30x2D4JOsDB/0wmXzsHxi +zntz+/u+eTvZaOEklyDsIQhrUehUFmxhYrQwmDoh3lGjJMpvgaRs4VmIMe28W8hf/aRI/lcodYfxFtJ5hMd6zmOn5Njc6CYrg/9jo9yk3bGlI sNCFI1SnPmG+mXj/cTqoAYNncOJoq6WX1ygxUmxn1ROxLwlUjOsUhsdFvYqGwQp/a2KNYZrBg0WepYLFlSzi+ZTUuoK7IV9n5Jp2t6MxRf634c AkJZnbY7HxZg5dNeFWDV5tdezXca+a6fWL631ix/dTkCZEOJ5NKobgt70Rk7qsEWPl/o+xJu4ZhalYm2JVr2JF4dY0bC7lpnPxthMGnfCj29d3q LId9BK9QocoRO/RMTpF56iPCJqiO/Qd/fD2va535H2opK2tZc5ztGbe2V8fcjuh</latexit> <latexit sha1_base64="Qnv5yYiVE9fYANkM28gLKOWtyCI=">ADk HicbZJLb9NAEMe3MdASXm2RuHCxqJDKJbI5QG4t6qXqRDSpI1DtF6P21X2Ye2uQ6OVP0RvCS+F4IPwzoOiuMw0kqz8/vPY1cTZ4xqEwS/tlrev fsPtnceth89fvL02e7e/oWuSLQJ5JNYyxBkYF9A01DIaZAsxjBoN4elLywQyUplJ8NvMxhxfC5pSgo0LDSL4Eh7O30x2D4JOsDB/0wmXzsHxi +zntz+/u+eTvZaOEklyDsIQhrUehUFmxhYrQwmDoh3lGjJMpvgaRs4VmIMe28W8hf/aRI/lcodYfxFtJ5hMd6zmOn5Njc6CYrg/9jo9yk3bGlI sNCFI1SnPmG+mXj/cTqoAYNncOJoq6WX1ygxUmxn1ROxLwlUjOsUhsdFvYqGwQp/a2KNYZrBg0WepYLFlSzi+ZTUuoK7IV9n5Jp2t6MxRf634c AkJZnbY7HxZg5dNeFWDV5tdezXca+a6fWL631ix/dTkCZEOJ5NKobgt70Rk7qsEWPl/o+xJu4ZhalYm2JVr2JF4dY0bC7lpnPxthMGnfCj29d3q LId9BK9QocoRO/RMTpF56iPCJqiO/Qd/fD2va535H2opK2tZc5ztGbe2V8fcjuh</latexit> <latexit sha1_base64="V3E+6xQWTj51FLMdFjAeVlbhcC0=">ADk HicbZJLbxMxEMfdLI8SXm05crGIkMol2uVQeqMVF8SpENKkzYbI651trfixsr1pI2s/BFf4ZHwbvMmibDaMZGk8v/8bE2Sc2ZsGP7Z6wQPHj56v P+k+/TZ8xcvDw6PLo0qNIUhVzpcUIMcCZhaJnlM41EJFwGCXzTxUfLUAbpuR3u8xhKsiNZBmjxPrQKIYf0fHy3eygF/bDleFdJ6qdHqrtYnbYM XGqaCFAWsqJMZMozO3UEW0Z5VB248JATuic3MDEu5IMFO3mrfEb30kxZnS/kiLV9FmhiPCmKVIvFIQe2varAr+j0Km51OHZN5YUHSdaOs4NgqX D0ep0wDtXzpHUI187Nieks0odZ/UTeWcEeVESmLr4vXVw1SDJ3X5bDYM2izLFE8reZX3GUV19BUFJvsYpcuNnThKd4qPq4hJdyN252vGvCqD a8b8Hq36CB+1cv0/c/Bsrcd/aPKXK43S2VmjhqntbxJWpaiRE+/jvI0HVhMmt6bY1FuzsvRrGrWXcte5fN+Pwn70NeydndQLu49eozfoGEXoA zpDn9EFGiK5ugn+oV+B0fBafAxOF9LO3t1ziu0ZcGXv3W6N7Y=</latexit> e2(y) <latexit sha1_base64="/cZAQAaeVrRdWj64IPf8gj45NY=">ADk HicbZJLbxMxEMfdLI8SXm2RuHBZUSGVS7TbQ+mNIi6IUyGkSZsNke2dba34sbK9oZG1H4IrSIivxbfBmw3KZsNIlsbz+8/D1pCcM2Oj6M9OJ7hz9 9793Qfdh48eP3m6t39wYVShKQyo4kqPCDbAmYSBZbDKNeABeEwJLP3FR/OQRum5Be7yGEi8LVkGaPY+tAwga/HR4vX073DqBctLdx24pVzePY8/ /UbIXQ+3e+YJFW0ECAt5diYcRzlduKwtoxyKLtJYSDHdIavYexdiQWYiVvOW4avfCQNM6X9kTZcRpsZDgtjFoJ4pcD2xrRZFfwfGxc2O504JvPCg qR1o6zgoVh9fgwZRqo5QvYKqZnzWkN1hjav0XdRMJ36gSAsvUJbelS6oGJHO3ZbnJYM2gzTLPiOJpNb/iLqu4hqaiWGcX23S+pnNPw43ioxWkm LtRu/NlA1624VUDXm137Tdwv53r94mbf2MR97nNU6o8Tqe1QgtX3dsirkxVg2Dt/4/zNu5bjZncmGJdr2Zl6dc0bi/ltnNx3IujXvzJ7+sJqm0Xv UAv0RGK0Rt0hj6gczRAFM3Qd/QD/QwOgtPgbfCulnZ2VjnP0IYFH/8Ce+U5uw=</latexit> <latexit sha1_base64="uJ1HR+xcZyqFO3JxD03CahK7i0=">ADk HicbZJLb9NAEMe3MY8SXm2RuHCxqJDKJbJ7KLlRxAX1VAhp0sYhWq/H7Sr7sHbXodHKH6I31Ep8LwQfhnUcFMdhpJVm5/efx64mzhjVJgh+bW8e /cfPNx+1H785Omz5zu7e2da5opAn0gm1TDGhgV0DfUMBhmCjCPGQzi6ceSD2agNJXiq5lnMOb4UtCUEmxcaBDBt8OD+dvJzn7QCRbmbzrh0tk/f pn9/PHnd/d0stvSUSJzkEYwrDWozDIzNhiZShULSjXEOGyRfwsi5AnPQY7uYt/DfuEjip1K5I4y/iNYzLOZaz3nslBybK91kZfB/bJSbtDu2V GS5AUGqRmnOfCP98vF+QhUQw+bOwURN6tPrDCxLgvakcCvhPJORaJja4LG5UN4tReF8U6gxWDJksdiyVLyvkls2nJFdQV+So736SzFZ056q8VH y4hwcwOm53Pa/C8CS9q8GKza6+Ge81ct09M/xsrtl+aPCHS4WRSKRS35b0pYlKXNWKs3P8x1sQ9ozAVa1Os6lWsKNyahs2l3HTODjth0Ak/u309Q pVto1foNTpAIXqHjtEndIr6iKApukG36M7b87re+9DJW1tLXNeoDXzTv4CIps7og=</latexit> <latexit sha1_base64="uJ1HR+xcZyqFO3JxD03CahK7i0=">ADk HicbZJLb9NAEMe3MY8SXm2RuHCxqJDKJbJ7KLlRxAX1VAhp0sYhWq/H7Sr7sHbXodHKH6I31Ep8LwQfhnUcFMdhpJVm5/efx64mzhjVJgh+bW8e /cfPNx+1H785Omz5zu7e2da5opAn0gm1TDGhgV0DfUMBhmCjCPGQzi6ceSD2agNJXiq5lnMOb4UtCUEmxcaBDBt8OD+dvJzn7QCRbmbzrh0tk/f pn9/PHnd/d0stvSUSJzkEYwrDWozDIzNhiZShULSjXEOGyRfwsi5AnPQY7uYt/DfuEjip1K5I4y/iNYzLOZaz3nslBybK91kZfB/bJSbtDu2V GS5AUGqRmnOfCP98vF+QhUQw+bOwURN6tPrDCxLgvakcCvhPJORaJja4LG5UN4tReF8U6gxWDJksdiyVLyvkls2nJFdQV+So736SzFZ056q8VH y4hwcwOm53Pa/C8CS9q8GKza6+Ge81ct09M/xsrtl+aPCHS4WRSKRS35b0pYlKXNWKs3P8x1sQ9ozAVa1Os6lWsKNyahs2l3HTODjth0Ak/u309Q pVto1foNTpAIXqHjtEndIr6iKApukG36M7b87re+9DJW1tLXNeoDXzTv4CIps7og=</latexit> <latexit sha1_base64="BA3P1cTIdsF5WVMLzcZjNWA5WmM=">ADk HicbZJLbxMxEMfdLNASXm05crGIkMol2u0BeqMVF8SpENKkzYbI651trfixsr2hkbUfgit8Mr4N3mRNhtGsjSe38etibJOTM2DP/sdYIHDx/tH zuPn67PmLw6PjK6MKTWFIFVd6nBADnEkYWmY5jHMNRCQcRsn8Y8VHC9CGKfnNLnOYCnIrWcYosT40iuH76cny7eywF/bDleFdJ6qdHqrtcnbUM XGqaCFAWsqJMZMozO3UEW0Z5VB248JATuic3MLEu5IMFO3mrfEb3wkxZnS/kiLV9FmhiPCmKVIvFIQe2farAr+j0Km51NHZN5YUHSdaOs4NgqX D0ep0wDtXzpHUI187Niekc0odZ/UTeW8IMqIYhMXxfurhqkGTuviy3GWwYtFnmWaJ4Ws2vuMsqrqGpKDbZxS5dbOjCU7xVfFxDSrgbtztfN+B1G 9404M1u10ED9q5fp+4+TdW4r62eUqVx+lsrdDCVfe2iCtT1UiI9v/HeRsPrCZMbk2xqbdmZenXNGov5a5zdqPwn70Jeydv6sX9gC9Qq/RCYrQe 3SOPqFLNEQUzdFP9Av9Do6Ds+BDcLGWdvbqnJdoy4LPfwF4ze3</latexit> eK(y) <latexit sha1_base64="zZSZ+/DGrM92+xH47Zr5ac1ENfA=">ADk HicbZJLbxMxEMfdLI8SXm2RuHCxqJDKJdrtAXqjiAuCSyGkSZsNkdc721rxY2V7QyNrPwRXkBfi2+DNxuUzYaRLI3n95+HrUlyzowNwz87neDW7 Tt3d+917z94+Ojx3v7BuVGFpjCgis9SogBziQMLMcRrkGIhIOw2T2ruLDOWjDlPxiFzlMBLmSLGOUWB8axvD149Hi5XTvMOyFS8PbTrRyDk+f5 r9+I4TOpvsdE6eKFgKkpZwYM47C3E4c0ZRDmU3LgzkhM7IFYy9K4kAM3HLeUv8wkdSnCntj7R4GW1mOCKMWYjEKwWx16bNquD/2Liw2cnEMZkXF iStG2UFx1bh6vE4ZRqo5QvEKqZnxXTa6IJtf6LurGEb1QJQWTq4pvSxVWDJHM3ZbnJYM2gzTLPEsXTan7FXVZxDU1Fsc4utul8Te4o3ioxWkh LtRu/NFA1604WUDXm537Tdwv53r94mbf2Ml7nObp1R5nE5rhRaurdFXJmqRkK0/z/O27hvNWFyY4p1vZqVpV/TqL2U2875cS8Ke9Env6+vUG276 Bl6jo5QhF6jU/QenaEBomiGvqMf6GdwEJwEb4K3tbSzs8p5gjYs+PAXyuY51A=</latexit> <latexit sha1_base64="UiSf8tl1AGan+BKFr9Dkq6/3J0s=">ADk HicbZJLb9NAEMe3MY8SXm2RuHCxWiGVS2T3ALlRxAXBpRDSpI1DtF6P21X2Ye2uQ6OVPwQ3BFK/VwUfhnWcKo7DSCvNzu8/j1NnDGqTRDcbLW8O 3fv3d9+0H746PGTpzu7e6da5opAn0gm1TDGhgV0DfUMBhmCjCPGQzi6fuSD2agNJXiq5lnMOb4QtCUEmxcaBDBt0+H81eTnYOgEyzM3TCpXNw/ Dy7/vn3T/dkstvSUSJzkEYwrDWozDIzNhiZShULSjXEOGyRfwMi5AnPQY7uYt/Bfukjip1K5I4y/iNYzLOZaz3nslBybS91kZfB/bJSbtDu2V GS5AUGqRmnOfCP98vF+QhUQw+bOwURN6tPLrHCxLgvakcCvhPJORaJja4KG5UN4tReFcU6gxWDJksdiyVLyvkls2nJFdQV+So736SzFZ056q8VH y4hwcwOm53PavCsCc9r8Hyza6+Ge81ct09M34V2y9NnhDpcDKpFIrb8t4UManLGjFW7v8Ya+KeUZiKtSlW9SpWFG5Nw+ZSbjqnR50w6ISf3b6+R pVtoxdoHx2iEL1Bx+gDOkF9RNAU/UC/0G9vz+t6b713lbS1tcx5htbM+/gPcZw7uw=</latexit> <latexit sha1_base64="UiSf8tl1AGan+BKFr9Dkq6/3J0s=">ADk HicbZJLb9NAEMe3MY8SXm2RuHCxWiGVS2T3ALlRxAXBpRDSpI1DtF6P21X2Ye2uQ6OVPwQ3BFK/VwUfhnWcKo7DSCvNzu8/j1NnDGqTRDcbLW8O 3fv3d9+0H746PGTpzu7e6da5opAn0gm1TDGhgV0DfUMBhmCjCPGQzi6fuSD2agNJXiq5lnMOb4QtCUEmxcaBDBt0+H81eTnYOgEyzM3TCpXNw/ Dy7/vn3T/dkstvSUSJzkEYwrDWozDIzNhiZShULSjXEOGyRfwMi5AnPQY7uYt/Bfukjip1K5I4y/iNYzLOZaz3nslBybS91kZfB/bJSbtDu2V GS5AUGqRmnOfCP98vF+QhUQw+bOwURN6tPLrHCxLgvakcCvhPJORaJja4KG5UN4tReFcU6gxWDJksdiyVLyvkls2nJFdQV+So736SzFZ056q8VH y4hwcwOm53PavCsCc9r8Hyza6+Ge81ct09M34V2y9NnhDpcDKpFIrb8t4UManLGjFW7v8Ya+KeUZiKtSlW9SpWFG5Nw+ZSbjqnR50w6ISf3b6+R pVtoxdoHx2iEL1Bx+gDOkF9RNAU/UC/0G9vz+t6b713lbS1tcx5htbM+/gPcZw7uw=</latexit> <latexit sha1_base64="2ZQq0xYDtpZLv8Wa+7uXHOsJg=">ADk HicbZJLbxMxEMfdLNASXm05crGIkMol2uUAvdGKC4JLIaRJmw2R1zvbWvFjZXtDI2s/BFf4ZHwbvMmibDaMZGk8v/8bE2Sc2ZsGP7Z6wT37j/YP 3jYfT4ydNnh0fHl0YVmsKQKq70OCEGOJMwtMxyGOcaiEg4jJL5h4qPFqANU/KbXeYwFeRGsoxRYn1oFMP3zyfL17PDXtgPV4Z3nah2eqi2i9lRx 8SpoUAaSknxkyiMLdTR7RlEPZjQsDOaFzcgMT70oiwEzdat4Sv/KRFGdK+yMtXkWbGY4IY5Yi8UpB7K1psyr4PzYpbHY6dUzmhQVJ142ygmOrc PV4nDIN1PKldwjVzM+K6S3RhFr/Rd1Ywg+qhCAydfFd6eKqQZK5u7LcZrBh0GaZ4niaTW/4i6ruIamothkF7t0saELT/FW8XENKeFu3O581YBXb XjdgNe7XQcNPGjn+n3i5t9Yifva5ilVHqeztUILV93bIq5MVSMh2v8f5208sJowuTXFpt6alaVf06i9lLvO5Zt+FPajL2Hv7G29sAfoBXqJTlCE3 qEz9BFdoCGiaI5+ol/od3AcnAbvg/O1tLNX5zxHWxZ8+gvH5DfQ</latexit> y <latexit sha1_base64="YG+YhEP4k3bUV6vibrBzoc3glc=">ADi nicbZJLbxMxEMfdLI8SCjRw5GJRIXGKdnvgIS6V4MCxJaRNm40i2zvbWvVjZXtDI2s/AeIGH45vgzcblM2GkSyN5/efh62heDWxfGfvV507/6Dh /uP+o8Pnjx9djh4fm51aRiMmRbaTCixILiCseNOwKQwQCQVcEFvP9X8YgHGcq2+uWUBM0muFc85Iy6Ezpbzw6N4GK8M7zrJ2jk6GfwcoGCn80HPp plmpQTlmCDWTpO4cDNPjONMQNVPSwsFYbfkGqbBVUSCnfnVpBV+HSIZzrUJRzm8irYzPJHWLiUNSkncje2yOvg/Ni1d/n7muSpKB4o1jfJSYKdx/ WycQPMiWVwCDM8zIrZDTGEufA5/VTBd6alJCrz6V3l07oBzf1dVW0z2DosjwqkVWz6+Fz2tuoK0oN9nlLl1s6CJQvFV8soaMCD/pdr5swcsuv GrBq92uoxYedXPDJgn7byzqv3Z5xnTA2bxRGOnre1cktK1rUGLC/wnRxSNnCFdbU2zqNayqwpom3aXcdc6Ph0k8TM7Cvr5Fje2jl+gVeoMS9A6do C/oFI0RQ4B+oF/od3QHUcfo+NtLe3znmBtiz6/BcwNDbI</latexit> <latexit sha1_base64="icsg/DrdlbjmAepD5G5/XZt+Cvc=">ADi nicbZLNbhMxEMfdLNASCiRwg8uKColTtNsDUHGpBAeOLSFt2mwUeb2zrV/rGxvaGTtEyBu8B68Bo/Ag3DHmw3KxmEkS+P5/efD1qQFo9pE0e+dT nDn7r3dvfvdB/sPHz3u9Z+caVkqAiMimVTjFGtgVMDIUMNgXCjAPGVwnt68r/n5HJSmUnw2iwKmHF8JmlOCjQudLma9g2gQLS3cduKVc3Dc/9b78 +zXz5NZv6OTJKSgzCEYa0ncVSYqcXKUMKg6ialhgKTG3wFE+cKzEFP7XLSKnzpIlmYS+WOMOEy2s6wmGu94KlTcmyutc/q4P/YpDT526mloigNC NI0yksWGhnWzw4zqoAYtnAOJoq6WUNyjRUmxn1ONxHwhUjOschsclvZpG6Q5va2qjYZrBn4LHcslSyr5fM5jVX0FaU6+xym87XdO5ouF8vIEM zv2O1+04IUPL1vwcrvrsIWHfq7bJKb/jZXaTz7PiHQ4mzUKxW190VM6rpGipX7P8Z8PDQKU7Exbpew6rKrWnsL+W2c3Y4iKNBfOr29TVqbA89R y/QKxSjN+gYfUQnaIQIAvQVfUc/gv3gMDgK3jXSzs4q5ynasODX7K2OU8=</latexit> <latexit sha1_base64="icsg/DrdlbjmAepD5G5/XZt+Cvc=">ADi nicbZLNbhMxEMfdLNASCiRwg8uKColTtNsDUHGpBAeOLSFt2mwUeb2zrV/rGxvaGTtEyBu8B68Bo/Ag3DHmw3KxmEkS+P5/efD1qQFo9pE0e+dT nDn7r3dvfvdB/sPHz3u9Z+caVkqAiMimVTjFGtgVMDIUMNgXCjAPGVwnt68r/n5HJSmUnw2iwKmHF8JmlOCjQudLma9g2gQLS3cduKVc3Dc/9b78 +zXz5NZv6OTJKSgzCEYa0ncVSYqcXKUMKg6ialhgKTG3wFE+cKzEFP7XLSKnzpIlmYS+WOMOEy2s6wmGu94KlTcmyutc/q4P/YpDT526mloigNC NI0yksWGhnWzw4zqoAYtnAOJoq6WUNyjRUmxn1ONxHwhUjOschsclvZpG6Q5va2qjYZrBn4LHcslSyr5fM5jVX0FaU6+xym87XdO5ouF8vIEM zv2O1+04IUPL1vwcrvrsIWHfq7bJKb/jZXaTz7PiHQ4mzUKxW190VM6rpGipX7P8Z8PDQKU7Exbpew6rKrWnsL+W2c3Y4iKNBfOr29TVqbA89R y/QKxSjN+gYfUQnaIQIAvQVfUc/gv3gMDgK3jXSzs4q5ynasODX7K2OU8=</latexit> <latexit sha1_base64="UFGn3rMe1QKPN7QvGLEGaKQ+8k=">ADi nicbZJLbxMxEMfdLI8SCrRw5GIRIXGKdnugIC6V4MCxJaRNm40i2zvbWvVjZXtDI2s/AVf4cHwbvMmibDaMZGk8v/8bA0tBLcujv/s9aIHDx893 n/Sf3rw7PmLw6OXF1aXhsGYaHNhBILgisYO+4ETAoDRFIBl/Tuc80vF2As1+q7WxYwk+RG8Zwz4kLofDk/HMTDeGV410kaZ4AaO5sf9WyaVZKU I4JYu0iQs38Q4zgRU/bS0UB2R25gGlxFJNiZX01a4bchkuFcm3CUw6toO8MTae1S0qCUxN3aLquD/2PT0uUfZp6ronSg2LpRXgrsNK6fjTNug DmxDA5hodZMbslhjAXPqefKvjBtJREZT69r3xaN6C5v6+qbQYbBl2WB0a1yOr5tfB5zQ20FeUmu9yliw1dBIq3ik8ayIjwk27nqxa86sLrFrze7 Tpq4VE3N2ySsP/Gov5bl2dMB5zN1wojfX3vioS2dQ1KTPg/Ibp45AzhamuKTb01q6qwpkl3KXedi+NhEg+T83hw+r5Z2H30Gr1B71CTtAp+orO0 BgxBOgn+oV+RwfRcfQx+rSW9vanFdoy6IvfwFmQzXZ</latexit> GloVe.6B <latexit sha1_base64="YHCiFnuTL5brZigISYw+jAQ=">ADl3icbZJLbxMxEMfdLI8SXi2cEBeLCKmnaJdD y60VlaDHlpA0bTZEXu9sa9WPle1NG1n7PbjC5+DA1+CDcMebDUqyYSRL4/nN46/RJDlnxobh761WcO/+g4fbj9qPnzx9nxn98XAqEJT6FPFlR4mxABnEvqWQ7DXAMRCYfz5Oa4udT0IYp+cXOchgLciVZxixPvTVxVrgT1wNoLv/oZzsdMJu ODe86UQLp3P4c+/PL4TQ6WS3ZeJU0UKAtJQTY0ZRmNuxI9oyqFsx4WBnNAbcgUj70oiwIzdXHaJ3/pIijOl/ZMWz6OrFY4IY2Yi8ZmC2GvTZFXwf2xU2Oz92DGZFxYkrQdlBcdW4WoHOGUaqOUz7xCqmdeK6TXRhFq/qXYs4ZYqIYhMXxXurg akGTurizXGSwZNFnmWaJ4WulX3GUV17CaUSyri06XdKp3it+XABKeFu2Jx8sQIvmvByBV5uTu2t4F6z1p8VN/9kJe5zk6dUeZxO6gwtXPVvJnFlqh4J0X5/nDdxz2rC5JqKZb+aldWZRs2j3HQG7pR2I3Ows7RPqptG71Gb9AeitABOkIn6BT 1EUafUPf0Y/gVXAYfAxO6tTW1qLmJVqz4Owvtl89kA=</latexit> <latexit sha1_base64="lrkntAxpwSesfDTwB134uh/gbmQ=">ADl3icbZJLbxMxEMfdLI8SXi2cEBeLCKlcot0e CrdWIEGPLSFp2myIvN7Z1qofK9sbGln7Gbhyhc/BiW/B+GONxuUZMNIlsbzm8dfo0lyzowNw9breDW7Tt3t+17z94+Ojxzu6TgVGFptCnis9TIgBziT0LbMchrkGIhIOZ8n1u4qfTUEbpuQnO8thLMilZBmjxPrQZxdrgT9wNYDuwdtystMJ u+Hc8KYTLZzO4c+9P7+xq9OJrstE6eKFgKkpZwYM4rC3I4d0ZRDmU7LgzkhF6TSxh5VxIBZuzmskv80kdSnCntn7R4Hl2tcEQYMxOJzxTEXpkmq4L/Y6PCZm/Gjsm8sCBpPSgrOLYKVzvAKdNALZ95h1DNvFZMr4gm1PpNtWMJX6gSgsjUxTe li6sBSeZuynKdwZJBk2WeJYqnlX7FXVZxDasZxbK62KTJZ16iteaDxeQEu6GzcnK/C8CS9W4MXm1N4K7jVr/Vlx809W4j42eUqVx+mkztDCVf9mElem6pEQ7fHeRP3rCZMrqlY9qtZWZ1p1DzKTWew343CbnQado4OUG3b6Dl6gfZQhF6jI3S MTlAfUaTRN/Qd/QieBYfB+C4Tm1tLWqeojULTv8C8EY+pg=</latexit> <latexit sha1_base64="lrkntAxpwSesfDTwB134uh/gbmQ=">ADl3icbZJLbxMxEMfdLI8SXi2cEBeLCKlcot0e CrdWIEGPLSFp2myIvN7Z1qofK9sbGln7Gbhyhc/BiW/B+GONxuUZMNIlsbzm8dfo0lyzowNw9breDW7Tt3t+17z94+Ojxzu6TgVGFptCnis9TIgBziT0LbMchrkGIhIOZ8n1u4qfTUEbpuQnO8thLMilZBmjxPrQZxdrgT9wNYDuwdtystMJ u+Hc8KYTLZzO4c+9P7+xq9OJrstE6eKFgKkpZwYM4rC3I4d0ZRDmU7LgzkhF6TSxh5VxIBZuzmskv80kdSnCntn7R4Hl2tcEQYMxOJzxTEXpkmq4L/Y6PCZm/Gjsm8sCBpPSgrOLYKVzvAKdNALZ95h1DNvFZMr4gm1PpNtWMJX6gSgsjUxTe li6sBSeZuynKdwZJBk2WeJYqnlX7FXVZxDasZxbK62KTJZ16iteaDxeQEu6GzcnK/C8CS9W4MXm1N4K7jVr/Vlx809W4j42eUqVx+mkztDCVf9mElem6pEQ7fHeRP3rCZMrqlY9qtZWZ1p1DzKTWew343CbnQado4OUG3b6Dl6gfZQhF6jI3S MTlAfUaTRN/Qd/QieBYfB+C4Tm1tLWqeojULTv8C8EY+pg=</latexit> <latexit sha1_base64="bF3W54KGXHSHjr+PeRuGAWNcnFQ=">ADl3icbZJLb9NAEMe3MY8SXi2cKi4rIiROkc2h cKMCifbYEpKmjUO0Xo/bVfdh7a5Do5W/R6/wrfg2XSdGcRxGWum/85uXRpPknBkbhn93OsGDh48e7z7pPn32/MXLvf1XI6MKTWFIFVd6nBADnEkYWmY5jHMNRCQczpObrxU/n4M2TMkfdpHDVJAryTJGifWuny7WAh9zNYL+4ZdytcL+HS8LaI atFDtZ3O9jsmThUtBEhLOTFmEoW5nTqiLaMcym5cGMgJvSFXMPFSEgFm6pZjl/id96Q4U9o/afHS28xwRBizEImPFMRemzarnP9jk8Jmn6aOybywIOmqUVZwbBWudoBTpoFavCUM38rJheE02o9ZvqxhJ+USUEkamLb0sXVw2SzN2W5SaDNYM 2yzxLFE+r+RV3WcU1NCOKdXaxTedrOvcUbxQf15AS7sbtzhcNeNGlw14ud10MCDdq4/K27+jZW472eUuVxOltFaOGqfzuIK1PVSIj2+O8jQdWEyY3pljXW7GyOtOofZTbYvShH4X96CzsHR3WB7uL3qC36D2K0Ed0hE7QKRoijS6Q7/Rn+A g+Bx8C05WoZ2dOuc12rDg7B46gjq4</latexit> GloVe.42B <latexit sha1_base64="3TNCOMbiD9hmAviWqyS1TzV4MY0=">ADmnicbZJLbxMxEMfdLI8SHk3hCAeLCKmnaLdCwI2qHABxKaR J02ajyOudba36sbK9oZG1n4QrfAsOfA0+CHe82aAkG0ayNJ7fP4aTZJzZmwY/t5pBbdu37m7e69/8HDR3ud/cdDowpNYUAV3qUEAOcSRhYZjmMcg1EJBzOkut3FT+bgTZMyVM7z2EiyKVkGaPE+tC0s+diLfB7robQe3l4XE473bAXLgxvO9HS6b79efDnF0LoZLrfMnGqa CFAWsqJMeMozO3EW0Z5VC248JATug1uYSxdyURYCZuobzEL3wkxZnS/kmLF9H1CkeEMXOR+ExB7JVpsir4PzYubPZm4pjMCwuS1oOygmOrcLUGnDIN1PK5dwjVzGvF9IpoQq1fVjuW8JUqIYhMXxTurgakGTupiw3GawYNFnmWaJ4WulX3GUV17CeUayqi206W9GZp3ij+Wg JKeFu1Jx8vgbPm/BiDV5sT+2v4X6z1l8WN/9kJe5Lk6dUeZxO6wtXPVvJnFlqh4J0X5/nDdx32rC5IaKVb+aldWZRs2j3HaGh70o7EWfw+7RK1TbLnqKnqMDFKHX6Ah9QCdogCgq0Df0Hf0IngXHwcfgU53a2lnWPEbFpz+BSMFPfs=</latexit> <latexit sha1_base64="XQvrH8rpUWKwOHdCsRX/ZUzS3/M=">ADmnicbZLNbtNAEMe3MR8lfDSFIxwsIqRyiewKQW+tygEQl0K aNG0cRev1uF1P6zdWi08jPwAFzhLTjxFjwId9ZxUByHkVand98/DWaOGNUmyD4vdXybt2+c3f7Xv+g4ePdjq7j4da5orAgEgm1SjGhgVMDUMBhlCjCPGZzF129LfjYDpakUp2aewYTjS0FTSrBxoWlnx0aK+YHELv1f5xMe10g16wMH/TCZdO9/Dn3p9fX6OXJ9Pdl o4SXIOwhCGtR6HQWYmFitDCYOiHeUaMkyu8SWMnSswBz2xC+WF/8JFEj+Vyj1h/EW0XmEx13rOY5fJsbnSTVYG/8fGuUkPJpaKLDcgSDUozZlvpF+uwU+oAmLY3DmYKOq0+uQK0yMW1Y7EvCFSM6xSGx0U9ioHBCn9qYo1hmsGDRZ6lgsWVLql8ymJVdQz8hX1fkmna3ozF /rfloCQlmdtScfF6D5014UYMXm1P7Ndxv1rLYvqfrNh+bvKESIeTaZWhuC3/zSQmdkjxsrtj7Em7huFqVhTsepXsaI807B5lJvOcL8XBr3wU9A9eo0q20ZP0XO0h0L0Bh2h9+gEDRBOfqGvqMf3jPv2PvgfaxSW1vLmidozbzTv1zsPxE=</latexit> <latexit sha1_base64="XQvrH8rpUWKwOHdCsRX/ZUzS3/M=">ADmnicbZLNbtNAEMe3MR8lfDSFIxwsIqRyiewKQW+tygEQl0K aNG0cRev1uF1P6zdWi08jPwAFzhLTjxFjwId9ZxUByHkVand98/DWaOGNUmyD4vdXybt2+c3f7Xv+g4ePdjq7j4da5orAgEgm1SjGhgVMDUMBhlCjCPGZzF129LfjYDpakUp2aewYTjS0FTSrBxoWlnx0aK+YHELv1f5xMe10g16wMH/TCZdO9/Dn3p9fX6OXJ9Pdl o4SXIOwhCGtR6HQWYmFitDCYOiHeUaMkyu8SWMnSswBz2xC+WF/8JFEj+Vyj1h/EW0XmEx13rOY5fJsbnSTVYG/8fGuUkPJpaKLDcgSDUozZlvpF+uwU+oAmLY3DmYKOq0+uQK0yMW1Y7EvCFSM6xSGx0U9ioHBCn9qYo1hmsGDRZ6lgsWVLql8ymJVdQz8hX1fkmna3ozF /rfloCQlmdtScfF6D5014UYMXm1P7Ndxv1rLYvqfrNh+bvKESIeTaZWhuC3/zSQmdkjxsrtj7Em7huFqVhTsepXsaI807B5lJvOcL8XBr3wU9A9eo0q20ZP0XO0h0L0Bh2h9+gEDRBOfqGvqMf3jPv2PvgfaxSW1vLmidozbzTv1zsPxE=</latexit> <latexit sha1_base64="81W3eQ71ESO0iRsmI+OybVbe2vc=">ADmnicbZJLb9NAEMe3MY8SHk3hCIcVERKnyK4q4FiVAyAuhTR p2jiK1utxu+o+rN1aLTyJ+EKH4pvwzoxiuMw0kr/nd+8NJok58zYMPyz1wnu3X/wcP9R9/GTp8OeofPx0YVmsKIKq70JCEGOJMwsxymOQaiEg4XCS3Hyt+sQBtmJLndpnDTJBryTJGifWue/AxVrgT1yNYXB8dFrOe/1wEK4M74qoFn1U29n8sGPiVNFCgLSUE2OmUZjbm SPaMsqh7MaFgZzQW3INUy8lEWBmbjV5id94T4ozpf2TFq+8zQxHhDFLkfhIQeyNabPK+T82LWz2YeaYzAsLkq4bZQXHVuFqDThlGqjlSy8I1czPiukN0YRav6xuLOEHVUIQmbr4rnRx1SDJ3F1ZbjPYMGizLNE8bSaX3GXVxDM6LYZBe7dLGhC0/xVvFJDSnhbtLufNmAl21 41YBXu12HDTxs5/rL4ubfWIn73uYpVR6n83WEFq76t4O4MlWNhGi/P87beGg1YXJrik29NSurM43aR7krxkeDKBxE38L+ybv6YPfRS/QavUReo9O0Gd0hkaIogL9RL/Q7+BVcBp8Cb6uQzt7dc4LtGXB+V+nGTsj</latexit> FastText <latexit sha1_base64="sVqH8YvI/mj2yRb3D0hV1tgzQm0=">ADl3icbZJLb9NAEMe3MY8SXi2cEJcVE VJPkc0BuLUSUtVjS5o2bRyi9XrcroPa3cdEq38PbjC5+DA1+CDcGcdB8VxGml2fnN46/RJDlnxobh751OcO/+g4e7j7qPnzx9nxv/8WFUYWmMKSKz1KiAHOJAwtsxGuQYiEg6Xyd2nil/OQBum5Lld5DAR5EayjFife iLi7XAx8TYc5jbcrXC/vh0vC2E62c3uHPgz+/EKn0/2OiVNFCwHSUk6MGUdhbieOaMsoh7IbFwZyQu/IDYy9K4kAM3FL2SV+6yMpzpT2T1q8jDYrHBHGLETiMwWxt6bNquD/2Liw2ceJYzIvLEhaD8oKjq3C1Q5wyjRQyxfe IVQzrxXTW6IJtX5T3VjCV6qEIDJ18bx0cTUgydy8LDcZrBm0WeZonha6VfcZRX0Mwo1tXFNp2t6cxTvNF8tIKUcDdqT75qwKs2vG7A6+2pgwYetGv9WXHzT1biPrd5SpXH6bTO0MJV/3YSV6bqkRDt98d5Gw+sJkxuqFj3q 1lZnWnUPspt5+JdPwr70VnYO3qPatFr9EbdIAi9AEdoRN0ioaIo2+oe/oR/AqOAyOg5M6tbOzqnmJNiw4+wviDT5A</latexit> <latexit sha1_base64="xH4mhS2gc1imMnRteTB2c3bDpuY=">ADl3icbZJLbxMxEMfdLI8SXi2cEBeLC Klcol0OwK2VKlU9tqRp02ZD5PXOtlb9WNneNJG1n4ErV/gcnPgWfBDueLNBSTaMZGk8v3n8NZok58zYMPy91Qru3X/wcPtR+/GTp8+e7+y+ODeq0BT6VHGlBwkxwJmEvmWwyDXQETC4SK5Paz4xQS0YUqe2VkOI0GuJcsYJd aHvrhYC3xEjD2DqS3HO52wG84NbzrRwuns/9z78+tr/O5kvNsycapoIUBayokxwyjM7cgRbRnlULbjwkBO6C25hqF3JRFgRm4u8RvfSTFmdL+SYvn0dUKR4QxM5H4TEHsjWmyKvg/Nixs9mnkmMwLC5LWg7KCY6twtQOcMg3U 8pl3CNXMa8X0hmhCrd9UO5ZwR5UQRKYunpYurgYkmZuW5TqDJYMmyzxLFE8r/Yq7rOIaVjOKZXWxSdLOvEUrzUfLCAl3A2aky9X4GUTXq3Aq82pvRXca9b6s+Lmn6zEfW7ylCqP03GdoYWr/s0krkzVIyHa74/zJu5ZTZhcU 7HsV7OyOtOoeZSbzvn7bhR2o9Owc/AB1baNXqM3aA9F6CM6QMfoBPURp9Q9/Rj+BVsB8cBcd1amtrUfMSrVlw+hcAz9W</latexit> <latexit sha1_base64="xH4mhS2gc1imMnRteTB2c3bDpuY=">ADl3icbZJLbxMxEMfdLI8SXi2cEBeLC Klcol0OwK2VKlU9tqRp02ZD5PXOtlb9WNneNJG1n4ErV/gcnPgWfBDueLNBSTaMZGk8v3n8NZok58zYMPy91Qru3X/wcPtR+/GTp8+e7+y+ODeq0BT6VHGlBwkxwJmEvmWwyDXQETC4SK5Paz4xQS0YUqe2VkOI0GuJcsYJd aHvrhYC3xEjD2DqS3HO52wG84NbzrRwuns/9z78+tr/O5kvNsycapoIUBayokxwyjM7cgRbRnlULbjwkBO6C25hqF3JRFgRm4u8RvfSTFmdL+SYvn0dUKR4QxM5H4TEHsjWmyKvg/Nixs9mnkmMwLC5LWg7KCY6twtQOcMg3U 8pl3CNXMa8X0hmhCrd9UO5ZwR5UQRKYunpYurgYkmZuW5TqDJYMmyzxLFE8r/Yq7rOIaVjOKZXWxSdLOvEUrzUfLCAl3A2aky9X4GUTXq3Aq82pvRXca9b6s+Lmn6zEfW7ylCqP03GdoYWr/s0krkzVIyHa74/zJu5ZTZhcU 7HsV7OyOtOoeZSbzvn7bhR2o9Owc/AB1baNXqM3aA9F6CM6QMfoBPURp9Q9/Rj+BVsB8cBcd1amtrUfMSrVlw+hcAz9W</latexit> <latexit sha1_base64="o1gA43HEtbBE2CNf70FiaACoO3M=">ADl3icbZJLa9tAEMc3Vh+p+0raU+lq Sn0ZKQe0t4aKIQckzpOnFiuWa1GyZJ9iN2Va7Poe+Safqt8m6xsFctyBxb+O795MUySc2ZsGD7sdInT5893Rfnq9Zu3e/vzo0qNIUhVzpUIMcCZhaJnlMo1EJFwuEhuf1b8YgbaMCXP7CKHiSDXkmWMEutdv12sBT 4ixp7B3JbTvV7YD5eGt0VUix6q7WS63zFxqmghQFrKiTHjKMztxBFtGeVQduPCQE7oLbmGsZeSCDATtxy7xJ+9J8WZ0v5Ji5feZoYjwpiFSHykIPbGtFnl/B8bFzb7PnFM5oUFSVeNsoJjq3C1A5wyDdTyhReEauZnxfSGaEKt 31Q3lvCHKiGITF08L1cNUgyNy/LTQZrBm2WeZYonlbzK+6yimtoRhTr7GKbztZ05ineKD6qISXcjdqdLxvwsg2vGvBqu+ugQftXH9W3PwbK3G/2jylyuN0uorQwlX/dhBXpqREO3x3kbD6wmTG5Msa63YmV1plH7KLfF+ d+FPaj07B3eFAf7C76iD6hLyhC39AhOkYnaIgo0ugO3aO/wYfgR3AUHK9COzt1znu0YcHpI2YwO2g=</latexit> … … Figure 1: Our proposed K-embeddings model composed of K-predictors where each contains several fully-connected layers. The shared layers consisting a deep neural network. Borrowing ideas from this theory, our classifier is designed to be trained on different supervisions for each class. Rather than using direct supervision, our classifier is composed of a set of regression functions, where each function is trained to predict a different word embedding (such as GloVe, FastText, etc.). The prediction of the model is based on the outcome of the regression functions. Refer to the model depicted schematically in Figure 1. Formally, the model is composed of K regression functions f k θk : X →Z for 1 ≤k ≤K. The input for each function is an instance x ∈X, and its output is a word embedding vector in Z. Note that the word embedding spaces are not the same for the different regression functions, and specifically the notion of distance is unique for each function. Overall, given an instance x, the output of the model is K different word embedding vectors. The set of parameters of a regression function k, θk = {θshared, θk excl.}, is composed of a set of parameters, θshared, that is shared among all the K functions, and a set of parameters, θk excl., which is exclusive to the k-th function. Each regression function f k θk is trained to predict a word embedding vector ek(y) corresponds to the word which represents the target label y ∈Y. In the next subsections, we give a detailed account of how the model is trained and then present the inference procedure following the procedure to detect out-of-distribution instances. 3.1 Training In classic supervised learning, the training set is composed of M instance-label pairs. In our setting, each example from the training set, Strain, is composed of an instance x ∈X and a set of K different word embeddings {e1(y), . . . , eK(y)} of a target label y ∈Y. Namely, Strain = {(xi, e1(yi), ..., eK(yi))}M i=1. Our goal in training is to minimize a loss function which measures the discrepancy between the predicted label and the desired label. Since our intermediate representation is based on word embeddings we cannot use the cross-entropy loss function. Moreover, we would like to keep the notion of similarity between the embedding vectors from the same space. Our surrogate loss function is the sum of K cosine distances between the predicted embedding and the corresponding embedding vector of the target label, both from the same embedding space. Namely, ¯ℓ(x, y; θ) = K X k=1 dcos(ek(y), f k θk(x)). (2) The cosine distance (or the cosine similarity) is a function often used in ranking tasks, where the goal is to give a high score to similar embedding vectors and a low score otherwise [9, 30]. 3.2 Inference At inference time, the regression functions predict K vectors, each corresponds to a vector in a different word embedding space. A straightforward solution is to predict the label using hard decision over the K output vectors by first predict the label of each output and then use a majority vote over the predicted labels. 3 Another, more successful procedure for decoding, is the soft decision, where we predict the label y which has the minimal distance to all of the K embedding vectors: ˆy = arg min y∈Y K X k=1 dcos(ek(y), f k θk(x)). (3) In order to distinguish between in- and out-of-distribution examples, we consider the norms of the predicted embedding vectors. When the sum of all the norms is below a detection threshold α we denote the example as an out-of-distribution example, namely, K X k=1 ∥f k θk(x)∥2 2 < α. (4) This is inspired by the discussion of [39, Section 4] and motivated empirically in Section 4.3. 4 Experiments In this section, we present our experimental results. First, we describe our experimental setup. Then, we evaluate our model using in-distribution examples, and lastly, we evaluate our model using out-of-distribution examples from different domains. We implemented the code using PyTorch [35]. It will be available under www.github.com/MLSpeech/semantic_OOD. 4.1 Experimental Setup Recall that each regression function f k θk is composed of a shared part and an exclusive part. In our setting, we used state-of-the-art known architectures as the shared part, and three fully-connected layers, with ReLU activation function between the first two, as the exclusive part. We evaluated our approach on CIFAR-10, CIFAR-100 [18] and Google Speech Commands Dataset1, abbreviated here as GCommands. For CIFAR-10 and CIFAR-100 we trained ResNet-18 and ResNet34 models [12], respectively, using stochastic gradient descent with momentum for 180 epochs. We used the standard normalization and data augmentation techniques. We used learning rate of 0.1, momentum value of 0.9 and weight decay of 0.0005. During training we divided the learning rate by 5 after 60, 120 and 160 epochs. For the GCommands dataset, we trained LeNet model [22] using Adam [16] for 20 epochs using batch size of 100 and a learning rate of 0.001. Similarly to [44] we extracted normalized spectrograms from the original waveforms where we zero-padded the spectrograms to equalize their sizes at 160 × 101. For our supervision, we fetched five word representations for each label. The first two word representations were based on the Skip-Gram model [29] trained on Google News dataset and One Billion Words benchmark [5], respectively. The third and forth representations were based on GloVe [36], where the third one was trained using both Wikipedia corpus and Gigawords [34] dataset, the fourth was trained using Common Crawl dataset. The last word representations were obtained using FastText [28] trained on Wikipedia corpus. We use the terms 1-embed, 3-embed, and 5-embed to specify the number of embeddings we use as supervision, i.e., the number of predicted embedding vectors. On 1-embed and 3-embed models we randomly pick 1 or 3 embeddings (respectively), out of the five embeddings. We compared our results to a softmax classifier (baseline) [13], ensemble of softmax classifiers (ensemble) [19] and to [25] (ODIN). For the ensemble method, we followed a similar approach to [19, 24] where we randomly initialized each of the models. For ODIN, we followed the scheme proposed in by the authors where we did a grid search over the ϵ and T values for each setting. In all of these models we optimized the cross-entropy loss function using the same architectures as in the proposed models. 4.2 In-Distribution Accuracy In this subsection, we evaluate the performance of our model and compare it to models based on softmax. Similar to [25], we considered CIFAR-10, CIFAR-100 and GCommands datasets 1https://research.googleblog.com/2017/08/launching-speech-commands-dataset.html 4 Table 1: Accuracy on in-distribution examples and semantical relevance of misclassifications. Dataset Model Accuracy Avg. WUP Avg. LCH Avg. Path GCommands Baseline 90.3 0.2562 1.07 0.0937 1-embed 90.42 0.3279 1.23 0.1204 3-embed 91.04 0.3215 1.22 0.1184 5-embed 91.13 0.3095 1.19 0.1141 Ensemble 90.9 0.2206 0.96 0.0748 CIFAR-10 Baseline 95.28 0.7342 1.7 0.1594 1-embed 95.11 0.741 1.73 0.1633 3-embed 94.99 0.7352 1.71 0.1609 5-embed 95.04 0.7302 1.69 0.157 Ensemble 95.87 0.733 1.71 0.1601 CIFAR-100 Baseline 79.14 0.506 1.38 0.1263 1-embed 77.62 0.51 1.39 0.1277 3-embed 78.31 0.501 1.38 0.1251 5-embed 78.23 0.5129 1.4 0.1293 Ensemble 81.38 0.5122 1.4 0.1291 as in-distribution examples. We report the accuracy for our models using K = 1, 3 or 5 word embeddings, and compare it to the baseline and to the ensemble of softmax classifier. Results are summarized in Table 1. Semantic Measure Word embeddings usually capture the semantic hierarchy between the words [29], since the proposed models are trained with word embeddings as supervision, they can capture such semantics. To measure the semantic quality of the model, we compute three semantic measures based on WordNet hierarchy: (i) Node-counting on the shortest path that connects the senses in the is-a taxonomy; (ii) Wu-Palmer (WUP) [41], calculates the semantic relatedness by considering the depth of the two senses in the taxonomy; and (iii) Leacock-Chodorow (LCH) [21], calculates relatedness by finding the shortest path between two concepts and scaling that value by twice the maximum depth of the hierarchy. Results suggest that on average our model produces labels which have slightly better semantic quality. 4.3 Out-of-Distribution Out-of-Distribution Datasets For out-of-distribution examples, we followed a similar setting as in [25, 13] and evaluated our models on several different datasets. All visual models were trained on CIFAR-10 and tested on SVHN[32], LSUN[42] (resized to 32x32x3) and CIFAR-100; and trained on CIFAR-100 and were tested on SVHN, LSUN (resized to 32x32x3) and CIFAR-10. For the speech models, we split the dataset into two disjoint subsets, the first contains 7 classes2 (denote by SC-7) and the other one contains the remaining 23 classes (denote by SC-23). We trained our models using SC-23 and test them on SC-7. Evaluation We followed the same metrics used by [13, 25]: (i) False Positive Rate (FPR) at 95% True Positive Rate (TPR): the probability that an out-of-distribution example is misclassified as in-distribution when the TPR is as high as 95%; (ii) Detection error: the misclassification probability when TPR is 95%, where we assumed that both out- and in-distribution have an equal prior of appearing; (iii) Area Under the Receiver Operating Characteristic curve (AUROC); and (iv) Area Under the Precision-Recall curve (AUPR) for in-distribution and out-of-distribution examples. Figure 2 presents the distribution of the L2-norm of the proposed method using 5 word embeddings and the maximum probability of the baseline model for CIFAR-100 (in-distribution) and SVHN (out-of-distribution). Both models were trained on CIFAR-100 and evaluated on CIFAR-100 test set (in-distribution) and SVHN (out-of-distribution). Results Table 2 summarizes the results for all the models. Results suggest that our method outperforms all the three methods in all but two settings: CIFAR-100 versus CIFAR-10 and CIFAR2Composed of the following classes: bed, down, eight, five, four, wow, and zero. 5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 L2-norm 0 2 4 6 8 10 density cifar100 svhn Figure 2: Distribution of the L2-norm of the proposed model with 5 word embeddings (left) and of the max probability of the baseline model (right). Both were evaluated on CIFAR-100 (in-distribution) and SVHN (out-of-distribution). 100 versus LSUN. This can be explained by taking a closer look into the structure of the datasets and the predictions made by our model. For these two settings, the in- and out-of-distribution datasets share common classes, and some of the classes of the in-distribution dataset appear in the out-of-distribution images. For example: the class bedroom in LSUN was detected as a bed, couch, and wardrobe in CIFAR-100 (56%, 18%, and 8% of the time, respectively); bridge of LSUN was detected as a bridge, road, and sea in CIFAR-100 (26%, 13%, and 9%); and tower of LSUN was detected as a skyscraper, castle, and rocket in CIFAR-100 (34%, 20%, and 6%), and there are many more. Similarly, CIFAR-10 and CIFAR-100 contain shared classes such as truck. Recall that the proportion of this class is 10% in CIFAR-10 and 1% in CIFAR-100. Hence, when the model is trained on CIFAR-100 and evaluated on CIFAR-10, it has 10% in-distribution examples a-priori. When the model is trained on CIFAR-10 and evaluated on CIFAR-100, it has 1% in-distribution examples a-priori. 5 Adversarial Examples Next, we evaluated the performance of our approach for detecting adversarial examples [11]. Although it is not clear if adversarial examples can be considered as an out-of-distribution, we found that our method is very efficient in detecting these examples. Since our goal is detecting adversarial examples rather than suggesting a defense against them, we generated the adversarial examples in a black box settings. We compared our method to an ensemble of softmax classifiers [19], both with K = 5 predictors, on the ImageNet dataset [7]. Both models are based on DenseNet-121 [15], wherein our model the K regression functions are composed of three fully-connected layers with ReLU as described earlier. We omitted from ImageNet these classes which do not have “off-the-shelf” word representations and were left with 645 labels3. We generated adversarial examples in a black box setting using a third model, namely VGG-19 [38] with the fast gradient sign method and ϵ = 0.007 [11], and measured the detection rate for each of the models. Notice that our goal was not to be robust to correctly classify adversarial examples but rather to detect them. We used the method of detecting out-of-distribution examples to detect adversarial examples, results are in Table 3. We further explored the inter-predictor agreements on the predicted class across the K predicted embeddings. The histogram of the differences between the maximum and the minimum rankings of the predicted label is presented in Figure 3. It can be observed that for our model the inter-predictor variability is much higher than that of the ensemble model. One explanation for this behavior is the transferability of adversarial examples across softmax classifiers, which can be reduced by using different supervisions. 3In [8] the authors suggested to use random vectors as labels. We leave the exploration of this research direction for future work. 6 Table 2: Results for in- and out-of-distribution detection for various settings. All values are in percentages. ↑indicates larger value is better, and ↓indicates lower value is better. In-Distribution Out-ofDistribution Model FPR (95% TPR) ↓ Detection Error ↓ AUROC ↑ AUPR-In ↑ AUPR-Out ↑ SC-23 (LeNet) SC-7 Baseline 77.53 41.26 82.74 94.33 50.44 ODIN 71.02 38.01 85.49 95.11 57.7 1-embed 70.64 37.8 85.85 95.21 58.08 3-embed 67.5 36.24 87.34 95.91 59.97 5-embed 69.23 37.09 86.93 95.74 58.97 Ensemble 72.73 38.85 85.99 95.69 50.71 CIFAR-10 (ResNet18) SVHN Baseline 7.19 6.09 97.2 96.35 98.05 ODIN 4.95 4.97 98.65 96.89 99.21 1-embed 2.41 3.7 99.48 98.77 99.79 3-embed 4.92 4.95 98.52 97.76 99.07 5-embed 4.14 4.57 99.1 98.3 99.55 Ensemble 6.01 5.5 98.24 97.41 98.94 CIFAR-10 (ResNet18) LSUN Baseline 50.25 27.62 91.28 91.58 89.3 ODIN 41.8 23.39 90.35 96.38 75.07 1-embed 26.11 15.55 95.37 95.81 94.85 3-embed 29.2 17.09 95.07 95.63 94.38 5-embed 22.98 13.99 96.05 96.72 94.86 Ensemble 46.16 25.58 92.93 94.1 77.57 CIFAR-10 (ResNet18) CIFAR-100 Baseline 58.75 31.87 87.76 86.73 85.83 ODIN 54.85 29.92 85.59 82.26 85.41 1-embed 48.72 26.86 89.18 88.91 88.39 3-embed 50.9 27.95 89.76 90.36 88.13 5-embed 45.25 25.12 91.23 91.86 89.63 Ensemble 56.14 30.57 90.03 90.01 88.27 CIFAR-100 (ResNet34) SVHN Baseline 87.88 46.44 74.11 63.6 84.17 ODIN 76.64 40.82 79.86 68.22 90.1 1-embed 75.79 40.39 81.82 71.52 90.1 3-embed 74.74 39.87 82.57 75.01 90.4 5-embed 60.14 32.57 87.42 77.95 93.56 Ensemble 85.92 45.46 79.1 69.23 89.3 CIFAR-100 (ResNet34) CIFAR-10 Baseline 77.21 41.1 79.18 80.71 75.22 ODIN 74.15 39.57 80.40 80.41 77.2 1-embed 80.82 42.9 75.99 74.27 73.01 3-embed 78.17 41.77 77.35 77.42 74.39 5-embed 77.03 41.01 77.7 77.23 74.61 Ensemble 73.57 39.28 81.49 83.24 78.16 CIFAR-100 (ResNet34) LSUN Baseline 80.41 42.7 78.02 79.25 73.34 ODIN 79.88 42.44 78.94 80.22 73.31 1-embed 80.99 42.99 76.41 75.08 74.02 3-embed 81.08 43.03 74.88 72.21 72.38 5-embed 80.87 42.93 76.08 75.3 72.67 Ensemble 79.53 42.26 79.05 92.61 74.06 We labeled an input as an adversarial example unless all the predictors were in full agreement. We calculated the detection rate of adversarial examples and the false rejection rate of legitimate examples. The ensemble achieved 43.88% detection rate and 11.69% false rejection rate, while the embedding model achieved 62.04% detection rate and 15.16% false rejection rate. Although the ensemble method achieves slightly better false rejection rate (3% improvement), the detection rate of our approach is significantly better (18% improvement). To better qualify that, we fixed the false rejection rate in both methods to be 3%. In this setting, the ensemble reaches 15.41% detection rate while our model reaches 28.64% detection rate (13% improvement). 6 Wrongly Classified Examples Recall the embedding models were trained to minimize the cosine distance between the output vector and the word representation of the target label according to some embedding space. When we plot the average L2-norm of the models’ output vectors as a function of the epochs, we have noticed 7 + + Figure 3: Histogram of the differences between the max and the min rankings of the predicted label in our model (left) and the ensemble model (right) for original and adversarial examples. 0 50 100 150 200 250 300 350 Epochs 2 4 6 8 10 12 14 Avg L2-norm correct examples wrong examples Figure 4: The average L2-norm for wrongly and correctly classified examples as a function of training epochs (left). Density of the L2-norm for wrongly, correctly classified, and out-of-distributions examples (right). that the norm of the wrongly classified examples is significantly smaller than those of correctly classified examples. These finding goes in hand with the results in [39], which observed that lower representation norms are negatively associated with the softmax predictions, as shown in the left panel of Figure 4. Similarly, we observe a similar behavior for out-of-distribution examples as shown in the right panel of Figure 4. These findings suggest that we can adjust the threshold α accordingly. We leave this further exploration for future work. 7 Related Work The problem of detecting out-of-distribution examples in low-dimensional space has been wellstudied, however those methods found to be unreliable for high-dimensional space [40]. Recently, out-of-distribution detectors based on deep models have been proposed. Several studies require enlarging or modifying the neural networks [23, 37, 3], and various approaches suggest to use the output of a pre-trained model with some minor modifications [13, 25]. There has been a variety of works revolving around Bayesian inference approximations, which approximate the posterior distribution over the parameters of the neural network and use them to quantify predictive uncertainty [31, 27]. These Bayesian approximations often harder to implement and computationally slower to train compared to non-Bayesian approaches. The authors of [10] proposed to use Monte Carlo dropout to estimate uncertainty at test time as Bayesian approximation. More recently, [19] introduced a non-Bayesian method, using an ensemble of classifiers for predictive uncertainty estimation, which proved to be significantly better than previous methods. 8 Table 3: Results for in- and out-of-distribution detection, for ImageNet (in) and adversarial examples (out) Model FPR (95% TPR) ↓ Detection Error ↓ AUROC ↑ AUPR-In ↑ AUPR-Out ↑ Ensemble 57.3 31.15 88.66 98.71 43.46 5-embed 57.26 31.12 89.58 98.64 47.2 8 Discussion and Future Work In this paper, we propose to use several semantic representations for each target label as supervision to the model in order to detect out-of-distribution examples, where the detection score is based on the L2-norm of the output representations. For future work, we would like to further investigate the following: (i) we would like to explore better decision strategy for detecting out-of-distribution examples; (ii) we would like to rigorously analyze the notion of confidence based on the L2-norm beyond [39]; (iii) we would like to inspect the relation between detecting wrongly classified examples and adversarial examples to out-of-distribution examples. References [1] Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, Bryan Catanzaro, Jingdong Chen, Mike Chrzanowski, Adam Coates, Greg Diamos, et al. Deep speech 2: Endto-end speech recognition in english and mandarin. In International Conference on Machine Learning, pages 173–182, 2016. [2] Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565, 2016. [3] Jerone TA Andrews, Thomas Tanay, Edward J Morton, and Lewis D Griffin. Transfer representation-learning for anomaly detection. ICML, 2016. [4] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. [5] Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. arXiv preprint arXiv:1312.3005, 2013. [6] Moustapha M Cisse, Yossi Adi, Natalia Neverova, and Joseph Keshet. Houdini: Fooling deep structured visual and speech recognition models with adversarial examples. In Advances in Neural Information Processing Systems, pages 6980–6990, 2017. [7] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. [8] Andrea Frome, Greg S Corrado, Jon Shlens, Samy Bengio, Jeff Dean, Tomas Mikolov, et al. Devise: A deep visual-semantic embedding model. In Advances in neural information processing systems, pages 2121–2129, 2013. [9] Tzeviya Fuchs and Joseph Keshet. Spoken term detection automatically adjusted for a given threshold. IEEE Journal of Selected Topics in Signal Processing, 11(8):1310–1317, 2017. [10] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050–1059, 2016. [11] Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. 9 [12] 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. [13] Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. arXiv preprint arXiv:1610.02136, 2016. [14] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. [15] Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, volume 1, page 3, 2017. [16] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [17] Felix Kreuk, Yossi Adi, Moustapha Cisse, and Joseph Keshet. Fooling end-to-end speaker verification by adversarial examples. arXiv preprint arXiv:1801.03339, 2018. [18] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [19] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pages 6405–6416, 2017. [20] Amos Lapidoth. A foundation in digital communication. Cambridge University Press, 2017. [21] Claudia Leacock and Martin Chodorow. Combining local context and wordnet similarity for word sense identification. WordNet: An electronic lexical database, 49(2):265–283, 1998. [22] 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. [23] Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. arXiv preprint arXiv:1711.09325, 2017. [24] Stefan Lee, Senthil Purushwalkam, Michael Cogswell, David Crandall, and Dhruv Batra. Why m heads are better than one: Training a diverse ensemble of deep networks. arXiv preprint arXiv:1511.06314, 2015. [25] Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. [26] Etai Littwin and Lior Wolf. The multiverse loss for robust transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3957–3966, 2016. [27] David JC MacKay. Bayesian methods for adaptive models. PhD thesis, California Institute of Technology, 1992. [28] Tomas Mikolov, Edouard Grave, Piotr Bojanowski, Christian Puhrsch, and Armand Joulin. Advances in pre-training distributed word representations. In Proceedings of the International Conference on Language Resources and Evaluation (LREC 2018), 2018. [29] 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, pages 3111–3119, 2013. [30] Einat Naaman, Yossi Adi, and Joseph Keshet. Learning similarity function for pronunciation variations. In Proc. of Interspeech, 2017. [31] Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012. 10 [32] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, page 5, 2011. [33] Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 427–436, 2015. [34] Robert Parker, David Graff, Junbo Kong, Ke Chen, and Kazuaki Maeda. English gigaword fifth edition, linguistic data consortium. Google Scholar, 2011. [35] 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. [36] 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. [37] Thomas Schlegl, Philipp Seeböck, Sebastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In International Conference on Information Processing in Medical Imaging, pages 146–157. Springer, 2017. [38] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [39] Yaniv Taigman, Ming Yang, Marc’Aurelio Ranzato, and Lior Wolf. Web-scale training for face identification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2746–2754, 2015. [40] Lucas Theis, Aäron van den Oord, and Matthias Bethge. A note on the evaluation of generative models. ICLR, 2015. [41] Zhibiao Wu and Martha Palmer. Verbs semantics and lexical selection. In Proceedings of the 32nd annual meeting on Association for Computational Linguistics, pages 133–138. Association for Computational Linguistics, 1994. [42] Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. [43] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. [44] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 11
2018
152
7,311
First-order Stochastic Algorithms for Escaping From Saddle Points in Almost Linear Time Yi Xu†, Rong Jin‡, Tianbao Yang† † Department of Computer Science, The University of Iowa, Iowa City, IA 52246, USA ‡ Machine Intelligence Technology, Alibaba Group, Bellevue, WA 98004, USA {yi-xu, tianbao-yang}@uiowa.edu, jinrong.jr@alibaba-inc.com Abstract In this paper, we consider first-order methods for solving stochastic non-convex optimization problems. The key building block of the proposed algorithms is firstorder procedures to extract negative curvature from the Hessian matrix through a principled sequence starting from noise, which are referred to NEgative-curvatureOriginated-from-Noise or NEON and are of independent interest. Based on this building block, we design purely first-order stochastic algorithms for escaping from non-degenerate saddle points with a much better time complexity (almost linear time in the problem’s dimensionality) under a bounded variance condition of stochastic gradients than previous first-order stochastic algorithms. In particular, we develop a general framework of first-order stochastic algorithms with a secondorder convergence guarantee based on our new technique and existing algorithms that may only converge to a first-order stationary point. For finding a nearly second-order stationary point x such that ∥∇F(x)∥≤ϵ and ∇2F(x) ≥−√ϵI (in high probability), the best time complexity of the presented algorithms is eO(d/ϵ3.5), where F(·) denotes the objective function and d is the dimensionality of the problem. To the best of our knowledge, this is the first theoretical result of first-order stochastic algorithms with an almost linear time in terms of problem’s dimensionality for finding second-order stationary points, which is even competitive with existing stochastic algorithms hinging on the second-order information. 1 Introduction The problem of interest in this paper is Stochastic Non-Convex Optimization given by min x∈Rd F(x) ≜Eξ[f(x; ξ)], (1) where ξ is a random variable and f(x; ξ) is a random smooth non-convex function of x. The only information available of F(x) to us is sampled stochastic functions f(x; ξ) and their gradients. A popular choice of algorithms for solving (1) is (mini-batch) stochastic gradient descent (SGD) method and its variants [6]. However, these algorithms do not necessarily guarantee to escape from a saddle point (more precisely a non-degenerate saddle point) x satisfying that: ∇F(x) = 0 and the minimum eigen-value of ∇2F(x)) is less than 0. Recently, new variants of SGD by adding isotropic noise into the stochastic gradient were proposed (noisy SGD [5], stochastic gradient Langevin dynamics (SGLD) [23]). These two works provide rigorous analyses of the noise-injected update for escaping from a saddle point. Unfortunately, both variants suffer from a polynomial time complexity with a super-linear dependence on the dimensionality d (at least a power of 4), which renders them not practical for optimizing problems of high dimension. On the other hand, second-order information carried by the Hessian has been utilized to escape from a saddle point, which usually yields an almost linear time complexity in terms of the dimensionality d under the assumption that the Hessian-vector product (HVP) can be performed in a linear time. In 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Table 1: Comparison with existing Stochastic Algorithms for achieving an (ϵ, γ)-SSP to (1), where p is a number at least 4, IFO (incremental first-order oracle) and ISO (incremental second-order oracle) are terminologies borrowed from [20], representing ∇f(x; ξ) and ∇2f(x; ξ)v respectively, Th denotes the runtime of ISO and Tg denotes the runtime of IFO. eO(·) hides a poly-logarithmic factor. SM refers to stochastic momentum methods. For γ, we only consider as lower as ϵ1/2. Algorithm Oracle Target Time Complexity Noisy SGD [5] IFO (ϵ, ϵ1/2)-SSP, high probability eO (Tgdpϵ−p) SGLD [23] IFO (ϵ, ϵ1/2)-SSP, high probability eO Tgdpϵ−4 Natasha2 [1] IFO + ISO (ϵ, ϵ1/2)-SSP, expectation eO Tgϵ−3.5 + Thϵ−2.5 Natasha2 [1] IFO + ISO (ϵ, ϵ1/4)-SSP, expectation eO Tgϵ−3.25 + Thϵ−1.75 SNCG [17] IFO + ISO (ϵ, ϵ1/2)-SSP, high probability eO Tgϵ−4 + Thϵ−2.5 SVRG-Hessian [20] (finite-sum objectives) IFO + ISO (ϵ, ϵ1/2)-SSP, high probability eO Tg(n2/3ϵ−2 + nϵ−1.5) (n is number of components) +Th(nϵ−1.5 + n3/4ϵ−7/4)  NEON-SGD, NEON-SM (this work) IFO (ϵ, ϵ1/2)-SSP, high probability eO Tgϵ−4 NEON-SCSG (this work) IFO (ϵ, ϵ1/2)-SSP, high probability eO Tgϵ−3.5 NEON-SCSG (this work) IFO (ϵ, ϵ4/9)-SSP, high probability eO Tgϵ−3.33 NEON-Natasha (this work) IFO (ϵ, ϵ1/2)-SSP, expectation eO Tgϵ−3.5 NEON-Natasha (this work) IFO (ϵ, ϵ1/4)-SSP, expectation eO Tgϵ−3.25 NEON-SVRG (this work) (finite sum) IFO (ϵ, ϵ1/2)-SSP, high probability eO Tg n2/3ϵ−2 + nϵ−1.5 + ϵ−2.75 practice, HVP can be estimated by a finite difference approximation using two gradient evaluations. However, the rigorous analysis of algorithms using such noisy approximation for solving non-convex optimization remains unsolved, and heuristic approaches may suffer from numerical issues. Although for some problems with special structures (e.g., neural networks), HVP can be efficiently computed using gradients, a HVP-free method that can escape saddle points for a broader family of non-convex problems is still desirable. This paper aims to design HVP-free stochastic algorithms for solving (1), which can converge to second order stationary points with a time complexity that is almost linear in the problem’s dimensionality. Our main contributions are: • As a key building block of proposed algorithms, first-order procedures (NEON) are proposed to extract negative curvature from the Hessian using a principled sequence starting from noise. Interestingly, our perspective of NEON connects the existing two classes of methods (noisebased and HVP-based) for escaping from saddle points. We provide a formal analysis of simple procedures based on gradient descent and accelerated gradient method for exacting a negative curvature direction from the Hessian. • We develop a general framework of first-order algorithms for stochastic non-convex optimization by combining the proposed first-order NEON procedures to extract negative curvature with existing first-order stochastic algorithms that aim at a first-order critical point. We also establish the time complexities of several interesting instances of our general framework for finding a nearly (ϵ, γ)second-order stationary point (SSP), i.e., ∥∇F(x)∥≤ϵ, and λmin(∇2F(x)) ≥−γ, where ∥· ∥ represents Euclidean norm of a vector and λmin(·) denotes the minimum eigen-value. A summary of our results and existing results for Stochastic Non-Convex Optimization is presented in Table 1. 2 Other Related Work SGD and its many variants (e.g., mini-batch SGD and stochastic momentum (SM) methods) have been analyzed for stochastic non-convex optimization [6, 7, 8, 22]. The iteration complexities of all these algorithms is O(1/ϵ4) for finding a first-order stationary point (FSP) (in expectation E[∥∇F(x)∥2 2] ≤ϵ2 or in high probability). Recently, there are some improvements for stochastic non-convex optimization. [14] proposed a first-order stochastic algorithm (named SCSG) using the variance-reduction technique, which enjoys an iteration complexity of O(1/ϵ−10/3) for finding an FSP (in expectation), i.e., E[∥∇F(x)∥2 2] ≤ϵ2. [1] proposed a variant of SCSG (named Natasha1.5) with the same convergence and complexity. An important application of NEON is that previous stochastic algorithms that have a first-order convergence guarantee can be strengthened to enjoy a second-order convergence guarantee by leveraging the proposed first-order NEON procedures to escape from saddle points. We will analyze several algorithms by combining the updates of SGD, SM, and SCSG with the proposed NEON. 2 Several recent works [17, 1, 20] propose to strengthen existing first-order stochastic algorithms to have second-order convergence guarantee by leveraging the second-order information. [17] used mini-batch SGD, [20] used SVRG for a finite-sum problem, and [1] used a similar algorithm to SCSG for their first-order algorithms. The second-order methods used in these studies for computing negative curvature can be replaced by the proposed NEON procedures. It is notable although a generic approach for stochastic non-convex optimization was proposed in [20], its requirement on the first-order stochastic algorithms precludes many interesting algorithms such as SGD, SM, and SCSG. Stronger convergence guarantee (e.g., converging to a global minimum) of stochastic algorithms has been studied in [9] for a certain family of problems, which is beyond the setting of the present work. It is also worth mentioning that the field of non-convex optimization is moving so fast that similar results have appeared online after the preliminary version of this work [2]. Allen-Zhu and Li [2] proposed NEON2 for finding a negative curvature, which includes a stochastic version and a deterministic version. We notice several differences between the two works: (i) they used Gaussian random noise with a variance proportional to d−C, where C is a large unknown constant, in contrast our NEON and NEON+ procedures use random noise sampled from the sphere of an Euclidean ball with radius proportional to log−2(d); (ii) the update of their deterministic NEON2det is constructed based on the Chebyshev polynomial, in contrast our NEON+ with a similar iteration complexity is based on the well-known Nesterov’s accelerated gradient method; (iii) we provide a general framework/analysis for promoting first-order algorithms to enjoy second-order convergence, which could be useful for promoting new first-order stochastic algorithms; (iv) the reported iteration complexity of their NEON2online is better than our stochastic variants of NEON. However, in most cases the total complexity for finding an (ϵ, √ϵ)-SSP is dominated by the complexity for finding a stationary point not by the complexity of stochastic NEON for finding a negative curvature. 3 Preliminaries Let ∥· ∥denote the Euclidean norm of a vector and ∥· ∥2 denote the spectral norm of a matrix. Let Sd r denote the sphere of an Euclidean ball centered at zero with radius r, and [t] denote a set {0, . . . , t}. A function f(x) has a L1-Lipschitz continuous gradient if it is differentiable and there exists L1 > 0 such that ∥∇f(x) −∇f(y)∥≤L1∥x −y∥holds for any x, y ∈Rd. A function f(x) has a L2-Lipschitz continuous Hessian if it is twice differentiable and there exists L2 > 0 such that ∥∇2f(x) −∇2f(y)∥2 ≤L2∥x −y∥holds for any x, y ∈Rd. It implies that |f(x) −f(y) −∇f(y)⊤(x −y) −1 2(x −y)⊤∇2f(y)(x −y)| ≤L2 6 ∥x −y∥3, and ∥∇f(x + u) −∇f(x) −∇2f(x)u∥≤L2∥u∥2/2. (2) We first make the following assumptions regarding the problem (1). Assumption 1. For the problem (1), we assume that (i). every random function f(x; ξ) is twice differentiable, and it has L1-Lipschitz continuous gradient and L2-Lipschitz continuous Hessian. (ii). given an initial point x0, there exists ∆< ∞such that F(x0) −F(x∗) ≤∆, where x∗denotes the global minimum of (1). (iii). there exists G > 0 such that E[exp(∥∇f(x; ξ) −∇F(x)∥2/G2)] ≤exp(1) holds. Remark. (1) the analysis of NEON or NEON+ or their stochastic versions for extracting the negative curvature only requires Assumption 1 (i). Indeed, the Lipschitz continuous Hessian can be relaxed to locally Lipchitz continuous Hessian condition according to our analysis. (2) Assumptions 1 (ii) (iii) are used in the analysis of Section 5, which are standard assumptions made in the literature of stochastic non-convex optimization [6, 7, 8]. Assumption 1 (iii) implies that E[∥∇f(x; ξ) − ∇F(x)∥2] ≤V ≜G2 holds. For stating our time complexities, we assume G is independent of d for finding an approximate local minimum in Section 5. Nevertheless, our comparison of the proposed algorithms with previous algorithms (e.g., SGLD [23], SNCG [17], Natasha2 [1]) in the stochastic setting are fair because similar assumptions are also made. We also note that [5] makes a stronger assumption about the stochastic gradients, i.e., ∥∇f(x; ξ) −∇F(x)∥≤O(d), which leads to a worse dependence of time complexity on d, i.e., O(dp) with p ≥4. Next, we discuss a second-order method based on HVPs to escape from a non-degenerate saddle point x of a function f(x) that satisfies λmin(∇2f(x)) ≤−γ, which can be found in many previous studies [21, 16, 4]. The method is based on a negative curvature (NC for short is used in the sequel) 3 direction v ∈Rd that satisfies ∥v∥= 1 and v⊤∇2f(x)v ≤−cγ, (3) where c > 0 is a constant. Given such a vector v, we can update the solution according to x+ = x −cγ L2 sign(v⊤∇f(x))v, or x′ + = x −cγ L2 ¯ξv, (4) where ¯ξ ∈{1, −1} is a Rademacher random variable used when ∇f(x) is not available. The following lemma establishes that the objective value of x+ or x′ + is less than that of x by a sufficient amount, which makes it possible to escape from the saddle point x. Lemma 1. For x satisfying λmin(∇2f(x)) ≤−γ and v satisfying (3), let x+, x′ + be given in (4), then we have f(x) −f(x+) ≥c3γ3 3L2 2 and E[f(x) −f(x′ +)] ≥c3γ3 3L2 2 . To compute a NC direction v that satisfies (3), we can employ the Lanczos method or the Power method for computing the maximum eigen-vector of the matrix (I −η∇2f(x)), where ηL1 ≤1 such that I −η∇2f(x) ⪰0. The Power method starts with a random vector v1 ∈Rd (e.g., drawn from a uniform distribution over the unit sphere) and iteratively compute vτ+1 = (I −η∇2f(x))vτ, τ = 1, . . . , t. Following the results in [13], it can be shown that if λmin(∇2f(x)) ≤−γ, then with at most log(d/δ2)L1 γ HVPs, the Power method finds a vector ˆvt = vt/∥vt∥such that ˆv⊤ t ∇2f(x)ˆvt ≤−γ 2 holds with high probability 1 −δ. Similarly, the Lanczos method (e.g., Lemma 11 in [21]) can find such a vector ˆvt with a lower number of HVPs, i.e., min(d, log(d/δ2)√L1 2 √ 2ε ). 4 Key Building Block: Extracting NC From Noise Our HVP-free stochastic algorithms with provable guarantees for solving (1) presented in next section are based on a key building block, i.e., extracting NC from noise using only first-order information. To tackle the stochastic objective in (1), our method is to compute a NC based on a mini-batch of functions Pm i=1 f(x; ξi)/m for a sufficiently large number of samples. Thus, a key building block of the proposed method is a first-order procedure to extract NC for a non-convex function f(x) 1. Below, we first propose a gradient descent based method for extracting NC, which achieves a similar iteration complexity to the Power method. Second, we present an accelerated gradient method to extract the NC to match the iteration complexity of the Lanczos method. Finally, we discuss the application of these procedures for stochastic non-convex optimization using mini-batch. 4.1 Extracting NC by NEON The NEON is inspired by the perturbed gradient descent (PGD) method (a method for solving deterministic non-convex problems) proposed in the seminal work [11] and its connection with the Power method as discussed shortly. Around a saddle point x, the PGD method first generates a random noise vector ˆe from the sphere of an Euclidean ball with a proper radius, then starts with a noise perturbed solution x0 = x + ˆe, the PGD generates the following sequence of solutions: xτ = xτ−1 −η∇f(xτ−1). (5) To establish a connection with the Power method and motivate the proposed NEON, let us define another sequence of bxτ = xτ −x. Then we have the recurrence for bxτ = bxτ−1 −η∇f(bxτ−1 + x), τ = 1, . . . , t. It is clear that for τ = 1, . . . , t, bxτ = bxτ−1 −η∇f(x) −η(∇f(bxτ−1 + x) −∇f(x)). To understand the above update, we adopt the following approximation: ∇f(x) ≈0 for an approximate saddle point, and from the Lipschitz continuous Hessian condition (2), we can see that ∇f(bxτ−1 + x) −∇f(x) ≈∇2f(x)bxτ−1 as long as ∥bxτ−1∥is small. Then for τ = 1, . . . , t, bxτ ≈bxτ−1 −η∇2f(x)bxτ−1 = (I −η∇2f(x))bxτ−1. It is obvious that the above approximated recurrence is close to the the sequence generated by the Power method with the same starting random vector ˆe = v1. This intuitively explains that why the updated solution xt = x + bxt can decrease the objective value due to that bxt is close to a NC of the 1We abuse the same notation f here. 4 Algorithm 1 NEON(f, x, t, F, r) 1: Input: f, x, t, F, r 2: Generate u0 randomly from Sd r 3: for τ = 0, . . . , t do 4: uτ+1 = uτ −η(∇f(x + uτ) −∇f(x)) 5: end for 6: if mini∈[t+1],∥ui∥≤U ˆfx(ui) ≤−2.5F 7: return uτ ′, τ ′ = arg mini∈[t+1],∥ui∥≤U ˆfx(ui) 8: else return 0 Algorithm 3 NCFind (y0:τ, u0:τ) 1: if minj=0,...,τ ∥yj −uj∥≥ζ√6ηF 2: return yj, j = min{j′ : ∥yj′−uj′∥≥ζ√6ηF} 3: else return yτ −uτ Algorithm 2 NEON+(f, x, t, F, U, ζ, r) 1: Input: f, x, t, F, U, ζ, r 2: Generate y0 = u0 randomly from Sr 3: for τ = 0, . . . , t do 4: if ∆x(yτ, uτ) < −γ 2 ∥yτ −uτ∥2 then 5: return v =NCFind(y0:τ, u0:τ) 6: end if 7: compute (yτ+1, uτ+1) by (8) 8: end for 9: if mini,∥yi∥≤U ˆfx(yi) ≤−2F then 10: let τ ′ = arg mini,∥yi∥≤U ˆfx(yi) 11: return yτ ′ 12: else 13: return 0 14: end if Hessian ∇2f(x). To provide a formal analysis, we will first analyze the following recurrence: uτ = uτ−1 −η(∇f(x + uτ−1) −∇f(x)), τ = 1, . . . (6) starting with a random noise vector u0, which is drawn from the sphere of an Euclidean ball with a proper radius r denoted by Sd r. It is notable that the recurrence in (6) is slightly different from that in (5). We emphasize that this simple change is useful for extracting the NC at any points whose Hessian has a negative eigen-value not just at non-degenerate saddle points, which can be used in some stochastic or deterministic algorithms [1, 4, 21, 16]. The proposed procedure NEON based on the above sequence for finding a NC direction of ∇2f(x) is presented in Algorithm 1, where ˆfx(u) is defined in (7). The following theorem states our result of NEON for extracting the NC. Theorem 1. Under Assumption 1 (i), let γ ∈(0, 1) and δ ∈(0, 1) be a sufficiently small. For any constant ˆc ≥18, there exists a constant cmax that depends on ˆc, such that if NEON is called with t = ˆc log(dL1/(γδ)) ηγ , F = ηγ3L1L−2 2 log−3(dL1/(γδ)), r = √ηγ2L−1/2 1 L−1 2 log−2(dL1/(γδ)), U = 4ˆc(√ηL1F/L2)1/3 and a constant η ≤cmax/L1, then at a point x satisfying λmin(∇2f(x)) ≤ −γ with high probability 1 −δ it returns u such that u⊤∇2f(x)u ∥u∥2 ≤− γ 8ˆc2 log(dL1/(γδ)) ≤−eΩ(γ). If NEON returns u ̸= 0, then the above inequality must hold; if NEON returns 0, we can conclude that λmin(∇2f(x)) ≥−γ with high probability 1 −O(δ). Remark: The above theorem shows that at any point x whose Hessian has a negative eigen-value (including non-degenerate saddle points), NEON can find a NC of ∇2f(x) with high probability. 4.2 Finding NC by Accelerated Gradient Method Although NEON provides a similar guarantee for extracting a NC as that provided by the Power method, but its iteration complexity O(1/γ) is worse than that of the Lanczos method, i.e., O(1/√γ). In this subsection, we present a first-order method that matches O(1/√γ) of the Lanczos method. Let us recall the sequence (6), which is essentially an application of gradient descent (GD) method to the following objective function: ˆfx(u) = f(x + u) −f(x) −∇f(x)⊤u. (7) In the sequel, we write ˆfx(u) = ˆf(u), where the dependent x should be clear from the context. By the Lipschitz continuous Hessian condition, we have that 1 2u⊤∇2f(x)u −L2 6 ∥u∥3 ≤ˆf(u). It implies that if ˆf(u) is sufficiently less than zero and ∥u∥is not too large, then u⊤∇2f(x)u ∥u∥2 will be sufficiently less than zero. Hence, NEON can be explained as using GD updates to decrease ˆf(u). 5 A natural question to ask is whether the convergence of GD updates of NEON can be accelerated by accelerated gradient (AG) methods. It is well-known from convex optimization literature that AG methods can accelerate the convergence of GD method for smooth problems. Recently, several studies have explored AG methods for non-convex optimization [15, 19, 3, 12]. Notably, [19] analyzed the behavior of AG methods near strict saddle points and investigated the rate of divergence from a strict saddle point for toy quadratic problems. [12] analyzed a single-loop algorithm based on Nesterov’s AG method for deterministic non-convex optimization. However, none of these studies provide an explicit complexity guarantee on extracting NC from the Hessian matrix for a general non-convex problem. Inspired by these studies, we will show that Nesterov’s AG (NAG) method [18] when applied the function ˆf(u) can find a NC with a complexity of eO(1/√γ). The updates of NAG method applied to the function ˆf(u) at a given point x is given by yτ+1 = uτ −η∇ˆf(uτ), uτ+1 = yτ+1 + ζ(yτ+1 −yτ), (8) where ζ(yτ+1 −yτ) is the momentum term, and ζ ∈(0, 1) is the momentum parameter. The proposed algorithm based on the NAG method (referred to as NEON+) for extracting NC of a Hessian matrix ∇2f(x) is presented in Algorithm 2, where ∆x(yτ, uτ) = ˆfx(yτ) −ˆfx(uτ) −∇ˆfx(uτ)⊤(yτ −uτ), and NCFind is a procedure that returns a NC by searching over the history y0:τ, u0:τ shown in Algorithm 3. The condition check in Step 4 is to detect easy cases such that NCFind can easily find a NC in historical solutions without continuing the update, which is designed following a similar procedure called Negative Curvature Exploitation (NCE) proposed in [12]. However, the difference is that NCFind is tailored to finding a negative curvature satisfying (3), while NCE in [12] is for ensuring a decrease on a modified objective. The theoretical result of NEON+ is presented below. Theorem 2. Under Assumption 1 (i), let γ ∈(0, 1) and δ ∈(0, 1) be a sufficiently small. For any constant ˆc ≥43, there exists a constant cmax that depends on ˆc, such that if NEON+is called with t = q ˆc log(dL1/(γδ)) ηγ , F = ηγ3L1L−2 2 log−3(dL1/(γδ)), r = √ηγ2L−1/2 1 L−1 2 log−2(dL1/(γδ)), U = 12ˆc(√ηL1F/L2)1/3, a small constant η ≤cmax/L1, and a momentum parameter ζ = 1−√ηγ, then at any point x satisfying λmin(∇2f(x)) ≤−γ with high probability 1 −δ it returns u such that u⊤∇2f(x)u ∥u∥2 ≤− γ 72ˆc2 log(dL1/(γδ)) ≤−eΩ(γ). If NEON+returns u ̸= 0, then the above inequality must hold; if NEON+returns 0, we can conclude that λmin(∇2f(x)) ≥−γ with high probability 1 −O(δ). 4.3 Stochastic Approach for Extracting NC In this subsection, we present a stochastic approach for extracting NC for F(x) in (1). For simplicity, we refer to both NEON and NEON+ as NEON. The challenge in employing NEON for finding a NC for the original function F(x) in (1) is that we cannot evaluate the gradient of F(x) exactly. To address this issue, we resort to the mini-batching technique. Let S = {ξ1, . . . , ξm} denote a set of random samples and define a sub-sampled function FS(x) = 1 |S| P ξ∈S f(x; ξ). Then we apply NEON to FS(x) for finding an approximate NC uS of ∇2FS(x). Below, we show that as long as m is sufficiently large, uS is also an approximate NC of ∇2F(x). Theorem 3. Under Assumption 1 (i), for a sufficiently small δ ∈(0, 1) and ˆc ≥43, let m ≥ 16L2 1 log(6d/δ) s2γ2 , where s = log−1(3dL1/(2γδ)) (12ˆc)2 is a proper small constant. If λmin(∇2F(x)) ≤−γ, there exists c > 0 such that with probability 1 −δ, NEON(FS, x, t, F, r) returns a vector uS such that u⊤ S ∇2F (x)uS ∥uS∥2 ≤−cγ, where c = (12ˆc)−2 log−1(3dL1/(2γδ)). If NEON(FS, x, t, F, r) returns 0, then with high probability 1 −O(δ) we have λmin(∇2F(x)) ≥−2γ. In either case, NEON terminates with an IFO complexity of eO(1/γ3) or eO(1/γ2.5) corresponding to Algorithm 1 and Algorithm 2, respectively. 6 Algorithm 4 NEON-A 1: Input: x1, other parameters of algorithm A 2: for j = 1, 2, . . . , do 3: Compute (yj, zj) = A(xj) 4: if first-order condition of yj not met then 5: let xj+1 = zj 6: else 7: uj = NEON(FS2, yj, t, F, r) 8: if uj = 0 return yj 9: else let xj+1 = yj −cγ ¯ξ L2 uj ∥uj∥ 10: end if 11: end for Algorithm 6 SCSG-epoch: (x, S1, b) 1: Input: x, an independent set of samples S1 and b ≤|S1| 2: Set m1 = |S1|, η = c′(m1/b)−2/3, c′ ≤1/6 3: Compute ∇FS(xj−1) and let x0 = x 4: Generate N ∼Geom(m1/(m1 + b)) 5: for k = 1, 2, . . . , N do 6: Sample samples Sk of size b 7: vk = ∇FSk(xk−1) −∇FSk(x0) + ∇FS(x0) 8: xk = xk−1 −ηvk 9: end for 10: return xN 5 First-order Algorithms for Stochastic Non-Convex Optimization In this section, we will first describe a general framework for promoting existing first-order stochastic algorithms denoted by A to enjoy a second-order convergence, which is shown in Algorithm 4. Here, we require A(xj) to return two points (yj, zj) that satisfy (9) and the mini-batch sample size m = |S2| satisfies the condition in Lemma 3. The proposed NEON is used for escaping from a saddle point. It should be noted that Algorithm 4 is abstract depending on how to implement Step 3, how to check the first-order condition, and how to set the step size parameter ¯ξ in Step 9. For theoretical interest, we will analyze Algorithm 4 with a Rademacher random variable ¯ξ ∈{1, −1} and its three main components satisfying the following properties. Property 1. (1) Step 7 - Step 9 guarantees that if λmin(∇2F(yj)) ≤−γ, there exists C > 0 such that E[F(xj+1) −F(yj)] ≤−Cγ3. Let the total IFO complexity of Step 7 - Step 9 be Tn. (2) There exists a first-order stochastic algorithm (yj, zj) = A(xj) that satisfies: if ∥∇F(yj)∥≥ϵ, then E[F(zj) −F(xj)] ≤−ε(ϵ, α) if ∥∇F(yj)∥≤ϵ, then E[F(yj) −F(xj)] ≤Cγ3/2 (9) where ε(ϵ, α) is a function of ϵ and a parameter α > 0. Let the total IFO complexity of A(x) be Ta. (3) the check of first-order condition can be implemented by using a mini-batch of samples S, i.e., ∥∇FS(yj)∥≤ϵ, where S is independent of yj such that ∥∇F(yj) −∇FS(yj)∥≤ϵ/2. Let the IFO complexity of checking the first-order condition be Tc. Property (1) can be guaranteed by Theorem 3 and Lemma 1. When using NEON, Tn = eO(1/γ3) and when using NEON+, Tn = eO(1/γ2.5). For Property (2), we will analyze several interesting algorithms. Property (3) can be guaranteed by Lemma 2 in the supplement under Assumption (1) (iii) with Tc = eO( 1 ϵ2 ). Based on the above properties, we have the following convergence of Algorithm 4. Theorem 4. Assume Properties 1 hold. Then with high probability 1−δ, NEON-A terminates with a total IFO complexity of eO(max( 1 ε(ϵ,α), 1 γ3 )(Tn + Ta + Tc)). Upon termination, with high probability ∥∇F(yj)∥≤O(ϵ) and λmin(∇2F(yj)) ≥−2γ, where eO(·) hides logarithmic factors of d and 1/δ, and problem’s other constant parameters. Next, we present corollaries of Theorem 4 for several instances of A, including stochastic gradient descent (SGD) method, stochastic momentum (SM) methods, mini-batch SGD (MSGD), and SCSG. SGD and its momentum variants (including stochastic heavy-ball (SHB) method and stochastic Nesterov’s accelerated gradient (SNAG) method) are popular stochastic algorithms for solving a stochastic non-convex optimization problem. We will consider them in a unified framework as established in [22]. The updates of SM starting from x0 are bxτ+1 = xτ −η∇f(xτ; ξτ), bxs τ+1 = xτ −sη∇f(xτ; ξτ), xτ+1 = bxτ+1 + β(bxs τ+1 −bxs τ), (10) 7 Algorithm 5 SM: (x0, η, β, s, t) 1: for τ = 0, 1, 2, . . . , t do 2: Compute xτ+1 according to (10) 3: Compute x+ τ+1 according to (11) 4: end for 5: return (x+ τ ′, x+ t+1), where τ ′ ∈{0, . . . , t} is a randomly generated. #IFO (or #ISO) ×104 0 1 2 3 4 5 6 vTHv -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 Power Lanczos NEON NEON+ NEONst NEON+st min-eig-val Figure 1: NEON vs Second-order Methods for Extracting NC for τ = 0, . . . , t and bxs 0 = x0, where β ∈(0, 1) is a momentum constant, η is a step size, s = 0, 1, 1/(1 −β) corresponds to SHB, SNAG and SGD. Let sequence x+ τ with x+ 0 = x0 be defined as x+ τ = xτ + pτ, τ ≥1, pτ = β 1 −β (xτ −xτ−1 −sη∇f(xτ−1; ξτ−1)). (11) We can implement A by Algorithm 5 and have the following result. Corollary 5. Let A(xj) be implemented by Algorithm 5 with t = Θ(1/ϵ2) iterations, η = Θ(ϵ2), β ∈ (0, 1), s ∈(0, 1/(1 −β)). Then Ta = O(1/ϵ2) and ε(ϵ, α) = Θ(ϵ2). Suppose that γ ≥ϵ2/3 and E[∥∇f(x; ξ)∥2] is bounded for s ̸= 1/(1 −β). Then with high probability, NEON-SM finds an (ϵ, γ)-SPP with a total IFO complexity of eO(max( 1 ϵ2 , 1 γ3 )(Tn + 1 ϵ2 )), where Tn = eO(1/γ3) (NEON) or Tn = eO(1/γ2.5) (NEON+). Remark: When γ = ϵ1/2, NEON-SM has an IFO complexity of eO( 1 ϵ4 ). MSGD computes (yj, zj) by zj = xj −L−1 1 ∇FS1(xj), yj = xj (12) where S1 is a set of samples independent of xj. Corollary 6. Let A(xj) be implemented by (12) with |S1| = eO(1/ϵ2). Then Ta = eO(1/ϵ2) and ε(ϵ, α) = ϵ2 4L1 . With high probability, NEON-MSGD finds an (ϵ, γ)-SPP with a total IFO complexity of eO(max( 1 ϵ2 , 1 γ3 )(Tn + 1/ϵ2)). Remark: Compared to Corollary 5, there is no requirement on γ ≥ϵ2/3, which is due to that MSGD can guarantee that E[F(yj) −F(xj)] ≤0. SCSG was proposed in [14], which only provides a first-order convergence guarantee. SCSG runs with multiple epochs, and each epoch uses similar updates as SVRG with three distinct features: (i) it was applied to a sub-sampled function FS1; (ii) it allows for using a mini-batch samples of size b independent of S1 to compute stochastic gradients; (ii) the number of updates of each epoch is a random number following a geometric distribution dependent on b and |S1|. These features make each SGCG epoch denoted by SCSG-epoch(x, S1, b) have an expected IFO complexity of Ta = O(|S1|). We present SCSG-epoch(x, S1, b) in Algorithm 6. For using SCSG, yj and zj are yj = SCSG-epoch(xj, S1, b), zj = yj (13) Corollary 7. Let A(xj) be implemented by (13) with |S1| = eO max(1/ϵ2, 1/(γ9/2b1/2))  . Then ε(ϵ, α) = Ω(ϵ4/3/b1/3) and E[Ta] = eO max(1/ϵ2, 1/(γ9/2b1/2))  . With high probability, NEONSCSG finds an (ϵ, γ)-SSP with an expected total IFO complexity of eO(max( b1/3 ϵ4/3 , 1 γ3 )(Tn + 1/ϵ2 + 1/(γ9/2b1/2))), where Tn = eO(1/γ3) (NEON) or Tn = eO(1/γ2.5) (NEON+). Remark: When γ = ϵ1/2, b = 1/√ϵ, NEON-SCSG has an expected IFO complexity of eO( 1 ϵ3.5 ). When γ ≥ϵ4/9, b = 1, NEON-SCSG has an expected IFO complexity of eO(1/ϵ3.33). Finally, we mention that the proposed NEON or NEON+ can be used in existing second-order stochastic algorithms that require a NC direction as a substitute of second-order methods [1, 20]. [1] developed Natasha2, which uses second-order online Oja’s algorithm for finding the NC. [20] developed a stochastic algorithm for solving a finite-sum problem by using SVRG and a second-order stochastic algorithm for computing the NC. We can replace the second-order methods for computing a NC in these algorithms by the proposed NEON or NEON+, with the resulting algorithms referred to as NEON-Natasha and NEON-SVRG. It is a simple exercise to derive the convergence results in Table 1, which is left to interested readers. 8 #IFO ×104 0 1 2 3 4 5 objective -4000 -3500 -3000 -2500 -2000 -1500 -1000 -500 0 d = 103 NEON+-SGD NEON-SGD Noisy SGD #IFO ×104 0 1 2 3 4 5 objective ×104 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 d = 104 NEON+-SGD NEON-SGD Noisy SGD #IFO ×104 0 1 2 3 4 5 objective ×105 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 d = 105 NEON+-SGD NEON-SGD Noisy SGD Figure 2: NEON-SGD vs Noisy SGD. (All algorithms converge to local minimum) 6 Experiments Extracting NC. First, we present some simulations to verify the proposed NEON procedures for extracting NC. To this end, we consider minimizing non-linear least square loss with a non-convex regularizer for classification, i.e., F(x) = Pd i=1 x2 i 1+x2 i + λ n Pn i=1(bi −σ(x⊤ai))2, where bi ∈{0, 1} denotes the label and ai ∈Rd denotes the feature vector of the i-th data, λ > 0 is a trade-off parameter, and σ(·) is a sigmoid function. We generate a random vector x ∼N(0, I) as the target point to construct ˆFx(u) and compute a NC of ∇2F(x). We use a binary classification data named gisette from the libsvm data website that has n = 6000 examples and d = 5000 features, and set λ = 3 in our simulation to ensure there is significant NC from the non-linear least-square loss. The step size η and initial radius in NEON procedures are set to be 0.01 and the momentum parameter in NEON+ is set to be 0.9. These values are tuned in a certain range. We compare the two NEON procedures and their stochastic variants (denoted by NEON-st and NEON+-st in the figure) with second-order methods that use HVPs, namely the Power method and the Lanczos method, where the HVPs are calculated exactly. The result is shown in Figure 1 whose y-axis denotes the value of bu⊤Hbu, where bu represents the found normalized NC vector and H = ∇2F(x) is the Hessian matrix. For NEON-st and NEON+-st, we use a sample size of 100. Please note that the solid red curve corresponding to NEON+-st terminates earlier due to that NCFind is executed. Several observations follow: (i) NEON performs similarly to the Power method (the two curves overlap in the figure); (ii) NEON+ has a faster convergence than NEON; (iv) the stochastic versions of NEON and NEON+ can quickly find a good NC directions than their full versions in terms of IFO complexity and are even competitive with the Lanczos method. We include several more results in the supplement. Escaping Saddles. Second, we present some simulations to verify the proposed NEON and NEON+ based algorithms for minimizing a stochastic objective. We consider a non-convex optimization problem with f(x; ξ) = Pd i=1 ξi(x4 i −4x2 i ) where ξi are a normal random variables with mean of 1 so that the saddle points of the expected function are known [10]. Assuming the noise ξ is only accessed through a sampler, then we compare NEON-SGD with a state-of-the-art algorithm Noisy SGD [5] for different values of d ∈{103, 104, 105}. The step size of Noisy SGD is tuned in a wide range and the best one is used. The step size in NEON procedures are set to be the same value as Noisy SGD. The radius in NEON procedures is set to be 0.01 and the momentum paramenter in NEON+ is set to be 0.9. The mini-batch size is tuned from {50, 100, 200, 500}. All algorithms are started with a same saddle point as the initial solution. The results are presented in Figure 2, showing that two variants of NEON-SGD methods can escape saddles faster than Noisy SGD. NEON+-SGD escapes saddle points the fastest among all algorithms for different values of d. In addition, the increasing of dimensionality d has much larger effect on the IFO complexity of Noisy-SGD than that of NEON-SGD methods, which is consistent with theoretical results. 7 Conclusions We have proposed novel first-order procedures to extract negative curvature from a Hessian matrix by using a noise-initiated sequence, which are of independent interest. A general framework for promoting a first-order stochastic algorithm to enjoy a second-order convergence is also proposed. Based on the proposed general framework, we designed several first-order stochastic algorithms with state-of-the-art second-order convergence guarantee. 9 Acknowledgement The authors thank the anonymous reviewers for their helpful comments. Y. Xu and T. Yang are partially supported by National Science Foundation (IIS-1545995). References [1] Z. Allen-Zhu. Natasha 2: Faster non-convex optimization than sgd. CoRR, /abs/1708.08694, 2017. [2] Z. Allen-Zhu and Y. Li. Neon2: Finding local minima via first-order oracles. CoRR, abs/1711.06673, 2017. [3] Y. Carmon, J. C. Duchi, O. Hinder, and A. Sidford. "convex until proven guilty": Dimension-free acceleration of gradient descent on non-convex functions. In ICML, pages 654–663, 2017. [4] Y. Carmon, J. C. Duchi, O. Hinder, and A. Sidford. Accelerated methods for nonconvex optimization. SIAM Journal on Optimization, 28(2):1751–1772, 2018. [5] R. Ge, F. Huang, C. Jin, and Y. Yuan. Escaping from saddle points — online stochastic gradient for tensor decomposition. In COLT, pages 797–842, 2015. [6] S. Ghadimi and G. Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [7] S. Ghadimi and G. Lan. Accelerated gradient methods for nonconvex nonlinear and stochastic programming. Math. Program., 156(1-2):59–99, 2016. [8] S. Ghadimi, G. Lan, and H. Zhang. Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization. Math. Program., 155(1-2):267–305, 2016. [9] E. Hazan, K. Y. Levy, and S. Shalev-Shwartz. On graduated optimization for stochastic non-convex problems. In ICML, pages 1833–1841, 2016. [10] P. Jain, P. Kar, et al. Non-convex optimization for machine learning. Foundations and Trends R⃝ in Machine Learning, 10(3-4):142–336, 2017. [11] C. Jin, R. Ge, P. Netrapalli, S. M. Kakade, and M. I. Jordan. How to escape saddle points efficiently. In ICML, pages 1724–1732, 2017. [12] C. Jin, P. Netrapalli, and M. I. Jordan. Accelerated gradient descent escapes saddle points faster than gradient descent. In COLT, pages 1042–1085, 2018. [13] J. Kuczynski and H. Wozniakowski. Estimating the largest eigenvalue by the power and lanczos algorithms with a random start. SIAM Journal on Matrix Analysis and Applications, 13(4):1094–1122, 1992. [14] L. Lei, C. Ju, J. Chen, and M. I. Jordan. Non-convex finite-sum optimization via SCSG methods. In NIPS, pages 2345–2355, 2017. [15] H. Li and Z. Lin. Accelerated proximal gradient methods for nonconvex programming. In NIPS, pages 379–387, 2015. [16] M. Liu and T. Yang. On noisy negative curvature descent: Competing with gradient descent for faster non-convex optimization. CoRR, abs/1709.08571, 2017. [17] M. Liu and T. Yang. Stochastic non-convex optimization with strong high probability secondorder convergence. CoRR, abs/1710.09447, 2017. [18] Y. Nesterov. Introductory lectures on convex optimization : a basic course. Applied optimization. Kluwer Academic Publ., 2004. [19] M. O’Neill and S. J. Wright. Behavior of accelerated gradient methods near critical points of nonconvex problems. CoRR, abs/1706.07993, 2017. 10 [20] S. Reddi, M. Zaheer, S. Sra, B. Poczos, F. Bach, R. Salakhutdinov, and A. Smola. A generic approach for escaping saddle points. In AISTATS, pages 1233–1242, 2018. [21] C. W. Royer and S. J. Wright. Complexity analysis of second-order line-search algorithms for smooth nonconvex optimization. SIAM Journal on Optimization, 28(2):1448–1477, 2018. [22] Y. Yan, T. Yang, Z. Li, Q. Lin, and Y. Yang. A unified analysis of stochastic momentum methods for deep learning. In IJCAI, pages 2955–2961, 2018. [23] Y. Zhang, P. Liang, and M. Charikar. A hitting time analysis of stochastic gradient langevin dynamics. In COLT, pages 1980–2022, 2017. 11
2018
153
7,312
cpSGD: Communication-efficient and differentially-private distributed SGD Naman Agarwal Google Brain Princeton, NJ 08540 namanagarwal@google.com Ananda Theertha Suresh Google Research New York, NY theertha@google.com Felix Yu Google Research New York, NY felixyu@google.com Sanjiv Kumar Google Research New York, NY sanjivk@google.com H. Brendan McMahan Google Research Seattle, WA mcmahan@google.com Abstract Distributed stochastic gradient descent is an important subroutine in distributed learning. A setting of particular interest is when the clients are mobile devices, where two important concerns are communication efficiency and the privacy of the clients. Several recent works have focused on reducing the communication cost or introducing privacy guarantees, but none of the proposed communication efficient methods are known to be privacy preserving and none of the known privacy mechanisms are known to be communication efficient. To this end, we study algorithms that achieve both communication efficiency and differential privacy. For d variables and n ⇡d clients, the proposed method uses O(log log(nd)) bits of communication per client per coordinate and ensures constant privacy. We also improve previous analysis of the Binomial mechanism showing that it achieves nearly the same utility as the Gaussian mechanism, while requiring fewer representation bits, which can be of independent interest. 1 Introduction 1.1 Background Distributed stochastic gradient descent (SGD) is a basic building block of modern machine learning [25, 11, 9, 28, 1, 27, 5]. In the typical scenario of synchronous distributed learning, in every round, each client obtains a copy of a global model which it updates based on its local data. The updates (usually in the form of gradients) are sent to a parameter server, where they are averaged and used to update the global model. Alternatively, without a central server, each client maintains a global model and either broadcasts the gradient to all or a subset of other clients, and updates its model with the aggregated gradient. In our paper we specifically consider the centralized setting, for the decentralized case the authors are referred to [36] and references therein. Often, the communication cost of sending the gradient becomes the bottleneck [30, 23, 22]. To address this issue, several recent works have focused on reducing the communication cost of distributed learning algorithms via gradient quantization and sparsification [32, 17, 33, 20, 21, 4, 34]. These algorithms have been shown to improve communication cost and hence communication time in distributed learning. This is especially effective in the federated learning setting where clients are mobile devices with expensive up-link communication cost [26, 20]. 32nd Conference on Neural Information Processing Systems (NIPS 2018), Montréal, Canada. While communication is a key concern in client based distributed machine learning, an equally important consideration is that of protecting the privacy of participating clients and their sensitive information. Providing rigorous privacy guarantees for machine learning applications has been an area of active recent interest [6, 35, 31]. Differentially private gradient descent algorithms in particular were studied in the work of [2]. A direct application of these mechanisms in distributed settings leads to algorithms with high communication costs. The key focus of our paper is to analyze mechanisms that achieve rigorous privacy guarantees as well as have communication efficiency. 1.2 Communication efficiency We first describe synchronous distributed SGD formally. Let F(w) : Rd ! R be of the form F(w) = 1 M · PM i=1 fi(w), where each fi resides at the ith client. For example, w’s are weights of a neural network and fi(w) is the loss of the network on data located on client i. Let w0 be the initial value. At round t, the server transmits wt to all the clients and asks a random set of n (batch size / lot size) clients to transmit their local gradient estimates gt i(wt). Let S be the subset of clients. The server updates as follows gt(wt) = 1 n X i2S gt i(wt), wt+1 , wt −γgt(wt) for some suitable choice of γ. Other optimization algorithms such as momentum, Adagrad, or Adam can also be used instead of the SGD step above. Naively for the above protocol, each of the n clients needs to transmit d reals, typically using O(d · log 1/⌘) bits1. This communication cost can be prohibitive, e.g., for a medium size PennTreeBank language model [39], the number of parameters d > 10 million and hence total cost is ⇠38MB (assuming 32 bit float), which is too large to be sent from a mobile phone to the server at every round. Motivated by the need for communication efficient protocols, various quantization algorithms have been proposed to reduce the communication cost [33, 20, 21, 38, 37, 34, 5]. In these protocols, the clients quantize the gradient by a function q and send an efficient representation of q(gt i(wt)) instead of its actual local gradient gt i(wt). The server computes the gradient as ˜gt(wt) = 1 n X i2S q(gt i(wt)), and updates wt as before. Specifically, [33] proposes a quantization algorithm which reduces the requirement of full (or floating point) arithmetic precision to a bit or few bits per value on average. There are many subsequent works e.g., see [21] and in particular [5] showed that stochastic quantization and Elias coding [15] can be used to obtain communication-optimal SGD for convex functions. If the expected communication cost at every round t is bounded by c, then the total communication cost of the modified gradient descent is at most T · c. (1) All the previous papers relate the error in gradient compression to SGD convergence. We first state one such result for completeness for non-convex functions and prove it in Appendix A. Similar (and stronger) results can be obtained for (strongly) convex functions using results in [16] and [29]. Corollary 1 ([16]). Let F be L-smooth and 8x krF(x)k2 D. Let w0 satisfy F(w0) −F(w⇤)  DF . Let q be a quantization scheme, and γ , min n L−1, p2DF (σ p LT)−1o , then after T rounds Et⇠(Unif[T ])[krF(wt)k2 2] 2DF L T + 2 p 2σpLDF p T + DB, where σ2 = max 1tT 2E[kgt(wt) −rF(wt)k2 2] + 2 max 1tT Eq[kgt(wt) −˜gt(wt)k2 2], (2) and B = max1tT kEq[gt(wt) −˜gt(wt)]k. The expectation in the above equations is over the randomness in gradients and quantization. 1⌘is the per-coordinate quantization accuracy. To represent a d dimensional vector X to an constant accuracy in Euclidean distance, each coordinate is usually quantized to an accuracy of ⌘= 1/ p d. 2 The above result relates the convergence of distributed SGD for non-convex functions to the worstcase mean square error (MSE) and bias in gradient mean estimates in Equation (2). Thus smaller the mean square error in gradient estimation, better convergence. Hence, we focus on the problem of distributed mean estimation (DME), where the goal is to estimate the mean of a set of vectors. 1.3 Differential privacy While the above schemes reduce the communication cost, it is unclear what (if any) privacy guarantees they offer. We study privacy from the lens of differential privacy (DP). The notion of differential privacy [13] provides a strong notion of individual privacy while permitting useful data analysis in machine learning tasks. We refer the reader to [14] for a survey. Informally, for the output to be differentially private, the estimated model should be indistinguishable whether a particular client’s data was taken into consideration or not. We define this formally in Section 2. In the context of client based distributed learning, we are interested in the privacy of the gradients aggregated from clients; differential privacy for the average gradients implies privacy for the resulting model since DP is preserved by post-processing. The standard approach is to let the server add the noise to the averaged gradients (e.g., see [14, 2] and references within). However, the above only works under a restrictive assumption that the clients can trust the server. Our goal is to also minimize the need for clients to trust the central aggregator, and hence we propose the following model: Clients add their share of the noise to their gradients gt i before transmission. Aggregation of gradients at the server results in an estimate with noise equal to the sum of the noise added at each client. This approach improves over server-controlled noise addition in several scenarios: Clients do not trust the server: Even in the scenario when the server is not trustworthy, the above scheme can be implemented via cryptographically secure aggregation schemes [7], which ensures that the only information about the individual users the server learns is what can be inferred from the sum. Hence, differential privacy of the aggregate now ensures that the parameter server does not learn any individual user information. This will encourage clients to participate in the protocol even if they do not fully trust the server. We note that while secure aggregation schemes add to the communication cost (e.g., [7] adds log2(k · n) for k levels of quantization), our proposed communication benefits still hold. For example, if n = 1024, a 4-bit quantization protocol would reduce communication cost by 67% compared to the 32 bit representation. Server is negligent, but not malicious: the server may "forget" to add noise, but is not malicious and not interested in learning characteristics of individual users. However, if the server releases the learned model to public, it needs to be differentially-private. A natural way to extend the results of [14, 2] is to let individual users add Gaussian noise to their gradients before transmission. Since the sum of Gaussians is Gaussian itself, differential privacy results follow. However, the transmitted values now are real numbers and the benefits of gradient compression are lost. Further, secure aggregation protocols [7] require discrete inputs. To resolve these issues, we propose that the clients add noise drawn from an appropriately parameterized Binomial distribution. We refer to this as the Binomial mechanism. Since Binomial random variables are discrete, they can be transmitted efficiently. Furthermore, the choice of the Binomial is convenient in the distributed setting because sum of Binomials is also binomially distributed i.e., if Z1 ⇠Bin(N1, p), Z2 ⇠Bin(N2, p) then Z1 + Z2 ⇠Bin(N1 + N2, p). Hence the total noise post aggregation can be analyzed easily, which is convenient for the distributed setting2. Binomial mechanism can be of independent interest in other applications with discrete output as well. Furthermore, unlike Gaussian it avoids floating point representation issues. 1.4 Summary of our results Binomial mechanism: We first study Binomial mechanism as a generic mechanism to release discrete valued data. Previous analysis of the Binomial mechanism (where you add noise Bin(N, p)) was due to [12], who analyzed the 1-dimensional case for p = 1/2 and showed that to achieve (", δ) differential privacy, N needs to be ≥64 log(2/δ)/"2. We improve the analysis in the following ways: 2Another choice is the Poisson distribution. Different from Poisson, the Binomial distribution has bounded support and has an easily analyzable communication complexity which is always bounded. 3 • d-dimensions. We extend the analysis of 1-dimensional Binomial mechanism to d dimensions. Unlike the Gaussian distribution, Binomial is not rotation invariant making the analysis more involved. The key fact utilized in this analysis is that Binomial distribution is locally rotationinvariant around the mean. • Improvement. We improve the previous result and show that N ≥8 log(2/δ)/"2 suffices for small ", implying that the Binomial and Gaussian mechanism perform identically as " ! 0. We note that while this is a constant improvement , it is crucial in making differential privacy practical. Differentially-private distributed mean estimation (DME): A direct application of Gaussian mechanism requires n · d reals and hence n · d · log(nd) bits of communication. This can be prohibitive in practice. We first propose a direct application of quantization [33] and Binomial mechanism and characterize its privacy/error guarantees along with its communication costs. We further show that coupling the scheme with random rotation can significantly improve communication further. In particular, for " = O(1), we provide an algorithm achieving the same privacy and error tradeoff as that of the Gaussian mechanism with communication n · d · ✓ log2 ✓ 1 + d n ◆ + O ✓ log log ✓nd δ ◆◆◆ bits, per round of distributed SGD. Hence when d ⇡n, the number of bits is n · d · log(log(nd)/δ). The rest of the paper is organized as follows. In Section 2, we review the notion of differential privacy and state our results for the Binomial mechanism. Motivated by the fact that the convergence of SGD can be reduced to the error in gradient estimate computation per-round, we formally describe the problem of DME in Section 3 and state our results in Section 4. In Section 4.2, we provide and analyze the implementation of the binomial mechanism in conjunction with quantization in the context of DME. The main idea is for each client to add noise drawn from an appropriately parameterized Binomial distribution to each quantized value before sending to the server. The server further subtracts the bias introduced by the noise to achieve an unbiased mean estimator. We further show in Section 4.3 that the rotation procedure proposed in [33] which reduces the MSE is helpful in reducing the additional error due to differential privacy. 2 Differential privacy 2.1 Notation We start by defining the notion of differential privacy. Formally, given a set of data sets D provided with a notion of neighboring data sets ND ⇢D ⇥D and a query function f : D ! X, a mechanism M : X ! O to release the answer of the query, is defined to be (", δ) differentially private if for any measurable subset S ✓O and two neighboring data sets (D1, D2) 2 ND, Pr (M(f(D1)) 2 S) e" Pr (M(f(D2)) 2 S) + δ. (3) Unless otherwise stated, for the rest of the paper, we will assume the output spaces X, O ✓Rd. We consider the mean square error as a metric to measure the error of the mechanism M. Formally, E(M) , max D2D E[kM(f(D)) −f(D)k2 2]. A key quantity in characterizing differential privacy for many mechanisms is the sensitivity of a query f : D ! Rd in a given norm `q. Formally this is defined as ∆q , max (D1,D2)2NDkf(D1) −f(D2)kq. (4) The canonical mechanism to achieve (", δ) differential privacy is the Gaussian mechanism Mσ g [14]: Mσ g(f(D)) , f(D) + Z, where Z ⇠N(0, σ2Id). We now state the well-known privacy guarantee of the Gaussian mechanism. Lemma 1 ( [14]). For any δ, `2 sensitivity bound ∆2, and σ such that σ ≥∆2 p 2 log 1.25/δ, Mσ g is ( ∆2 σ p 2 log 1.25/δ, δ) differentially private 3 and the error is bounded by d · σ2. 3All logs are to base e unless otherwise stated. 4 2.2 Binomial Mechanism We now define the Binomial mechanism for the case when the output space X of the query f is Zd. The Binomial mechanism is parameterized by three quantities N, p, s where N 2 N, p 2 (0, 1), and quantization scale s = 1/j for some j 2 N and is given by MN,p,s b (f(D)) , f(D) + (Z −Np) · s, (5) where for each coordinate i, Zi ⇠Bin(N, p) and independent. One dimensional binomial mechanism was introduced by [12] for the case when p = 1/2. We analyze the mechanism for the general d-dimensional case and for any p. This analysis is involved as the Binomial mechanism is not rotation invariant. By carefully exploiting the local rotation invariant structure near the mean, we show that: Theorem 1. For any δ, parameters N, p, s and sensitivity bounds ∆1, ∆2, ∆1 such that Np(1 −p) ≥max (23 log(10d/δ), 2∆1/s) , the Binomial mechanism is (", δ) differentially private for " = ∆2 q 2 log 1.25 δ s p Np(1 −p) + ∆2cp q log 10 δ + ∆1bp sNp(1 −p)(1 −δ/10) + ∆1dp log 1.25 δ + ∆1dp log 20d δ log 10 δ sNp(1 −p) , (6) where bp, cp, and dp are defined in (16), (11), and (15) respectively, and for p = 1/2, bp = 1/3, cp = 5/2, and dp = 2/3. The error of the mechanism is d · s2 · Np(1 −p). The proof is given in Appendix B. We make some remarks regarding the design and the guarantee for the Binomial Mechanism. Note that the privacy guarantee for the Binomial mechanism depends on all three sensitivity parameters ∆2, ∆1, ∆1 as opposed to the Gaussian mechanism which only depends on ∆2. The ∆1 and ∆1 terms can be seen as the added complexity due to discretization. Secondly setting s = 1 (i.e. providing no scale to the noise) in the expression (6), it can be readily seen that the terms involving ∆1 and ∆2 scale differently with respect to the variance of the noise. This motivates the use of the accompanying quantization scale s in the mechanism. Indeed it is possible that the resolution of the integer that is provided by the Binomial noise could potentially be too large for the problem leading to worse guarantees. In this setting, the quantization parameter s helps normalize the noise correctly. Further, it can be seen as long as the variance of the random variable s · Z is fixed, increasing Np(1 −p) and decreasing s makes the Binomial mechanism closer to the Gaussian mechanism. Formally, if we let σ = s p Np(1 −p) and s σ/(c p d), then using the Cauchy-Schwartz inequality, the " guarantee (6) can be rewritten as " = (∆2/σ) p 2 log 1.25/δ (1 + O (1/c)) . The variance of the Binomial distribution is Np(1 −p) and the leading term in " matches exactly the " term in Gaussian mechanism. Furthermore, if s is o(1/ p d), then this mechanism approaches the Gaussian mechanism. This result agrees with the Berry-Esseen type Central limit theorems for the convergence of one dimensional Binomial distribution to the Gaussian distribution. In Figure 1, we plot the error vs " for Gaussian and Binomial mechanism. Observe that as scale is reduced, error vs privacy trade-off for Binomial mechanism approaches that of Gaussian mechanism. Finally note that, while p = 1/2 will in general be the optimal choice as it maximizes the variance for a fixed communication budget, there might be corner cases wherein the required variance is so small that it cannot be achieved by an integer choice of N and p = 1/2. Our results working with general p also cover these corner cases. 3 Distributed mean estimation (DME) We have related the SGD convergence rate to the MSE in approximating the gradient at each step in Corollary 1. Eq. (1) relates the communication cost of SGD to the communication cost of estimating gradient means. Advanced composition theorem (Thm. 3.5 [19]) or moments accounting [2] can be used to relate the privacy guarantee of SGD to that of gradient mean estimate at each instance t. We also note that in SGD, we often sample the clients, standard privacy amplification results via sampling [2], can be used to get tighter bounds in this case. 5 Figure 1: Comparison of error vs privacy for Gaussian and Binomial mechanism at different scales (a) " = 4.0 (b) " = 2.0 Figure 2: cpSGD with rotation on the infinite MNIST dataset. k is the number of quantization levels, and m is the parameter of the binomial noise (p = 0.5, s = 1). The baseline is without quantization and differential privacy. δ = 10−9. Therefore, akin to [33], in the rest of the paper we just focus on the MSE and privacy guarantees of DME. The results for synchronous distributed GD follow from Corollary 1 (convergence), advanced composition theorem (privacy), and Eq. (1) (communication). Formally, the problem of DME is defined as given n vectors X , {X1 . . . Xn} where Xi 2 Rd is on client i, we wish to compute the mean ¯X = 1 n Pn i=1 Xi at a central server. For gradient descent at each round t, Xi is set to gt i. DME is a fundamental building block for many distributed learning algorithms including distributed PCA/clustering [24]. While analyzing private DME we assume that each vector Xi has bounded `2 norm, i.e. kXik D. The reason to make such an assumption is to be able to define and analyze the privacy guarantees and is often enforced in practice by employing gradient clipping at each client. We note that this assumption appears in previous works on gradient descent and differentially private gradient descent (e.g. [2]). Since our results also hold for all gradients without any statistical assumptions, we get desired convergence results and privacy results for SGD. 3.1 Communication protocol Our proposed communication algorithms are simultaneous and independent, i.e., the clients independently send data to the server at the same time. We allow the use of both private and public randomness. Private randomness refers to random values generated by each client separately, and public randomness refers to a sequence of random values that are shared among all parties4. Given n vectors X , {X1 . . . Xn} where Xi 2 Rd resides on a client i. In any independent communication protocol, each client transmits a function of Xi (say q(Xi)), and a central server estimates the mean by some function of q(X1), q(X2), . . . , q(Xn). Let ⇡be any such protocol and let Ci(⇡, Xi) be the expected number of bits transmitted by the i-th client during protocol ⇡, where throughout the paper, expectation is over the randomness in protocol ⇡. Let Ci(⇡, Xi) be the number of bits transmitted by client i. The total number of bits transmitted by all clients with the protocol ⇡is C(⇡, Xn 1 ) def = Pn i=1 Ci(⇡, Xi). Let the estimated mean be ˆ¯X. For a protocol ⇡, the MSE of the estimate is E(⇡, Xn 1 ) = E h k ˆ¯X −¯Xk2 2 i . We note that bounds on E((⇡, Xn 1 ), translates to bounds on gradients estimates in Eq. (2) and result in convergence guarantees via Corollary 1. 3.2 Differential privacy To state the privacy results for DME, we define the notion of data sets and neighbors as follows. A dataset is a collection of vectors X = {X1, . . . Xn}. The notion of neighboring data sets typically corresponds to those differing only on the information of one user, i.e. X, X⌦i are neighbors if they differ in one vector. Note that this notion of neighbors for DME in the context of distributed gradient 4Public randomness can be emulated by the server communicating a random seed 6 descent translates to two data sets F = f1, f2, . . . fn and F 0 = f 0 1, f 0 2, . . . f 0 n being neighbors if they differ in one function fi and corresponds to guaranteeing privacy for individual client’s data. The bound kXik2 D translates to assuming kgt ik D, ensured via gradient clipping. 4 Results for distributed mean estimation (DME) In this section we describe our algorithms, the associated MSE, and the privacy guarantees in the context of DME. First, we first establish a baseline by stating the results for implementing the Gaussian mechanism by adding Gaussian noise on each client vector. 4.1 Gaussian protocol In the Gaussian mechanism, each client sends vector Yi = Xi + Zi, where Zis are i.i.d distributed as N(0, σ2Id). The server estimates the mean by ˆ¯X = 1/n · Pn i=1 Yi. We refer to this protocol as ⇡g. Since Pn i=1 Zi/n is distributed as N(0, σ2Id/n) the above mechanism is equivalent to applying the Gaussian mechanism on the output with variance σ2/n. Since changing any of the Xi’s changes the norm of ¯X by at most 2D/n, the following theorem follows directly from Lemma 1. Theorem 2. Under the Gaussian mechanism, the mean estimate is unbiased and communication cost is n · d reals. Moreover, for any δ and σ ≥2D pn · p 2 log 1.25/δ, it is (", δ) differentially private for " = 2D pnσ r 2 log 1.25 δ and E(⇡g, X) = dσ2 n , We remark that real numbers can potentially be quantized to O(log dn/"δ) bits with insignificant effect to privacy5. However this is asymptotic and can be prohibitive in practice [20], where we have a small fixed communication budget and d is of the order of millions. A natural way to reduce communication cost is via quantization, where each client quantizes Yis before transmitting. However how privacy guarantees degrade as the quantization of the Gaussian mechanism is hard to analyze particularly under aggregation. Instead we propose to use the Binomial mechanism which we describe next. 4.2 Stochastic k-level quantization + Binomial mechanism We now define the mechanism ⇡sk(Bin(m, p)) based on k-bit stochastic quantization ⇡sk proposed in [33] composed with the Binomial mechanism. It will be parameterized by 3 quantities k, m, p. First, the server sends Xmax to all the clients, with the hope that for all i, j, −Xmax Xi(j)  Xmax. The clients then clip each coordinate of their vectors to the range [−Xmax, Xmax]. For every integer r in the range [0, k), let B(r)represent a bin (one for each r), i.e. B(r) def = −Xmax + 2rXmax k −1 , (7) The algorithm quantizes each coordinate into one of the bins stochastically and adds scaled Binomial noise. Formally client i computes the following quantities for every j Ui(j) = ( B(r + 1) w.p. Xi(j)−B(r) B(r+1)−B(r) B(r) otherwise. Yi(j) = Ui(j) + 2Xmax k −1 · Ti(j). (8) where r is such that Xi(j) 2 [B(r), B(r + 1)] and Ti(j) ⇠Bin(m, p). The client sends Yi to the server. The server now estimates ¯X by ˆ¯X⇡sk(Bin(m,p)) = 1 n n X i=1 ✓ Yi −2Xmaxmp k −1 ◆ . (9) If 8j, Xi(j) 2 [−Xmax, Xmax], then E h Yi −2Xmaxmp k−1 i = Xi, and ˆ¯X⇡sk(Bin(m,p)) will be an unbiased estimate of the mean. 5Follows by observing that quantizing all values to 1/poly(n, d, 1/", log 1/δ) accuracy ensures minimum loss in privacy. In practice this is often implemented using 32 bits of quantization via float representation. 7 Before stating the formal guarantees we will require the definitions of the following quantities representing the sensitivity of the quantization protocol in the appropriate norm. ∆1(Xmax, D) def = k + 1 ∆1(Xmax, D) def = p dD(k −1) Xmax + s 2 p dD log(2/δ)(k −1) Xmax + 4 3 log 2 δ ∆2(Xmax, D) def = D(k −1) Xmax + v u u t∆1 + s 2 p dD log(2/δ)(k −1) Xmax . (10) For brevity of notation we have suppressed the parameters k, δ from the LHS. With no prior information on Xmax, the natural choice is to set Xmax = D. With this value of Xmax we characterize the MSE, sensitivity, and communication complexity of ⇡sk(Bin(m, p)) below leveraging Theorem 1. Theorem 3. If Xmax = D, then the mean estimate is unbiased and E (⇡sk(Bin(m, p)), Xn)  dD2 n(k −1)2 + d n · 4mp(1 −p)D2 (k −1)2 , Furthermore if mnp(1 −p) ≥max (23 log(10d/δ), 2∆1(D, Xmax)) , then for any δ, ˆ¯X⇡sk(Bin(m,p)) is (", 2δ) differentially private where " (as given by Theorem 1) is " = ∆2 q 2 log 1.25 δ p mnp(1 −p) + ∆2cp q log 10 δ + ∆1bp mnp(1 −p)(1 −δ/10) + ∆1dp log 1.25 δ + ∆1dp log 20d δ log 10 δ mnp(1 −p) , with sensitivity parameters {∆1(Xmax, D), ∆2(Xmax, D), ∆1(Xmax, D)} as defined in (10). Furthermore, C(⇡sk(Bin(m, p)), Xn) = n · (d log2(k + m) + ˜O(1)).6 We provide the proof in Appendix D. The first term in the expression for " in the above theorem recovers the same guarantee as that of the Gaussian mechanism (Theorem 2). Further, it can be seen that the trailing terms are negligible when k >> p d. Formally this leads to the following corollary summarizing the communication cost for " 1 for achieving the same guarantee as the Gaussian mechanism. Corollary 2. There exists an implementation of ⇡sk(Bin(m, p)), which achieves the same privacy and error as the full precision Gaussian mechanism with a total communication complexity of n · d · ✓ log2 ✓p d + d n"2 ◆ + O ✓ log log ✓nd "δ ◆◆◆ bits. The communication cost of the above algorithm is ⌦(log d) bits per coordinate per client, which can be prohibitive. In the next section we show that these bounds can be further improved via rotation. 4.3 Error reduction via randomized rotation As seen in Corollary 2, for ⇡sk(Bin(m, p)) to have error and privacy same as that of the Gaussian mechanism, the best bound on the communication cost guaranteed is ⌦(log(d)) bits per coordinate irrespective of how large n is. The proof reveals that this is due to the error being proportional to O(d(Xmax)2/n). Therefore MSE reduces when Xmax is small, e.g., when Xi is uniform on the unit sphere, Xmax is O ⇣p (log d)/d ⌘ (whp) [10]. [33] showed that the same effect can be observed by randomly rotating the vectors before quantization. Here we show that random rotation reduces the leading term in the error as well as improves the privacy guarantee. Using public randomness, all clients and the central server generate a random orthogonal matrix R 2 Rd⇥d according to some known distribution. Given a protocol ⇡for DME which takes inputs 6 ˜O is used to denote poly-logarithmic factors. 8 X1 . . . Xn, we define Rot(⇡, R) as the protocol where each client i first computes, X0 i = RXi, and runs the protocol on X0 1, X0 2, . . . X0 n. The server then obtains the mean estimate ˆ¯ X0 in the rotated space using the protocol ⇡and then multiplies by R−1 to obtain the coordinates in the original basis, i.e., ˆ¯X = R−1 ˆ¯ X0. Due to the fact that d can be huge in practice, we need orthogonal matrices that permit fast matrixvector products. Naive matrices that support fast multiplication such as block-diagonal matrices often result in high values of kX0 ik2 1. Similar to [33], we propose to use a special type of orthogonal matrix R = 1 p dHA, where A is a random diagonal matrix with i.i.d. Rademacher entries (±1 with probability 0.5) and H is a Walsh-Hadamard matrix [18]. Applying both rotation and its inverse takes O(d log d) time and O(1) space (with an in-place algorithm). The next theorem provides the MSE and privacy guarantees for Rot(⇡sk(Bin(m, p)), HA). Theorem 4 (Appendix E). For any δ, let Xmax = 2D q log(2nd/δ) d , then E(Rot(⇡sk(Bin(m, p))), HA) 2 log 2nd δ · D2 n(k −1)2 + 8 log 2nd δ · mp(1 −p)D2 n(k −1)2 + 4D2δ2. The bias of mean estimate is bounded by 2Dδ. Furthermore if mnp(1 −p) ≥max (23 log(10d/δ), 2∆1(D, Xmax)) , then ˆ¯X(Rot(⇡sk(Bin(m, p)))) is (", 3δ) differentially private where " (as given by Theorem 1) is " = ∆2 q 2 log 1.25 δ p mnp(1 −p) + ∆2cp q log 10 δ + ∆1bp mnp(1 −p)(1 −δ/10) + ∆1dp log 1.25 δ + ∆1dp log 20d δ log 10 δ mnp(1 −p) , with sensitivity parameters {∆1(Xmax, D), ∆2(Xmax, D), ∆1(Xmax, D)} (Eq. (10)). Furthermore, C(Rot(⇡sk(Bin(m, p))), Xn) = n · (d log2(k + m) + ˜O(1)). The following corollary now bounds the communication cost for Rot(⇡sk(Bin(m, p)), HA) when " 1 akin to Corollary 2. Corollary 3. There exists an implementation of Rot(⇡sk(Bin(m, p)), HA), that achieves the same error and privacy of the full precision Gaussian mechanism with a total communication complexity: n · d ✓ log2 ✓ 1 + d n"2 ◆ + O ✓ log log dn "δ ◆◆ bits. Note that k is no longer required to be set to ⌦( p d) and hence if d = o(n"2), then Rot(⇡sk(Bin(m, p)), HA) has the same privacy and utilities as the Gaussian mechanism, but with just O(nd log log(nd/δ")) communication cost. 5 Discussion We trained a three-layer model (60 hidden nodes each with ReLU activation) on the infinite MNIST dataset [8] with 25M data points and 25M clients. At each step 10,000 clients send their data to the server. This setting is close to real-world settings of federated learning where there are hundreds of millions of users. The results are in Figure 2. Note that the models achieve different levels of accuracy depending on communication cost and privacy parameter ". We note that we trained the model with exactly one epoch, so each sample was used at most once in training. In this setting, the per batch " and the overall " are the same. There are several interesting future directions. On the theoretical side, it is not clear if our analysis of Binomial mechanism is tight. Furthermore, it is interesting to have better privacy accounting for Binomial mechanism via a moments accountant. On the practical side, we plan to explore the effects of neural network topology, over-parametrization, and optimization algorithms on the accuracy of the privately learned models. 9 References [1] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016. [2] Martín Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pages 308–318. ACM, 2016. [3] Nir Ailon and Bernard Chazelle. Approximate nearest neighbors and the fast JohnsonLindenstrauss transform. In STOC, 2006. [4] Dan Alistarh, Demjan Grubic, Jerry Liu, Ryota Tomioka, and Milan Vojnovic. Communicationefficient stochastic gradient descent, with applications to neural networks. 2017. [5] Dan Alistarh, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Randomized quantization for communication-optimal stochastic gradient descent. arXiv:1610.02132, 2016. [6] Raef Bassily, Adam Smith, and Abhradeep Thakurta. Private empirical risk minimization: Efficient algorithms and tight error bounds. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pages 464–473. IEEE, 2014. [7] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. Practical secure aggregation for privacy-preserving machine learning. pages 1175–1191, 2017. [8] Leon Bottou. The infinite mnist dataset. [9] Adam Coates, Brody Huval, Tao Wang, David Wu, Bryan Catanzaro, and Ng Andrew. Deep learning with cots hpc systems. In International Conference on Machine Learning, pages 1337–1345, 2013. [10] Sanjoy Dasgupta and Anupam Gupta. An elementary proof of a theorem of johnson and lindenstrauss. Random Structures & Algorithms, 22(1):60–65, 2003. [11] Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, Andrew Senior, Paul Tucker, Ke Yang, Quoc V Le, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pages 1223–1231, 2012. [12] Cynthia Dwork, Krishnaram Kenthapadi, Frank McSherry, Ilya Mironov, and Moni Naor. Our data, ourselves: Privacy via distributed noise generation. In Eurocrypt, volume 4004, pages 486–503. Springer, 2006. [13] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In TCC, volume 3876, pages 265–284. Springer, 2006. [14] Cynthia Dwork and Aaron Roth. The algorithmic foundations of differential privacy. Found. Trends Theor. Comput. Sci., 9(3&#8211;4):211–407, August 2014. [15] Peter Elias. Universal codeword sets and representations of the integers. IEEE transactions on information theory, 21(2):194–203, 1975. [16] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [17] Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1737–1746, 2015. [18] Kathy J Horadam. Hadamard matrices and their applications. Princeton university press, 2012. [19] Peter Kairouz, Sewoong Oh, and Pramod Viswanath. The composition theorem for differential privacy. IEEE Transactions on Information Theory, 63(6):4037–4049, 2017. 10 [20] Jakub Koneˇcn`y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016. [21] Jakub Koneˇcn`y and Peter Richtárik. Randomized distributed mean estimation: Accuracy vs communication. arXiv preprint arXiv:1611.07555, 2016. [22] Mu Li, David G Andersen, Jun Woo Park, Alexander J Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J Shekita, and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In OSDI, volume 1, page 3, 2014. [23] Mu Li, David G Andersen, Alexander J Smola, and Kai Yu. Communication efficient distributed machine learning with the parameter server. In Advances in Neural Information Processing Systems, pages 19–27, 2014. [24] Stuart Lloyd. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129–137, 1982. [25] Ryan McDonald, Keith Hall, and Gideon Mann. Distributed training strategies for the structured perceptron. In HLT, 2010. [26] H. Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), 2016. [27] H. Brendan McMahan, Eider Moore, Daniel Ramage, and Blaise Aguera y Arcas. Federated learning of deep networks using model averaging. arXiv:1602.05629, 2016. [28] Daniel Povey, Xiaohui Zhang, and Sanjeev Khudanpur. Parallel training of deep neural networks with natural gradient and parameter averaging. arXiv preprint, 2014. [29] Alexander Rakhlin, Ohad Shamir, Karthik Sridharan, et al. Making gradient descent optimal for strongly convex stochastic optimization. In ICML. Citeseer, 2012. [30] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in neural information processing systems, pages 693–701, 2011. [31] Anand D Sarwate and Kamalika Chaudhuri. Signal processing and machine learning with differential privacy: Algorithms and challenges for continuous data. IEEE signal processing magazine, 30(5):86–94, 2013. [32] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Communication Association, 2014. [33] Ananda Theertha Suresh, X Yu Felix, Sanjiv Kumar, and H Brendan McMahan. Distributed mean estimation with limited communication. In International Conference on Machine Learning, pages 3329–3337, 2017. [34] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. arXiv preprint arXiv:1705.07878, 2017. [35] Xi Wu, Fengan Li, Arun Kumar, Kamalika Chaudhuri, Somesh Jha, and Jeffrey Naughton. Bolton differential privacy for scalable stochastic gradient descent-based analytics. In Proceedings of the 2017 ACM International Conference on Management of Data, pages 1307–1322. ACM, 2017. [36] Kun Yuan, Qing Ling, and Wotao Yin. On the convergence of decentralized gradient descent. SIAM Journal on Optimization, 26(3):1835–1854, 2016. [37] Huizi Mao Yu Wang Bill Dally Yujun Lin, Song Han. Deep gradient compression: Reducing the communication bandwidth for distributed training. International Conference on Learning Representations, 2018. 11 [38] Takuya Akiba Yusuke Tsuzuku, Hiroto Imachi. Variance-based gradient compression for efficient distributed deep learning, 2018. [39] Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014. 12
2018
154
7,313
Factored Bandits Julian Zimmert University of Copenhagen zimmert@di.ku.dk Yevgeny Seldin University of Copenhagen seldin@di.ku.dk Abstract We introduce the factored bandits model, which is a framework for learning with limited (bandit) feedback, where actions can be decomposed into a Cartesian product of atomic actions. Factored bandits incorporate rank-1 bandits as a special case, but significantly relax the assumptions on the form of the reward function. We provide an anytime algorithm for stochastic factored bandits and up to constants matching upper and lower regret bounds for the problem. Furthermore, we show how a slight modification enables the proposed algorithm to be applied to utilitybased dueling bandits. We obtain an improvement in the additive terms of the regret bound compared to state-of-the-art algorithms (the additive terms are dominating up to time horizons that are exponential in the number of arms). 1 Introduction We introduce factored bandits, which is a bandit learning model, where actions can be decomposed into a Cartesian product of atomic actions. As an example, consider an advertising task, where the actions can be decomposed into (1) selection of an advertisement from a pool of advertisements and (2) selection of a location on a web page out of a set of locations, where it can be presented. The probability of a click is then a function of the quality of the two actions, the attractiveness of the advertisement and the visibility of the location it was placed at. In order to maximize the reward the learner has to maximize the quality of actions along each dimension of the problem. Factored bandits generalize the above example to an arbitrary number of atomic actions and arbitrary reward functions satisfying some mild assumptions. explicit reward models weakly constrained reward models Combin. Bandits relaxation Chen et al. (2016) A “ t0, 1ud (Generalized) Linear Bandits Factored Bandits Stochastic Rank-1 Utility Based Uniformly Identifiable Dueling Bandits Condorcet Winner Figure 1: Relations between factored bandits and other bandit models. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In a nutshell, at every round of a factored bandit game the player selects L atomic actions, a1, . . . , aL, each from a corresponding finite set A of size |A| of possible actions. The player then observes a reward, which is an arbitrary function of a1, . . . , aL satisfying some mild assumptions. For example, it can be a sum of the quality of atomic actions, a product of the qualities, or something else that does not necessarily need to have an analytical expression. The learner does not have to know the form of the reward function. Our way of dealing with combinatorial complexity of the problem is through introduction of unique identifiability assumption, by which the best action along each dimension is uniquely identifiable. A bit more precisely, when looking at a given dimension we call the collection of actions along all other dimensions a reference set. The unique identifiability assumption states that in expectation the best action along a dimension outperforms any other action along the same dimension by a certain margin when both are played with the same reference set, irrespective of the composition of the reference set. This assumption is satisfied, for example, by the reward structure in linear and generalized linear bandits, but it is much weaker than the linearity assumption. In Figure 1, we sketch the relations between factored bandits and other bandit models. We distinguish between bandits with explicit reward models, such as linear and generalized linear bandits, and bandits with weakly constrained reward models, including factored bandits and some relaxations of combinatorial bandits. A special case of factored bandits are rank-1 bandits [7]. In rank-1 bandits the player selects two actions and the reward is the product of their qualities. Factored bandits generalize this to an arbitrary number of actions and significantly relax the assumption on the form of the reward function. The relation with other bandit models is a bit more involved. There is an overlap between factored bandits and (generalized) linear bandits [1; 6], but neither is a special case of the other. When actions are represented by unit vectors, then for (generalized) linear reward functions the models coincide. However, the (generalized) linear bandits allow a continuum of actions, whereas factored bandits relax the (generalized) linearity assumption on the reward structure to uniform identifiability. There is a partial overlap between factored bandits and combinatorial bandits [3]. The action set in combinatorial bandits is a subset of t0, 1ud. If the action set is unrestricted, i.e. A “ t0, 1ud, then combinatorial bandits can be seen as factored bandits with just two actions along each of the d dimensions. However, typically in combinatorial bandits the action set is a strict subset of t0, 1ud and one of the parameters of interest is the permitted number of non-zero elements. This setting is not covered by factored bandits. While in the classical combinatorial bandits setting the reward structure is linear, there exist relaxations of the model, e.g. Chen et al. [4]. Dueling bandits are not directly related to factored bandits and, therefore, we depict them with faded dashed blocks in Figure 1. While the action set in dueling bandits can be decomposed into a product of the basic action set with itself (one for the first and one for the second action in the duel), the observations in dueling bandits are the identities of the winners rather than rewards. Nevertheless, we show that the proposed algorithm for factored bandits can be applied to utility-based dueling bandits. The main contributions of the paper can be summarized as follows: 1. We introduce factored bandits and the uniform identifiability assumption. 2. Factored bandits with uniformly identifiable actions are a generalization of rank-1 bandits. 3. We provide an anytime algorithm for playing factored bandits under uniform identifiability assumption in stochastic environments and analyze its regret. We also provide a lower bound matching up to constants. 4. Unlike the majority of bandit models, our approach does not require explicit specification or knowledge of the form of the reward function (as long as the uniform identifiability assumption is satisfied). For example, it can be a weighted sum of the qualities of atomic actions (as in linear bandits), a product thereof, or any other function not necessarily known to the algorithm. 5. We show that the algorithm can also be applied to utility-based dueling bandits, where the additive factor in the regret bound is reduced by a multiplicative factor of K compared to state-of-the-art (where K is the number of actions). It should be emphasized that in stateof-the-art regret bounds for utility-based dueling bandits the additive factor is dominating 2 for time horizons below ΩpexppKqq, whereas in the new result it is only dominant for time horizons up to OpKq. 6. Our work provides a unified treatment of two distinct bandit models: rank-1 bandits and utility-based dueling bandits. The paper is organized in the following way. In Section 2 we introduce the factored bandit model and uniform identifiability assumption. In Section 3 we provide algorithms for factored bandits and dueling bandits. In Section 4 we analyze the regret of our algorithm and provide matching upper and lower regret bounds. In Section 5 we compare our work empirically and theoretically with prior work. We finish with a discussion in Section 6. 2 Problem Setting 2.1 Factored bandits We define the game in the following way. We assume that the set of actions A can be represented as a Cartesian product of atomic actions, A “ ÂL “1 A. We call the elements of A atomic arms. For rounds t “ 1, 2, ... the player chooses an action At P A and observes a reward rt drawn according to an unknown probability distribution pAt (i.e., the game is “stochastic”). We assume that the mean rewards µpaq “ Errt|At “ as are bounded in r´1, 1s and that the noise ηt “ rt ´ µpAtq is conditionally 1-sub-Gaussian. Formally, this means that @λ P R E “ eληt|Ft´1 ‰ ď exp ˆλ2 2 ˙ , where Ft :“ tA1, r1, A2, r2, ..., At, rtu is the filtration defined by the history of the game up to and including round t. We denote a˚ “ pa˚ 1, a˚ 2, ..., a˚ Lq “ argmaxaPA µpaq. Definition 1 (uniform identifiability). An atomic set Ak has a uniformly identifiable best arm a˚ k if and only if @a P Akzta˚ ku : Δkpaq :“ min bP ‰k A µpa˚ k, bq ´ µpa, bq ą 0. (1) We assume that all atomic sets have uniformly identifiable best arms. The goal is to minimize the pseudo-regret, which is defined as RegT “ E « Tÿ t“1 µpa˚q ´ µpAtq ff . Due to generality of the uniform identifiability assumption we cannot upper bound the instantaneous regret µpa˚q ´ µpAtq in terms of the gaps Δpaq. However, a sequential application of (1) provides a lower bound µpa˚q ´ µpaq “ µpa˚q ´ µpa1, a˚ 2, ..., a˚ Lq ` µpa1, a˚ 2, ..., a˚ Lq ´ µpaq ě Δ1pa1q ` µpa1, a˚ 2, ..., a˚ Lq ´ µpaq ě ... ě L ÿ “1 Δpaq. (2) For the upper bound let κ be a problem dependent constant, such that µpa˚q´µpaq ď κ řL “1 Δpaq holds for all a. Since the mean rewards are in r´1, 1s, the condition is always satisfied by κ “ mina, 2Δ´1  paq and by equation (2) κ is always larger than 1. The constant κ appears in the regret bounds. In the extreme case when κ “ mina, 2Δ´1  paq the regret guarantees are fairly weak. However, in many specific cases mentioned in the previous section, κ is typically small or even 1. We emphasize that algorithms proposed in the paper do not require the knowledge of κ. Thus, the dependence of the regret bounds on κ is not a limitation and the algorithms automatically adapt to more favorable environments. 3 2.2 Dueling bandits The set of actions in dueling bandits is factored into AˆA. However, strictly speaking the problem is not a factored bandit problem, because the observations in dueling bandits are not the rewards.1 When playing two arms, a and b, we observe the identity of the winning arm, but the regret is typically defined via average relative quality of a and b with respect to a “best” arm in A. The literature distinguishes between different dueling bandit settings. We focus on utility-based dueling bandits [14] and show that they satisfy the uniform identifiability assumption. In utility-based dueling bandits, it is assumed that each arm has a utility upaq and that the winning probabilities are defined by Pra wins against bs “ νpupaq´upbqq for a monotonously increasing link function ν. Let wpa, bq be 1 if a wins against b and 0 if b wins against a. Let a˚ :“ argmaxaPA upaq denote the best arm. Then for any arm b P A and any a P Aza˚, it holds that Erwpa˚, bqs ´ Erwpa, bqs “ νpupa˚q ´ upbqq ´ νpupaq ´ upbqq ą 0, which satisfies the uniform identifiability assumption. For the rest of the paper we consider the linear link function νpxq “ 1`x 2 . The regret is then defined by RegT “ E « Tÿ t“1 upa˚q ´ upAtq 2 ` upa˚q ´ upBtq 2 ff . (3) 3 Algorithms Although in theory an asymptotically optimal algorithm for any structured bandit problem was presented in [5], for factored bandits this algorithm does not only require solving an intractable semiinfinite linear program at every round, but it also suffers from additive constants which are exponential in the number of atomic actions L. An alternative naive approach could be an adaptation of sparring [16], where each factor runs an independent K-armed bandit algorithm and does not observe the atomic arm choices of other factors. The downside of sparring algorithms, both theoretically and practically, is that each algorithm operates under limited information and the rewards become non i.i.d. from the perspective of each individual factor. Our Temporary Elimination Algorithm (TEA, Algorithm 1) avoids these downsides. It runs independent instances of the Temporary Elimination Module (TEM, Algorithm 3) in parallel, one per each factor of the problem. Each TEM operates on a single atomic set. The TEA is responsible for the synchronization of TEM instances. Two main ingredients ensure information efficiency. First, we use relative comparisons between arms instead of comparing absolute mean rewards. This cancels out the effect of non-stationary means. The second idea is to use local randomization in order to obtain unbiased estimates of the relative performance without having to actually play each atomic arm with the same reference, which would have led to prohibitive time complexity. 1 @ : TEM Ð new TEM(A) 2 t Ð 1 3 for s “ 1, 2, . . . do 4 Ms Ð argmax | TEM . getActiveSetpfptq´1q| 5 Ts Ð pt, t ` 1, . . . , t ` Ms ´ 1q 6 for  P t1, . . . , Lu in parallel do 7 TEM . scheduleNextpTsq 8 for t P Ts do 9 rt Ð playppTEM .Atq“1,...,Lq 10 for  P t1, . . . , Lu in parallel do 11 TEM . feedbackpprt1qt1PTsq 12 t Ð t ` |Ts| Algorithm 1: Factored Bandit TEA 1 TEM Ð new TEM(A) 2 t Ð 1 3 for s “ 1, 2, . . . do 4 As Ð TEM . getActiveSetpfptq´1q 5 Ts Ð pt, t ` 1, . . . , t ` |As| ´ 1q 6 TEM . scheduleNextpTsq 7 for b P As do 8 rt Ð playpTEM .At, bq 9 t Ð t ` 1 10 TEM . feedbackpprt1qt1PTsq Algorithm 2: Dueling Bandit TEA 1In principle, it is possible to formulate a more general problem that would incorporate both factored bandits and dueling bandits. But such a definition becomes too general and hard to work with. For the sake of clarity we have avoided this path. 4 The TEM instances run in parallel in externally synchronized phases. Each module selects active arms in getActiveSetpδq, such that the optimal arm is included with high probability. The length of a phase is chosen such that each module can play each potentially optimal arm at least once in every phase. All modules schedule all arms for the phase in scheduleNext. This is done by choosing arms in a round robin fashion (random choices if not all arms can be played equally often) and ordering them randomly. All scheduled plays are executed and the modules update their statistics through the call of feedback routine. The modules use slowly increasing lower confidence bounds for the gaps in order to temporarily eliminate arms that are with high probability suboptimal. In all algorithms, we use fptq :“ pt ` 1q log2pt ` 1q. Dueling bandits For dueling bandits we only use a single instance of TEM. In each phase the algorithm generates two random permutations of the active set and plays the corresponding actions from the two lists against each other. (The first permutation is generated in Line 6 and the second in Line 7 of Algorithm 2.) 3.1 TEM The TEM tracks empirical differences between rewards of all arms ai and aj in Dij. Based on these differences, it computes lower confidence bounds for all gaps. The set K˚ contains those arms where all LCB gaps are zero. Additionally the algorithm keeps track of arms that were never removed from B. During a phase, each arm from K˚ is played at least once, but only arms in B can be played more than once. This is necessary to keep the additive constants at M logpKq instead of MK. global :Ni,j, Di,j, K˚, B 1 Function initialize(K) 2 @ai, aj P K : Ni,j, Di,j Ð 0, 0 3 B Ð K 4 5 Function getActiveSet(δ) 6 if DNi,j “ 0 then 7 K˚ Ð K 8 else 9 for ai P K do 10 ˆΔLCBpaiq Ð maxaj‰ai Dj,i Nj,i ´ c 12 logp2KfpNj,iqδ´1q Nj,i 11 K˚ Ð tai P K| ˆΔLCBpaiq ď 0u 12 if |K˚| “ 0 then 13 K˚ Ð K 14 B Ð B X K˚ 15 if |B| “ 0 then 16 B Ð K˚ 17 return K˚ 18 19 Function scheduleNext(T ) 20 for a P K˚ do 21 ˜t Ð random unassigned index in T 22 A˜t Ð a 23 while not all Ats, . . . , Ats`|T |´1 assigned do 24 for a P B do 25 ˜t Ð random unassigned index in T 26 A˜t Ð a 27 28 Function feedback(tRtuts,...,ts`Ms´1) 29 @ai : N i s, Ri s Ð 0, 0 30 for t “ ts, . . . , ts ` Ms ´ 1 do 31 RAt s Ð RAt s ` Rt 32 N At s Ð N At s ` 1 33 for ai, aj P K˚ do 34 Di,j Ð Di,j`mintN s i , N s j up Ri s Nis ´ Rj s Nj s q 35 Ni,j Ð Ni,j ` mintN s i , N s j u Algorithm 3: Temporary Elimination Module (TEM) Implementation 4 Analysis We start this section with the main theorem, which bounds the number of times the TEM pulls sub-optimal arms. Then we prove upper bounds on the regret for our main algorithms. Finally, we prove a lower bound for factored bandits that shows that our regret bound is tight up to constants. 4.1 Upper bound for the number of sub-optimal pulls by TEM Theorem 1. For any TEM submodule TEM with an arm set of size K “ |A|, running in the TEA algorithm with M :“ max |A| and any suboptimal atomic arm a ‰ a˚, let Ntpaq denote the number of times TEM has played the arm a up to time t. Then there exist constants Cpaq ď M for 5 a ‰ a˚, such that ErNtpaqs ď 120 Δpaq2 ˜ logp2Kt log2ptqq ` 4 log ˆ48 logp2Kt log2ptqq Δpaq2 ˙ ¸ ` Cpaq, where ř a‰a˚ Cpaq ď M logpKq ` 5 2K in the case of factored bandits and Cpaq ď 5 2 for dueling bandits. Proof sketch. [The complete proof is provided in the Appendix.] Step 1 We show that the confidence intervals are constructed in such a way that the probability of all confidence intervals holding at all epochs up from s1 is at least 1 ´ maxsěs1 fptsq´1. This requires a novel concentration inequality (Lemma 3) for a sum of conditionally σs-sub-gaussian random variables, where σs can be dependent on the history. This technique might be useful for other problems as well. Step 2 We split the number of pulls into pulls that happen in rounds where the confidence intervals hold and those where they fail: Ntpaq “ N conf t paq ` N conf t paq. We can bound the expectation of N conf t paq based on the failure probabilities given by Prconf failure at round ss ď 1 fptsq. Step 3 We define s1 as the last round in which the confidence intervals held and a was not eliminated. We can split N conf t paq “ N conf ts1 paq ` Cpaq and use the confidence intervals to upper bound N conf ts1 paq. The upper bound on ř a Cpaq requires special handling of arms that were eliminated once and carefully separating the cases where confidence intervals never fail and those where they might fail. 4.2 Regret Upper bound for Dueling Bandit TEA A regret bound for the Factored Bandit TEA algorithm, Algorithm 1, is provided in the following theorem. Theorem 2. The pseudo-regret of Algorithm 1 at any time T is bounded by RegT ď κ ¨ ˝ L ÿ “1 ÿ a‰a˚  120 Δpaq ˜ logp2|A|t log2ptqq ` 4 log ˆ48 logp2|A|t log2ptqq Δpaq ˙ ¸¸ ` max  |A| ÿ  logp|A|q ` ÿ  5 2|A|. Proof. The design of TEA allows application of Theorem 1 to each instance of TEM. Using µpa˚q ´ µpaq ď κ řL “1 Δpaq, we have that RegT “ Er Tÿ t“1 µpa˚q ´ µpatqss ď κ L ÿ l“1 ÿ a‰a˚  ErNT paqsΔpaq. Applying Theorem 1 to the expected number of pulls and bounding the sums ř a CpaqΔpaq ď ř a Cpaq completes the proof. 4.3 Dueling bandits A regret bound for the Dueling Bandit TEA algorithm (DBTEA), Algorithm 2, is provided in the following theorem. Theorem 3. The pseudo-regret of Algorithm 2 for any utility-based dueling bandit problem at any time T (defined in equation (3) satisfies RegT ď O ´ř a‰a˚ logpT q Δpaq ¯ ` OpKq. 6 Proof. At every round, each arm in the active set is played once in position A and once in position B in playpA, Bq. Denote by N A t paq the number of plays of an arm a in the first position, N B t paq the number of plays in the second position, and Ntpaq the total number of plays of the arm. We have RegT “ ÿ a‰a˚ ErNtpaqsΔpaq “ ÿ a‰a˚ ErN A t paq ` N B t paqsΔpaq “ ÿ a‰a˚ 2ErN A t paqsΔpaq. The proof is completed by applying Theorem 1 to bound ErN A t paqs. 4.4 Lower bound We show that without additional assumptions the regret bound cannot be improved. The lower bound is based on the following construction. The mean reward of every arm is given by µpaq “ µpa˚q ´ ř  Δpaq. The noise is Gaussian with variance 1. In this problem, the regret can be decomposed into a sum over atomic arms of the regret induced by pulling these arms, RegT “ ř  ř aPA ErNT paqsΔpaq. Assume that we only want to minimize the regret induced by a single atomic set A. Further, assume that Δkpaq for all k ‰  are given. Then the problem is reduced to a regular K-armed bandit problem. The asymptotic lower bound for K-armed bandit under 1-Gaussian noise goes back to [10]: For any consistent strategy θ, the asymptotic regret is lower bounded by lim infT Ñ8 Regθ T logpT q ě ř a‰a˚ 2 Δpaq. Due to regret decomposition, we can apply this bound to every atomic set separately. Therefore, the asymptotic regret in the factored bandit problem is lim inf T Ñ8 Regθ T logpTq ě L ÿ “1 ÿ a‰a ˚ 2 Δpaq. This shows that our general upper bound is asymptotically tight up to leading constants and κ. κ-gap We note that there is a problem-dependent gap of κ between our upper and lower bounds. Currently we believe that this gap stems from the difference between information and computational complexity of the problem. Our algorithm operates on each factor of the problem independently of other factors and is based on the “optimism in the face of uncertainty” principle. It is possible to construct examples in which the optimal strategy requires playing surely sub-optimal arms for the sake of information gain. For example, this kind of constructions were used by Lattimore and Szepesvári [11] to show suboptimality of optimism-based algorithms. Therefore, we believe that removing κ from the upper bound is possible, but requires a fundamentally different algorithm design. What is not clear is whether it is possible to remove κ without significant sacrifice of the computational complexity. 5 Comparison to Prior Work 5.1 Stochastic rank-1 bandits Stochastic rank-1 bandits introduced by Katariya et al. [7] are a special case of factored bandits. The authors published a refined algorithm for Bernoulli rank-1 bandits using KL confidence sets in Katariya et al. [8]. We compare our theoretical results with the first paper because it matches our problem assumptions. In our experiments, we provide a comparison to both the original algorithm and the KL version. In the stochastic rank-1 problem there are only 2 atomic sets of size K1 and K2. The matrix of expected rewards for each pair of arms is of rank 1. It means that for each u P A1 and v P A2, there exist u, v P r0, 1s such that Errpu, vqs “ u¨v. The proposed Stochastic rank-1 Elimination algorithm introduced by Katariya et al. is a typical elimination style algorithm. It requires knowledge of the time horizon and uses phases that increase exponentially in length. In each phase, all arms are played uniformly. At the end of a phase, all arms that are sub-optimal with high probability are eliminated. Theoretical comparison It is hard to make a fair comparison of the theoretical bounds because TEA operates under much weaker assumptions. Both algorithms have a regret bound of O ´´ř uPA1zu˚ 1 Δ1puq ` ř vPA2zv˚ 1 Δ2pvq ¯ logptq ¯ . The problem independent multiplicative factors 7 hidden under O are smaller for TEA, even without considering that rank-1 Elimination requires a doubling trick for anytime applications. However, the problem dependent factors are in favor of rank-1 Elimination, where the gaps correspond to the mean difference under uniform sampling pu˚ ´ uq ř vPA2 v{K2. In factored bandits, the gaps are defined as pu˚ ´ uq minvPA2 v, which is naturally smaller. The difference stems from different problem assumptions. Stronger assumptions of rank-1 bandits make elimination easier as the number of eliminated suboptimal arms increases. The TEA analysis holds in cases where it becomes harder to identify suboptimal arms after removal of bad arms. This may happen when highly suboptimal atomic actions in one factor provide more discriminative information on atomic actions in other factors than close to optimal atomic actions in the same factor (this follows the spirit of illustration of suboptimality of optimistic algorithms in [11]). We leave it to future work to improve the upper bound of TEA under stronger model assumptions. In terms of memory and computational complexity, TEA is inferior to regular elimination style algorithms, because we need to keep track of relative performances of the arms. That means both computational and memory complexities are Opř  |A|2q per round in the worst case, as opposed to rank-1 Elimination that only requires O ` |A1| ` |A2| ˘ . Empirical comparison The number of arms is set to 16 in both sets. We always fix u˚ ´ u “ v˚ ´ v “ 0.2. We vary the absolute value of u˚v˚. As expected, rank1ElimKL has an advantage when the Bernoulli random variables are strongly biased towards one side. When the bias is close to 1 2, we clearly see the better constants of TEA. In the evaluation we clearly outperform rank-1 Elimination Figure 2: Comparison of Rank1Elim, Rank1ElimKL, and TEA for K “ L “ 16. The results are averaged over 20 repetitions of the experiment. over different parameter settings and even beat the KL optimized version if the means are not too close to zero or one. This supports that our algorithm does not only provide a more practical anytime version of elimination, but also improves on constant factors in the regret. We believe that our algorithm design can be used to improve other elimination style algorithms as well. 5.2 Dueling Bandits: Related Work To the best of our knowledge, the proposed Dueling Bandit TEA is the first algorithm that satisfies the following three criteria simultaneously for utility-based dueling bandits: • It requires no prior knowledge of the time horizon (nor uses the doubling trick or restarts). • Its pseudo-regret is bounded by Opř a‰a˚ logptq Δpaq q. • There are no additive constants that dominate the regret for time horizons T ą OpKq. We want to stress the importance of the last point. For all state-of-the-art algorithms known to us, when the number of actions K is moderately large, the additive term is dominating for any realistic time horizon T. In particular, Ailon et al. [2] introduces three algorithms for the utility-based dueling bandit problem. The regret of Doubler scales with Oplog2ptqq. The regret of MultiSBM has an additive term of order ř a‰a˚ K Δpaq that is dominating for T ă ΩpexppKqq. The last algorithm, Sparring, has no theoretical analysis. Algorithms based on the weaker Condorcet winner assumption apply to utility-based setting, but they all suffer from equally large or even larger additive terms. The RUCB algorithm introduced by Zoghi et al. [17] has an additive term in the bound that is defined as 2DΔmax logp2Dq, for 8 Δmax “ maxa‰a˚ Δpaq and D ą 1 2 ř ai‰a˚ ř aj‰ai 4α mintΔpaiq2,Δpajq2u. By unwrapping these definitions, we see that the RUCB regret bound has an additive term of order 2DΔmax ě ř a‰a˚ K Δpaq. This is again the dominating term for time horizons T ď ΩpexppKqq. The same applies to the RMED algorithm introduced by Komiyama et al. [9], which has an additive term of OpK2q. (The dependencies on the gaps are hidden behind the O-notation.) The D-TS algorithm by Wu and Liu [13] based on Thompson Sampling shows one of the best empirical performances, but its regret bound includes an additive constant of order OpK3q. Other algorithms known to us, Interleaved Filter [16], Beat the Mean [15], and SAVAGE [12], all require knowledge of the time horizon T in advance. Empirical comparison We have used the framework provided by Komiyama et al. [9]. We use the same utility for all sub-optimal arms. In Figure 3, the winning probability of the optimal arm over suboptimal arms is always set to 0.7, we run the experiment for different number of arms K. TEA outperforms all algorithms besides RMED variants, as long as the number of arms are sufficiently big. To show that there also exists a regime where the improved constants gain an advantage over RMED, we conducted a second experiment in Figure 4 (in the Appendix), where we set the winning probability to 0.952 and significantly increase the number of arms. The evaluation shows that the additive terms are indeed non-negligible and that Dueling Bandit TEA outperforms all baseline algorithms when the number of arms is sufficiently large. Figure 3: Comparison of Dueling Bandits algorithms with identical gaps of 0.4. The results are averaged over 20 repetitions of the experiment. 6 Discussion We have presented the factored bandits model and uniform identifiability assumption, which requires no knowledge of the reward model. We presented an algorithm for playing stochastic factored bandits with uniformly identifiable actions and provided matching upper and lower bounds for the problem up to constant factors. Our algorithm and proofs might serve as a template to turn other elimination style algorithms into improved anytime algorithms. Factored bandits with uniformly identifiable actions generalize rank-1 bandits. We have also provided a unified framework for the analysis of factored bandits and utility-based dueling bandits. Furthermore, we improve the additive constants in the regret bound compared to state-of-the-art algorithms for utility-based dueling bandits. There are multiple potential directions for future research. One example mentioned in the text is the possibility of improving the regret bound when additional restrictions on the form of the reward function are introduced or improvements of the lower bound when algorithms are restricted in computational or memory complexity. Another example is the adversarial version of the problem. 2Smaller gaps show the same behavior but require more arms and more timesteps. 9 References [1] Y. Abbasi-Yadkori, D. Pál, and C. Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011. [2] N. Ailon, Z. Karnin, and T. Joachims. Reducing dueling bandits to cardinal bandits. In International Conference on Machine Learning, pages 856–864, 2014. [3] N. Cesa-Bianchi and G. Lugosi. Combinatorial bandits. Journal of Computer and System Sciences, 78(5):1404–1422, 2012. [4] W. Chen, Y. Wang, Y. Yuan, and Q. Wang. Combinatorial multi-armed bandit and its extension to probabilistically triggered arms. The Journal of Machine Learning Research, 17(1):1746–1778, 2016. [5] R. Combes, S. Magureanu, and A. Proutiere. Minimal exploration in structured stochastic bandits. In Advances in Neural Information Processing Systems, pages 1761–1769, 2017. [6] S. Filippi, O. Cappe, A. Garivier, and C. Szepesvári. Parametric bandits: The generalized linear case. In Advances in Neural Information Processing Systems, pages 586–594, 2010. [7] S. Katariya, B. Kveton, C. Szepesvári, C. Vernade, and Z. Wen. Stochastic rank-1 bandits (long version). In AISTATS, volume 54 of PMLR, pages 392–401, April 2017. [8] S. Katariya, B. Kveton, C. Szepesvári, C. Vernade, and Z. Wen. Bernoulli rank-1 bandits for click feedback. International Joint Conference on Artificial Intelligence, 2017. [9] J. Komiyama, J. Honda, H. Kashima, and H. Nakagawa. Regret lower bound and optimal algorithm in dueling bandit problem. In Conference on Learning Theory, pages 1141–1154, 2015. [10] T. L. Lai and H. Robbins. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985. [11] T. Lattimore and C. Szepesvári. The end of optimism? An asymptotic analysis of finite-armed linear bandits (long version). In AISTATS, volume 54 of PMLR, pages 728–737, April 2017. [12] T. Urvoy, F. Clerot, R. Féraud, and S. Naamane. Generic exploration and k-armed voting bandits. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 91–99, 2013. [13] H. Wu and X. Liu. Double thompson sampling for dueling bandits. In Advances in Neural Information Processing Systems, pages 649–657, 2016. [14] Y. Yue and T. Joachims. Interactively optimizing information retrieval systems as a dueling bandits problem. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 1201–1208. ACM, 2009. [15] Y. Yue and T. Joachims. Beat the mean bandit. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pages 241–248, 2011. [16] Y. Yue, J. Broder, R. Kleinberg, and T. Joachims. The k-armed dueling bandits problem. Journal of Computer and System Sciences, 78(5):1538–1556, 2012. [17] M. Zoghi, S. Whiteson, R. Munos, and M. Rijke. Relative upper confidence bound for the k-armed dueling bandit problem. In International Conference on Machine Learning, pages 10–18, 2014. 10
2018
155
7,314
Poison Frogs! Targeted Clean-Label Poisoning Attacks on Neural Networks Ali Shafahi∗ University of Maryland ashafahi@cs.umd.edu W. Ronny Huang∗ University of Maryland wrhuang@umd.edu Mahyar Najibi University of Maryland najibi@cs.umd.edu Octavian Suciu University of Maryland osuciu@umiacs.umd.edu Christoph Studer Cornell University studer@cornell.edu Tudor Dumitras University of Maryland tudor@umiacs.umd.edu Tom Goldstein University of Maryland tomg@cs.umd.edu Abstract Data poisoning is an attack on machine learning models wherein the attacker adds examples to the training set to manipulate the behavior of the model at test time. This paper explores poisoning attacks on neural nets. The proposed attacks use “clean-labels”; they don’t require the attacker to have any control over the labeling of training data. They are also targeted; they control the behavior of the classifier on a specific test instance without degrading overall classifier performance. For example, an attacker could add a seemingly innocuous image (that is properly labeled) to a training set for a face recognition engine, and control the identity of a chosen person at test time. Because the attacker does not need to control the labeling function, poisons could be entered into the training set simply by leaving them on the web and waiting for them to be scraped by a data collection bot. We present an optimization-based method for crafting poisons, and show that just one single poison image can control classifier behavior when transfer learning is used. For full end-to-end training, we present a “watermarking” strategy that makes poisoning reliable using multiple (≈50) poisoned training instances. We demonstrate our method by generating poisoned frog images from the CIFAR dataset and using them to manipulate image classifiers. 1 Introduction Before deep learning algorithms can be deployed in high stakes, security-critical applications, their robustness against adversarial attacks must be put to the test. The existence of adversarial examples in deep neural networks (DNNs) has triggered debates on how secure these classifiers are [Szegedy et al., 2013, Goodfellow et al., 2015, Biggio et al., 2013]. Adversarial examples fall within a category of attacks called evasion attacks. Evasion attacks happen at test time – a clean target instance is modified to avoid detection by a classifier, or spur misclassification. However, these attacks do not map to certain realistic scenarios in which the attacker cannot control test time data. For example, consider a retailer aiming to mark a competitor’s email as spam through an ML-based spam filter. Evasion attacks are not applicable because the attacker cannot modify the victim emails. Similarly, ∗Authors contributed equally. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. an adversary may not be able to alter the input to a face recognition engine that operates under supervised conditions, such as a staffed security desk or building entrance. Such systems are still susceptible to data poisoning attacks. These attacks happen at training time; they aim to manipulate the performance of a system by inserting carefully constructed poison instances into the training data. This paper studies poisoning attacks on neural nets that are targeted, meaning they aim to control the behavior of a classifier on one specific test instance. For example, they manipulate a face recognition engine to change the identity of one specific person, or manipulate a spam filter to allow/deny a specific email of the attacker’s choosing. We propose clean label attacks that do not require control over the labeling function; the poisoned training data appear to be labeled correctly according to an expert observer. This makes the attacks not only difficult to detect, but opens the door for attackers to succeed without any inside access to the data collection/labeling process. For example, an adversary could place poisoned images online and wait for them to be scraped by a bot that collects data from the web. The retailer described above could contribute to a spam filter dataset simply by emailing people inside an organization. 1.1 Related work Classical poisoning attacks indiscriminately degrade test accuracy rather than targeting specific examples, making them easy to detect. While there are studies related to poisoning attacks on support vector machines [Biggio et al., 2012] or Bayesian classifiers [Nelson et al., 2008], poisoning attacks on Deep Neural Networks (DNN) have been rarely studied. In the few existing studies, DNNs have been shown to fail catastrophically against data poisoning attacks. Steinhardt et al. [2017] reported that, even under strong defenses, there is an 11% reduction in test accuracy when the attacker is allowed 3% training set modifications. Muñoz-González et al. [2017] propose a back-gradient based approach for generating poisons. To speed up the process of generating poisoning instances, Yang et al. [2017] develop a generator that produces poisons. A more dangerous approach is for the attacker to target specific test instances. For example, the retailer mentioned above, besides achieving her target goal, does not want to render the spam filter useless or tip off the victim to the presence of her attack. Targeted backdoor attacks [Chen et al., 2017] with few resources (∼50 training examples) have been recently shown to cause the classifier to fail for special test examples. Gu et al. [2017] trains a network using mislabeled images tagged with a special pattern, causing the classifier to learn the association between the pattern and the class label. In Liu et al. [2017] a network is trained to respond to a trojan trigger. These attacks present the same shortcomings as evasion attacks; they require test-time instances to be modified to trigger the mispredictions. Moreover, in most prior work, the attacker is assumed to have some degree of control over the labeling process for instances in the training set. This inadvertently excludes real-world scenarios where the training set is audited by human reviewers who will label each example as it appears to the eye, or where the labels are assigned by an external process (such as malware detectors which often collect ground truth labeled by third party antiviruses). Assumed control over the labeling function leads to a straightforward one-shot attack wherein the target instance with a flipped label is added as poison. Overfitting on the poison would then ensure that the target instance would get misclassified during inference time. The most closely related work to our own is by Suciu et al. [2018], who studies targeted attacks on neural nets. This attack, however, requires that poisons fill at least 12.5% (and up to 100%) of every minibatch, which may be unrealistic in practice. In contrast, our attacks do not require any control of the minibatching process, and assume a much smaller poisoning budget (<0.1% vs. >12.5%). Finally, we note that several works have approached poisoning from a theoretical perspective. Mahloujifar and Mahmoody [2017], Mahloujifar et al. [2017] study poisoning threat models from a theoretical perspective, and the robustness of classifiers to training data perturbations was considered in Diakonikolas et al. [2016]. 1.2 Contributions In this work, we study a new type of attack, henceforth called clean-label attacks, wherein the attacker’s injected training examples are cleanly labeled by a certified authority, as opposed to maliciously labeled by the attacker herself. Our strategy assumes that the attacker has no knowledge of the training data but has knowledge of the model and its parameters. This is a reasonable 2 assumption given that many classic networks pre-trained on standard datasets, such as ResNet [He et al., 2015] or Inception [Szegedy et al., 2014] trained on ImageNet, are frequently used as feature extractors. The attacker’s goal is to cause the retrained network to misclassify a special test instance from one class (e.g. a piece of malware) as another class of her choice (e.g. benign application) after the network has been retrained on the augmented data set that includes poison instances. Besides the intended misprediction on the target, the performance degradation on the victim classifier is not noticeable. This makes state-of-the-art poisoning defenses that measure the performance impact of training instances (such as Barreno et al. [2010]) ineffective. A similar type of attack was demonstrated using influence functions (Koh and Liang [2017]) for the scenario where only the final fully connected layer of the network was retrained on the poisoned dataset, with a success rate of 57%.We demonstrate an optimization-based clean-label attack under the transfer learning scenario studied by Koh and Liang [2017], but we achieve 100% attack success rate on the same dog-vs-fish classification task. Further, we study – for the first time to our knowledge – clean-label poisoning in the end-to-end training scenario where all layers of the network are retrained. Through visualizations, we shed light on why this scenario is much more difficult due to the expressivity of deep networks. Informed by these visualizations, we craft a 50 poison instance attack on a deep network which achieves success rates of up to 60% in the end-to-end training scenario. 2 A simple clean-label attack We now propose an optimization-based procedure for crafting poison instances that, when added to the training data, manipulate the test-time behavior of a classifier. Later, we’ll discuss tricks to boost the power of this simple attack. An attacker first chooses a target instance from the test set; a successful poisoning attack causes this target example to be misclassified during test time. Next, the attacker samples a base instance from the base class, and makes imperceptible changes to it to craft a poison instance; this poison is injected into the training data with the intent of fooling the model into labelling the target instance with the base label at test time. Finally, the model is trained on the poisoned dataset (clean dataset + poison instances). If, at test time, the model mistakes the target instance as being in the base class, then the poisoning attack is considered successful. 2.1 Crafting poison data via feature collisions Let f(x) denote the function that propagates an input x through the network to the penultimate layer (before the softmax layer). We call the activations of this layer the feature space representation of the input since it encodes high-level semantic features. Due to the high complexity and nonlinearity of f, it is possible to find an example x that “collides” with the target in feature space, while simultaneously being close to the base instance b in input space by computing p = argmin x ∥f(x) −f(t)∥2 2 + β ∥x −b∥2 2 (1) The right-most term of Eq. 1 causes the poison instance p to appear like a base class instance to a human labeler (β parameterizes the degree to which this is so) and hence be labeled as such. Meanwhile, the first term of Eq. 1 causes the poison instance to move toward the target instance in feature space and get embedded in the target class distribution. On a clean model, this poison instance would be misclassified as a target. If the model is retrained on the clean data + poison instances, however, the linear decision boundary in feature space is expected to rotate to label the poison instance as if it were in the base class. Since the target instance is nearby, the decision boundary rotation may inadvertently include the target instance in the base class along with the poison instance (note that training strives for correct classification of the poison instance but not the target since the latter is not part of the training set). This allows the unperturbed target instance, which is subsequently misclassified into the base class during test time, to gain a “backdoor” into the base class. 2.2 Optimization procedure Our procedure for performing the optimization in Eq. 1 to obtain p is shown in Algorithm 1. The algorithm uses a forward-backward-splitting iterative procedure [Goldstein et al., 2014]. The first (forward) step is simply a gradient descent update to minimize the L2 distance to the target instance 3 in feature space. The second (backward step) is a proximal update that minimizes the Frobenius distance from the base instance in input space. The coefficient β is tuned to make the poison instance look realistic in input space, enough to fool an unsuspecting human observer into thinking the attack vector image has not been tampered with. Algorithm 1 Poisoning Example Generation Input: target instance t, base instance b, learning rate λ Initialize x: x0 ←b Define: Lp(x) = ∥f(x) −f(t)∥2 for i = 1 to maxIters do Forward step: bxi = xi−1 −λ∇xLp(xi−1) Backward step: xi = ( bxi + λβb)/(1 + βλ) end for 3 Poisoning attacks on transfer learning We begin by examining the case of transfer learning, in which a pre-trained feature extraction network is used, and only the final network (softmax) layer is trained to adapt the network to a specific task. This procedure is common in industry where we want to train a robust classifier on limited data. Poisoning attacks in this case are extremely effective. In Section 4, we generalize these attacks to the case of end-to-end training. We perform two poisoning experiments. First, we attack a pretrained InceptionV3 [Szegedy et al., 2016] network under the scenario where the weights of all layers excluding the last are frozen. Our network and dataset (ImageNet [Russakovsky et al., 2015] dog-vs-fish) were identical to that of Koh and Liang [2017]. Second, we attack an AlexNet architecture modified for the CIFAR-10 dataset by Krizhevsky and Hinton [2009] under the scenario where all layers are trained.2 3.1 A one-shot kill attack We now present a simple poisoning attack on transfer learned networks. In this case, a “one-shot kill” attack is possible; by adding just one poison instance to the training set (that is labeled by a reliable expert), we cause misclassification of the target with 100% success rate. Like in Koh and Liang [2017], we essentially leverage InceptionV3 as a feature extractor and retrain its final fully-connected layer weights to classify between dogs and fish. We select 900 instances from each class in ImageNet as the training data and remove duplicates from the test data that are present in the training data as a pre-processing step3. After this, we are left with 1099 test instances (698 test instances for the dog class and 401 test instances for the fish class). We select both target and base instances from the test set and craft a poison instance using Algorithm 1 with maxIters = 1000. Since the images in ImageNet have different dimensions, we calculate β for Eq. 1 using β = β0 · 20482/(dimb)2 which takes the dimensionality of the base instance (dimb) and the dimension of InceptionV3’s feature space representation layer (2048) into account. We use β0 = 0.25 in our experiments. We then add the poison instance to the training data and perform cold-start training (all unfrozen weights initialized to random values). We use the Adam optimizer with learning rate of 0.01 to train the network for 100 epochs. The experiment is performed 1099 times – each with a different test-set image as the target instance – yielding an attack success rate of 100%. For comparison, the influence function method studied in Koh and Liang [2017] reports a success rate of 57% . The median misclassification confidence was 99.6% (Fig. 1b). Further, the overall test accuracy is hardly affected by the poisoning, dropping by an average of 0.2%, with a worst-case of 0.4%, from the original 99.5% over all experiments. Some sample target instances and their corresponding poison instances are illustrated in Fig. 1a. Note that it is not generally possible to get 100% success rate on transfer learning tasks. The reason that we are able to get such success rate using InceptionV3 on the dog-vs-fish task is because there 2The code is available at https://github.com/ashafahi/inceptionv3-transferLearn-poison 3If an identical image appears in both the train and test set, it could be chosen as both a base and target, in which case poisoning is trivial. We remove duplicate images to prevent this sort of “cheating.” 4 (a) Sample target and poison instances. misclassification confidence count (a.u.) poisoned model clean model Results of 1099 experiments (b) Incorrect class’s probability histogram predicted for the target image by the clean (dark red) and poisoned (dark blue) models. When trained on a poisoned dataset, the target instances not only get misclassified; they get misclassified with high confidence. Figure 1: Transfer learning poisoning attack. (a) The top row contains 5 random target instances (from the “fish” class). The second row contains the constructed poison instance corresponding to each of these targets. We used the same base instance (second row, leftmost image) for building each poison instance. The attack is effective for any base, but fewer iterations are required if the base image has a higher resolution. We stopped the poison generation algorithm when the maximum iterations was met or when the feature representation of the target and poison instances were less than 3 units apart (in Euclidean norm). The stopping threshold of 3 was determined by the minimum distance between all pairs of training points. As can be seen, the poison instances are visually indistinguishable from the base instance (and one another). Rows 3 and 4 show samples from similar experiments where the target (fish) and base (dog) classes were swapped. are more trainable weights (2048) than training examples (1801). As long as the data matrix contains no duplicate images, the system of equations that needs to be solved to find the weight vector is under-determined and overfitting on all of the training data is certain to occur. To better understand what causes the attacks to be successful, we plot the angular deviation between the decision boundary (i.e. the angular difference between the weight vectors) of the clean and poisoned networks in Fig. 2 (blue bars and lines). The angular deviation is the degree to which retraining on the poison instance caused the decision boundary to rotate to encompass the poison instance within the base region. This deviation occurs mostly in the first epoch as seen in Fig. 2b, suggesting that the attack may succeed even with suboptimal retraining hyperparameters. The final deviation of 23 degrees on average (Fig. 2a) indicates that a substantial alteration to the final layer decision boundary is made by the poison instance. These results verify our intuition that misclassification of the target occurs due to changes in the decision boundary. While our main formulation (Eq. 1) promotes similarity between the poison and base images via the ℓ2 metric, the same success rate of 100% is achieved when we promote similarity via an ℓ∞bound of 2 (out of a dynamic range of 255) as is done in Koh and Liang [2017]. Details of the experiment are presented in the supplementary material. The experiments here were on a binary classification task (“dog” vs. “fish”). There is, however, no constraint on applying the same poisoning procedure to many-class problems. In the supplementary material, we present additional experiments where a new class, “cat”, is introduced and we show 100% poisoning success on the 3-way task is still achieved while maintaining an accuracy of 96.4% on clean test images. 5 angular deviation (deg) probability (a.u) decision boundary angular deviation due to poisoning transfer learning end-toend (a) PDF of decision boundary ang. deviation. decision boundary angular deviation due to poisoning transfer learning end-to-end (multi poison) end-to-end (single poison) (b) Average angular deviation vs epoch. Figure 2: Angular deviation of the feature space decision boundary when trained with clean dataset + poison instance(s) versus when trained with clean dataset alone. (a) Histogram of the final (last epoch) angular deviation over all experiments. In transfer learning (blue), there is a significant rotation (average of 23 degrees) in the feature space decision boundary. In contrast, in end-to-end training (red) where we inject 50 poison instances, the decision boundary’s rotation is negligible. (b) Most of the parameter adjustment is done during the first epoch. For the end-to-end training experiments, the decision boundary barely changes. 4 Poisoning attacks on end-to-end training We saw in Section 3 that poisoning attacks on transfer learning are extremely effective. When all layers are trainable, these attacks become more difficult. However, using a “watermarking” trick and multiple poison instances, we can still effectively poison end-to-end networks. Our end-to-end experiments focus on a scaled-down AlexNet architecture for the CIFAR-10 dataset4 (architectural details in appendix), initialized with pretrained weights (warm-start), and optimized with Adam at learning rate 1.85 × 10−5 over 10 epochs with batch size 128. Because of the warmstart, the loss was constant over the last few epochs after the network had readjusted to correctly classify the poison instances. 4.1 Single poison instance attack We begin with an illustrative example of attacking a network with a single poison instance. Our goal is to visualize the effect of a poison on the network’s behavior, and explain why poisoning attacks under end-to-end training are more difficult than under transfer learning. For the experiments, we randomly selected “airplane” as the target class and “frog” as the base class. For crafting poison instances, we used a β value of 0.1 and iteration count of 12000. Figure 3a shows the target, base, and poison feature space representations visualized by projecting the 193-dimensional deep feature vectors onto a 2-dimensional plane. The first dimension is along the vector joining the centroids of the base and target classes (u = µbase −µtarget), while the second dimension is along the vector orthogonal to u and in the plane spanned by u and θ (the weight vector of the penultimate layer, i.e. the normal to the decision boundary). This projection allows us to visualize the data distribution from a viewpoint best representing the separation of the two classes (target and base). We then evaluate our poisoning attack by training the model with the clean data + single poison instance. Fig. 3a shows the feature space representations of the target, base, and poison instances along with the training data under a clean (unfilled markers) and poisoned (filled markers) model. In their clean model feature space representations, the target and poison instances are overlapped, indicating that our poison-crafting optimization procedure (Algorithm 1) works. Oddly, unlike the transfer learning scenario where the final layer decision boundary rotates to accommodate the poison instance within the base region, the decision boundary in the end-to-end training scenario is unchanged after retraining on the poisoned dataset, as seen through the red bars and lines in Fig. 2. From this, we make the following important observation: During retraining with the poison data, the network modifies its lower-level feature extraction kernels in the shallow layers so the poison instance is returned to the base class distribution in the deep layers. 4We do this to keep runtimes short since quantifying performance of these attacks requires running each experiment (and retraining the whole network) hundreds of times. 6 Target train instances Base train instances Clean model: Poisoned model: Feature space visualization of unsuccessful single-shot poisoning attack (a) Feature space visualization of successful multi-shot poisoning attack (b) Figure 3: Feature space visualization of end-to-end training poisoning attacks. (a) A single poison instance is unable to successfully attack the classifier. The poison instance’s feature space position under the clean model is overlapped with that of the target instance. However, when the model is trained on the clean + poisoned data (i.e. the poisoned model), the feature space position of the poison instance is returned to the base class distribution, while target remains in the target class distribution. (b) To make the attack successful, we construct 50 poison instances from 50 random base instances that are “watermarked” with a 30% opacity target instance. This causes the target instance to be pulled out of the target class distribution (in feature space) into the base class distribution and get incorrectly classified as the base class. In other words, the poison instance generation exploits imperfections in the feature extraction kernels in earlier layers such that the poison instance is placed alongside the target in feature space. When the network is retrained on this poison instance, because it is labeled as a base, those early-layer feature kernel imperfections are corrected and the poison instance is returned to the base class distribution. This result shows that the objectives of poison instance generation and of network training are mutually opposed and thus a single poison may not be enough for compromising even extreme outlier target examples. To make the attack successful, we must find a way to ensure that the target and poison instances do not get separated in feature space upon retraining. 4.2 Watermarking: a method to boost the power of poison attacks To prevent the separation of poison and target during training, we use a simple but effective trick: add a low-opacity watermark of the target instance to the poisoning instance to allow for some inseparable feature overlap while remaining visually distinct. This blends some features of the target instance into the poison instance and should cause the poison instance to remain within feature space proximity of the target instance even after retraining. Watermarking has been previously used in Chen et al. [2017], but their work required the watermark to be applied during inference time, which is unrealistic in situations where the attacker cannot control the target instance. 7 Figure 4: 12 out of 60 random poison instances that successfully cause a bird target instance to get misclassified as a dog in the end-to-end training scenario. An adversarial watermark (opacity 30%) of the target bird instance is applied to the base instances when making the poisons. More examples are in the supplementary material. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 5 9 13 17 21 25 29 33 37 41 45 49 PROBABILITY OUTLIER ID Successful Unsuccessful (a) Attacks on the most outlier target airplanes. The bars indicate the probability of the target instance before the attack (calculated using the pre-trained network). The coloring, denotes whether the attack was successful or unsuccessful. Each experiment utilizes a watermark opacity of 30% and 50 poisons. Out of these 50 outliers, the attack succeeds 70% of the time (compare to 53% for a random target). 0 20 40 60 # poisons 0.00 0.25 0.50 0.75 1.00 success rate success rates of various experiments bird-vs-dog | opacity 30% airplane-vs-frog | opacity 30% airplane-vs-frog | opacity 20% (b) Success rate of attacks on different targets from different bases as a function of number of poison instances used and different target opacity added to the base instances. Figure 5: Success rates for attacks on outliers and random targets. While attacking non-outlier is still possible, attacking an outlier can increase the chances of success. A base watermarked image with target opacity γ is formed by taking a weighted combination of the base b and the target images t: b ←γ · t + (1 −γ) · b. Some randomly selected poison instances are shown in the supplementary material. Watermarks are not visually noticeable even up to 30% opacity for some target instances. Fig. 4 illustrates 60 poison instances used for successfully attacking a “bird” target instance. 4.2.1 Multiple poison instance attacks Poisoning in the end-to-end training scenario is difficult because the network learns feature embeddings that optimally distinguish the target from the poison. But what if we introduce multiple poison instances derived from different base instances into the training set? For the classifier to resist multiple poisons, it must learn a feature embedding that separates all poison instances from the target while also ensuring that the target instance remains in the target distribution. We show in our experiments that using a high diversity of bases prevents the moderately-sized network from learning features of the target that are distinct from those of the bases. Consequently, when the network is retrained, the target instance is pulled along with the poison instances toward the base distribution, and attacks are frequently successful. These dynamics are shown in Fig. 3b. In Fig. 2, we observe that even in the multiple poison experiments, the decision boundary of the final layer remains unchanged, suggesting that there’s a fundamentally different mechanism by which poisoning succeeds in the transfer learning vs. end-to-end training scenarios. Transfer learning reacts to poisons by rotating the decision boundary to encompass the target, while end-to-end training reacts by pulling the target into the base distribution (in feature space). The decision boundary in the end-to-end scenario remains stationary (varying by fractions of a degree) under retraining on the poisoned dataset, as shown in Fig. 2. To quantify how the number of poison instances impacts success rate, we ran experiments for each number of poison instances between 1 and 70 (increments of 5). Experiments used randomly chosen target instances from the test set. Each poison was generated from a random base in the test set (resulting in large feature diversity among poisons). A watermarking opacity of 30% or 20% was used to enhance feature overlap between the poisons and targets. The attack success rate (over 30 random trials) is shown in Fig. 5b. The set of 30 experiments was repeated for a different target-base class pair within CIFAR-10 to verify that the success rates are not class dependent. We also try a 8 lower opacity and observe that the success rate drops. The success rate increases monotonically with the number of poison instances. With 50 poisons the success rate is about 60% for the bird-vs-dog task. Note we declare success only when the target is classified as a base; the attack is considered unsuccessful even when the target instance is misclassified to a class other than the base. We can increase the success rate of this attack by targeting data outliers. These targets lie far from other training samples in their class, and so it should be easier to flip their class label. We target the 50 “airplanes” with the lowest classification confidence (but still correctly classified), and attack them using 50 poison frogs per attack. The success rate for this attack is 70% (Fig. 5a), which is 17% higher than for randomly chosen targets. To summarize, clean-label attacks under the end-to-end scenario require multiple techniques to work: (1) optimization via Algorithm 1, (2) diversity of poison instances, and (3) watermarking. In the supplementary material, we provide a leave-one-out ablation study with 50 poisons which verifies that all three techniques are required for successful poisoning. 5 Conclusion We studied targeted clean-label poisoning methods that attack a net at training time with the goal of manipulating test-time behavior. These attacks are difficult to detect because they involve nonsuspicious (correctly labeled) training data, and do not degrade the performance on non-targeted examples. The proposed attack crafts poison images that collide with a target image in feature space, thus making it difficult for a network to discern between the two. These attacks are extremely powerful in the transfer learning scenario, and can be made powerful in more general contexts by using multiple poison images and a watermarking trick. Training with poison instances is akin to the adversarial training technique for defending against evasion attacks (Goodfellow et al. [2015]). The poison instance can here be seen as an adversarial example to the base class. While our poisoned dataset training does indeed make the network more robust to base-class adversarial examples designed to be misclassified as the target, it also has the effect of causing the unaltered target instance to be misclassified as a base. This side effect of adversarial training was exploited in this paper, and is worth further investigation. Many neural networks are trained using data sources that are easily manipulated by adversaries.We hope that this work will raise attention for the important issue of data reliability and provenance. 6 Acknowledgements Goldstein and Shafahi were supported by the Office of Naval Research (N00014-17-1-2078), DARPA Lifelong Learning Machines (FA8650-18-2-7833), the DARPA YFA program (D18AP00055), and the Sloan Foundation. Studer was supported in part by Xilinx, Inc. and by the US National Science Foundation (NSF) under grants ECCS-1408006, CCF-1535897, CCF-1652065, CNS-1717559, and ECCS-1824379. Dumitras and Suciu were supported by the Department of Defense. 9 References 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. Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. International Conference on Learning Representation, 2015. Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Šrndi´c, Pavel Laskov, Giorgio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pages 387–402. Springer, 2013. Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. arXiv preprint arXiv:1206.6389, 2012. Blaine Nelson, Marco Barreno, Fuching Jack Chi, Anthony D. Joseph, Benjamin I. P. Rubinstein, Udam Saini, Charles Sutton, J. D. Tygar, and Kai Xia. Exploiting machine learning to subvert your spam filter. In Proceedings of the 1st Usenix Workshop on Large-Scale Exploits and Emergent Threats, pages 7:1–7:9, Berkeley, CA, USA, 2008. Jacob Steinhardt, Pang Wei Koh, and Percy Liang. Certified Defenses for Data Poisoning Attacks. arXiv preprint arXiv:1706.03691, (i), 2017. URL http://arxiv.org/abs/1706.03691. Luis Muñoz-González, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pages 27–38. ACM, 2017. Chaofei Yang, Qing Wu, Hai Li, and Yiran Chen. Generative poisoning attack method against neural networks. arXiv preprint arXiv:1703.01340, 2017. Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted Backdoor Attacks on Deep Learning Systems Using Data Poisoning. arXiv preprint arXiv:1712.05526, 2017. URL http://arxiv.org/abs/1712.05526. Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. Yingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee, Juan Zhai, Weihang Wang, and Xiangyu Zhang. Trojaning attack on neural networks. 2017. Octavian Suciu, Radu M˘arginean, Yi˘gitcan Kaya, Hal Daumé III, and Tudor Dumitra¸s. When does machine learning fail? generalized transferability for evasion and poisoning attacks. arXiv preprint arXiv:1803.06975, 2018. Saeed Mahloujifar and Mohammad Mahmoody. Blockwise p-tampering attacks on cryptographic primitives, extractors, and learners. Cryptology ePrint Archive, Report 2017/950, 2017. https: //eprint.iacr.org/2017/950. Saeed Mahloujifar, Dimitrios I. Diochnos, and Mohammad Mahmoody. Learning under p-tampering attacks. CoRR, abs/1711.03707, 2017. URL http://arxiv.org/abs/1711.03707. Ilias Diakonikolas, Daniel M Kane, and Alistair Stewart. Efficient robust proper learning of logconcave distributions. arXiv preprint arXiv:1606.03077, 2016. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. arXiv preprint arXiv:1512.03385, 7(3):171–180, 2015. ISSN 1664-1078. doi: 10.3389/fpsyg.2013.00124. URL http://arxiv.org/pdf/1512.03385v1.pdf. Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going Deeper with Convolutions. arXiv:1409.4842, 2014. ISSN 10636919. doi: 10.1109/CVPR.2015.7298594. URL https://arxiv.org/abs/1409.4842. 10 Marco Barreno, Blaine Nelson, Anthony D Joseph, and JD Tygar. The security of machine learning. Machine Learning, 81(2):121–148, 2010. Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. arXiv preprint arXiv:1703.04730, 2017. Tom Goldstein, Christoph Studer, and Richard Baraniuk. A field guide to forward-backward splitting with a fasta implementation. arXiv preprint arXiv:1411.3406, 2014. 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. Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. 11
2018
156
7,315
Implicit Probabilistic Integrators for ODEs Onur Teymur⇤& Ben Calderhead Department of Mathematics Imperial College London Han Cheng Lie & T.J. Sullivan Institute of Mathematics, Freie Universit¨at Berlin; & Zuse Institut Berlin Abstract We introduce a family of implicit probabilistic integrators for initial value problems (IVPs), taking as a starting point the multistep Adams–Moulton method. The implicit construction allows for dynamic feedback from the forthcoming timestep, in contrast to previous probabilistic integrators, all of which are based on explicit methods. We begin with a concise survey of the rapidly-expanding field of probabilistic ODE solvers. We then introduce our method, which builds on and adapts the work of Conrad et al. (2016) and Teymur et al. (2016), and provide a rigorous proof of its well-definedness and convergence. We discuss the problem of the calibration of such integrators and suggest one approach. We give an illustrative example highlighting the effect of the use of probabilistic integrators—including our new method—in the setting of parameter inference within an inverse problem. 1 Set-up, motivation and context We consider the common statistical problem of inferring model parameters ✓from data Y . In a Bayesian setting, the parameter posterior is given by p(✓|Y ) / p(Y |✓)p(✓). Suppose we have a regression model in which the likelihood term p(Y |✓) requires us to solve an ordinary differential equation (ODE). Specifically, for each datum, we have Yj = x(tYj) + "j for some latent function x(t) satisfying ˙x = f(x, ✓) and vector of measurement errors " with spread parameter σ. We can write the full model as p(✓, σ, x|Y ) / p(Y |x, σ)p(x|✓)p(✓)p(σ). Since x is latent, it is included as an integral part of the posterior model. This more general decomposition would not need to be considered explicitly in, say, a linear regression model for which x = ✓1 + ✓2t; here we would simply have p(x|✓) = δx(✓1 + ✓2t). In other words, given ✓there is no uncertainty in x, and the model would reduce to simply p(✓, σ|Y ) / p(Y |✓, σ)p(✓)p(σ). In our case, however, x is defined implicitly through the ODE ˙x = f(x, ✓) and p(x|✓) is therefore no longer trivial. What we mean by this is that x can only be calculated approximately and thus— following the central principle of probabilistic numerical methods (Hennig et al., 2015)—we assign to it a probability distribution representing our lack of knowledge about its true value. Our focus here is on initial value problems (IVPs) where we assume the initial value X0 ⌘x(0) is known (though an extension to unknown X0 is straightforward). We thus have the setup p(✓, σ, x|Y, X0) / p(Y |x, σ)p(x|✓, X0)p(✓)p(σ). (1) For our purposes, the interesting term on the right-hand side is p(x|✓), where hereafter we omit X0. In the broadest sense, our aim is to account as accurately as possible for the numerical error which is inevitable in the calculation of x, and to do this within a probabilistic framework by describing p(x|✓). We then wish to consider the effect of this uncertainty as it is propagated through (1), when performing inference on ✓in an inverse problem setting. An experimental example in this context is considered in Section 3. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. ⇤Corresponding author: o@teymur.uk 1.1 Probabilistic numerical methods Before we give a summary of the current state of probabilistic numerical methods (PN) for ODEs, we take a brief diversion. It is interesting to note that the concept of defining a distribution for p(x|✓) has appeared in the recent literature in different forms. For example, a series of papers (Calderhead et al., 2009; Dondelinger et al., 2013; Wang and Barber, 2014; Macdonald et al., 2015), which arose separately from PN in its modern form, seek to avoid solving the ODE entirely and instead replace it with a ‘surrogate’ statistical model, parameterised by φ, with the primary motivation being to reduce overall computation. The central principle in these papers is to perform gradient matching (GM) between the full and surrogate models. A consequence of this framework is the introduction of a distribution p(x|✓, φ) akin to the p(x|✓) appearing in (1). The aim is to approximate x using statistical techniques, but there is no attempt to model the error itself—instead, simply an attempt to minimise the discrepancy between the true solution and its surrogate. Furthermore, the parameters φ of the surrogate models proposed in the GM framework are fitted by conditioning on data Y, meaning p(x|✓, φ) needs to be viewed as a data-conditioned posterior p(x|✓, φ, Y ). In our view this is problematic, since where the uncertainty in a quantity of interest arises solely from the inexactness of the numerical methods used to calculate it, inference over that quantity should not be based on data that is the outcome of an experiment. The circularity induced in (1) by Y-conditioning is clear. The fundamental shift in thinking in the papers by Hennig and Hauberg (2014) and Chkrebtii et al. (2016), building on Skilling (1991), and then followed up and extended by Schober et al. (2014), Conrad et al. (2016), Teymur et al. (2016), Kersting and Hennig (2016), Schober et al. (2018) and others is that of what constitutes ‘data’ in the algorithm used to determine p(x|✓). By contrast to the GM approach, the experimental data Y is not used in constructing this distribution. Though the point has already been made tacitly in some of these works, we argue that this constitutes the key difference in philosophy. Instead, we should strive to quantify the numerical uncertainty in x first, then propagate this uncertainty via the data likelihood to the Bayesian inversion employed for inferring ✓. This is effectively direct probabilistic modelling of the numerical error and is the approach taken in PN. How then is x inferred in PN? The common thread here is that a discrete path Z ⌘Z1:N is generated which numerically approximates X ⌘X1:N—the discretised version of the true solution x—then ‘model interrogations’ (Chkrebtii et al., 2016) F := f(Z, ✓) are thought of as a sort of numerical data and x is inferred based on these. Done this way, an entirely model-based description of the uncertainty in x results, with no recourse to experimental data Y . 1.2 Sequential inference Another central feature of PN solvers from Chkrebtii et al. (2016) onward is that of treating the problem sequentially, in the manner of a classic IVP integrator. In all of the GM papers, and indeed in Hennig and Hauberg (2014), X is treated as a block – inferred all at once, given data Y (or, in Hennig and Hauberg, F). This necessarily limits the degree of feedback possible from the dynamics of the actual ODE, and in a general IVP this may be the source of significant inaccuracy, since errors in the inexact values Z approximating X are amplified by the ODE itself. In a sequential approach, the numerical data is not a static pre-existing object as the true data Y is, but rather is generated as we go by repeatedly evaluating the ODE at a sequence of input ordinates. Thus it is clear that the numerical data generated at time t is affected by the inferred solution at times before t. This iterative information feedback is qualitatively much more like a standard IVP solver than a block inference approach and is similar to the principle of statistical filtering (S¨arkk¨a, 2013). We now examine the existing papers in this area more closely, in order to give context to our own contribution in the subsequent section. In Chkrebtii et al. (2016) a Gaussian process (GP) prior is jointly placed over x and its derivative ˙x, then at step i the current GP parameters are used to predict a value for the state at the next step, Zi+1. This is then transformed to give Fi+1 ⌘f(Zi+1, ✓). The modelling assumption now made is that this value is distributed around the true value of the derivative ˙Xi+1 with Gaussian error. On this basis the new datum is assimilated into the model, giving a posterior for (x, ˙x) which can be used as the starting prior in the next step. This approach does not make direct use of the sequence Z; rather it is merely generated in order to produce the numerical data F which is then compared to the prior model in derivative space. The result is a distributional Gaussian posterior over x consistent with the sequence F. 2 Conrad et al. (2016) take a different approach. Treating the problem in a discrete setting, they produce a sequence Z of values approximating X, with Fi+1 ⌘f(Zi+1, ✓) constituting the data and Zi+1 calculated from the previous values Zi and Fi by employing some iterative relation akin to a randomised version of a standard IVP solver. Note that there is no attempt to continuously assimilate the generated values into the model for the unknown X or ˙X during the run of the algorithm. Instead, the justification for the method comes post hoc in the form of a convergence theorem bounding the maximum expected squared-error maxi E||Zi −Xi||2. An extension to multistep methods—in which Zi+1 is allowed to depend on multiple past values Fi —is introduced in Teymur et al. (2016) and utilises the same basic approach. Various extensions and generalisations of the theoretical results in these papers are given in Lie et al. (2017), and a related idea in which the step-size is randomised is proposed by Abdulle and Garegnani (2018). This approach is intuitive, allowing for modified versions of standard algorithms which inherit known useful properties, and giving provable expected error bounds. It is also more general since it allows for non-parametric posterior distributions for x, though it relies on Monte Carlo sampling to give empirical approximations to it. Mathematically, we write p(Z|✓) = Z p(Z, F|✓) dF = Z "N−1 Y i=0 p(Fi|Zi, ✓)p(Zi+1|Zi, Fi) # dF. (2) Here, Z ⌘Z1:N is the approximation to the unknown discretised solution function X ⌘X1:N, and each Fi ⌘f(Zi, ✓) is a piece of numerical data. We use Fi to mean (Fi, Fi−1, Fi−2, . . . ). Using the terminology of Hennig et al. (2015), the two constituent components of the telescopic decomposition in the right-hand side of (2) correspond to the ‘decision rule’ (how the algorithm generates a new data-point Fi) and the ‘generative model’ (which encodes the likelihood model for Z) respectively. Note that, from a statistical viewpoint, the method explicitly defines a distribution over numerical solutions Z rather than an uncertainty centred around the true solution x (or X). The relationship of the measure over Z to that over X is then guaranteed by the convergence analysis. The term p(Fi|Zi, ✓) is taken in both Conrad et al. (2016) and Teymur et al. (2016) to be simply a deterministic transformation; this could be written in distributional form as δFi(f(Zi, ✓)). The term p(Zi+1|Zi, Fi) is given by Conrad et al. as a Gaussian centred around the output Zdet i+1 of any deterministic single step IVP solver, with variance scaled in accordance with the constraints of their theorem. Teymur et al. introduce a construction for this term which permits conditioning on multiple previous Fi’s and has mean equivalent to the multistep Adams–Bashforth method. They give the corresponding generalised convergence result. Their proof is also easily verified to be valid for implicit multistep methods—a result we appeal to later—though the specific implicit integrator model they suggest is methodologically inconsistent, for reasons we will explain in Section 2. In all of the approaches described so far, Monte Carlo sampling is required to marginalise F and thereby calculate p(Z|✓). This constitutes an appreciable computational overhead. A third approach, related to stochastic filtering, is presented in Schober et al. (2014), Kersting and Hennig (2016) and Schober et al. (2018). These papers develop a framework which does not rely on sampling, but instead makes the simplifying assumption that all distributions are Gaussian, and propagates the uncertainty from step to step using the theory of Kalman filtering (S¨arkk¨a, 2013). This is an alternative settlement to the accuracy/computational cost trade-off, a point which is acknowledged in those papers. For the sake of comparison, we can loosely rewrite their general approach in our notation as follows: p(x|✓) = Z Y i p( ˜Zi+1|x[i], F0:i)p(Fi+1| ˜Zi+1, ✓)p(x[i+1]| ˜Zi+1, Fi+1) & dF d ˜Z, (3) where we write x[i] instead of Zi to emphasise that this represents an i-times updated model for the continuous solution x, rather than the i’th iteration of an algorithm which generates an approximation to the discrete Xi. This algorithm predicts a value for the new state ˜Zi+1 from the current model and all previous data, then generates a data point based on that prediction, and then updates the model based on this new datum. Note that all distributions in this framework are Gaussian, to permit fast filtering, and as a result the non-linearities in f are effectively linearised, and any numerical method which produces non-Gaussian errors has Gaussians fitted to them anyway. This filtering approach is interesting because of the earlier-stated desideratum of maximising the degree of feedback from the ODE dynamics to the solver. The predict-evaluate-update approach 3 suggested by (3) means that information from the ODE function at the next time step ti+1 is fed back into the procedure at each step, unlike in other methods which only predict forwards. In numerical analysis this is typically a much-desired feature, leading to methods with improved stability and accuracy. However, it is still a three-part procedure, analogous for example to paired Adams– Bashforth and Adams–Moulton integrators used in PEC mode (Butcher, 2008). This connection is referred to in Schober et al. (2018). 2 Our proposed method We now propose a different, novel sequential procedure which also incorporates information from the ODE at time step ti+1 but does so directly. This produces a true implicit probabilistic integrator, without a subtle inconsistency present in the method suggested by Teymur et al. (2016). There, the analogue of (2) defines a joint Gaussian distribution over Zi+1 and Fi+1 (the right-hand component, with Fi replaced by F(i+1)) but then generates Fi+1 by passing Zi+1 through the function f (the left hand component). This gives two mutually-incompatible meanings to Fi+1, one linearly and one non-linearly related to Zi+1. Our proposed method fixes this problem. Indeed, we specifically exploit the difference in these two quantities by separating them out and directly penalising the discrepancy between them. To introduce the idea we consider the one-dimensional case first, then later we generalise to a multidimensional context. We first note that unlike in the explicit randomised integrators of Conrad et al. (2016) and Teymur et al. (2016), we do not have access to the exact deterministic Adams–Moulton predictor, to which we could then add a zero-mean perturbation. An alternative approach is therefore required. Consider instead the following distribution which directly advances the integrator one step and depends only the current point: p(Zi+1 = z|Zi, ✓, ⌘) / g(r(z), ⌘). (4) Here, r(z) is a positive discrepancy measure in derivative space defined in the next paragraph, and g is an ⌘-scaled functional transformation which ensures that the expression is a valid probability distribution in the variable z. A concrete example will illuminate the definition. Consider the simplest implicit method, backward Euler. This is defined by the relation Zi+1 = Zi + hFi+1 and typically can only be solved by an iterative calculation, since Fi+1 ⌘f(Zi+1, ✓) is of course unknown. If the random variable Zi+1 has value z, then we may express Fi+1 as a function of z. Specifically, we have Fi+1(z) = h−1(z −Zi). The discrepancy r(z) between the value of Fi+1(z) and the value of f(z, ✓) can then be used as a measure of the error in the linear method, and penalised. This is equivalent to penalising the difference between the two different expressions for Fi+1 arising from the previously-described naive extension of (2) to the implicit case. We write p(Zi+1 = z|Zi, ✓, ⌘) = K−1 exp ⇣ −1 2⌘−2 ( h−1(z −Zi) −f(z, ✓) )2⌘ . (5) Comparing (4) and (5), r(z) is the expression h−1(z −Zi) −f(z, ✓), and g is in this case the transformation u 7! exp(−u2/2⌘2). This approach directly advances the solver in a single leap, without collecting explicit numerical data as in previous approaches. It is in general non-parametric and requires either sampling or approximation to be useful (more on which in the next section). Since f is in general non-linear, it follows that r is non-linear too. It then follows that the density in equation (5) does not result in a Gaussian measure, despite g being a squared-exponential transformation. The generalisation to higher order implicit linear multistep methods of Adams–Moulton (AM) type, having the form Zi+1 = Zi + h Ps−1 j=−1 βjf(Zi−j, ✓), for AM coefficients βj, follows as p(Zi+1 = z|Zi, ✓, ⌘) = 1 K exp 0 @−1 2⌘2 h−1(z −Zi) −Ps−1 j=0 βjFi−j β−1 −f(z, ✓) !21 A . (6) 2.1 Mathematical properties of the proposed method The following analysis proves the well-definedness and convergence properties of the construction proposed in Section 2. First we show that the distribution (6) is well-defined and proper, by proving 4 the finiteness and strict positivity of the normalising constant K. We then describe conditions on the h-dependence of the scaling parameter ⌘, such that the random variables ⇠i in (8) satisfy the hypotheses of Theorem 3 in Teymur et al. (2016). In particular, the convergence of our method follows from the Adams–Moulton analogue of that result. Denote by h ✓,s : Rd⇥s ! Rd the deterministic map defined by the s-step Adams–Moulton method. For example, the implicit map associated with the backward Euler method—the ‘zero step’ AM method—for a fixed parameter ✓is h ✓,0(Zi) = Zi + hf( h ✓,0(Zi), ✓). More generally, the map associated with the s-step AM method is h ✓,s(Zi−s+1:i) = Zi + h h β−1f ( h ✓,s(Zi−s+1:i), ✓ ) + Ps−1 j=0 βjf(Zi−j, ✓) i , (7) where Zi−s+1:i ⌘(Zi, Zi−1, . . . , Zi−s+1), and the βj 2 R+ are the Adams–Moulton coefficients. Note that h ✓,s(Zi−s+1:i) represents the deterministic Adams–Moulton estimate for Zi+1. Given a probability space (⌦, F, P), define for every i 2 N the random variable ⇠h i : ⌦! Rd according to Zi+1 = h ✓,s(Zi−s+1:i) + ⇠h i . (8) The relationship between the expressions (6) and (8) is addressed in part (i) of the following Theorem, the proof of which is given in the supplementary material accompanying this paper. Theorem. Assume that the vector field f(·, ✓) is globally Lipschitz with Lipschitz constant Lf,✓> 0. Fix s 2 N [ {0}, Zi−s+1:i 2 Rd⇥s, ✓2 Rq, and 0 < h < (Lf,✓β−1)−1. If ⌘= kh⇢for some k > 0 independent of h and ⇢≥−1, then the following statements hold: (i) The function defined in (6) is a well-defined probability density. (ii) For every r ≥1, there exists a constant 0 < Cr < 1 that does not depend on h, such that for all i 2 N, E[k⇠ikr] Crh(⇢+1)r. (iii) If ⇢≥s + 1 2, the probabilistic integrator defined by (6) converges in mean-square as h ! 0, at the same rate as the deterministic s-step Adams–Moulton method. 2.2 Multi-dimensional extension The extrapolation part of any linear method operates on each component of a multi-dimensional problem separately. Thus if Z = (Z(1), . . . , Z(d))T , we have Z(k) i+1 = Z(k) i + h P j βjF (k) i−j for each component k in turn. Of course, this is not true of the transformation Zi+1 7! Fi+1 ⌘ f(Zi+1), except in the trivial case where f is linear in z; thus in (2), the right-hand distribution is componentwise-independent while the left-hand one is not. All previous sequential PN integrators have treated the multi-dimensional problem in this way, as a product of one-dimensional relations. In our proposal it does not make sense to consider the system of equations component by component, due to the presence of the non-linear f(z, ✓) term, which appears as an intrinsic part of the stepforward distribution p(Zi+1|Zi, ✓, ⌘). The multi-dimensional analogue of (6) should take account of this and be defined over all d dimensions together. For vector-valued z, Zk, Fk, we therefore define p(Zi+1|Zi, ✓, H) / exp 4 −1 2r(z)T H−1r(z) . (9) where r(z) = β−1 −1(h−1(z −Zi)−Ps−1 j=0 βjFi−j)−f(z, ✓) is now a d⇥1 vector of discrepancies in derivative space, and H is a d ⇥d matrix encoding the solver scale, generalising ⌘. Straightforward modifications to the proof give multi-dimensional analogues to the statements in the Theorem. 2.3 Calibration and setting H The issue of calibration of ODE solvers is addressed without consensus in every treatment of this topic referenced in Section 1. The approaches can broadly be split into those of ‘forward’ type, in which there is an attempt to directly model what the theoretical uncertainty in a solver step should be and propagate that through the calculation; and those of ‘backward’ type, where the uncertainty scale is somehow matched after the computation to that suggested by some other indicator. Both of these have shortcomings, the former due to the inherent difficulty of explicitly describing the error, and the latter because it is by definition less precise. One major stumbling block is that it is in general a challenging problem to even define what it means for an uncertainty estimate to be well-calibrated. 5 In the present paper, we require a way of setting H. We proceed by modifying and generalising an idea from Conrad et al. (2016) which falls into the ‘backward’ category. There, the variance of the step-forward distribution Var(Zi+1| · · · ) is taken to be a matrix ⌃Z = ↵h⇢Id, with ↵determined by a scale-matching procedure that ensures the integrator outputs a global error scale in line with expectations. We refer the reader to the detailed exposition of this procedure in Section 3.1 of that paper. Furthermore, the convergence result from Teymur et al. (2016) implies that, for the probabilistic s-step Adams–Bashforth integrator, the exponent ⇢should be taken to be 2s + 1. In our method, we are not able to relate such a matrix ⌃Z directly to H because from the definition (9) it is clear that H is a scaling matrix for the spread of the derivative Fi+1, whereas ⌃Z measures the spread of the state Zi+1. In order to transform to the correct space without linearising the ODE, we apply the multivariate delta method (Oehlert, 1992) to give an approximation for the variance of the transformed random variable, and set H to be equal to the result. Thus H = Var(f(Zi+1)) ⇡Jf(E(Zi+1))⌃ZJf(E(Zi+1))T = ↵h⇢Jf(E(Zi+1))Jf(E(Zi+1))T , (10) where Jf is the Jacobian of f. The mean value E(Zi+1) is unknown, but we can use an explicit method of equal or higher order to compute an estimate ZAB i+1 at negligible cost, and use Jf(ZAB i+1) instead, under the assumption that these are reasonably close. Remember that we are roughly calibrating the method so some level of approximation is unavoidable. This comment applies equally to the case where the Jacobian is not analytically available and is estimated numerically. Such approximations do not affect the fundamental convergence properties of the algorithm, since they do not affect the h-scaling of the stepping distribution. We also note that we are merely matching variances/spread parameters and nowhere assuming that the distribution (9) is Gaussian. This idea bears some similarity to the original concept in Skilling (1993), where a scalar ‘stiffness constant’ is used in a similar way to transform the uncertainty scale from solution space to derivative space. We now ascertain the appropriate h-scaling for H by setting the exponent ⇢. The condition required by the univariate analysis in this paper is that ⌘= kh⇢; part (iii) of the Theorem shows that we require ⇢≥s + 1 2, where s is the number of steps in the corresponding AM method.2 Choosing ⇢= s + 1 2 —an approach supported by the numerical experiments in Section 3—the backwards Euler method (s = 0) requires ⇢= 1 2. The multidimensional analogue of the above condition is H = Qh2⇢ for an h-independent positive-definite matrix Q. Since Jf is independent of h, this means we must set ⌃Z to be proportional to h2(s+ 1 2 ), and thus we have H = ↵h2s+1Jf(E(Zi+1))Jf(E(Zi+1))T . Our construction has the beneficial consequence of giving a non-trivial cross-correlation structure to the error calibration matrix H, allowing a richer description of the error in multi-dimensional problems, something absent from previous approaches. Furthermore, it derives this additional information via direct feedback from the ODE, which we have shown is a desirable attribute. 2.4 Reducing computational expenditure In the form described in the previous section, our algorithm results in a non-parametric distribution for Zi+1 at each step. With this approach, a description of the uncertainty in the numerical method can only be evaluated by a Monte Carlo sampling procedure at every iteration. Even if this sampling is performed using a method well-suited to targeting distributions close to Gaussian—we use a modified version of the pre-conditioned Crank–Nicolson algorithm proposed by Cotter et al. (2013)—there is clearly a significant computational penalty associated with this. The only way to avoid this penalty is by reverting to distributions of standard form, which are easy to sample from. One possibility is to approximate (6) by a Gaussian distribution—depending on how this approximation is performed the desideratum of maintaining information feedback from the future dynamics of the target function can be maintained. For example, a first order Taylor expansion of f(z) ⇡f(Zi)+Jf(Zi)(z −Zi), when substituted into r(z) as defined in (9), gives an approximation ˜r(z) which is linear in z. This yields a non-centred Gaussian when transformed into a probability measure as in (9). Defining Γ ⌘(hβ−1Id)−1 −Jf(Zi) and w ⌘f(Zi, ✓) + β−1 −1(Ps−1 j=0 βjFi−j), 2We take this opportunity to remind the reader of the unfortunate convention from numerical analysis that results in s having different meanings here and in the previous paragraph—the explicit method of order s is the one with s steps, whereas the implicit method of order s is the one with s −1 steps. 6 some straightforward algebra gives the moments of the approximating Gaussian measure for the next step as µ = Zi + Γ−1w and Var = ↵h2s+1Γ−1JfJT f Γ−T . We note that this procedure is merely to facilitate straightforward sampling—though ˜r(z) is linear in z, the inclusion of the first additional term from the Taylor expansion means that information about the non-linearity (in z) of f are still incorporated to second order, and the generated solution Z is not jointly Gaussian across time steps i. Furthermore, since Γ−1 is order 1 in h, this approximation does not impact the global convergence of the integrator, as long as H is set in accordance with the principles described in Section 2.3. This method of solving implicit integrators by linearising them in f is well-known in classical numerical analysis, and the resulting methods are sometimes called semi-implicit methods (Press et al., 2007). 3 Experimental results We illustrate our new algorithm by considering the case of a simple inverse problem, the FitzHugh– Nagumo model discussed in Ramsay et al. (2007) and subsequently considered in a several papers on this topic. This is a two-dimensional non-linear dynamical system with three parameters ✓= (✓1, ✓2, ✓3), the values of which (✓1 = 0.2, ✓2 = 0.2, ✓3 = 3.0) are chosen to produce periodic motion. With the problem having a Bayesian structure, we write down the posterior as p(✓, Z|Y ) / p(Y |Z, σ)p(Z|✓, ⇠)p(✓)p(⇠). (11) This expression recalls (1), but with Z substituting for x as described in Section 1.2. We write p(Z|✓, ⇠) to emphasise that the trajectory Z depends on the sequence of random perturbations ⇠0:N. For simplicity we use the known value of σ throughout, so do not include it in the posterior model. Conrad et al. (2016) remark on the biasing effect on the posterior distribution for ✓of naively evaluating the forward model using a standard numerical method. They showed that their probabilistic integrator returns wider posteriors, preventing misplaced overconfidence in an erroneous estimate. We now extend these experiments to our new method. In passing, we note interesting recent theoretical developments discussing the quantitative effect on posterior inference of randomised forward models, presented in Lie et al. (2018). Figure 1: 500 Monte Carlo repetitions of the probabilistic backward Euler (AM0) method applied to the FitzHugh–Nagumo model with h = 0.1 and 0 t 20. The approximation from Section 2.4 is used and ↵⇤ AM0 = 0.2. The upper pane plots the ensemble of discrete trajectories, with the path of the deterministic backward Euler method in light blue. The lower pane is based on the same data, this time summarised. The ensemble mean is shown dashed, and 1σ, 2σ and 3σ intervals are shown shaded, with reference solution in solid black. 7 3.1 Calibration The first task is to infer the appropriate value for the overall scaling constant ↵for each method, to be used in setting the matrix H in (10). As in Conrad et al. (2016), we calculate a value ↵⇤that maximises the agreement between the output of the probabilistic integrator and a measure of global error from the deterministic method, and then fix and proceed with this value. For each of several methods M, ↵⇤ M was calculated for a range of values of h and was close to constant throughout, suggesting that the h-scaling advocated in Section 2.3 (ie. taking the equality in the bound in part (iii) of the Theorem) is the correct one. This point has not been specifically addressed in previous works on this subject. The actual maxima ↵⇤ M for each method are different and further research is required to examine whether a relationship can be deduced between these values and some known characteristic of each method, such as number of steps s or local error constant of the underlying method. Furthermore, we expect these values to be problem-dependent. In this case, we found ↵⇤ AB1 ⇡0.2, ↵⇤ AB2 ⇡0.1, ↵⇤ AB3 ⇡0.2, ↵⇤ AM0 ⇡0.2, ↵⇤ AM1 ⇡0.05, ↵⇤ AM2 ⇡0.05. Having calibrated the probabilistic integrator, we illustrate its typical output in Figure 1: the top pane plots the path of 500 iterations of the probabilistic backward Euler method run at ↵= ↵⇤ AM0 = 0.2. We plot the discrete values Z1:N for each repetition, without attempting to distinguish the trajectories from individual runs. This is to stress that each randomised run (resulting from a different instantiation of ⇠) is not intended to be viewed as a ‘typical sample’ from some underlying continuous probability measure, as in some other probabilistic ODE methods, but rather that collectively they form an ensemble from which an empirical distribution characterising discrete-time solution uncertainty can be calculated. The bottom pane plots the same data but with shaded bands representing the 1σ, 2σ and 3σ intervals, and a dotted line representing the empirical mean. 3.2 Parameter inference We now consider the inverse problem of inferring the parameters of the FitzHugh–Nagumo model in the range t 2 [0, 20]. We first generate synthetic data Y ; 20 two-dimensional data-points collected at times tY = 1, 2, . . . , 20 corrupted by centred Gaussian noise with variance σ = (0.01) · I2. We then treat the parameters ✓as unknown and run an MCMC algorithm—Adaptive Metropolis Hastings (Haario et al., 2001)—to infer their posterior distribution. In Conrad et al. (2016), the equivalent algorithm performs multiple repetitions of the forward solve at each step of the outer MCMC (each with a different instantiation of ⇠) then marginalises ⇠out to form an expected likelihood. This is computationally very expensive; in our experiments we find that for the MCMC to mix well, many tens of repetitions of the forward solve are required at each step. Instead we use a Metropolis-within-Gibbs scheme where at MCMC iteration k, a candidate parameter ✓⇤is proposed and accepted or rejected having had its likelihood calculated using the same sample ⇠[k] 0:N as used in the current iteration k. If accepted as ✓[k+1], a new ⇠[k+1] 0:N can then be sampled and the likelihood value recalculated ready for the next proposal. The proposal at step k + 1 is then compared to this new value. Pseudo-code for this algorithm is given in the supplementary material. Our approach requires that p(Z|✓, ⇠) be recalculated exactly once for each time a new parameter value ✓⇤is accepted. The cost of this strategy is therefore bounded by twice the cost of an MCMC operating with a deterministic integrator—the bound being achieved only in the scenario that all proposed moves ✓⇤are accepted. Thus the algorithm, in contrast to the calibration procedure (which is relatively costly but need only be performed once), has limited additional computational overhead compared to the naive approach using a classical method. Figure 2 shows kernel density estimates approximating the posterior distribution of (✓2,✓3) for the forward Euler, probabilistic forward Euler, backward Euler and probabilistic backward Euler methods. Each represents 1000 parameter samples from simulations run with step-sizes h = 0.005, 0.01, 0.02, 0.05. This is made of 11000 total samples, with the first 1000 discarded as burn-in, and the remainder thinned by a factor of 10. For each method M, its pre-calculated calibration parameter ↵⇤ M is used to set the variance of ⇠. At larger step-sizes, the deterministic methods both give over-confident and biased estimates (on different sides of the true value). In accordance with the findings of Conrad et al. (2016), the probabilistic forward Euler method returns a wider posterior which covers the true solution. The 8 Figure 2: Comparison of the posterior distribution of (✓2, ✓3) from the FitzHugh– Nagumo model in cases where the forward solve is calculated using one of four different integrators (deterministic and probabilistic backward- and forward-Euler methods), each for four different step sizes h = 0.005, 0.01, 0.02, 0.05. All density estimates calculated using 1000 MCMC samples. Dashed black lines indicate true parameter values. Full details are given in main text. bottom right-hand panel demonstrates the same effect with the probabilistic backward Euler method we have introduced in this paper. We find similar results for second- and higher-order methods, both explicit and implicit. The scale of the effect is however relatively small on such a simple test problem, where a higher-order integrator would not be expected to produce much error in the forward solve. Further work will investigate the application of these methods to more challenging problems. 4 Conclusions and avenues for further work In this paper, we have surveyed the existing collection of probabilistic integrators for ODEs, and proposed a new construction—the first to be based on implicit methods—giving a rigorous description of its theoretical properties. We have given preliminary experimental results showing the effect on parameter inference of the use of different first-order methods, both existing and new, in the evaluation of the forward model. Higher-order multistep methods are allowed by our construction. Our discussion on integrator calibration does not claim a resolution to this subtle and thorny problem, but suggests several avenues for future research. We have mooted a question on the relationship between the scaling parameter ↵and other method characteristics. Insight into this issue may be the key to making these types of randomised methods more practical, since common tricks for calibration may emerge which are then applicable to different problems. An interesting direction of enquiry, being explored separately, concerns whether estimates of global error from other sources, eg. adjoint error modelling, condition number estimation, could be gainfully applied to calibrate these methods. 9 Acknowledgements HCL and TJS are partially supported by the Freie Universit¨at Berlin within the Excellence Initiative of the German Research Foundation (DFG). This work was partially supported by the DFG through grant CRC 1114 Scaling Cascades in Complex Systems, and by the National Science Foundation (NSF) under grant DMS-1127914 to the Statistical and Applied Mathematical Sciences Institute’s QMC Working Group II Probabilistic Numerics. References Abdulle, A. and Garegnani, G. (2018). Random Time Step Probabilistic Methods for Uncertainty Quantification in Chaotic and Geometric Numerical Integration. arXiv:1801.01340. Butcher, J. (2008). Numerical Methods for Ordinary Differential Equations: Second Edition. Wiley. Calderhead, B., Girolami, M., and Lawrence, N. (2009). Accelerating Bayesian Inference over Nonlinear Differential Equations with Gaussian Processes. Advances in Neural Information Processing Systems (NeurIPS), 21:217–224. Chkrebtii, O., Campbell, D., Calderhead, B., and Girolami, M. (2016). Bayesian Solution Uncertainty Quantification for Differential Equations. Bayesian Analysis, 11(4):1239–1267. Conrad, P., Girolami, M., S¨arkk¨a, S., Stuart, A., and Zygalakis, K. (2016). Statistical Analysis of Differential Equations: Introducing Probability Measures on Numerical Solutions. Statistics and Computing, pages 1–18. Cotter, S., Roberts, G., Stuart, A., and White, D. (2013). MCMC Methods for Functions: Modifying Old Algorithms to Make Them Faster. Statistical Science, 28(3):424–446. Dondelinger, F., Rogers, S., and Husmeier, D. (2013). ODE Parameter Inference using Adaptive Gradient Matching with Gaussian Processes. Proc. of the 16th Int. Conf. on Artificial Intelligence and Statistics (AISTATS), 31:216–228. Haario, H., Saksman, E., and Tamminen, J. (2001). An Adaptive Metropolis Algorithm. Bernoulli, 7(2):223–242. Hennig, P. and Hauberg, S. (2014). Probabilistic Solutions to Differential Equations and their Application to Riemannian Statistics. Proc. of the 17th Int. Conf. on Artificial Intelligence and Statistics (AISTATS), 33:347–355. Hennig, P., Osborne, M., and Girolami, M. (2015). Probabilistic Numerics and Uncertainty in Computations. Proc. R. Soc. A, 471(2179):20150142. Kersting, H. and Hennig, P. (2016). Active Uncertainty Calibration in Bayesian ODE Solvers. Uncertainty in Artificial Intelligence (UAI), 32. Lie, H. C., Stuart, A., and Sullivan, T. (2017). Strong Convergence Rates of Probabilistic Integrators for Ordinary Differential Equations. arXiv:1703.03680. Lie, H. C., Sullivan, T. J., and Teckentrup, A. L. (2018). Random Forward Models and Log-Likelihoods in Bayesian Inverse Problems. SIAM/ASA Journal on Uncertainty Quantification. To appear. Macdonald, B., Higham, C., and Husmeier, D. (2015). Controversy in Mechanistic Modelling with Gaussian Processes. Proc. of the 32nd Int. Conf. on Machine Learning (ICML), 37:1539–1547. Oehlert, G. (1992). A Note on the Delta Method. The American Statistician, 46(1):27–29. Press, W., Teukolsky, S., Vetterling, W., and Flannery, B. (2007). Numerical Recipes 3rd Edition: The Art of Scientific Computing. Cambridge University Press. Ramsay, J., Hooker, G., Campbell, D., and Cao, J. (2007). Parameter Estimation for Differential Equations: a Generalized Smoothing Approach. J. Royal Stat. Soc. B, 69(5):741–796. S¨arkk¨a, S. (2013). Bayesian Filtering and Smoothing. Cambridge University Press. Schober, M., Duvenaud, D., and Hennig, P. (2014). Probabilistic ODE Solvers with Runge-Kutta Means. Advances in Neural Information Processing Systems (NeurIPS), 27:739–747. Schober, M., S¨arkk¨a, S., and Hennig, P. (2018). A Probabilistic Model for the Numerical Solution of Initial Value Problems. Statistics and Computing, pages 1–24. Skilling, J. (1991). Bayesian Solution of Ordinary Differential Equations. In Smith, C. R., editor, Maximum Entropy and Bayesian Methods, Fundamental Theories of Physics, pages 23–37. Springer, Dordrecht. Skilling, J. (1993). Bayesian Numerical Analysis. In Grandy, W. J. and Milonni, P., editors, Physics and Probability, pages 207–222. Cambridge University Press. Teymur, O., Zygalakis, K., and Calderhead, B. (2016). Probabilistic Linear Multistep Methods. Advances in Neural Information Processing Systems (NeurIPS), 29:4314–4321. Wang, Y. and Barber, D. (2014). Gaussian Processes for Bayesian Estimation in Ordinary Differential Equations. Proc. of the 31st Int. Conf. on Machine Learning (ICML), 32:1485–1493. 10
2018
157
7,316
Non-metric Similarity Graphs for Maximum Inner Product Search Stanislav Morozov Yandex, Lomonosov Moscow State University stanis-morozov@yandex.ru Artem Babenko Yandex, National Research University Higher School of Economics artem.babenko@phystech.edu Abstract In this paper we address the problem of Maximum Inner Product Search (MIPS) that is currently the computational bottleneck in a large number of machine learning applications. While being similar to the nearest neighbor search (NNS), the MIPS problem was shown to be more challenging, as the inner product is not a proper metric function. We propose to solve the MIPS problem with the usage of similarity graphs, i.e., graphs where each vertex is connected to the vertices that are the most similar in terms of some similarity function. Originally, the framework of similarity graphs was proposed for metric spaces and in this paper we naturally extend it to the non-metric MIPS scenario. We demonstrate that, unlike existing approaches, similarity graphs do not require any data transformation to reduce MIPS to the NNS problem and should be used for the original data. Moreover, we explain why such a reduction is detrimental for similarity graphs. By an extensive comparison to the existing approaches, we show that the proposed method is a game-changer in terms of the runtime/accuracy trade-off for the MIPS problem. 1 Introduction The Maximum Inner Product Search (MIPS) problem has recently received increased attention from different research communities. The machine learning community has been especially active on this subject, as MIPS arises in a number of important machine learning tasks such as efficient Bayesian inference[1, 2], memory networks training[3], dialog agents[4], reinforcement learning[5]. The MIPS problem formulates as follows. Given the large database of vectors X = {xi ∈Rd|i = 1, . . . , n} and a query vector q ∈Rd, we need to find an index j such that ⟨xj, q⟩≥⟨xi, q⟩= xT i q, i ̸= j (1) In practice we often need K > 1 vectors that provide the largest inner products and the top-K MIPS problem is considered. For large-scale databases the sequential scan with the O(nd) complexity is not feasible, and the efficient approximate methods are required. The current studies on efficient MIPS can be roughly divided into two groups. The methods from the first group [6, 7, 8], which are probably the more popular in the machine learning community, reduce MIPS to the NNS problem. They typically transform the database and query vectors and then search the neighbors via traditional NNS structures, e.g., LSH[7] or partition trees[6]. The second group includes the methods that filter out the unpromising database vectors based on inner product upper bounds, like the Cauchy-Schwarz inequality[9, 10]. In this work we introduce a new research direction for the MIPS problem. We propose to employ the similarity graphs framework that was recently shown to provide the exceptional performance for the nearest neighbor search. In this framework the database is represented as a graph, where each 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. vertex corresponds to a database vector. If two vertices i and j are connected by an edge that means that the corresponding database vectors xi and xj are close in terms of some metric function. The neighbor search for a query q is performed via graph exploration: on each search step, the query moves from the current vertex to one of adjacent vertex, corresponding to a vector, which is the closest to the query. The search terminates when the query reaches a local minimum. To the best of our knowledge, we are the first who expands similarity graphs on the MIPS territory with non-metric similarity function. We summarize the main contributions of this paper below: 1. We provide the theoretical analysis to justify the use of similarity graphs for inner product similarity function. 2. We demonstrate both theoretically and experimentally that typical MIPS-to-NNS reductions are detrimental for similarity graphs. 3. We introduce a new large-scale dataset for the MIPS algorithms evaluation to facilitate research in this direction. The dataset and the C++ implementation of our method are available online1. The rest of the paper is organized as follows: in Section 2, we shortly review the existing MIPS methods and the similarity graphs framework. In Section 3 we advocate the usage of similarity graphs for MIPS and describe the efficient algorithm as well. In addition, we demonstrate that one should not reduce MIPS to NNS when using similarity graphs. In Section 4, we compare the proposed approach to the current state-of-the-art and demonstrate its exceptional advantage over existing methods. Finally, in Section 5 we conclude the paper and summarize the results. 2 Related work Now we describe several methods and ideas from the previous research that are essential for description of our method. Hereafter we denote the database by X = {xi ∈Rd|i = 1, . . . , n} and a query vector by q ∈Rd. 2.1 The existing approaches to the MIPS problem Reduction to NNS. The first group of methods[6, 7, 8] reformulates the MIPS problem as a NNS problem. Such reformulation becomes possible via mapping the original data to a higher dimensional space. For example, [7] maps a database vector x to ˆx = (x, p 1 −∥x∥2)T (2) and a query vector q is mapped to ˆq = (q, 0)T (3) The transformation from [7] assumes without loss of generality that ∥x∥≤1 for all x ∈X and ∥q∥= 1 for a query vector q. After the mapping the transformed vectors ˆx and ˆq have unit norms and ∥ˆx −ˆq∥2 = ∥ˆx∥2 + ∥ˆq∥2 −2⟨ˆx, ˆq⟩= −2⟨x, q⟩+ 2 (4) so the minimization of ∥ˆx −ˆq∥is equivalent to the maximization of ⟨x, q⟩. Other MIPS-to-NNS transformations are also possible, as shown in [11] and [12], and the empirical comparison of different transformations was recently performed in [6]. After transforming the original data, the MIPS problem becomes equivalent to metric neighbor search and can be solved with standard NNS techniques, like LSH[7], Randomized Partitioning Tree[6] or clustering[8]. Upper-bounding. Another family of methods use inner product upper bounds to construct a small set of promising candidates, which are then checked exhaustively. For example, the LEMP framework[9] filters out the unpromising database vectors based on the Cauchy-Schwarz inequality. Furthermore, [9] proposes an incremental pruning technique that refines the upper bound by computing the partial inner product over the first several dimensions. The FEXIPRO method[10] goes further and performs SVD over the database vectors to make the first dimensions more meaningful. These steps typically improve the upper bounds, and the incremental pruning becomes more efficient. The very recent 1https://github.com/stanis-morozov/ip-nsw 2 Greedy-MIPS method[13] uses another upper bound ⟨q, x⟩= dP i=1 qixi ≤d maxi{qixi} to construct the candidate set efficiently. The efficiency of upper-bound methods is confirmed by experimental comparison[9, 13] and their source code, available online. Despite a large number of existing MIPS methods, the problem is far from being solved, especially given rapidly growing databases in nowadays applications. In this work we propose to solve MIPS with the similarity graphs framework that does not fall into either of the two groups above. 2.2 NNS via similarity graph exploration Here we shortly describe the similarity graphs that are currently used for NNS in metric spaces. For a database X = {xi ∈Rd|i = 1, . . . , n} the similarity (or knn-)graph is a graph where each vertex corresponds to one of the database vectors x. The vertices i and j are connected by an edge if xj belongs to the set of k nearest neigbors of xi, xj ∈NNk(xi) in terms of some metric similarity function s(x, y). The usage of knn-graphs for NNS was initially proposed in the seminal work[14]. The approach[14] constructs the database knn-graph and then performs the search by greedy walk on this graph. First, the search process starts from a random vertex and then on each step a query moves from the current vertex to its neighbor, which appears to be the closest to a query. The process terminates when the query reaches a local minimum. The pseudocode of the greedy walk procedure is presented on Algorithm 1. Algorithm 1 Greedy walk 1: Input: Similarity Graph Gs, similarity function s(x, y), query q, entry vertex v0 2: Initialize vcurr = v0 3: repeat 4: for vadj adjacent to vcurr in Gs do 5: if s(vadj, q) < s(vcurr, q) then 6: vcurr = vadj 7: until vcurr changes 8: return vcurr Since [14] gave rise to research on NNS with similarity graphs, a plethora of methods, which elaborate the idea, were proposed. The current state-of-the-art graph-based NNS implementations[15, 16, 17] develop additional heuristics that increase the efficiency of both graph construction and search process. Here we describe in detail the recent Navigable Small World (NSW) approach[15], as it is shown to provide the state-of-the-art for NNS[18] and its code is available online. Our approach for MIPS will be based on the NSW algorithm, although the other graph-based NNS methods[16, 17] could also be used. Algorithm 2 NSW graph construction 1: Input: Database X, similarity function s(x, y), maximum vertex degree M 2: Initialize graph Gs = ∅ 3: for x in X do 4: S = {M vertices from Gs, s.t. the corresponding vectors y give the largest values of s(x, y)} 5: Add x to the graph Gs and connect it by the directed edges with vertices in S 6: return Gs The key to the practical success of NSW lies in the efficiency of both knn-graph construction and neighbor search. NSW constructs the knn-graph by adding vertices in the graph sequentially one by one. On each step NSW adds the next vertex v, corresponding to a database vector x to the current graph. v is connected by directed edges to M vertices, corresponding to the closest database vectors that are already added to the graph. The construction algorithm is presented in Algorithm 2. The primary parameter of the NSW is the maximum vertex degree M, which determines the balance between the search efficiency and the probability that search stops in the suboptimal local minima. When searching via Greedy walk, NSW maintains a priority queue of a size L with the knn-graph vertices, which neighbors should be visited by the search process. With L=1 the search in NSW is equivalent to Algorithm 1, while with L > 1 it can be considered as a variant of Beam Search[19], 3 which makes the search process less greedy. In practice, varying L allows to balance between the runtime and search accuracy in NSW. Prior work on non-metric similarity search on graphs. After the publication, we became aware of a body of previous work that explored the use of proximity graphs with general non-metric similarity functions[20, 21, 22, 23, 24]. In these works, the MIPS problem is investigated as a special case and the effectiveness of proximity graph based methods to the MIPS problem has been confirmed. 3 Similarity graphs for MIPS Now we extend the similarity graphs framework to applications with a non-metric similarity function s(x, y). Assume that we have a database X = {xi ∈Rd|i = 1, . . . , n} and aim to solve the problem arg max xi∈X s(q, xi), q ∈Rd (5) 3.1 Exact solution First, let us construct a graph Gs such that the greedy walk procedure (Algorithm 1), provides the exact answer to the problem (5). [14] has shown that for Euclidean distance s(x, y) = −∥x −y∥, the minimal Gs with this property is the Delaunay graph of X. Now we generalize this result for a broader range of similarity functions. Definition. The s-Voronoi cell Rk, associated with the element xk ∈X, is a set Rk = {x ∈Rd|s(x, xk) > s(x, xj) ∀j ̸= k} (6) The diagrams of s-Voronoi cells for s(x, y) = −∥x−y∥and s(x, y) = ⟨x, y⟩are shown on Figure 1. s(x, y) = −∥x −y∥ s(x, y) = ⟨x, y⟩ Figure 1: s-Voronoi diagram examples on the plane Note, that in the case of inner product s-Voronoi cells for some points are empty. It implies that these points can not be answers in MIPS. Now we can define a s-Delaunay graph for a similarity function s(x, y). Definition. The s-Delaunay graph for the database X and the similarity function s(x, y) is a graph Gs(V, E) where the set of vertices V corresponds to the set X and two vertices i and j are connected by an edge if the correspoding s-Voronoi cells Ri and Rj are adjacent in Rd. Theorem 1. Suppose that the similarity function s(x, y) is such that for every finite database X the corresponding s-Voronoi cells are path-connected sets. Then the greedy walk (Algorithm 1) stops at the exact solution for problem (5) if the similarity graph Gs contains the s-Delaunay graph as a subgraph. 4 Proof. Assume that the greedy walk with a query q stops at the point x i.e. s(x, q) > s(y, q) for all y ∈N(x), where N(x) is a set of vertices that are adjacent to x. Suppose that there is a point z /∈N(x) such that s(z, q) > s(x, q). It means that the point q does not belong to the s-Voronoi cell Rx corresponding to the point x. Note, that if we remove all the points from Gs except x ∪N(x), a set of points covered by Rx does not change as all adjacent s-Voronoi regions correspond to vertices from N(x) and they are not removed. Hence, the query q still does not belong to Rx. Since the s-Voronoi cells cover the whole space, the point q belongs to some Rx′, x′ ∈N(x). This means that s(x′, q) > s(x, q).This contradiction proves the theorem. Now we show that s(x, y) = ⟨x, y⟩satisfies the assumptions of the Theorem. Lemma 1. Suppose X is a finite database and the similarity function s(x, y) is linear, then the s-Voronoi cells are convex. Proof. Consider a s-Voronoi cell Rx, corresponding to a point x ∈X. Let us take two arbitrary vectors u and v from the s-Voronoi cell Rx. It means that s(x, u) > s(w, u) ∀w ∈X \ {x} (7) s(x, v) > s(w, v) ∀w ∈X \ {x} (8) Hence, due to linearity s(x, tu + (1 −t)v) > s(w, tu + (1 −t)v), t ∈[0, 1] (9) Therefore, vector tu + (1 −t)v ∈Rx for every t ∈[0, 1]. Corollary 1. If the graph G(V, E) contains the s-Delaunay graph for the similarity function s(x, y) = ⟨x, y⟩then greedy walk always gives the exact true answer for MIPS. Proof. Due to Lemma 1 all s-Voronoi cells for s(x, y) = ⟨x, y⟩are convex, therefore, path-connected. 3.2 s-Delaunay graph approximation for MIPS In practice, the computation and usage of the exact s-Delaunay graph in high-dimensional spaces are infeasible due to the exponentially growing number of edges[25]. Instead, we approximate the s-Delaunay graph as was previously proposed for Euclidean distance case in [16, 17, 15]. In particular, we adopt the approximation proposed in [15] by simply extending Algorithm 2 to inner product similarity function s(x, y) = ⟨x, y⟩. As in [15] we also restrict the vertex degree to a constant M, which determines the s-Delaunay graph approximation quality. We refer to the proposed MIPS method as ip-NSW. The search process in ip-NSW remains the same as in [15] except that the inner product similarity function guides the similarity graph exploration. Let us provide some intuition behind the proposed s-Delaunay graph approximation. In fact, each vertex x is connected to M vertices that provide the highest inner product values⟨x, ·⟩. The heuristic geometrical argument in favor of such approximation is that for s(x, y) = ⟨x, y⟩s-Voronoi cells are polyhedral angles, and the «direction vectors» of adjacent s-Voronoi cells are likely to have large inner product values. While missing the strict mathematical justification, the proposed approach provides the brilliant performance, as confirmed in the experimental section. 3.3 Similarity graphs after reduction to NNS The natural question is: Why should we develop an additional theory for non-metric similarity graphs? Maybe, one should just reduce the MIPS problem to NNS[6, 7, 8] and apply the state-of-the-art graph implementation for Euclidean similarity. In fact, such a solution is detrimental for runtime-accuracy trade-off, as will be demonstrated in the experimental section. In this section, we provide the intuitive explanation of the inferior performance using the example of transformation form [7]: ˆx = (x, p 1 −∥x∥2)T ; ˆq = (q, 0)T = (q, p 1 −∥q∥2)T (10) assuming that ∥x∥≤1 for all x ∈X and ∥q∥= 1. Other transformations could be considered in the similar way. Now we construct the Euclidean similarity graph for the transformed database 5 ˆX = {(x, p 1 −∥x∥2)T |x ∈X} via Algorithm 2. In terms of the original database X, the Euclidean distance between the transformed elements equals ∥ˆx −ˆy∥2 = −2⟨x, y⟩+ 2 −2 p 1 −∥x∥2p 1 −∥y∥2 (11) Note, that the Euclidean similarity graph, constructed for the transformed database ˆX, is equivalent to a graph, constructed for the original X with the similarity function s(x, y) = ⟨x, y⟩+ p 1 −∥x∥2p 1 −∥y∥2 or equivalently s(x, y) = ∥x∥∥y∥cos α + p 1 −∥x∥2p 1 −∥y∥2, (12) where α is the angle between x and y. The first term in this sum encourages large norms, while the second term penalizes large norms. In high-dimensional spaces the typical values of cos α tend to be small even for close vectors, which results in the dominance of the second term. Thus, when a new vertex is added to a graph, it prefers to be connected to the vertices, corresponding to vectors with smaller norms. Thus, the edges in the Euclidean graph, constructed for the transformed data, typically lead in the direction of norm decreasing, which is counterproductive to MIPS, which prefers the vectors of larger norms. On the other hand, the non-metric similarity graph, constructed with s(x, y) = ⟨x, y⟩, is more probable to contain edges, directed towards increasing of norms. To verify this explanation, we measure the rate of edges that lead to vectors of larger norms for ip-NSW and the Euclidean NSW on the transformed data. The numbers for three datasets, presented in Table 2, fully confirm our intuition. 4 Experiments In this section we present the experimental evaluation of non-metric similarity graphs for the top-K MIPS problem. All the experiments were performed on Intel Xeon E5-2650 machine in a single thread mode. For evaluation, we used the commonly used Recall measure that is defined as a rate of successfully found neighbors, averaged over a set of queries. We performed the experiments with K = 1 and K = 10. Datasets. We summarize the information on the benchmark datasets in Table 1. The Netflix, MovieLens and Yahoo!Music datasets are the established benchmarks for the MIPS problem. Music100 is a new dataset that we introduce to the community2. This dataset was obtained by IALSfactorization[26] of the user-item ranking matrix, with dimensionality 100. The matrix contains the ratings from 3,897,789 users on one million popular songs from proprietary music recommendation service. To the best of our knowledge, there is no publicly available dataset of such a large scale and high dimensionality. Normal-64 dataset was generated as a sample from a standard normal distribution with the dimension 64. For all the datasets, the groundtruth neighbors were computed by sequential scan. The recall values were averaged over 10, 000 randomly sampled queries. Table 1: The datasets used in the evaluation. DATASET |X| |Q| DIM NETFLIX 17,770 480,189 200 MOVIELENS 33,670 247,753 150 YAHOO! MUSIC 624,961 1,000,990 50 MUSIC-100 1,000,000 3,897,789 100 NORMAL-64 1,048,576 20,000 64 4.1 Non-metric graphs or reduction to NNS? Here we experimentally investigate the optimal way to use the similarity graphs for the MIPS problem. We argue that the straightforward solution by reduction to NNS and then using the standard Euclidean similarity graph is suboptimal. To confirm this claim, we compare the performance of the non-metric similarity graph (denoted by ip-NSW) to the performance of Euclidean similarity graph combined with transformation from[7] (denoted by NSW+reduction). The runtime-accuracy 2https://github.com/stanis-morozov/ip-nsw 6 plots on three datasets are presented on Figure 2. The plots confirm the advantage of non-metric similarity graphs, especially in the high recall regime. For instance, ip-NSW reaches the recall level 0.9 five times faster on Music-100. We believe that the reason for the inferior performance of the NSW+reduction approach is the edge distribution bias, described in Section 3.3. Overall, we conclude that similarity graphs do not require any MIPS-to-NNS transformation that makes them favorable over other similarity search frameworks. In the subsequent experiments, we evaluate only the ip-NSW approach as our main contribution. Table 2: The rate of similarity graph edges that lead to vector of larger norms for ip-NSW and NSW+reduction. This rate is much higher in the non-metric similarity graph in ip-NSW, which results in higher MIPS performance. DATASET NSW+REDUCTION IP-NSW MUSIC-100 0.349335 0.75347 YAHOO! MUSIC 0.398541 0.92353 NORMAL-64 0.362722 0.703605 Music-100 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Time (ms) ip-NSW NSW+reduction Yahoo! Music 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 ip-NSW NSW+reduction Normal-64 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 ip-NSW NSW+reduction 0.70 0.75 0.80 0.85 0.90 0.95 1.00 Recall 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 Time (ms) ip-NSW NSW+reduction 0.70 0.75 0.80 0.85 0.90 0.95 1.00 Recall 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 ip-NSW NSW+reduction 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 ip-NSW NSW+reduction Figure 2: The performance of non-metric ip-NSW and the Euclidean NSW for transformed data on three million-scala datasets. The combination of metric similarity graphs with MIPS-to-NNS reduction results in inferior performance. 4.2 Comparison to the state-of-the-art As our main experiment, we extensively compare the proposed ip-NSW method to the existing approaches. We compared the following algorithms: Naive-MKL The sequential scan implementation that uses the Intel MKL library3 for efficient vector-matrix multiplication. LSH+reduction[7] We used the implementation available in [13]. We tuned the parameter B in a range {20, 40, 80, 160} and the parameter R in a range {5, 8, 11, 14, 17, 20}. Clustering+reduction[8] We used our own reimplementation and use √ N clusters of size √ N, where N is the size of the database. When searching, the number of considered clusters was varied from 1 to 50. FEXIPRO[10] We used the author’s implementation of the FEXIPRO framework4 with the algorithm FEXIPRO-SIR and the parameters scalingV alue = 127 and SIGMA = 0.8 since it was recommended in [10] as the best combination. Note, that FEXIPRO is an exact method. 3https://software.intel.com/mkl 4https://github.com/stanford-futuredata/FEXIPRO-orig 7 LEMP[9] We used the author’s implementation of the LEMP framework5 with the algorithm LEMPHYB-REL. We varied parameters R from 0.1 to 0.9 with step 0.1 and ε from 0.2 to 0.6 with step 0.05 to achieve the runtime-accuracy plots. Greedy-MIPS[13] We used the author’s implementation6 with a budget parameter tuned for the each dataset. ip-NSW is the proposed algorithm based on the non-metric similarity graph, described in Section 3.2. While Netflix and MovieLens are the established datasets in previous works, we do not consider them as interesting benchmarks these days. They both contain only several thousand vectors and the exact Naive-MKL is efficient enough on them. E.g. Naive-MKL works only 0.56 ms on Netflix and 1.42 ms on MovieLens, which is fast enough for most of applications. Thus, we perform the extensive comparison on three million-scale datasets only. The Figure 3 presents the runtime-accuracy plots for the compared approaches. The timings for Naive-MKL and FEXIPRO are presented under the corresponding plots. Overall, the proposed ip-NSW method outperforms the existing approaches by a substantial margin. For example, ip-NSW reaches 0.9 recall level ten times faster that the fastest baseline. Note, that the for top-10 MIPS the advantage of ip-NSW is even more impressive on all datasets. To justify that the speedup improvements are due to the proposed algorithm and not because of implementation differences (such as libraries, cache locallity, register level optimizations and so on) we also compare number of inner products needed to achieve certain recall levels for different methods. The plots for three datasets and top-10 MIPS are presented on Figure 4. Music-100 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Time (ms) ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 56.071 Naive-MKL — 74.239 Yahoo! Music 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 0.895 Naive-MKL — 19.551 Normal-64 0.0 0.2 0.4 0.6 0.8 1.0 0 2 4 6 8 10 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 76.922 Naive-MKL — 36.377 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Time (ms) ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 76.506 Naive-MKL — 74.760 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.0 0.5 1.0 1.5 2.0 2.5 3.0 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 2.673 Naive-MKL — 19.649 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0 2 4 6 8 10 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction FEXIPRO — 77.227 Naive-MKL — 37.129 Figure 3: The runtime-recall plots on three datasets for top-1 MIPS (top) and top-10 MIPS (bottom). The timings for the exact FEXIPRO and Naive-MKL methods are presented under the corresponding plots. Additional memory consumption. The performance advantage of the similarity graphs comes at a price of additional memory to maintain the graph structure. In our experiments we use M = 32 edges per vertex, which results in 32 × n × sizeof(int) bytes for edge lists. Note, that the size of the database equals d × n × sizeof(float) bytes, hence for high-dimensional datasets d ≫32 the additional memory consumption is negligible. 5https://github.com/uma-pi1/LEMP 6https://github.com/rofuyu/exp-gmips-nips17 8 Music-100 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 Number of inner products 1e4 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction Yahoo! Music 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 1e4 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction Normal-64 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0 1 2 3 4 5 1e4 ip-NSW Greedy-MIPS Clustering+red. LEMP LSH+reduction Figure 4: The number of inner products computations needed to achieve certain recall levels on three datasets for top-10 MIPS. 5 Conclusion In this work, we have proposed and evaluated a new framework for inner product similarity search. We extend the framework of similarity graphs to the non-metric similarity search problems and demonstrate that the practically important case of inner product could be perfectly solved by these graphs. We also investigate the optimal way to use this framework for MIPS and demonstrate that the popular MIPS-to-NNS reductions are harmful to similarity graphs. The optimized implementation of the proposed method will be available upon publication to support the further research in this direction. References [1] Stephen Mussmann and Stefano Ermon. Learning and inference via maximum inner product search. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 2587–2596, 2016. [2] Stephen Mussmann, Daniel Levy, and Stefano Ermon. Fast amortized inference and learning in log-linear models with randomly perturbed nearest neighbor search. In Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence, UAI 2017, Sydney, Australia, August 11-15, 2017, 2017. [3] Sarath Chandar, Sungjin Ahn, Hugo Larochelle, Pascal Vincent, Gerald Tesauro, and Yoshua Bengio. Hierarchical memory networks. CoRR, abs/1605.07427, 2016. [4] Matthew Henderson, Rami Al-Rfou, Brian Strope, Yun-Hsuan Sung, László Lukács, Ruiqi Guo, Sanjiv Kumar, Balint Miklos, and Ray Kurzweil. Efficient natural language response suggestion for smart reply. CoRR, abs/1705.00652, 2017. [5] Kwang-Sung Jun, Aniruddha Bhargava, Robert D. Nowak, and Rebecca Willett. Scalable generalized linear bandits: Online computation and hashing. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 98–108, 2017. [6] O. Keivani, K. Sinha, and P. Ram. Improved maximum inner product search with better theoretical guarantees. In 2017 International Joint Conference on Neural Networks (IJCNN), pages 2927–2934, May 2017. [7] Behnam Neyshabur and Nathan Srebro. On symmetric and asymmetric lshs for inner product search. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pages 1926–1934. JMLR.org, 2015. [8] Alex Auvolat and Pascal Vincent. Clustering is efficient for approximate maximum inner product search. CoRR, abs/1507.05910, 2015. [9] Christina Teflioudi and Rainer Gemulla. Exact and approximate maximum inner product search with lemp. ACM Trans. Database Syst., 42(1):5:1–5:49, December 2016. 9 [10] Hui Li, Tsz Nam Chan, Man Lung Yiu, and Nikos Mamoulis. Fexipro: Fast and exact inner product retrieval in recommender systems. In SIGMOD Conference, 2017. [11] Anshumali Shrivastava and Ping Li. Asymmetric lsh (alsh) for sublinear time maximum inner product search (mips). In Advances in Neural Information Processing Systems, pages 2321–2329, 2014. [12] Yoram Bachrach, Yehuda Finkelstein, Ran Gilad-Bachrach, Liran Katzir, Noam Koenigstein, Nir Nice, and Ulrich Paquet. Speeding up the xbox recommender system using a euclidean transformation for inner-product spaces. October 2014. [13] Hsiang-Fu Yu, Cho-Jui Hsieh, Qi Lei, and Inderjit S. Dhillon. A greedy approach for budgeted maximum inner product search. In NIPS, 2017. [14] Gonzalo Navarro. Searching in metric spaces by spatial approximation. The VLDB Journal, 11(1):28–46, Aug 2002. [15] Yury A. Malkov and D. A. Yashunin. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. CoRR, abs/1603.09320, 2016. [16] Cong Fu and Deng Cai. Efanna : An extremely fast approximate nearest neighbor search algorithm based on knn graph. CoRR, abs/1609.07228, 2016. [17] B. Harwood and T. Drummond. Fanng: Fast approximate nearest neighbour graphs. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5713–5722, June 2016. [18] Wen Li, Ying Zhang, Yifang Sun, Wei Wang, Wenjie Zhang, and Xuemin Lin. Approximate nearest neighbor search on high dimensional data - experiments, analyses, and improvement (v1.0). CoRR, abs/1610.02455, 2016. [19] Stuart C. Shapiro. Encyclopedia of Artificial Intelligence. 1987. [20] Leonid Boytsov, David Novak, Yury Malkov, and Eric Nyberg. Off the beaten path: Let’s replace term-based retrieval with k-nn search. In CIKM, 2016. [21] Bilegsaikhan Naidan, Leonid Boytsov, and Eric Nyberg. Permutation search methods are efficient, yet faster search is possible. VLDB, 2015. [22] Leonid Boytsov. Efficient and accurate non-metric k-nn search with applications to text matching. Technical report, 2017. [23] Alexander Ponomarenko, Nikita Avrelin, Bilegsaikhan Naidan, and Leonid Boytsov. Comparative analysis of data structures for approximate nearest neighbor search. Data Analytics, pages 125–130, 2014. [24] Wei Dong, Charikar Moses, and Kai Li. Efficient k-nearest neighbor graph construction for generic similarity measures. In Proceedings of the 20th international conference on World wide web, pages 577–586. ACM, 2011. [25] Jean-Daniel Boissonnat and Mariette Yvinec. Algorithmic Geometry. Cambridge University Press, New York, NY, USA, 1998. [26] Y. Hu, Y. Koren, and C. Volinsky. Collaborative filtering for implicit feedback datasets. In 2008 Eighth IEEE International Conference on Data Mining, pages 263–272, Dec 2008. 10
2018
158
7,317
Learning convex polytopes with margin Lee-Ad Gottlieb Ariel University leead@ariel.ac.il Eran Kaufman Ariel University erankfmn@gmail.com Aryeh Kontorovich Ben-Gurion University karyeh@bgu.sc.il Gabriel Nivasch Ariel University gabrieln@ariel.ac.il Abstract We present an improved algorithm for properly learning convex polytopes in the realizable PAC setting from data with a margin. Our learning algorithm constructs a consistent polytope as an intersection of about t log t halfspaces with margins in time polynomial in t (where t is the number of halfspaces forming an optimal polytope). We also identify distinct generalizations of the notion of margin from hyperplanes to polytopes and investigate how they relate geometrically; this result may be of interest beyond the learning setting. 1 Introduction In the theoretical PAC learning setting [Valiant, 1984], one considers an abstract instance space X — which, most commonly, is either the Boolean cube {0, 1}d or the Euclidean space Rd. For the former setting, an extensive literature has explored the statistical and computational aspects of learning Boolean functions [Angluin, 1992, Hellerstein and Servedio, 2007]. Yet for the Euclidean setting, a corresponding theory of learning geometric concepts is still being actively developed [Kwek and Pitt, 1998, Jain and Kinber, 2003, Anderson et al., 2013, Kane et al., 2013]. The focus of this paper is the latter setting. The simplest nontrivial geometric concept is perhaps the halfspace. These concepts are well-known to be hard to agnostically learn [Höffgen et al., 1995] or even approximate [Amaldi and Kann, 1995, 1998, Ben-David et al., 2003]. Even the realizable case, while commonly described as “solved” via the Perceptron algorithm or linear programming (LP), is not straightforward: The Perceptron’s runtime is quadratic in the inverse-margin, while solving the consistent hyperplane problem in strongly polynomial time is equivalent to solving the general LP problem in strongly polynomial time [Nikolov, 2018, Chvátal], a question that has been open for decades [Bárász and Vempala, 2010]. Thus, an unconditional (i.e., infinite-precision and independent of data configuration in space) polynomial-time solution for the consistent hyperplane problem hinges on the strongly polynomial LP conjecture. If we consider not a single halfspace, but polytopes defined by the intersection of multiple halfspaces, the computational and generalization bounds rapidly become more pessimistic. Megiddo [1988] showed that the problem of deciding whether two sets of points in general space can be separated by the intersection of two hyperplanes is NP-complete, and Khot and Saket [2011] showed that “unless NP = RP, it is hard to (even) weakly PAC-learn intersection of two halfspaces”, even when allowed the richer class of O(1) intersecting halfspaces. Under cryptographic assumptions, Klivans and Sherstov [2009] showed that learning an intersection of nε halfspaces is intractable regardless of hypothesis representation. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Since the margin assumption is what allows one to find a consistent hyperplane in provably strongly polynomial time, it is natural to seek to generalize this scheme to intersections of t halfspaces each with margin γ; we call this the γ-margin of a t-polytope. This problem was considered by Arriaga and Vempala [2006], who showed that such a polytope can be learned (in dimension d) in time O(dmt) + (t log t)O((t/γ2) log(t/γ)) with sample complexity m = O (t/γ2) log(t) log(t/γ)  (where we have taken the PAC-learning parameters ε, δ to be constants). In fact, they actually construct a candidate t-polytope as their learner; as such, their approach is an example of proper learning, where the hypothesis is chosen from the same concept class as the true concept. In contrast, Klivans and Servedio [2008] showed that a γ-margin t-polytope can be learned by constructing a function that approximates the polytope’s behavior, without actually constructing a t-polytope. This is an example of improper learning, where the hypothesis is selected from a broader class than that of the true concept. They achieved a runtime of min   d(t/γ)O(t log t log(1/γ)), d log t γ O(√ 1/γ log t)    and sample complexity m = O (1/γ)t log t log(1/γ) . Very recently, Goel and Klivans [2018] improved on this latter result, constructing a function hypothesis in time poly(d, tO(1/γ)), with sample complexity exponential in γ−1/2. Our results. The central contribution of the paper is improved algorithmic runtimes and sample complexity for computing separating polytopes (Theorem 7). In contrast to the algorithm of Arriaga and Vempala [2006], whose runtime is exponential in t/γ2, and to that of [Goel and Klivans, 2018], whose sample complexity is exponential in γ−1/2, we give an algorithm with polynomial sample complexity m = ˜O(t/γ2) and runtime only m ˜ O(1/γ2). We accomplish this by constructing an O(t log m)-polytope that correctly separates the data. This means that our hypothesis is drawn from a broader class than the t-polytopes of Arriaga and Vempala [2006] (allowing faster runtime), but from a much narrower class than the functions of Klivans and Servedio [2008], Goel and Klivans [2018] (allowing for improved sample complexity). Complementing our algorithm, we provide the first nearly matching hardness-of-approximation bounds, which demonstrate that an exponential dependence on tγ−2 is unavoidable for the computation of separating t-polytopes, under standard complexity-theoretic assumptions (Theorem 6). This motivates our consideration of O(t log m)-polytopes instead. Our final contribution is in introducing a new and intuitive notion of polytope margin: This is the γ-envelope of a convex polytope, defined as all points within distance γ of the polytope boundary, as opposed to the above γ-margin of the polytope, defined as the intersection of the γ-margins of the hyperplanes forming the polytope. (See Figure 2 for an illustration, and Section 2 for precise definitions.) Note that these two objects may exhibit vastly different behaviors, particularly at a sharp intersection of two or more hyperplanes. It seems to us that the envelope of a polytope is a more natural structure than its margin, yet we find the margin more amenable to the derivation of both VC-bounds (Lemma 1) and algorithms (Theorem 7). We demonstrate that results derived for margins can be adapted to apply to envelopes as well. We prove that when confined to the unit ball, the γ-envelope fully contains within it the (γ2/2)-margin (Theorem 10), and this implies that statistical and algorithmic results for the latter hold for the former as well. Related work. When general convex bodies are considered under the uniform distribution1 (over the unit ball or cube), exponential (in dimension and accuracy) sample-complexity bounds were obtained by Rademacher and Goyal [2009]. This may motivate the consideration of convex polytopes, and indeed a number of works have studied the problem of learning convex polytopes, including Hegedüs [1994], Kwek and Pitt [1998], Anderson et al. [2013], Kane et al. [2013], Kantchelian et al. [2014]. Hegedüs [1994] examines query-based exact identification of convex polytopes with integer vertices, with runtime polynomial in the number of vertices (note that the number of vertices 1Since the concept class of convex sets has infinite VC-dimension, without distribution assumptions, an adversarial distribution can require an arbitrarily large sample size, even in 2 dimensions [Kearns and Vazirani, 1997]. 2 can be exponential in the number of facets [Matoušek, 2002]). Kwek and Pitt [1998] also rely on membership queries (see also references therein regarding prior results, as well as strong positive results in 2 dimensions). Anderson et al. [2013] efficiently approximately recover an unknown simplex from uniform samples inside it. Kane et al. [2013] learn halfspaces under the log-concave distributional assumption. The recent work of Kantchelian et al. [2014] bears a superficial resemblance to ours, but the two are actually not directly comparable. What they term worst case margin will indeed correspond to our margin. However, their optimization problem is non-convex, and the solution relies on heuristics without rigorous run-time guarantees. Their generalization bounds exhibit a better dependence on the number t of halfspaces than our Lemma 3 (O( √ t) vs. our O(t log t)). However, the hinge loss appearing in their Rademacher-based bound could be significantly worse than the 0-1 error appearing in our VC-based bound. We stress, however, that the main contribution of our paper is algorithmic rather than statistical. 2 Preliminaries Notation. For x ∈Rd, we denote its Euclidean norm ∥x∥2 := qPd i=1 x(i)2 by ∥x∥and for n ∈N, we write [n] := {1, . . . , n}. Our instance space X is the unit ball in Rd: X =  x ∈Rd : ∥x∥≤1 . We assume familiarity with the notion of VC-dimension as well as with basic PAC definitions such as generalization error (see, e.g., Kearns and Vazirani [1997]). Polytopes. A (convex) polytope P ⊂Rd is the convex hull of finitely many points: P = conv({x1, . . . , xn}). Alternatively, it can be defined by t hyperplanes (wi, bi) ∈Rd × R where ∥wi∥= 1 for each i: P =  x ∈Rd : min i∈[t] wi · x + bi ≥0  . (1) A hyperplane (w, b) is said to classify a point x as positive (resp., negative) with margin γ if w · x + b ≥γ (resp., ≤−γ). Since ∥w∥= 1, this means that x is γ-far from the hyperplane  x′ ∈Rd : w · x′ + b = 0 , in ℓ2 distance. Margins and envelopes. We consider two natural ways of extending this notion to polytopes: the γ-margin and the γ-envelope. For a polytope defined by t hyperplanes as in (1), we say that x is in the inner γ-margin of P if 0 ≤min i∈[t] wi · x + bi ≤γ and that x is in the outer γ-margin of P if 0 ≥min i∈[t] wi · x + bi ≥−γ. Similarly, we say that x is in the outer γ-envelope of P if x /∈P and infp∈P ∥x −p∥≤γ and that x is in the inner γ-envelope of P if x ∈P and infp/∈P ∥x −p∥≤γ. We call the union of the inner and the outer γ-margins the γ-margin, and we denote it by ∂P [γ]. Similarly, we call the union of the inner and the outer γ-envelopes the γ-envelope, and we denote it by ∂P (γ). The two notions are illustrated in Figure 2. As we show in Section 4 below, the inner envelope coincides with the inner margin, but this is not the case for the outer objects: The outer margin always contains the outer envelope, and could be of arbitrarily larger volume. Fat hyperplanes and polytopes. Binary classification requires a collection of concepts mapping the instance space (in our case, the unit ball in Rd) to {−1, 1}. However, given a hyperplane (w, b) and a margin γ, the function fw,b : Rd →R given by fw,b(x) = w · x + b partitions Rd into three regions: positive  x ∈Rd : fw,b(x) ≥γ , negative  x ∈Rd : fw,b(x) ≤−γ , and ambiguous  x ∈Rd : |fw,b(x)| < γ . We use a standard device (see, e.g., Hanneke and Kontorovich [2017, 3 Section 4]) of defining an auxiliary instance space X ′ = X × {−1, 1} together with the concept class Hγ =  hw,b : w ∈Rd, b ∈R, ∥w∥= 1/γ , where, for all (x, y) ∈X ′, hw,b(x, y) = sign(y(w · x + b)), |w · x + b| ≥γ −1, else. It is shown in [Hanneke and Kontorovich, 2017, Lemma 6] that2 Lemma 1. The VC-dimension of Hγ is at most (2/γ + 1)2. Analogously, we define the concept class Pt,γ of γ-fat t-polytopes as follows. Each hP ∈Pt,γ is induced by some t-halfspace intersection P as in (1). The label of a pair (x, y) ∈X ′ is determined as follows: If x is in the γ-margin of P, then the pair is labeled −1 irrespective of y. Otherwise, if x ∈P and y = 1, or else x /∈P and y = −1, then the pair is labeled 1. Otherwise, the pair is labeled −1. Lemma 2. The VC-dimension of Pt,γ in d dimensions is at most min {2(d + 1)t log(3t), 2vt log(3t)} , where v = (2/γ + 1)2. Proof. The family of intersections of t concept classes of VC-dimension at most v is bounded by 2vt log(3t) [Blumer et al., 1989, Lemma 3.2.3]. Since the class of d-dimensional hyperplanes has VC-dimension d + 1 [Long and Warmuth, 1994], the family of polytopes has VC-dimension at most 2(d + 1)t log(3t). The second part of the bound is obtained by applying Blumer et al. [1989, Lemma 3.2.3] to the VC bound in Lemma 1. Generalization bounds. The following VC-based generalization bounds are well-known; the first one may be found in, e.g., Cristianini and Shawe-Taylor [2000], while the second one in Anthony and Bartlett [1999]. Lemma 3. Let H be a class of learners with VC-dimension dVC. If a learner h ∈H is consistent on a random sample S of size m, then with probability at least 1 −δ its generalization error is err(h) ≤2 m dVC log(2em/dVC) + log(2/δ)  . Dimension reduction. The Johnson-Lindenstrauss (JL) transform [Johnson and Lindenstrauss, 1982] takes a set S of m vectors in Rd and projects them into k = O(ε−2 log m) dimensions, while preserving all inter-point distances and vector norms up to 1+ε distortion. That is, if f : Rd →Rk is a linear embedding realizing the guarantees of the JL transform on S, then for every x ∈S we have (1 −ε)∥x∥≤∥f(x)∥≤(1 + ε)∥x∥, and for every x, y ∈S we have (1 −ε)∥x −y∥≤∥f(x −y)∥≤(1 + ε)∥x −y∥. The JL transform can be realized with probability 1 −n−c for any constant c ≥1 by a randomized linear embedding, for example a projection matrix with entries drawn from a normal distribution [Achlioptas, 2003]. This embedding is oblivious, in the sense that the matrix can be chosen without knowledge of the set S. It is an easy matter to show that the JL transform can also be used to approximately preserve distances to hyperplanes, as in the following lemma. 2Such estimates may be found in the literature for homogeneous (i.e., b = 0) hyperplanes (see, e.g., Bartlett and Shawe-Taylor [1999, Theorem 4.6]), but dealing with polytopes, it is important for us to allow offsets. As discussed in Hanneke and Kontorovich [2017], the standard non-homogeneous to homogeneous conversion can degrade the margin by an arbitrarily large amount, and hence the non-homogeneous case warrants an independent analysis. 4 Lemma 4. Let S be set of d-dimensional vectors in the unit ball, T be a set of normalized vectors, and f : Rd →Rk a linear embedding realizing the guarantees of the JL transform. Then for any 0 < ε < 1 and some k = O((log |S ∪T|)/ε2), with probability 1 −|S ∪T|−c (for any constant c > 1) we have for all x ∈S and t ∈T that f(t) · f(x) ∈t · x ± ε. Proof. Let the constant in k be chosen so that the JL transform preserves distances and norms among S ∪T within a factor 1 + ε′ for ε′ = ε/5. By the guarantees of the JL transform for the chosen value of k, we have that f(t) · f(x) = 1 2  ∥f(t)∥2 + ∥f(x)∥2 −∥f(t) −f(x)∥2 ≤ 1 2  (1 + ε′)2(∥t∥2 + ∥x∥2) −(1 −ε′)2∥t −x∥2 < 1 2  (1 + 3ε′)(∥t∥2 + ∥x∥2) −(1 −2ε′)∥t −x∥2 < 1 2  5ε′(∥t∥2 + ∥x∥2) + t · x  ≤ 5ε′ + t · x. = ε + t · x. A similar argument gives that f(t) · f(x) > −ε + t · x. 3 Computing and learning separating polytopes In this section, we present algorithms to compute and learn γ-fat t-polytopes. We begin with hardness results for this problem, and show that these hardness results justify algorithms with run time exponential in the dimension or the square of the reciprocal of the margin. We then present our algorithms. 3.1 Hardness We show that computing separating polytopes is NP-hard, and even hard to approximate. We begin with the case of a single hyperplane. The following preliminary lemma builds upon Amaldi and Kann [1995, Theorem 10]. Lemma 5. Given a labelled point set S (n = |S|) with p negative points, let h∗be a hyperplane that places all positive points of S on its positive side, and maximizes the number of negative points on its negative size — let opt be the number of these negative points. Then it is NP-hard to find a hyperplane ˜h consistent with all positive points, and which places at least opt/p1−o(1) negative points on on the negative side of ˜h. This holds even when the optimal hyperplane correctly classifying opt points has margin γ ≥ 1 4√opt. Proof. We reduce from maximum independent set, which for p vertices is hard to approximate to within p1−o(1) [Zuckerman, 2007]. Given a graph G = (V, E), for each vetex vi ∈V place a negative point on the basis vector ei. Now place a positive point at the origin, and for each edge (vi, vj) ∈E, place a positive point at (ei + ej)/2. Consider a hyperplane consistent with the positive points and placing opt negative points on the negative side: These negative points must represent an independent set in G, for if (vi, vj) ∈E, then by construction the midpoint of ei, ej is positive, and so both ei, ej cannot lie on the negative side of the hyperplane. Likewise, if G contained an independent set V ′ ⊂V of size opt, then we consider the hyperplane defined by the equation w · x + 3 4√opt = 0, where coordinate w(j) = − 1 √opt if vj ∈V ′ and w(j) = 0 otherwise. It is easily verified that the distance from the hyperplane to a negative point (i.e. a basis vector) is − 1 √opt + 3 4√opt = − 1 4√opt, to the origin is 3 4√opt, and to all other positive points is at least − 1 2√opt + 3 4√opt = 1 4√opt. 5 We can now extend the above result for a hyperplane to similar ones for polytopes: Theorem 6. Given a labelled point set S (n = |S|) with p negative points, let H∗be a collection of t halfspaces whose intersection partitions S into positive and negative sets. Then it is NP-hard to find a collection ˜H of size less than tp1−o(1) whose intersection also partitions S into positive and negative sets. This holds even when all hyperplanes have margin γ ≥ 1 4√ p/t, Proof. The reduction is from minimum coloring, which is hard to approximate within a factor of n1−o(1) [Zuckerman, 2007]. The construction is identical to that of the proof of Lemma 5. In particular, a set of vertices in G assigned the same color necessarily form an independent set, and so their corresponding negative points in S can be separated from all positive points by some halfspace, and vice-versa. The only difficulty in the reduction is our insistence that the margin must be of size at least 1 4√ p/t; as in Lemma 5, this holds only when the halfspaces are restricted to separate at most opt = p/t points. But there is no guarantee that the optimal coloring satisfies this requirement, that is if the optimal coloring possesses t colors, that each color represents only p/t vertices. To this end, if a color in the optimal t-coloring of G covers more than p/t vertices, we partition it into a set of colors, each coloring no more than p/t vertices. This increases the total number of colors to at most 2t, which does not affect the hardness-of-approximation result. The Exponential Time Hypothesis (ETH) posits that maximum independent set and minimum coloring cannot be solved in less than cn operations (for some constant c)3. As Lemma 5 asserts that the separating hyperplane problem remains hard for margin γ ≥ 1 4√opt ≥ 1 4√p, we cannot hope to find an optimal solution in time less than cp ≥c1/(16γ2). Likewise, as Theorem 6 asserts that the separating tpolytope problem remains hard for margin γ ≥ 1 4√ p/t we cannot hope to find a consistent t-polytope in time less than cp ≥ct/(16γ2). This justifies the exponential dependence on tγ−2 in the algorithm of Arriaga and Vempala [2006], and implies that to avoid an exponential dependence on t in the runtime, we should consider broader hypothesis class, for example O(t log m)-polytopes. 3.2 Algorithms Here we present algorithms for computing polytopes, and use them to give an efficient algorithm for learning polytopes. In what follows, we give two algorithms inspired by the work of Arriaga and Vempala [2006]. Both have runtime faster than the algorithm of Arriaga and Vempala [2006], and the second is only polynomial in t. Theorem 7. Given a labelled point set S (n = |S|) for which some γ-fat t-polytope correctly separates the positive and negative points (i.e., the polytope is consistent), we can compute the following with high probability: 1. A consistent (γ/4)-fat t-polytope in time nO(tγ−2 log(1/γ)). 2. A consistent (γ/4)-fat O(t log n)-polytope in time nO(γ−2 log(1/γ)). Before proving Theorem 7, we will need a preliminary lemma: Lemma 8. Given any 0 < δ < 1, there exists a set V of unit vectors of size |V | = δ−O(d) with the following property: For any unit vector w, there exists a v ∈V that satisfies v · x ∈w · x ± δ for all vectors x with ∥x∥≤1. The set V can be constructed in time δ−O(d) with high probability. This implies that if a set S admits a hyperplane (w, b) with margin γ, then S admits a hyperplane (v, b) (for v ∈V ) with margin at least γ −δ. 3This does not necessary imply that approximating these problems requires cn operations: As hardness-ofapproximation results utilize polynomial-time reductions, ETH implies only that the runtime is exponential in some polynomial in n. 6 Proof. We take V to be a δ-net of the unit ball, a set satisfying that every point on the ball is within distance δ of some point in V . Then |V | ≤(1 + 2/δ)d [Vershynin, 2010, Lemma 5.2]. For any unit vector w we have for some v ∈V that ∥w −v∥≤δ, and so for any vector x satisfying ∥x∥≤1 we have |w · x −v · x| = |(w −v) · x| ≤∥w −v∥≤δ. The net can be constructed by a randomized greedy algorithm. By coupon-collector analysis, it suffices to sample O(|V | log |V |) random unit vectors. For example, each can be chosen by sampling its coordinate from N(0, 1) (the standard normal distribution), and then normalizing the vector. The resulting set contains within it a δ-net. Proof of Theorem 7. We first apply the Johnson-Lindenstrauss transform to reduce dimension of the points in S to k = O(γ−2 log(n + t)) = O(γ−2 log n) while achieving the guarantees of Lemma 4 for the points of S and the t halfspaces forming the optimal γ-fat t-polytope, with parameter ε = γ 12. In the embedded space, we extract a δ-net V of Lemma 8 with parameter δ = γ 12, and we have |V | = δ−O(k). Now define the set B consisting of all values of the form γi 12 for integer i = {0, 1, . . . , ⌊12/γ⌋}. It follows that for each d-dimensional halfspace (w, b) forming the original γ-fat t-polytope, there is a k-dimensional halfspace (v, b′) with v ∈V and b′ ∈B satisfying v · f(x) + b′ ∈w · x + b ± γ/4 for every x ∈S. Given (v, b′), we can recover an approximation to (w, b) in the d-dimensional origin space thus: Let S′ ⊂S include only those points x ∈S for which |v · f(x) + b′| ≥3γ 4 , and it follows that |w · x + b| ≥3γ 4 −γ 4 = γ 2 . As S′ is a separable point set with margin Θ(γ), we can run the Perceptron algorithm on S′ in time O(dnγ−2), and find a d-dimensional halfspace w′ consistent with w on all points at distance γ 4 or more from w. We will refer to w′ as the d-dimensional mirror of v. We compute the d-dimensional mirror of every vector in V for every candidate value in B. We then enumerate all possible t-polytopes by taking intersections of all combinations of t mirror halfspaces, in total time (1/γ)O(kt) = nO(tγ−2 log(1/γ)), and choose the best one consistent with S. The first part of the theorem follows. Better, we may give a greedy algorithm with a much improved runtime: First note that as the intersection of t halfspaces correctly classifies all points, the best halfspace among them correctly classifies at least a (1/t)-fraction of the negative points with margin γ. Hence it suffices to find the d-dimensional mirror which is consistent with all positive points and maximizes the number of correct negative points, all with margin γ 4 . We choose this halfspace, remove from S the correctly classified negative points, and iteratively search for the next best halfspace. After ct log n iterations (for an appropriate constant c), the number of remaining points is n(1 −Ω(1/t))ct log n < ne−ln n = 1, and the algorithm terminates. Having given an algorithm to compute γ-fat t-polytopes, we can now give an efficient algorithm to learn γ-fat t-polytopes. We sample m points, and use the second item of Theorem 7 to find a (γ/4)-fat O(t log m)-polytope consistent with the sample. By Lemma 2, the class of polytopes has VC-dimension O(γ−2t log m). The size of m is chosen according to Lemma 3, and we conclude: Theorem 9. There exists an algorithm that learns γ-fat t-polytopes with sample complexity m = O  t εγ2 log2 t εγ + log 1 δ  in time mO((1/γ2) log(1/γ)), where ε, δ are the desired accurcy and confidence levels. 4 Polytope margin and envelope In this section, we show that the notions of margin and envelope defined in Section 2 are, in general, quite distinct. Fortunately, when confined to the unit ball X, one can be used to approximate the other. 7 P P(–γ) = P[–γ] P[+γ] P(+γ) Figure 1: Expansion and contraction of a polytope by γ. Figure 2: The γ-envelope ∂P (γ) (left) and γ-margin ∂P [γ] (right) of a polytope P. Given two sets S1, S2 ⊆Rd, their Minkowski sum is given by S1 + S2 = {p + q : p ∈S1, q ∈S2}, and their Minkowski difference is given by S1 −S2 = {p ∈Rd : {p} + S2 ⊆S1}. Let Bγ = {p ∈ Rd : ∥p∥≤γ} be a ball of radius γ centered at the origin. Given a polytope P ∈Rd an a real number γ > 0, let P (+γ) = P + Bγ, P (−γ) = P −Bγ. Hence, P (+γ) and P (−γ) are the results of expanding or contracting, in a certain sense, the polytope P. Also, let P [+γ] be the result of moving each halfspace defining a facet of P outwards by distance γ, and similarly, let P [−γ] be the result of moving each such halfspace inwards by distance γ. Put differently, we can think of the halfspaces defining the facets of P as moving outwards at unit speed, so P expands with time. Then P [±γ] is P at time ±γ. See Figure 1. Observation 1. We have P (−γ) = P [−γ]. Proof. Each point in P [−γ] is at distance at least γ from each hyperplane containing a facet of P, hence, it is at distance at least γ from the boundary of P, so it is in P (−γ). Now, suppose for a contradiction that there exists a point p ∈P (−γ) \ P [−γ]. Then p is at distance less than γ from a point q ∈∂h \ f, where f is some facet of P and ∂h is the hyperplane containing f. But then the segment pq must intersect another facet of P. However, in the other direction we have P (+γ) ⊊P [+γ]. Furthermore, the Hausdorff distance between them could be arbitrarily large (see again Figure 1). Then the γ-envelope of P is given by ∂P (γ) = P (+γ) \ P (−γ), and the γ-margin of P is given by ∂P [γ] = P [+γ] \ P [−γ]. See Figure 2. Since the γ-margin of P is not contained in the γ-envelope of P, we would like to find some sufficient condition under which, for some γ′ < γ, the γ′-margin of P is contained in the γ-envelope of P. Our solution to this problem is given in the following theorem. Recall that X is the unit ball in Rd. Theorem 10. Let P ⊂Rd be a polytope, and let 0 < γ < 1. Suppose that P [−γ] ∩X ̸= ∅. Then, within X, the (γ2/2)-margin of P is contained in the γ-envelope of P; meaning, ∂P [γ2/2] ∩X ⊆ ∂P (γ). 8 The proof uses the following general observation: Observation 2. Let Q = Q(t) be an expanding polytope whose defining halfspaces move outwards with time, each one at its own constant speed. Let p = p(t) be a point that moves in a straight line at constant speed. Suppose t1 < t2 < t3 are such that p(t1) ∈Q(t1) and p(t3) ∈Q(t3). Then p(t2) ∈Q(t2) as well. Proof. Otherwise, p exits one of the halfspaces and enters it again, which is impossible. Proof of Theorem 10. By Observation 1, it suffices to show that P [+γ2/2] ∩X ⊆P (+γ). Hence, let p ∈P [+γ2/2] ∩X and q ∈P [−γ] ∩X. Let s be the segment pq. Let r be the point in s that is at distance γ from p. Suppose for a contradiction that p /∈P (+γ). Then r /∈P. Consider P = P(t) as a polytope that expands with time, as above. Let z = z(t) be a point that moves along s at constant speed, such that z(−γ) = q and z(γ2/2) = p. Since ∥r −q∥≤2, the speed of s is at most 2/γ. Hence, between t = 0 and t = γ2/2, z moves distance at most γ, so z(0) is already between r and p. In other words, z exits P and reenters it, contradicting Observation 2. It follows immediately from Theorem 10 and Lemma 2 that the VC-dimension of the class of t-polytopes with envelope γ is at most min {2(d + 1)t log(3t), 2vt log(3t)} , where v = (4/γ2 + 1)2. Likewise, we can approximate the optimal t-polytope with envelope γ by the algorithms of Theorem 7 (with parameter γ′ = γ2/2). Acknowledgments We thank Sasho Nikolov, Bernd Gärtner and David Eppstein for helpful discussions. L. Gottlieb and A. Kontorovich were supported in part by the Israel Science Foundation (grant No. 755/15). References Dimitris Achlioptas. Database-friendly random projections: Johnson-Lindenstrauss with binary coins. J. Comput. Syst. Sci., 66(4):671–687, 2003. doi: 10.1016/S0022-0000(03)00025-4. URL https://doi.org/10.1016/S0022-0000(03)00025-4. Edoardo Amaldi and Viggo Kann. The complexity and approximability of finding maximum feasible subsystems of linear relations. Theoretical Computer Science, 147(1):181 – 210, 1995. ISSN 03043975. doi: https://doi.org/10.1016/0304-3975(94)00254-G. URL http://www.sciencedirect. com/science/article/pii/030439759400254G. Edoardo Amaldi and Viggo Kann. On the approximability of minimizing nonzero variables or unsatisfied relations in linear systems. Theoretical Computer Science, 209(1):237 – 260, 1998. ISSN 0304-3975. doi: https://doi.org/10.1016/S0304-3975(97)00115-1. URL http://www. sciencedirect.com/science/article/pii/S0304397597001151. Joseph Anderson, Navin Goyal, and Luis Rademacher. Efficient learning of simplices. In COLT 2013 The 26th Annual Conference on Learning Theory, June 12-14, 2013, Princeton University, NJ, USA, pages 1020–1045, 2013. URL http://jmlr.org/proceedings/papers/v30/Anderson13. html. Dana Angluin. Computational learning theory: Survey and selected bibliography. In Proceedings of the 24th Annual ACM Symposium on Theory of Computing, May 4-6, 1992, Victoria, British Columbia, Canada, pages 351–369, 1992. doi: 10.1145/129712.129746. URL http://doi.acm. org/10.1145/129712.129746. Martin Anthony and Peter L. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, Cambridge, 1999. ISBN 0-521-57353-X. doi: 10.1017/CBO9780511624216. URL http://dx.doi.org/10.1017/CBO9780511624216. 9 Rosa I. Arriaga and Santosh Vempala. An algorithmic theory of learning: Robust concepts and random projection. Machine Learning, 63(2):161–182, 2006. doi: 10.1007/s10994-006-6265-7. URL https://doi.org/10.1007/s10994-006-6265-7. Mihály Bárász and Santosh Vempala. A new approach to strongly polynomial linear programming. In Innovations in Computer Science - ICS 2010, Tsinghua University, Beijing, China, January 5-7, 2010. Proceedings, pages 42–48, 2010. URL http://conference.itcs.tsinghua.edu.cn/ ICS2010/content/papers/4.html. Peter Bartlett and John Shawe-Taylor. Generalization performance of support vector machines and other pattern classifiers, pages 43–54. MIT Press, Cambridge, MA, USA, 1999. ISBN 0-262-19416-3. Shai Ben-David, Nadav Eiron, and Philip M. Long. On the difficulty of approximately maximizing agreements. J. Comput. Syst. Sci., 66(3):496–514, 2003. doi: 10.1016/S0022-0000(03)00038-2. URL https://doi.org/10.1016/S0022-0000(03)00038-2. Anselm Blumer, Andrzej Ehrenfeucht, David Haussler, and Manfred K. Warmuth. Learnability and the Vapnik-Chervonenkis dimension. J. Assoc. Comput. Mach., 36(4):929–965, 1989. ISSN 0004-5411. Vašek Chvátal. Notes on the Khachiyan-Kalantari algorithm. URL https://users.encs. concordia.ca/~chvatal/notes/khakal.pdf. Nello Cristianini and John Shawe-Taylor. An Introduction to Support Vector Machines and Other Kernel-based Learning Methods. Cambridge University Press, 2000. ISBN 0521780195. URL https://www.amazon.com/ Introduction-Support-Machines-Kernel-based-Learning/dp/0521780195? SubscriptionId=0JYN1NVW651KCA56C102&tag=techkie-20&linkCode=xm2&camp= 2025&creative=165953&creativeASIN=0521780195. Surbhi Goel and Adam Klivans. Learning neural networks with two nonlinear layers in polynomial time (arxiv:1709.06010v4). 2018. Steve Hanneke and Aryeh Kontorovich. Optimality of SVM: Novel proofs and tighter bounds. 2017. URL https://www.cs.bgu.ac.il/~karyeh/opt-svm.pdf. Tibor Hegedüs. Geometrical concept learning and convex polytopes. In Proceedings of the Seventh Annual ACM Conference on Computational Learning Theory, COLT 1994, New Brunswick, NJ, USA, July 12-15, 1994., pages 228–236, 1994. doi: 10.1145/180139.181124. URL http: //doi.acm.org/10.1145/180139.181124. Lisa Hellerstein and Rocco A. Servedio. On PAC learning algorithms for rich boolean function classes. Theor. Comput. Sci., 384(1):66–76, 2007. doi: 10.1016/j.tcs.2007.05.018. URL https: //doi.org/10.1016/j.tcs.2007.05.018. Klaus-Uwe Höffgen, Hans Ulrich Simon, and Kevin S. Van Horn. Robust trainability of single neurons. J. Comput. Syst. Sci., 50(1):114–125, 1995. doi: 10.1006/jcss.1995.1011. URL https: //doi.org/10.1006/jcss.1995.1011. Sanjay Jain and Efim B. Kinber. Intrinsic complexity of learning geometrical concepts from positive data. J. Comput. Syst. Sci., 67(3):546–607, 2003. doi: 10.1016/S0022-0000(03)00067-9. URL https://doi.org/10.1016/S0022-0000(03)00067-9. William B. Johnson and Joram Lindenstrauss. Extensions of Lipschitz mappings into a Hilbert space. Conference in modern analysis and probability (New Haven, Conn.). In Contemp. Math., 26, Amer. Math. Soc., Providence, pages 189–206, 1982. Daniel M. Kane, Adam R. Klivans, and Raghu Meka. Learning halfspaces under log-concave densities: Polynomial approximations and moment matching. In COLT 2013 - The 26th Annual Conference on Learning Theory, June 12-14, 2013, Princeton University, NJ, USA, pages 522–545, 2013. URL http://jmlr.org/proceedings/papers/v30/Kane13.html. 10 Alex Kantchelian, Michael Carl Tschantz, Ling Huang, Peter L. Bartlett, Anthony D. Joseph, and J. Doug Tygar. Large-margin convex polytope machine. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 3248–3256, 2014. URL http:// papers.nips.cc/paper/5511-large-margin-convex-polytope-machine. Micheal Kearns and Umesh Vazirani. An Introduction to Computational Learning Theory. The MIT Press, 1997. Subhash Khot and Rishi Saket. On the hardness of learning intersections of two halfspaces. J. Comput. Syst. Sci., 77(1):129–141, 2011. doi: 10.1016/j.jcss.2010.06.010. URL https://doi. org/10.1016/j.jcss.2010.06.010. Adam R. Klivans and Rocco A. Servedio. Learning intersections of halfspaces with a margin. J. Comput. Syst. Sci., 74(1):35–48, 2008. doi: 10.1016/j.jcss.2007.04.012. URL https://doi. org/10.1016/j.jcss.2007.04.012. Adam R. Klivans and Alexander A. Sherstov. Cryptographic hardness for learning intersections of halfspaces. J. Comput. Syst. Sci., 75(1):2–12, 2009. doi: 10.1016/j.jcss.2008.07.008. URL https://doi.org/10.1016/j.jcss.2008.07.008. Stephen Kwek and Leonard Pitt. PAC learning intersections of halfspaces with membership queries. Algorithmica, 22(1/2):53–75, 1998. doi: 10.1007/PL00013834. URL https://doi.org/10. 1007/PL00013834. Philip M. Long and Manfred K. Warmuth. Composite geometric concepts and polynomial predictability. Inf. Comput., 113(2):230–252, 1994. doi: 10.1006/inco.1994.1071. URL https://doi.org/10.1006/inco.1994.1071. Jiˇrí Matoušek. Lectures on discrete geometry, volume 212 of Graduate Texts in Mathematics. Springer-Verlag, New York, 2002. ISBN 0-387-95373-6. doi: 10.1007/978-1-4613-0039-7. URL https://doi.org/10.1007/978-1-4613-0039-7. Nimrod Megiddo. On the complexity of polyhedral separability. Discrete & Computational Geometry, 3(4):325–337, Dec 1988. ISSN 1432-0444. doi: 10.1007/BF02187916. URL https://doi.org/ 10.1007/BF02187916. Aleksandar Nikolov. Complexity of finding a consistent hyperplane. Theoretical Computer Science Stack Exchange, 2018. URL https://cstheory.stackexchange.com/q/40554. Luis Rademacher and Navin Goyal. Learning convex bodies is hard. In COLT 2009 - The 22nd Conference on Learning Theory, Montreal, Quebec, Canada, June 18-21, 2009, 2009. URL http://www.cs.mcgill.ca/~colt2009/papers/030.pdf#page=1. Leslie G. Valiant. A theory of the learnable. Commun. ACM, 27(11):1134–1142, 1984. Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. CoRR, abs/1011.3027, 2010. URL http://arxiv.org/abs/1011.3027. David Zuckerman. Linear degree extractors and the inapproximability of max clique and chromatic number. Theory of Computing, 3(6):103–128, 2007. doi: 10.4086/toc.2007.v003a006. URL http://www.theoryofcomputing.org/articles/v003a006. 11
2018
159
7,318
ResNet with one-neuron hidden layers is a Universal Approximator Hongzhou Lin MIT Cambridge, MA 02139 hongzhou@mit.edu Stefanie Jegelka MIT Cambridge, MA 02139 stefje@mit.edu Abstract We demonstrate that a very deep ResNet with stacked modules that have one neuron per hidden layer and ReLU activation functions can uniformly approximate any Lebesgue integrable function in d dimensions, i.e. ℓ1(Rd). Due to the identity mapping inherent to ResNets, our network has alternating layers of dimension one and d. This stands in sharp contrast to fully connected networks, which are not universal approximators if their width is the input dimension d [21, 11]. Hence, our result implies an increase in representational power for narrow deep networks by the ResNet architecture. 1 Introduction Deep neural networks are central to many recent successes of machine learning, including applications such as computer vision, natural language processing, or reinforcement learning. A common trend in deep learning has been to construct larger and deeper networks, starting from the pioneer convolutional network LeNet [19], to networks with tens of layers such as AlexNet [17] or VGG-Net [28], or recent architectures like GoogLeNet/Inception [30] or ResNet [13, 14], which may contain hundreds or thousands of layers. A typical observation is that deeper networks offer better performance. This phenomenon, at least on the training set, supports the intuition that a deeper network should have more capacity to approximate the target function, and leads to a question that has received increasing interest in the theory of deep learning: can all functions that we may care about be approximated well by a sufficiently large and deep network? In this work, we address this important question for the popular ResNet architecture. The question of representational power of neural networks has been answered in different forms. Results in the late eighties showed that a network with a single hidden layer can approximate any continuous function with compact support to arbitrary accuracy, when the width goes to infinity [7, 15, 10, 18]. This result is referred to as the universal approximation theorem. Analogous to the classical Stone-Weierstrass theorem on polynomials or the convergence theorem on Fourier series, this theorem implies that the family of neural networks are universal approximators: we can apply neural networks to approximate any continuous function and the accuracy improves as we add more neurons in the width. More importantly, the coefficients in the network can be efficiently learned via back-propagation, providing an explicit representation of the approximation. This classical universal approximation theorem completely relies on the power of the width increasing to infinity, i.e., “fat” networks. Current “tall” deep learning models, however, are not captured by this setting. Consequently, theoretically analyzing the benefit of depth has gained much attention in the recent literature [31, 6, 9, 32, 23, 20, 25]. The main focus of these papers is to provide examples of functions that can be efficiently represented by a deep network but are hard to represent by shallow networks. These examples require exponentially many neurons in a shallow network to achieve the same approximation accuracy as a deep network with only a polynomial or linear number of 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. neurons. Yet, these specific examples do not imply that all shallow networks can be represented by deep networks, leading to an important question: If the number of neurons in each layer is bounded, does universal approximation hold when the depth goes to infinity? This question has recently been studied by [21, 11] for fully connected networks with ReLU activation functions: if each hidden layer has at least d + 1 neurons, where d is the dimension of the input space, the universal approximation theorem holds as the depth goes to infinity. If, however, at most d neurons can be used in each hidden layer, then universal approximation is impossible even with infinite depth. In practice, other architectures have been developed to improve empirical results. A popular example is ResNet [13, 14], which includes an identity mapping in addition to each layer. A first step towards a better theoretical understanding of those empirically successful models is to ask how the above question extends to them. Do the architecture variations make a difference theoretically? Due to the identity mapping, for ResNet, the width of the network remains the same as the input dimension. For a formal analysis, we stack modules of the form shown in Figure 1, and analyze how small the hidden green layers can be. The resulting width of d (blue) or even less (green) stands in sharp contrast with the negative result for width d for fully connected networks in [21, 11]. Indeed, our empirical illustrations in Section 2 demonstrate that, empirically, significant differences in the representational power of narrow ResNets versus narrow fully connected networks can be observed. Our theoretical results confirm those observations. Hardt and Ma [12] show that ResNet enjoys universal finite-sample expressive power, i.e., ResNet can represent any classifier on any finite sample perfectly. This positive result in the discrete setting motivates our work. Their proof, however, relies on the fact that samples are “far” from each other and hence cannot be used in the setting of full functions in continuous space. Contributions. The main contribution of this paper is to show that ResNet with one single neuron per hidden layer is enough to provide universal approximation as the depth goes to infinity. More precisely, we show that for any Lebesgue-integrable1 function f : Rd →R, for any ǫ > 0, there exists a ResNet R with ReLU activation and one neuron per hidden layer such that Z Rd |f(x) −R(x)|dx ≤ǫ. This result implies that, compared to fully connected networks, the identity mapping of ResNet indeed adds representational power for tall networks. · · · ReLU · · · +Id Figure 1: The basic residual block with one neuron per hidden layer. The ResNet in our construction is built by stacking residual blocks of the form illustrated in Figure 1, with one neuron in the hidden layer. A basic residual block consists of two linear mappings and a single ReLU activation [12, 13]. More formally, it is a function TU,V,u from Rd to Rd defined by TU,V,u(x) = V ReLU(Ux + u), where U ∈R1×d, V ∈Rd×1, u ∈R and the ReLU activation function is defined by ReLU(x) = max(x, 0) = [x]+. (1) After performing the nonlinear transformation, we add the identity to form the input of the next layer. The resulting ResNet is a combination of several basic residual blocks and a final linear output layer: R(x) = L ◦(Id + TN) ◦(Id + TN−1) ◦· · · ◦(Id + T0)(x), 1A function f is Lebesgue-integrable if R Rd |f(x)|dx < ∞. 2 where L : Rd →R is a linear operator and Ti are basic one-neuron residual blocks. Unlike the original architecture [13], we do not include any convolutional layers, max pooling or batch normalization; the above simplified architecture turns out to be sufficient for universal approximation. 2 A motivating example We begin by empirically exploring the difference between narrow fully connected networks, with d neurons per hidden layer, and ResNet via a simple example: classifying the unit ball in the plane. The training set consists of randomly generated samples (zi, yi)i=1···n ∈R2 × {−1, 1} with yi = 1 if ∥zi∥2 ≤1; −1 if 2 ≤∥zi∥2 ≤3. We artificially create a margin between positive and negative samples to make the classification task easier. As loss, we use the logistic loss 1 n P log(1 + e−yi ˆ yi), where ˆyi = fN (zi) is the output of the network on the i-th sample. After training, we illustrate the learned decision boundaries of the networks for various depths. Ideally, we would expect the decision boundaries of our models to be close to the true distribution, i.e., the unit ball. Training data 1 Hidden Layer 2 Hidden Layers 3 Hidden Layers 5 Hidden Layers Figure 2: Decision boundaries obtained by training fully connected networks with width d = 2 per hidden layer (top row) and ResNet (bottom row) with one neuron in the hidden layers on the unit ball classification problem. The fully connected networks fail to capture the true function, in line with the theory stating that width d is too narrow for universal approximation. ResNet in contrast approximates the function well, empirically supporting our theoretical results. Figure 2 shows the results. For the fully connected networks (top row), the learned decision boundaries have roughly the same shape for different depths: the approximation quality seems to not improve with increasing depth. While one may be inclined to argue that this is due to local optimality, our observation agrees with the results in [21]: Proposition 2.1. Let fN : Rd →R be the function defined by a fully connected network N with ReLU activation. Denote by P =  x ∈Rd | fN (x) > 0 the positive level set of fN . If each hidden layer of N has at most d neurons, then λ(P) = 0 or λ(P) = +∞, where λ denotes the Lebesgue measure. In other words, the non-trivial level set of a narrow fully connected network is always unbounded. The proof is a direct application of Theorem 2 of [21], see Appendix E. Thus, even when the depth goes to infinity, a narrow fully connected network can never approximate a bounded region. Here we only show the case d = 2 because we can easily visualize the data; the same observation will still hold in higher dimensions. An even stronger, recent result states that any connected component of the decision boundaries obtained by a narrow fully connected network is unbounded [3]. The decision boundaries for ResNet appear strikingly different: despite the even narrower width of one, from 2 hidden layers onwards, the ResNet represents the indicator of a bounded region. 3 With increasing depth, the decision boundary seems to converge to the unit ball, implying that Proposition 2.1 cannot hold for ResNet. These observations motivate the universal approximation theorem that we will show in the next section. 3 Universal approximation theorem In this section, we present the universal approximation theorem for ResNet with one-neuron hidden layers. We sketch the proof in the one-dimensional case; the induction for higher dimensions relies on similar ideas and may be found in the appendix. Theorem 3.1 (Universal Approximation of ResNet). For any d ∈N, the family of ResNet with one-neuron hidden layers and ReLU activation function can universally approximate any f ∈ℓ1(Rd). In other words, for any ǫ > 0, there is a ResNet R with finitely many layers such that Z Rd |f(x) −R(x)|dx ≤ǫ. Outline of the proof. The proof starts with a well-known fact: the class of piecewise constant functions with compact support and finitely many discontinuities is dense in ℓ1(Rd). Thus it suffices to approximate any piecewise constant function. Given a piecewise constant function, we first construct a grid “indicator” function on its support, as shown in Figure 4. This function is similar to an indicator function in the sense that it vanishes outside the support, but, instead of being constantly equal to one, a grid indicator function takes different constant values on different grid cells, see Definition B.3 for a formal definition. The property of having different function values creates a“fingerprint” on each grid cell, which will help to distinguish them. Then, we divide the space into different level sets, such that one level set contains exactly one grid cell. Finally, we fit the function value on each grid cell, cell by cell. Sketch of the proof when d = 1. We start with the one-dimensional case, which is central to our construction. As mentioned above, it is sufficient to approximate piecewise constant functions. Given a piecewise constant function h, there is a subdivision −∞< a0 < a1 < · · · < aM < +∞such that h(x) = M X k=1 hk1x∈[ak−1,ak), where hk is the constant value on the k-th subdivision Ik = [ak−1, ak). We will approximate h via trapezoid functions of the following form, shown in Figure 3. x ↔δ ↔δ ak−1 ak Iδ k Figure 3: A trapezoid function, which is a continuous approximation of the indicator function. The parameter δ measures the quality of the approximation. A trapezoid function is a simple continuous approximation of the indicator function. It is constant on the segment Iδ k = [ak−1 + δ, ak −δ] and linear in the δ-tolerant region Ik\Iδ k. As δ goes to zero, the trapezoid function tends point-wise to the indicator function. A natural idea to approximate h is to construct a trapezoid function on each subdivision Ik and to then sum them up. This is the main strategy used in [21, 11] to show a universal approximation theorem for fully connected networks with width at least d + 1. However, this strategy is not applicable for the ResNet structure because the summation requires memory of past components, and hence requires additional units in every layer. The width constraint of ResNet makes the difference here. In contrast, we construct our approximation in a sequential way: we build the components of the trapezoid function one after another. With this sequential construction, we can only build increasing 4 x · · · a0 a1 a2 a3 aM−1 aM increasing Figure 4: An increasing trapezoid function, which is a special case of grid indicator function when d = 1, is trapezoidal on each subdivision with increasing constant value from left to right. trapezoid functions as shown in Figure 4. Such functions are trapezoidal on each subdivision Ik and the constant value on Iδ k increases when k grows. The construction relies on the following basic operations: Proposition 3.2 (Basic operations). The following operations are realizable by a single basic residual block of ResNet with one neuron: (a) Shifting by a constant: R+ = R + c for any c ∈R; (b) Min or Max with a constant: R+ = min{R, c} or R+ = max{R, c} for any c ∈R; (c) Min or Max with a linear transformation: R+ = min{R, αR + β} (or max) for any α, β ∈R; where R represents the input layer in the basic residual block and R+ the output layer. Geometrically, operation (a) allows us to shift the function by a constant; operation (b) allows us to remove the level set {R ≥c} or {R ≤c} and operation (c) can be used to adjust the slope. With these basic operations at hand, we construct the increasing trapezoid function by induction on the subdivisions. For any m ∈[0, M], we construct a function Rm satisfying C1. Rm = 0 on (−∞, a0]; C2. Rm is a trapezoid function on each Ik, for any k = 1, · · · , m; C3. Rm = (k + 1)∥h∥∞on Iδ k = [ak−1 + δ, ak −δ] for any k = 1, · · · , m; C4. Rm is bounded on (−∞, am] by 0 ≤Rm ≤(m + 1)∥h∥∞; C5. Rm(x) = −(m+1)∥h∥∞ δ (x −am) if x ∈[am, +∞); where ∥h∥∞= max k=1···M |hk| is the infinity norm and δ > 0 measures the quality of the approximation. An illustration of Rm is shown in Figure 5. On the first m subdivisions, Rm is the restriction of the desired increasing trapezoid function. On [am, +∞), the function Rm is a very steep linear function with negative slope that enables the construction of next subdivision. Given Rm, we sequentially stack three residual blocks to build Rm+1: • R+ m = max n Rm, −  1 + 1 m+1  Rm o ; • R++ m = min n R+ m, −R+ m + (m+2)∥h∥∞ δ (am+1 −am) o ; • Rm+1 = min{R++ m , (m + 2)∥h∥∞}. Figure 5 illustrates the effect of these blocks: the first operation flips the linear part on [am, +∞) by adjusting the slope, the second operation folds the linear function in the middle of [am, am+1], and finally we cut off the peak at the appropriate level (m + 2)∥h∥∞. 5 x Rm a0 am 1 x R+ m a0 am 2 x R++ m am am+1 3 x Rm+1 am am+1 4 Figure 5: The construction of Rm+1 based on Rm. We build the next trapezoid function (red) and keep the previous ones (blue) unchanged. An important consideration is that we need to keep the function on previous subdivisions unchanged while building the next trapezoid function. We achieve this by increasing the function values. The different values will be the basis for adjusting the function value in each subdivision to the final value of the target function we want to approximate. Before proceeding with the adjustment, we remark that RM goes to −∞as x →∞. This negative “tail” is easily removed by performing a cut-off operation via the max operator. This gives us the desired increasing trapezoid function R∗ M. To adjust the function values on the intervals Iδ k, we identify the Iδ k via the level sets of R∗ M. This works because, by construction, R∗ M = (k + 1)∥h∥∞on Iδ k. More precisely, we define the level sets Lk = {k∥h∥∞< R∗ M ≤(k + 1)∥h∥∞} (for k = 0, · · · , M) and adjust them one by one from highest to lowest value: for any k = M, · · · , 1, we sequentially build R∗ k−1 = R∗ k + hk −(k + 1)∥h∥∞ ∥h∥∞ [R∗ k −k∥h∥∞]+. (2) An illustration of the R∗ k is shown in Figure 6. x · · · a0 a1 a2 a3 aM−1 aM M|h|∞ x · · · a0 a1 a2 aM−2 aM−1 aM (M −1)|h|∞ Figure 6: An illustration of the function adjustment procedure applied to the top level sets. At each step, we adjust one Iδ k to the desired function value hk. In particular, the first step from R∗ M to R∗ M−1 only scales the top level set because the ReLU activation [RM −M|h|∞]+ is active if and only if x ∈LM. The coefficients are appropriately selected such that after the scaling, the constant in Iδ M matches hM. Hence, we have R∗ M−1 = hM if x ∈Iδ M ⊂LM; R∗ M if x /∈LM. Next, we set the second largest level set to hM−1, and so on. As a result, the function R∗ 0, obtained after rescaling all the level sets is the desired approximation of the piecewise constant function h. Concretely, we show that R∗ 0 satisfies • R∗ 0 = 0 on (−∞, a0] and [aM, +∞); • R∗ 0 = hk on Iδ k = [ak−1 + δ, ak −δ] for any k = 1, · · · , M; 6 • R∗ 0 is bounded with −∥h∥∞≤R∗ 0 ≤∥h∥∞. The detailed proof is deferred to Appendix B. Importantly, our construction is valid for any small enough δ satisfying 0 < 2δ < min k=1,··· ,M{ak −ak−1}. Hence, the approximation error, which is bounded by Z R |R∗ 0(x) −h(x)|dx ≤4Mδ∥h∥∞, can be made arbitrarily small by taking δ to 0. This completes the proof. Extension to higher dimensions. The last step of the one-dimensional construction is performed by sliding through all the grid cells and adjusting the function value sequentially. This procedure can be done regardless of the dimension. Therefore, it suffices to build a d-dimensional grid indicator function, which generalizes the notion of increasing trapezoid function into high dimensional space (Definition B.3 in the appendix). We perform an induction over dimensions. The main idea is to sum up an appropriate one-dimensional grid indicator function and an appropriate d −1 dimensional grid indicator function, as illustrated in Figure 7. + = Figure 7: One dimensional grid indicator functions on the first (left) and second (middle) coordinate. Both functions can be constructed independently by our one hidden unit ResNet. The summation gives the desired shape inside each grid cell. However, some regions outside the grid cells are also raised, but were supposed to be zero. We address this issue via another, separate level set property: there is a threshold T such that a) the function value inside each Iδ k is larger than T; b) the function values outside the grid cells are smaller than T. Therefore, the desired grid indicator function can be obtained by performing a max operator with the threshold T, i.e., cutting off the smaller values and setting them to zero (see Appendix C). Number of neurons/layers. A straightforward consequence of our construction is that we can approximate any piecewise constant function to arbitrary accuracy with a ResNet of O(number of grid cells) hidden units/layers. The most space-consuming procedure is the function adjustment that requires going through each of the grid cells one by one. This procedure however can be parallelized if we allow more hidden units per layer. Deriving an exact relationship between the original target function f and the required number of grid cells is nontrivial and highly dependent on characteristics of f. In particular, when the function f is continuous, this number is related to the modulus of continuity of f defined by ωK(r) = max x,y∈K,∥x−y∥≤r |f(x) −f(y)|, where K is any compact set and r represents the radius of the discretization. Given a desired approximation accuracy ǫ, we need to • first, determine a compact set K such that R Rd\K |f| ≤ǫ and restrict f to K; • second, determine r such that ωK(r) ≤ǫ/Vol(K). Then, the number of grid cells is O(1/rd). This dependence is suboptimal in the exponent, and it may be possible to improve it using a similar strategy as [34]. Also, by imposing stronger smoothness assumptions, this number may be reducible dramatically [2, 22, 33]. These improvements are not the main focus of this paper, and we leave them for future work. 7 4 Discussion and concluding remarks In this paper, we have shown a universal approximation theorem for the ResNet structure with one unit per hidden layer. This result stands in contrast to recent results on fully connected networks, for which universal approximation fails with width d or less. To conclude, we add some final remarks and implications. ResNet vs Fully connected networks. While we achieve universal approximation with only one hidden neuron in each basic residual block, one may argue that the structure of ResNet still passes the identity to the next layer. This identity map could be counted as d hidden units, resulting in a total of d + 1 hidden unites per residual block, and could be viewed as making the network a width (d + 1) fully connected network. But, even from this angle, ResNet corresponds to a compressed or sparse version of a fully connected network. In particular, a width (d + 1) fully connected network has O(d2) connections per layer, whereas only O(d) connections are present in ResNet thanks to the identity map. This “overparametrization” of fully connected networks may be a partial explanation why dropout [29] has been observed to be beneficial for such networks. By the same argument, our result implies that width (d + 1) fully connected networks are universal approximators, which is the minimum width needed [11]. A detailed construction may be found in Appendix F. Why does universal approximation matter? As shown in Section 2, a width d fully connected network can never approximate a compact decision boundary even if we allow infinite depth. However, in high dimensional space, it is very hard to visualize and check the obtained decision boundary. The universal approximation theorem then provides a sanity check, and ensures that, in principle, we are able to capture any desired decision boundary. Training efficiency. The universal approximation theorem only guarantees the possibility of approximating any desired function, but it does not guarantee that we will actually find it in practice by running SGD or any other optimization algorithm. Understanding the efficiency of training may require a better understanding of the optimization landscape, a topic of recent attention [5, 16, 24, 26, 8, 35, 27]. Here, we try to provide a slightly different angle. By our theory, ResNet with one-neuron hidden layers is already a universal approximator. In other words, a ResNet with multiple units per layer is in some sense an over-parametrization of the model, and over-parametrization has been observed to benefit optimization [36, 4, 1]. This might be one reason why training a very deep ResNet is “easier” than training a fully connected network. A more rigorous analysis is an interesting direction for future work. Generalization. Since a universal approximator is able to fit any function, one might expect it to overfit very easily. Yet, it is commonly observed that deep networks generalize surprisingly well on the test set. The explanation of this phenomenon is orthogonal to our paper, however, knowing the universal approximation capability is an important building block of such a theory. Moreover, the above-mentioned “over-parametrization” implied by our results may play a role too. To conclude, we have shown a universal approximation theorem for ResNet with one-neuron hidden layers. This theoretically distinguishes them from fully connected networks. To some extent, our construction also theoretically motivates the current practice of going deeper and deeper in the ResNet architecture. Acknowledgements We would like to thank Jeffery Z. HaoChen for useful feedback and suggestions for this paper. This research was supported by The Defense Advanced Research Projects Agency (grant number YFA17 N66001-17-1-4039). The views, opinions, and/or findings contained in this article are those of the author and should not be interpreted as representing the official views or policies, either expressed or implied, of the Defense Advanced Research Projects Agency or the Department of Defense. References [1] S. Arora, N. Cohen, and E. Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. arXiv:1802.06509, 2018. 8 [2] A. R. Barron. Universal approximation bounds for superpositions of a sigmoidal function. IEEE Transactions on Information theory, 39(3):930–945, 1993. [3] H. Beise, S. D. Da Cruz, and U. Schroder. On decision regions of narrow deep neural networks. arXiv:1807.01194, 2018. [4] A. Brutzkus, A. Globerson, E. Malach, and S. Shalev-Shwartz. Sgd learns over-parameterized networks that provably generalize on linearly separable data. In The International Conference on Learning Representations (ICLR), 2018. [5] A. Choromanska, M. Henaff, M. Mathieu, G. B. Arous, and Y. LeCun. The loss surfaces of multilayer networks. In The International Conference on Artificial Intelligence and Statistics (AISTATS), 2015. [6] N. Cohen, O. Sharir, and A. Shashua. On the expressive power of deep learning: A tensor analysis. In Conference on Learning Theory (COLT), 2016. [7] G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303–314, 1989. [8] S. S. Du, J.D. Lee, Y. Tian, B. Poczos, and A. Singh. Gradient descent learns one-hidden-layer cnn: Don’t be afraid of spurious local minima. arXiv preprint arXiv:1712.00779, 2017. [9] R. Eldan and O. Shamir. The power of depth for feedforward neural networks. In Conference on Learning Theory (COLT), 2016. [10] K. Funahashi. On the approximate realization of continuous mappings by neural networks. Neural networks, 2(3):183–192, 1989. [11] B. Hanin and M. Sellke. Approximating continuous functions by relu nets of minimal width. arXiv:1710.11278, 2017. [12] M. Hardt and T. Ma. Identity matters in deep learning. In The International Conference on Learning Representations (ICLR), 2017. [13] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In IEEE conference on computer vision and pattern recognition (CVPR), 2016. [14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), 2016. [15] K. Hornik, M. Stinchcombe, and H. White. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359–366, 1989. [16] K. Kawaguchi. Deep learning without poor local minima. In Advances in Neural Information Processing Systems (NIPS), 2016. [17] A. Krizhevsky, I. Sutskever, and G.E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NIPS), pages 1097– 1105, 2012. [18] V. Kurková. Kolmogorov’s theorem and multilayer neural networks. Neural networks, 5(3): 501–506, 1992. [19] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [20] S. Liang and R. Srikant. Why deep neural networks for function approximation? In The International Conference on Learning Representations (ICLR), 2017. [21] Z. Lu, H. Pu, F. Wang, Z. Hu, and L. Wang. The expressive power of neural networks: A view from the width. In Advances in Neural Information Processing Systems (NIPS), 2017. [22] H. N. Mhaskar. Neural networks for optimal approximation of smooth and analytic functions. Neural computation, 8(1):164–177, 1996. 9 [23] H. N. Mhaskar and T. Poggio. Deep vs. shallow networks: An approximation theory perspective. Analysis and Applications, 14(06):829–848, 2016. [24] Q. Nguyen and M. Hein. The loss surface of deep and wide neural networks. In Proceedings of the International Conferences on Machine Learning (ICML), 2017. [25] D. Rolnick and M. Tegmark. The power of deeper networks for expressing natural functions. In The International Conference on Learning Representations (ICLR), 2018. [26] S. Shalev-Shwartz, O. Shamir, and S. Shammah. Weight sharing is crucial to succesful optimization. arXiv:1706.00687, 2017. [27] O. Shamir. Are resnets provably better than linear predictors? arXiv:1804.06739, 2018. [28] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In The International Conference on Learning Representations (ICLR), 2015. [29] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research (JMLR), 15(1):1929–1958, 2014. [30] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, A. Rabinovich, J. Rick Chang, et al. Going deeper with convolutions. In IEEE conference on computer vision and pattern recognition (CVPR), 2015. [31] L. Szymanski and B. McCane. Deep networks are effective encoders of periodicity. IEEE transactions on neural networks and learning systems, 25(10):1816–1827, 2014. [32] M. Telgarsky. Benefits of depth in neural networks. In Conference on Learning Theory (COLT), 2016. [33] D. Yarotsky. Error bounds for approximations with deep relu networks. Neural Networks, 94: 103–114, 2017. [34] D. Yarotsky. Optimal approximation of continuous functions by very deep relu networks. arXiv preprint arXiv:1802.03620, 2018. [35] C. Yun, S. Sra, and A. Jadbabaie. Global optimality conditions for deep neural networks. In The International Conference on Learning Representations (ICLR), 2018. [36] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. In The International Conference on Learning Representations (ICLR), 2016. 10
2018
16
7,319
Distilled Wasserstein Learning for Word Embedding and Topic Modeling Hongteng Xu1,2 Wenlin Wang2 Wei Liu3 Lawrence Carin2 1Infinia ML, Inc. 2Duke University 3Tencent AI Lab hongteng.xu@infiniaml.com Abstract We propose a novel Wasserstein method with a distillation mechanism, yielding joint learning of word embeddings and topics. The proposed method is based on the fact that the Euclidean distance between word embeddings may be employed as the underlying distance in the Wasserstein topic model. The word distributions of topics, their optimal transports to the word distributions of documents, and the embeddings of words are learned in a unified framework. When learning the topic model, we leverage a distilled underlying distance matrix to update the topic distributions and smoothly calculate the corresponding optimal transports. Such a strategy provides the updating of word embeddings with robust guidance, improving the algorithmic convergence. As an application, we focus on patient admission records, in which the proposed method embeds the codes of diseases and procedures and learns the topics of admissions, obtaining superior performance on clinically-meaningful disease network construction, mortality prediction as a function of admission codes, and procedure recommendation. 1 Introduction Word embedding and topic modeling play important roles in natural language processing (NLP), as well as other applications with textual and sequential data. Many modern embedding methods [30, 33, 28] assume that words can be represented and predicted by contextual (surrounding) words. Accordingly, the word embeddings are learned to inherit those relationships. Topic modeling methods [8], in contrast, typically represent documents by the distribution of words, or other “bagof-words” techniques [17, 24], ignoring the order and semantic relationships among words. The distinction between how the word order is (or is not) accounted for when learning topics and word embeddings manifests a potential methodological gap or mismatch. This gap is important when considering clinical-admission analysis, the motivating application of this paper. Patient admissions in hospitals are recorded by the code of international classification of diseases (ICD). For each admission, one may observe a sequence of ICD codes corresponding to certain kinds of diseases and procedures, and each code is treated as a “word.” To reveal the characteristics of the admissions and relationships between different diseases/procedures, we seek to model the “topics” of admissions and also learn an embedding for each ICD code. However, while we want embeddings of similar diseases/procedures to be nearby in the embedding space, learning the embedding vectors based on surrounding ICD codes for a given patient admission is less relevant, as there is often a diversity in the observed codes for a given admission, and the code order may hold less meaning. Take the MIMIC-III dataset [25] as an example. The ICD codes in each patient’s admission are ranked according to a manually-defined priority, and the adjacent codes are often not clinically-correlated with each other. Therefore, we desire a model that jointly learns topics and word embeddings, and that for both does not consider the word (ICD code) order. Interestingly, even in the context of traditional NLP tasks, it has been recognized recently that effective word embeddings may 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Admission records based on ICD codes: Admission 1: d348, d271, p4538, …. Admission 2: d3919, d394, d4011, d4019, … … Admission M: d4160, p423, … Word distribution Word embedding d250 Diabetes d250 Diabetes d27410 Nephropathy d9920 Stroke d9920 Stroke Index of ICD code WassersteinSpace for Admissions Euclidean Space for ICD Code Embedding Optimal transport betweenadmissions The probability of ICD code Index of ICD code d27410 Nephropathy Admission Topic Topic Diabetes Nephropathy Figure 1: Consider two admissions with mild and severe diabetes, which are represented by two distributions of diseases (associated with ICD codes) in red and orange, respectively. They are two dots in the Wasserstein ambient space, corresponding to two weighted barycenters of Wasserstein topics (the color stars). The optimal transport matrix between these two admissions is built on the distance between disease embeddings in the Euclidean latent space. The large value in the matrix (the dark blue elements) indicates that it is easy to transfer diabetes to its complication like nephropathy, whose embedding is a short distance away (short blue arrows). be learned without considering word order [37], although that work didn’t consider topic modeling or our motivating application. Although some works have applied word embeddings to represent ICD codes and related clinical data [11, 22], they ignore the fact that the clinical relationships among the diseases/procedures in an admission may not be approximated well by their neighboring relationships in the sequential record. Most existing works either treat word embeddings as auxiliary features for learning topic models [15] or use topics as the labels for supervised embedding [28]. Prior attempts at learning topics and word embeddings jointly [38] have fallen short from the perspective of these two empirical strategies. We seek to fill the aforementioned gap, while applying the proposed methodology to clinicaladmission analysis. As shown in Fig. 1, the proposed method is based on a Wasserstein-distance model, in which (i) the Euclidean distance between ICD code embeddings works as the underlying distance (also referred to as the cost) of the Wasserstein distance between the distributions of the codes corresponding to different admissions [26]; (ii) the topics are “vertices” of a geometry in the Wasserstein space and the admissions are the “barycenters” of the geometry with different weights [36]. When learning this model, both the embeddings and the topics are inferred jointly. A novel learning strategy based on the idea of model distillation [20, 29] is proposed, improving the convergence and the performance of the learning algorithm. The proposed method unifies word embedding and topic modeling in a framework of Wasserstein learning. Based on this model, we can calculate the optimal transport between different admissions and explain the transport by the distance of ICD code embeddings. Accordingly, the admissions of patients become more interpretable and predictable. Experimental results show that our approach is superior to previous state-of-the-art methods in various tasks, including predicting admission type, mortality of a given admission, and procedure recommendation. 2 A Wasserstein Topic Model Based on Euclidean Word Embeddings Assume that we have M documents and a corpus with N words, e.g., respectively, admission records and the dictionary of ICD codes. These documents can be represented by Y = [ym] ∈RN×M, where ym ∈ΣN, m ∈{1, ..., M}, is the distribution of the words in the m-th document, and ΣN is an N-dimensional simplex. These distributions can be represented by some basis (i.e., topics), denoted as B = [bk] ∈RN×K, where bk ∈ΣN is the k-th base distribution. The word embeddings can be formulated as X = [xn] ∈RD×N, where xn is the embedding of the n-th word, n ∈{1, ..., N}, is obtained by a model, i.e., xn = gθ(wn) with parameters θ and predefined representation wn of the word (e.g., wn may be a one-hot vector for each word). The distance between two word embeddings is denoted dnn′ = d(xn, xn′), and generally it is assumed to be Euclidean. These distances can be formulated as a parametric distance matrix Dθ = [dnn′] ∈RN×N. 2 Denote the space of the word distributions as the ambient space and that of their embeddings as the latent space. We aim to model and learn the topics in the ambient space and the embeddings in the latent space in a unified framework. We show that recent developments in the methods of Wasserstein learning provide an attractive solution to achieve this aim. 2.1 Revisiting topic models from a geometric viewpoint Traditional topic models [8] often decompose the distribution of words conditioned on the observed document into two factors: the distribution of words conditioned on a certain topic, and the distribution of topics conditioned on the document. Mathematically, it corresponds to a low-rank factorization of Y , i.e., Y = BΛ, where B = [bk] contains the word distributions of different topics and Λ = [λm] ∈RK×M, λm = [λkm] ∈ΣK, contains the topic distributions of different documents. Given B and λm, ym can be equivalently written as ym = Bλm = arg miny∈ΣN XK k=1 λkm∥bk −y∥2 2, (1) where λkm is the probability of topic k given document m. From a geometric viewpoint, {bk} in (1) can be viewed as vertices of a geometry, whose “weights” are λm. Then, ym is the weighted barycenter of the geometry in the Euclidean space. Following this viewpoint, we can extend (1) to another metric space, i.e., ym = arg miny∈ΣN XK k=1 λkmd2(bk, y) = yd2(B, λm), (2) where yd2(B, λm) is the barycenter of the geometry, with vertices B and weights λm in the space with metric d. 2.2 Wasserstein topic model When the distance d in (2) is the Wasserstein distance, we obtain a Wasserstein topic model, which has a natural and explicit connection with word embeddings. Mathematically, let (Ω, d) be an arbitrary space with metric D and P(Ω) be the set of Borel probability measures on Ω, respectively. Definition 2.1. For p ∈[1, ∞) and probability measures u and v in P(Ω), their p-order Wasserstein distance [40] is Wp(u, v) = (infπ∈Π(u,v) R Ω×Ωdp(x, y)dπ(x, y)) 1 p , where Π(u, v) is the set of all probability measures on Ω× Ωwith u and v as marginals. Definition 2.2. The p-order weighted Fréchet mean in the Wasserstein space (or called Wasserstein barycenter) [1] of K measures B = {b1, ..., bK} in P ⊂ P(Ω) is q(B, λ) = arg infq∈P PK k=1 λkW p p (bk, q), where λ = [λk] ∈ΣK decides the weights of the measures. When Ωis a discrete state space, i.e., {1, ..., N}, the Wasserstein distance is also called the optimal transport (OT) distance [36]. More specifically, the Wasserstein distance with p = 2 corresponds to the solution to the discretized Monge-Kantorovich problem: W 2 2 (u, v; D) := minT ∈Π(u,v) Tr(T ⊤D), (3) where u and v are two distributions of the discrete states and D ∈RN×N is the underlying distance matrix, whose element measures the distance between different states. Π(u, v) = {T |T 1 = u, T ⊤1 = v}, and Tr(·) represents the matrix trace. The matrix T is called the optimal transport matrix when the minimum in (3) is achieved. Applying the discrete Wasserstein distance in (3) to (2), we obtain our Wasserstein topic model, i.e., yW 2 2 (B, λ; D) = arg miny∈ΣN XK k=1 λkW 2 2 (bk, y; D). (4) In this model, the discrete states correspond to the words in the corpus and the distance between different words can be calculated by the Euclidean distance between their embeddings. In this manner, we establish the connection between the word embeddings and the topic model: the distance between different topics (and different documents) is achieved by the optimal transport between their word distributions built on the embedding-based underlying distance. For arbitrary 3 two word embeddings, the more similar they are, the smaller underlying distance we have, and more easily we can achieve transfer between them. In the learning phase (as shown in the following section), we can learn the embeddings and the topic model jointly. This model is especially suitable for clinical admission analysis. As discussed above, we not only care about the clustering structure of admissions (the relative proportion, by which each topic is manifested in an admission), but also want to know the mechanism or the tendency of their transfers in the level of disease. As shown in Fig. 1, using our model, we can calculate the Wasserstein distance between different admissions in the level of disease and obtain the optimal transport from one admission to another explicitly. The hierarchical architecture of our model helps represent each admission by its topics, which are the typical diseases/procedures (ICD codes) appearing in a class of admissions. 3 Wasserstein Learning with Model Distillation Given the word-document matrix Y and a predefined number of topics K, we wish to jointly learn the basis B, the weight matrix Λ, and the model gθ of word embeddings. This learning problem can be formulated as minB,Λ,θ XM m=1 L(ym, yW 2 2 (B, λm; Dθ)), s.t. bk ∈ΣN, for k = 1, .., K, and λm ∈ΣK, for m = 1, .., M. (5) Here, Dθ = [dnn′] and the element dnn′ = ∥gθ(wn)−gθ(wn′)∥2. The loss function L(·, ·) measures the difference between ym and its estimation yW 2 2 (B, λm; Dθ). We can solve this problem based on the idea of alternating optimization. In each iteration we first learn the basis B and the weights Λ given the current parameters θ. Then, we learn the new parameters θ based on updated B and Λ. 3.1 Updating word embeddings to enhance the clustering structure Suppose that we have obtained updated B and Λ. Given current Dθ, we denote the optimal transport between document ym and topic bk as Tkm. Accordingly, the Wasserstein distance between ym and bk is Tr(T ⊤ kmDθ). Recall from the topic model in (4) that each document ym is represented as the weighted barycenter of B in the Wasserstein space, and the weights λm = [λkm] represent the closeness between the barycenter and different bases (topics). To enhance the clustering structure of the documents, we update θ by minimizing the Wasserstein distance between the documents and their closest topics. Consequently, the documents belonging to different clusters would be far away from each other. The corresponding objective function is XM m=1 Tr(T ⊤ kmmDθ) = Tr(T ⊤Dθ) = X n,n′ tnn′∥xn,θ −xn′,θ∥2 2, (6) where Tkmm is the optimal transport between ym and its closest base bkm. The aggregation of these transports is given by T = P m Tkmm = [tnn′], and Xθ = [xn,θ] are the word embeddings. Considering the symmetry of Dθ, we can replace tnn′ in (6) with tnn′+tn′n 2 . The objective function can be further written as Tr(XθLX⊤ θ ), where L = diag( T +T ⊤ 2 1N)−T +T ⊤ 2 is the Laplacian matrix. To avoid trivial solutions like Xθ = 0, we add a smoothness regularizer and update θ by optimizing the following problem: minθ E(θ) = minθ Tr(XθLX⊤ θ ) + β∥θ −θc∥2 2, (7) where θc is current parameters and β controls the significance of the regularizer. Similar to Laplacian Eigenmaps [6], the aggregated optimal transport T works as the similarity measurement between proposed embeddings. However, instead of requiring the solution of (7) to be the eigenvectors of L, we enhance the stability of updating by ensuring that the new θ is close to the current one. 3.2 Updating topic models based on the distilled underlying distance Given updated word embeddings and the corresponding underlying distance Dθ, we wish to further update the basis B and the weights Λ. The problem is formulated as a Wasserstein dictionary-learning problem, as proposed in [36]. Following the same strategy as [36], we rewrite {λm} and {bk} as λkm(A) = exp(αkm) P k′ exp(αk′m), bnk(R) = exp(γnk) P n′ exp(γn′k), (8) 4 Algorithm 1 Distilled Wasserstein Learning (DWL) for Joint Word Embedding and Topic Modeling 1: Input: The distributions of words for documents Y . The distillation parameter τ. The number of epochs I. Batch size s. The weight in Sinkhon distance ϵ. The weight β in (7). The learning rate ρ. 2: Output: The parameters θ, basis B, and weights Λ. 3: Initialize θ, A, R ∼N(0, 1), and calculate B(R) and Λ(A) by (8). 4: For i = 1, ..., I 5: For Each batch of documents 6: Calculate the Sinkhorn gradient with distillation: ∇BLτ|B and ∇ΛLτ|Λ. 7: R ←R −ρ∇BLτ|B∇RB|R, A ←A −ρ∇ΛLτ|Λ∇AΛ|A. 8: Calculate B(R), Λ(A) and the gradient of (7) ∇θE(θ)|θ, then update θ ←θ −ρ∇θE(θ)|θ. where A = [αkm] and R = [γnk] are new parameters. Based on (8), the normalization of {λm} and {bk} is met naturally, and we can reformulate (5) to an unconstrained optimization problem, i.e., minA,R XM m=1 L(ym, yW 2 2 (B(R), λm(A); Dθ)). (9) Different from [36], we introduce a model distillation method to improve the convergence of our model. The key idea is that the model with the current underlying distance Dθ works as a “teacher,” while the proposed model with new basis and weights is regarded as a “student.” Through Dθ, the teacher provides the student with guidance for its updating. We find that if we use the current underlying distance Dθ to calculate basis B and weights Λ, we will encounter a serious “vanishing gradient” problem when solving (7) in the next iteration. Because Tr(T ⊤ kmmDθ) in (6) has been optimal under the current underlying distance and new B and Λ, it is difficult to further update Dθ. Inspired by recent model distillation methods in [20, 29, 34], we use a smoothed underlying distance matrix to solve the “vanishing gradient” problem when updating B and Λ. In particular, the yW 2 2 (B(R), λm(A); Dθ) in (9) is replaced by a Sinkhorn distance with the smoothed underlying distance, i.e., ySϵ(B(R), λm(A); Dτ θ ), where (·)τ, 0 < τ < 1, is an element-wise power function of a matrix. The Sinkhorn distance Sϵ is defined as Sϵ(u, v; D) = minT ∈Π(u,v) Tr(T ⊤D) + ϵTr(T ⊤ln(T )), (10) where ln(·) calculates element-wise logarithm of a matrix. The parameter τ works as the reciprocal of the “temperature” in the smoothed softmax layer in the original distillation method [20, 29]. The principle of our distilled learning method is that when updating B and Λ, the smoothed underlying distance is used to provide “weak” guidance. Consequently, the student (i.e., the proposed new model with updated B and Λ) will not completely rely on the information from the teacher (i.e., the underlying distance obtained in a previous iteration), and will tend to explore new basis and weights. In summary, the optimization problem for learning the Wasserstein topic model is minA,R Lτ(A, R) = minA,R XM m=1 L(ym, ySϵ(B(R), λm(A); Dτ θ )), (11) which can be solved under the same algorithmic framework as that in [36]. Our algorithm is shown in Algorithm 1. The details of the algorithm and the influence of our distilled learning strategy on the convergence of the algorithm are given in the Supplementary Material. Note that our method is compatible with existing techniques, which can work as a fine-tuning method when the underlying distance is initialized by predefined embeddings. When the topic of each document is given, km in (6) is predefined and the proposed method can work in a supervised way. 4 Related Work Word embedding, topic modeling, and their application to clinical data Traditional topic models, like latent Dirichlet allocation (LDA) [8] and its variants, rely on the “bag-of-words” representation of documents. Word embedding [30] provides another choice, which represents documents as the fusion of the embeddings [27]. Recently, many new word embedding techniques have been proposed, e.g., the Glove in [33] and the linear ensemble embedding in [32], which achieve encouraging 5 performance on word and document representation. Some works try to combine word embedding and topic modeling. As discussed above, they either use word embeddings as features for topic models [38, 15] or regard topics as labels when learning embeddings [41, 28]. A unified framework for learning topics and word embeddings was still absent prior to this paper. Focusing on clinical data analysis, word embedding and topic modeling have been applied to many tasks. Considering ICD code assignment as an example, many methods have been proposed to estimate the ICD codes based on clinical records [39, 5, 31, 22], aiming to accelerate diagnoses. Other tasks, like clustering clinical data and the prediction of treatments, can also be achieved by NLP techniques [4, 19, 11]. Wasserstein learning and its application in NLP The Wasserstein distance has been proven useful in distribution estimation [9], alignment [44] and clustering [1, 43, 14], avoiding over-smoothed intermediate interpolation results. It can also be used as loss function when learning generative models [12, 3]. The main bottleneck of the application of Wasserstein learning is its high computational complexity. This problem has been greatly eased since Sinkhorn distance was proposed in [13]. Based on Sinkhorn distance, we can apply iterative Bregman projection [7] to approximate Wasserstein distance, and achieve a near-linear time complexity [2]. Many more complicated models have been proposed based on Sinkhorn distance [16, 36]. Focusing on NLP tasks, the methods in [26, 21] use the same framework as ours, computing underlying distances based on word embeddings and measuring the distance between documents in the Wasserstein space. However, the work in [26] does not update the pretrained embeddings, while the model in [21] does not have a hierarchical architecture for topic modeling. Model distillation As a kind of transfer learning techniques, model distillation was originally proposed to learn a simple model (student) under the guidance of a complicated model (teacher) [20]. When learning the target-distilled model, a regularizer based on the smoothed outputs of the complicated model is imposed. Essentially, the distilled complicated model provides the target model with some privileged information [29]. This idea has been widely used in many applications, e.g., textual data modeling [23], healthcare data analysis [10], and image classification [18]. Besides transfer learning, the idea of model distillation has been extended to control the learning process of neural networks [34, 35, 42]. To the best of our knowledge, our work is the first attempt to combine model distillation with Wasserstein learning. 5 Experiments To demonstrate the feasibility and the superiority of our distilled Wasserstein learning (DWL) method, we apply it to analysis of admission records of patients, and compare it with state-of-the-art methods. We consider a subset of the MIMIC-III dataset [25], containing 11, 086 patient admissions, corresponding to 56 diseases and 25 procedures, and each admission is represented as a sequence of ICD codes of the diseases and the procedures. Using different methods, we learn the embeddings of the ICD codes and the topics of the admissions and test them on three tasks: mortality prediction, admission-type prediction, and procedure recommendation. For all the methods, we use 50% of the admissions for training, 25% for validation, and the remaining 25% for testing in each task. For our method, the embeddings are obtained by the linear projection of one-hot representations of the ICD codes, which is similar to the Word2Vec [30] and the Doc2Vec [27]. For our method, the loss function L is squared loss. The hyperparameters of our method are set via cross validation: the batch size s = 256, β = 0.01, ϵ = 0.01, the number of topics K = 8, the embedding dimension D = 50, and the learning rate ρ = 0.05. The number of epochs I is set to be 5 when the embeddings are initialized by Word2Vec, and 50 when training from scratch. The distillation parameter is τ = 0.5 empirically, whose influence on learning result is shown in the Supplementary Material. 5.1 Admission classification and procedure recommendation The admissions of patients often have a clustering structure. According to the seriousness of the admissions, they are categorized into four classes in the MIMIC-III dataset: elective, emergency, urgent and newborn. Additionally, diseases and procedures may lead to mortality, and the admissions can be clustered based on whether the patients die or not during their admissions. Even if learned in a unsupervised way, the proposed embeddings should reflect the clustering structure of the admissions to some degree. We test our DWL method on the prediction of admission type and 6 Table 1: Admission classification accuracy (%) for various methods. Word Feature Doc. Feature Metric Dim. Mortality Adm. Type 1-NN 5-NN 1-NN 5-NN — TF-IDF [17] Euclidean 81 69.98±0.05 75.32±0.04 82.27±0.03 88.28±0.02 — LDA [8] 8 66.03±0.06 69.05±0.06 81.41±0.04 86.57±0.04 Word2Vec [30] Doc2Vec [27] 50 57.98±0.08 59.80±0.08 70.57±0.08 79.94±0.07 Word2Vec [30] AvePooling 50 70.42±0.05 75.21±0.04 84.88±0.07 89.16±0.06 Glove [33] AvePooling 50 66.94±0.06 73.21±0.04 81.91±0.05 88.21±0.05 DWL (Scratch) AvePooling 50 71.01±0.12 74.74±0.11 84.54±0.13 89.49±0.12 DWL (Finetune) AvePooling 50 71.52±0.07 75.44±0.07 85.54±0.09 89.28±0.09 Word2Vec [30] Topic weight [36] Euclidean 8 70.31±0.04 74.89±0.04 83.63±0.05 89.25±0.04 DWL (Scratch) 70.45±0.08 74.88±0.07 83.82±0.12 88.80±0.12 DWL (Finetune) 70.88±0.07 75.67±0.07 84.26±0.09 89.13±0.08 Word2Vec [30] Word distribution 81 70.61±0.04 75.92±0.04 84.08±0.05 89.06±0.05 Glove [33] Wasserstein 70.64±0.06 75.97±0.05 83.92±0.08 89.17±0.07 DWL (Scratch) [26] 71.01±0.10 75.88±0.09 84.23±0.12 89.33±0.11 DWL (Finetune) 70.65±0.07 76.00±0.06 84.35±0.08 89.61±0.07 Table 2: Top-N procedure recommendation results for various methods. Method Top-1 (%) Top-3 (%) Top-5 (%) P R F1 P R F1 P R F1 Word2Vec [30] 39.95 13.27 18.25 31.70 33.46 29.30 28.89 46.98 32.59 Glove [33] 32.66 13.01 17.22 29.45 30.99 27.41 27.93 44.79 31.47 DWL (Scratch) 37.89 12.42 17.16 30.14 29.78 27.14 27.39 43.81 30.81 DWL (Finetune) 40.00 13.76 18.71 31.88 33.71 29.58 30.59 48.56 34.28 mortality. For the admissions, we can either represent them by the distributions of the codes and calculate the Wasserstein distance between them, or represent them by the average pooling of the code embeddings and calculate the Euclidean distance between them. A simple KNN classifier can be applied under these two metrics, and we consider K = 1 and K = 5. We compare the proposed method with the following baselines: (i) bag-of-words-based methods like TF-IDF [17] and LDA [8]; (ii) word/document embedding methods like Word2Vec [30], Glove [33], and Doc2Vec [27]; and (iii) the Wasserstein-distance-based method in [26]. We tested various methods in 20 trials. In each trial, we trained different models on a subset of training admissions and tested them on the same testing set, and calculated the averaged results and their 90% confidential intervals. The classification accuracy for various methods are shown in Table 1. Our DWL method is superior to its competitors on classification accuracy. Besides this encouraging result, we also observe two interesting and important phenomena. First, for our DWL method the model trained from scratch has comparable performance to that fine-tuned from Word2Vec’s embeddings, which means that our method is robust to initialization when exploring clustering structure of admissions. Second, compared with measuring Wasserstein distance between documents, representing the documents by the average pooling of embeddings and measuring their Euclidean distance obtains comparable results. Considering the fact that measuring Euclidean distance has much lower complexity than measuring Wasserstein distance, this phenomenon implies that although our DWL method is time-consuming in the training phase, the trained models can be easily deployed for large-scale data in the testing phase. The third task is recommending procedures according to the diseases in the admissions. In our framework, this task can be solved by establishing a bipartite graph between diseases and procedures based on the Euclidean distance between their embeddings. The proposed embeddings should reflect the clinical relationships between procedures and diseases, such that the procedures are assigned to the diseases with short distance. For the m-th admission, we may recommend a list of procedures with length L, denoted as Em, based on its diseases and evaluate recommendation results based on the ground truth list of procedures, denoted as Tm. In particular, given {Em, Tm}, we calculate the top-L precision, recall and F1-score as follows: P = PM m=1 Pm = PM m=1 |Em∩Tm| |Em| , R = PM m=1 Rm = PM m=1 |Em∩Tm| |Tm| , F1 = PM m=1 2PmRm Pm+Rm . Table 2 shows the performance of various methods with L = 1, 3, 5. We find that although our DWL method is not as good as the Word2Vec when the model is trained from scratch, which may be caused by the much fewer epochs we executed, it indeed outperforms other methods when the model is fine-tuned from Word2Vec. 7 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● d_4019 d_41401 d_4241 d_V4582 d_2724 d_486 d_99592 d_51881 d_5990 d_5849 d_78552 d_25000 d_2449 d_41071 d_4280 d_4168 d_412 d_2761 d_2720 d_2762 d_0389 d_4589 d_42731 d_2859 d_311 d_V3001 d_V053 d_4240 d_V3000 d_7742 d_42789 d_5070 d_V502 d_2760 d_V1582 d_40390 d_V4581 d_V290 d_5845 d_2875 d_2767 d_32723 d_V5861 d_2851 d_53081 d_496 d_40391 d_9971 d_5119 d_2749 d_5859 d_49390 d_45829 d_3051 d_V5867 d_5180 p_9604 p_9671 p_3615 p_3961 p_8872 p_9904 p_9907 p_9672 p_331 p_3893 p_966 p_3995 p_9915 p_8856 p_9955 p_3891 p_9390 p_9983 p_640 p_3722 p_8853 p_3723 p_5491 p_3324 p_4513 (a) Full graph ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● d_4019 d_41401 d_4241 d_V4582 d_99592 d_5990 d_5849 d_78552 d_25000 d_2449 d_41071 d_4280 d_4168 d_412 d_2761 d_2720 d_2762 d_0389 d_4589 d_2859 d_311 d_V3001 d_V3000 d_42789 d_5070 d_V502 d_2760 d_V1582 d_40390 d_V290 d_5845 d_2875 d_2767 d_32723 d_V5861 d_53081 d_496 d_40391 d_9971 d_2749 d_5859 d_49390 d_45829 d_3051 d_5180 p_9604 p_9671 p_3615 p_3961 p_8872 p_9904 p_9907 p_331 p_3893 p_3995 p_9915 p_8856 p_3891 p_3722 p_8853 p_3723 p_5491 p_4513 (b) Enlarged part 1 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● d_41401 d_25000 d_2449 d_4280 d_4168 d_412 d_2761 d_2720 d_2762 d_4589 d_V3001 d_5070 d_2760 d_V1582 d_40390 d_2875 d_2767 d_32723 d_V5861 d_53081 d_496 d_40391 d_9971 d_2749 d_5859 d_49390 d_45829 p_3615 p_8872 p_3891 p_3722 p_8853 p_4513 (c) Enlarged part 2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● d_4019 d_41401 d_4241 d_V4582 d_99592 d_5990 d_5849 d_78552 d_25000 d_2449 d_41071 d_4280 d_4168 d_412 d_2761 d_2720 d_2762 d_0389 d_4589 d_2859 d_311 d_V3001 d_V3000 d_42789 d_5070 d_V502 d_2760 d_V1582 d_40390 d_V290 d_5845 d_2875 d_2767 d_32723 d_V5861 d_53081 d_496 d_40391 d_9971 d_2749 d_5859 d_49390 d_45829 d_3051 d_5180 p_9604 p_9671 p_3615 p_3961 p_8872 p_9904 p_9907 p_331 p_3893 p_3995 p_9915 p_8856 p_3891 p_3722 p_8853 p_3723 p_5491 p_4513 (d) Enlarged part 3 Figure 2: (a) The KNN graph of diseases and procedures with K = 4. Its enlarged version is in the Supplementary Material. The ICD codes related to diseases are with a prefix “d”, whose nodes are blue, while those related to procedures are with a prefix “p”, whose nodes are orange. (b-d) Three enlarged subgraphs corresponding to the red frames in (a). In each subfigure, the nodes/dots in blue are diseases while the nodes/dots in orange are procedures. Table 3: Top-3 ICD codes in each topic associated with the corresponding diseases/procedures. Topic 1 Topic 2 Topic 3 Topic 4 Topic 5 Topic 6 Topic 7 Topic 8 d_5859 d_4241 d_311 p_8856 d_2449 d_7742 p_9904 d_311 Chronic kidney disease Aortic valve disorders Mycobacteria Coronary arteriography Hypothyroidism Neonatal jaundice Cell transfusion Mycobacteria d_2859 p_3891 d_V3001 d_41071 d_2749 p_9672 d_5119 d_5119 Anemia Arterial catheterization Single liveborn Subendocardial infarction Gout Ventilation Pleural effusion Pleural effusion p_8872 d_9971 d_5849 d_2851 d_41401 p_9907 p_331 d_42731 Heart ultrasound Cardiac complications Kidney failure Posthemorrhagic anemia Atherosclerosis Serum transfusion Incision of lung Atrial fibrillation 5.2 Rationality Analysis To verify the rationality of our learning result, in Fig. 2 we visualize the KNN graph of diseases and procedures. We can find that the diseases in Fig. 2(a) have obvious clustering structure while the procedures are dispersed according to their connections with matched diseases. Furthermore, the three typical subgraphs in Fig. 2 can be interpreted from a clinical viewpoint. Figure 2(b) clusters cardiovascular diseases like hypotension (d_4589, d_45829) and hyperosmolality (d_2762) with their common procedure, i.e., diagnostic ultrasound of heart (p_8872). Figure 2(c) clusters coronary artery bypass (p_3615) with typical postoperative responses like hyperpotassemia (d_2767), cardiac complications (d_9971) and congestive heart failure (d_4280). Figure 2(d) clusters chronic pulmonary heart diseases (d_4168) with its common procedures like cardiac catheterization (p_3772) and abdominal drainage (p_5491) and the procedures are connected with potential complications like septic shock (d_78552). The rationality of our learning result can also be demonstrated by the topics shown in Table 3. According to the top-3 ICD codes, some topics have obvious clinical interpretations. Specifically, topic 1 is about kidney disease and its complications and procedures; topic 2 and 5 are about serious cardiovascular diseases; topic 4 is about diabetes and its cardiovascular complications and procedures; topic 6 is about the diseases and the procedures of neonatal. We show the map between ICD codes and corresponding diseases/procedures in the Supplementary Material. 6 Conclusion and Future Work We have proposed a novel method to jointly learn the Euclidean word embeddings and a Wasserstein topic model in a unified framework. An alternating optimization method was applied to iteratively update topics, their weights, and the embeddings of words. We introduced a simple but effective model distillation method to improve the performance of the learning algorithm. Testing on clinical admission records, our method shows the superiority over other competitive models for various tasks. Currently, the proposed learning method shows a potential for more-traditional textual data analysis (documents), but its computational complexity is still too high for large-scale document applications (because the vocabulary for real documents is typically much larger than the number of ICD codes considered here in the motivating hospital-admissions application). In the future, we plan to further accelerate the learning method, e.g., by replacing the Sinkhorn-based updating precedure with its variants like the Greenkhorn-based updating method [2]. 8 7 Acknowledgments This research was supported in part by DARPA, DOE, NIH, ONR and NSF. Morgan A. Schmitz kindly helped us by sharing his Wasserstein dictionary learning code. We also thank Prof. Hongyuan Zha at Georgia Institute of Technology for helpful discussions. References [1] M. Agueh and G. Carlier. Barycenters in the Wasserstein space. SIAM Journal on Mathematical Analysis, 43(2):904–924, 2011. [2] J. Altschuler, J. Weed, and P. Rigollet. Near-linear time approximation algorithms for optimal transport via Sinkhorn iteration. arXiv preprint arXiv:1705.09634, 2017. [3] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. [4] J. M. Bajor, D. A. Mesa, T. J. Osterman, and T. A. Lasko. Embedding complexity in the data representation instead of in the model: A case study using heterogeneous medical data. arXiv preprint arXiv:1802.04233, 2018. [5] T. Baumel, J. Nassour-Kassis, M. Elhadad, and N. Elhadad. Multi-label classification of patient notes a case study on ICD code assignment. arXiv preprint arXiv:1709.09587, 2017. [6] M. Belkin and P. Niyogi. Laplacian Eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003. [7] J.-D. Benamou, G. Carlier, M. Cuturi, L. Nenna, and G. Peyré. Iterative Bregman projections for regularized transportation problems. SIAM Journal on Scientific Computing, 37(2):A1111– A1138, 2015. [8] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent Dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003. [9] E. Boissard, T. Le Gouic, J.-M. Loubes, et al. Distribution’s template estimate with Wasserstein metrics. Bernoulli, 21(2):740–759, 2015. [10] Z. Che, S. Purushotham, R. Khemani, and Y. Liu. Distilling knowledge from deep networks with applications to healthcare domain. arXiv preprint arXiv:1512.03542, 2015. [11] E. Choi, M. T. Bahadori, E. Searles, C. Coffey, M. Thompson, J. Bost, J. Tejedor-Sojo, and J. Sun. Multi-layer representation learning for medical concepts. In KDD, 2016. [12] N. Courty, R. Flamary, and M. Ducoffe. Learning Wasserstein embeddings. arXiv preprint arXiv:1710.07457, 2017. [13] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in neural information processing systems, pages 2292–2300, 2013. [14] M. Cuturi and A. Doucet. Fast computation of Wasserstein barycenters. In International Conference on Machine Learning, pages 685–693, 2014. [15] R. Das, M. Zaheer, and C. Dyer. Gaussian LDA for topic models with word embeddings. In ACL (1), pages 795–804, 2015. [16] A. Genevay, G. Peyré, and M. Cuturi. Sinkhorn-AutoDiff: Tractable Wasserstein learning of generative models. arXiv preprint arXiv:1706.00292, 2017. [17] S. Gerard and J. M. Michael. Introduction to modern information retrieval. ISBN, 1983. [18] S. Gupta, J. Hoffman, and J. Malik. Cross modal distillation for supervision transfer. In Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, pages 2827– 2836. IEEE, 2016. [19] H. Harutyunyan, H. Khachatrian, D. C. Kale, and A. Galstyan. Multitask learning and benchmarking with clinical time series data. arXiv preprint arXiv:1703.07771, 2017. [20] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. [21] G. Huang, C. Guo, M. J. Kusner, Y. Sun, F. Sha, and K. Q. Weinberger. Supervised word mover’s distance. In Advances in Neural Information Processing Systems, pages 4862–4870, 2016. [22] J. Huang, C. Osorio, and L. W. Sy. An empirical evaluation of deep learning for ICD-9 code assignment using MIMIC-III clinical notes. arXiv preprint arXiv:1802.02311, 2018. [23] H. Inan, K. Khosravi, and R. Socher. Tying word vectors and word classifiers: A loss framework for language modeling. arXiv preprint arXiv:1611.01462, 2016. 9 [24] T. Joachims. Learning to classify text using support vector machines: Methods, theory and algorithms, volume 186. Kluwer Academic Publishers Norwell, 2002. [25] A. E. Johnson, T. J. Pollard, L. Shen, H. L. Li-wei, M. Feng, M. Ghassemi, B. Moody, P. Szolovits, L. A. Celi, and R. G. Mark. MIMIC-III, a freely accessible critical care database. Scientific data, 3:160035, 2016. [26] M. Kusner, Y. Sun, N. Kolkin, and K. Weinberger. From word embeddings to document distances. In International Conference on Machine Learning, pages 957–966, 2015. [27] Q. Le and T. Mikolov. Distributed representations of sentences and documents. In International Conference on Machine Learning, pages 1188–1196, 2014. [28] Y. Liu, Z. Liu, T.-S. Chua, and M. Sun. Topical word embeddings. In AAAI, pages 2418–2424, 2015. [29] D. Lopez-Paz, L. Bottou, B. Schölkopf, and V. Vapnik. Unifying distillation and privileged information. arXiv preprint arXiv:1511.03643, 2015. [30] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [31] J. Mullenbach, S. Wiegreffe, J. Duke, J. Sun, and J. Eisenstein. Explainable prediction of medical codes from clinical text. arXiv preprint arXiv:1802.05695, 2018. [32] A. Muromägi, K. Sirts, and S. Laur. Linear ensembles of word embedding models. arXiv preprint arXiv:1704.01419, 2017. [33] J. Pennington, R. Socher, and C. 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. [34] G. Pereyra, G. Tucker, J. Chorowski, Ł. Kaiser, and G. Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017. [35] A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu, and R. Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. [36] M. A. Schmitz, M. Heitz, N. Bonneel, F. Ngole, D. Coeurjolly, M. Cuturi, G. Peyré, and J.-L. Starck. Wasserstein dictionary learning: Optimal transport-based unsupervised nonlinear dictionary learning. SIAM Journal on Imaging Sciences, 11(1):643–678, 2018. [37] D. Shen, G. Wang, W. Wang, M. R. Min, Q. Su, Y. Zhang, C. Li, R. Henao, and L. Carin. Baseline needs more love: On simple word-embedding-based models and associated pooling mechanisms. In ACL, 2018. [38] B. Shi, W. Lam, S. Jameel, S. Schockaert, and K. P. Lai. Jointly learning word embeddings and latent topics. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 375–384. ACM, 2017. [39] H. Shi, P. Xie, Z. Hu, M. Zhang, and E. P. Xing. Towards automated ICD coding using deep learning. arXiv preprint arXiv:1711.04075, 2017. [40] C. Villani. Optimal transport: Old and new, volume 338. Springer Science & Business Media, 2008. [41] W. Wang, Z. Gan, W. Wang, D. Shen, J. Huang, W. Ping, S. Satheesh, and L. Carin. Topic compositional neural language model. arXiv preprint arXiv:1712.09783, 2017. [42] Y.-X. Wang and M. Hebert. Learning to learn: Model regression networks for easy small sample learning. In European Conference on Computer Vision, pages 616–634. Springer, 2016. [43] J. Ye, P. Wu, J. Z. Wang, and J. Li. Fast discrete distribution clustering using Wasserstein barycenter with sparse support. IEEE Transactions on Signal Processing, 65(9):2317–2332, 2017. [44] Y. Zemel and V. M. Panaretos. Fréchet means and Procrustes analysis in Wasserstein space. arXiv preprint arXiv:1701.06876, 2017. 10
2018
160
7,320
Inferring Latent Velocities from Weather Radar Data using Gaussian Processes Rico Angell University of Massachusetts Amherst rangell@cs.umass.edu Daniel Sheldon University of Massachusetts Amherst sheldon@cs.umass.edu Abstract Archived data from the US network of weather radars hold detailed information about bird migration over the last 25 years, including very high-resolution partial measurements of velocity. Historically, most of this spatial resolution is discarded and velocities are summarized at a very small number of locations due to modeling and algorithmic limitations. This paper presents a Gaussian process (GP) model to reconstruct high-resolution full velocity fields across the entire US. The GP faithfully models all aspects of the problem in a single joint framework, including spatially random velocities, partial velocity measurements, station-specific geometries, measurement noise, and an ambiguity known as aliasing. We develop fast inference algorithms based on the FFT; to do so, we employ a creative use of Laplace’s method to sidestep the fact that the kernel of the joint process is non-stationary. 1 Introduction Archived data from the US network of weather radars hold valuable information about atmospheric phenomona across the US for over 25 years [1]. Although these radars were designed to monitor weather, they also detect flying animals such as birds, bats, and insects [2]. The information contained in the archive is critical to understanding phenomena ranging from extreme weather to bird migration [3–5]. This paper is concerned with using radar to measure velocity, with the primary goal of gathering detailed information about bird migration. Radar is the most comprehensive source of information about this difficult-to-study phenomenon [5–8], but, historically, most information has gone largely unused due to the sheer size of the data and the difficulty of interpreting it automatically. Recently, analytical advances including machine learning [9, 10] are enabling scientists to begin to conduct larger scale studies [5, 7, 11]. Radar measurements of bird migration density, direction, and speed are important for understanding the biology of bird migration and to guide conservation [11–15]. Machine learning methods to automate the detailed interpretation of radar data will allow scientists to answer questions at the scale of the entire continent and over more than two decades. Doppler radars measure the rate at which objects approach or depart the radar, which gives partial information about their velocity. By making certain smoothness assumptions, it is possible to reconstruct full velocity vectors [9, 16]. However, current methods are limited by rigid smoothness assumptions and summarize all velocity information down to 143 points across the US (the locations of the radar stations) even though the original data has on the order of half a billion measurements for one nationwide snapshot. The goal of this paper is to develop a comprehensive, principled, probabilistic model, together with fast algorithms, to reconstruct spatially detailed velocity fields across the US. There are three critical challenges. First, radars only measure radial velocity, the component of velocity in the direction of 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. the radar beam, so the full velocity is underdetermined. Second, the measured radial velocity may be aliased, which means it is only known up to an additive constant. Third, measurements are tied to station-specific geometry, so it is not clear how to combine data from many stations, for example to fill in gaps in coverage between stations (e.g., see Figure 1(d)). Prior research has primarily addressed these challenges separately, and has been unable to combine information from many radars to reconstruct detailed velocity fields. Our first contribution is a joint Gaussian process (GP) to simultaneously model the radial velocity measurements from all radar stations. While it is natural to model the velocity field itself as a GP, it is not obvious how to model the collection of all station-specific measurements as a GP. We start by positing a GP on latent velocity vectors, and then derive a GP on the measurements such that the station-specific geometry is encoded in the kernel function. Our second contribution is a suite of fast algorithms for inference in this GP, which allows it to scale to very large data sets. We leverage fast FFT-based algorithms for GP kernel operations for points on a regular grid [17–19]. However, these require a stationary kernel, which due to the station-specific geometry, ours is not. We show how to achieve the same speed benefits by using Laplace’s method (for exact inference) so that fast kernel operations can be performed in the space of latent velocities, where the kernel is stationary. Finally, we show how to model aliasing directly within the GP framework by employing a wrapped normal likelihood [9, 20]; this fits seamlessly into our fast approach using Laplace’s method. The result is a first-of-its-kind probabilistic model that jointly models all aspects of the data generation and measurement process; it accepts as input the raw radial velocity measurements, and outputs smooth reconstructed velocity fields. 2 Background and Problem Definition Radar Basics. The US network of weather radars, known as “NEXRAD” radars, consists of 143 radars in the continental US. Each conducts a volume scan or scan every 6 to 10 minutes, during which is rotates its antenna 360 degrees around a fixed vertical axis (one “sweep”) at increasing elevation angles. The result of one scan is a set of raster data products in three-dimensional polar coordinates corresponding to this scanning strategy. One measurement corresponds to a particular antenna position (azimuth and elevation angle) and range; the corresponding volume of atmosphere at this position in the polar grid is called a sample volume. NEXRAD radars collect up to six different data products. For our purposes the most important are reflectivity and radial velocity. Reflectivity measures the density of objects, specifically, the total cross-sectional area of objects in a sample volume that reflect radio waves back to the radar. Radial velocity is the rate at which objects in a sample volume approach or depart the radar, which is measured by analyzing the frequency shift of reflected radio waves (the “Doppler effect”). Radial velocity is illustrated in Figure 1(a). For any given sample volume, radial velocity gives only partial velocity information: the projection of the actual velocity onto a unit vector in the direction of the radar beam. However, if the actual velocity field is smooth, we can often make good inferences about the full velocity. Figure 1(b) shows example radial velocity information measured from the KBGM radar in Binghamton, NY on the night of September 11, 2010, during which there was heavy bird migration. Objects approaching the radar have negative radial velocities (green), and objects departing the radar have positive radial velocities (red). We can infer from the overall pattern that objects (in this case, migrating birds) are moving relatively uniformly from northeast to southwest. Velocity Model. To make inferences of the type in Figure 1(b) we need to simultaneously reason about spatial properties of the velocity field and the measurement geometry. To set up this type of analysis, for the ith sample volume within the domain of one radar station, let ai be the unit vector in the direction from the radar station to the sample volume. This is given by ai = (cos φi cos ρi, sin φi cos ρi, sin ρi) where φi and ρi are the azimuth and elevation angles, respectively. Let zi = (ui, vi, wi) be the actual, unobserved, velocity vector. Then the radial velocity is aT i zi, and the measured radial velocity is yi = aT i zi + ϵi. Here, ϵi ∼N(0, σ2) is zero-mean Gaussian noise that plays the dual role of modeling measurement error and deviations from whatever prior model is chosen for the set of all zi. For example, in the uniform velocity model [16], velocities are assumed to be constant-valued within fixed height bins above ground level within the domain of 2 velocity radar beam radial velocity km km −200 −100 0 100 200 −200 −100 0 100 200 m/s −20 −10 0 10 20 km km −200 −100 0 100 200 −200 −100 0 100 200 m/s −20 −10 0 10 20 (d) (a) (b) (c) Figure 1: Illustration of key concepts: (a) schematic of radial velocity measurement, (b) radial velocity in the vicinity of Binghmaton, NY radar station during bird migration event on Sep 11, 2010, (c) aliased radial velocity, (d) a nationwide mosiac of raw radial velocity data is not easily interpretable, but we can extract a velocity field from this inforation (arrows). See text for explanation. one radar station, which is a very rigid uniformity assumption. Reported values for the noise standard deviation are σ ∈[2, 6] ms−1 for birds, and σ < 2 ms−1 for precipitation [7]. Aliasing. Aliasing complicates the interpretation of radial velocity data. Due to the sampling frequency of the radars, radial velocities can only be resolved up to the Nyquist velocity Vmax, which depends on the operating mode of the radar. If the magnitude of the true radial velocity ri = aT i zi exceeds Vmax, then the measurement will be aliased. The aliasing operation is mathematically equivalent to the modulus operation: for any real number r, define the aliased measurement of r to be ¯r := r mod 2Vmax, with the convention that ¯r lies in the interval [−Vmax, Vmax] instead of [0, 2Vmax]. The values ¯r + 2kVmax, k ∈N will all result in the same aliased measurement, and are called aliases. Effectively, this means that radial velocities will “wrap around” at ±Vmax. For example, Figure 1(c) shows the same data as Figure 1(b), but before aliasing errors have been corrected. In this example Vmax = 11ms−1. We see that that fastest approaching birds in the northeast quadrant appear to be departing (red), instead of approaching (dark green). Multiple Radar Stations. The interpretation of radial velocity is station-specific. Figure 1(d) shows a nationwide mosaic of radial velocity from individual stations, overlaid by a velocity field. The mosaic is very difficult to interpret, due to abrupt changes at the boundaries between station coverage areas. Thus, although we are very accustomed to seeing nationwide composites of radar reflectivity, radial velocity data is not presented or analyzed in this way. This is the main problem we seek to remedy in this work, by reconstructing velocity fields of the type overlaid on Figure 1(d). Related Work. The uniform velocity model [16], described above, makes a strong spatial unformity assumption to reconstruct velocities at different heights in the immediate vicinity of one radar station. Variants of this method are known as velocity volume profiling (VVP) or velocity-azimuthal display (VAD). The uniformity assumptions prevent these algorithms from reconstructing spatially varying velocity fields or combining information from multiple radars. Multi-Doppler methods combine 3 measurements from two or more radars to reconstruct full velocity vectors at points within the overlap of their domains [16, 21, 22]. No spatial smoothness assumptions are made. Full velocity fields can be reconstructed, but only within the overlap of radar domains. Dealiasing is the process of correcting aliasing errors to guess the true radial velocity, usually by making smoothness assumptions or using some external information [23]. Almost all previous work treats the different analytical challenges (reconstruction from spatial cues, multiple stations, dealiasing) separately; a few methods combine dealiasing with VVP or multi-Doppler methods [9, 24, 25]. Our method extends all of these methods into a single, elegant, joint probabilistic model. 3 Modeling Latent Velocities In this section, we present our joint probabilistic model for radial velocity measurements and latent velocities. We begin by considering the problem in the absence of aliasing, and come back to it in Section 4. Likelihood in the absence of aliasing. Let Oi be the set of stations that measure radial velocities at location xi. The likelihood of a single radial velocity measurement yij, in the absence of aliasing, given the latent velocity zi and the radial axis aij, is Gaussian around the perfect radial velocity measurement of the ground-truth latent velocity p(yij|zi; xi) = N(yij; aT ijzi, σ2). (1) The observed radial velocity measurements are conditionally independent given the latent velocities, so the joint likelihood factorizes completely p(y|z; x) = Y i Y j∈Oi p(yij|zi; xi) = Y i Y j∈Oi N(yij; aT ijzi, σ2). (2) GP prior. We model the latent velocity field as a vector-valued GP. The GP prior has a zero-valued mean function and a modified squared exponential kernel. Since the GP is vector-valued, the output of the kernel function is a 3 × 3 matrix of the following form. κθ(xi, xj) = diag  exp −dα(xi, xj) 2βu  , exp −dα(xi, xj) 2βv  , exp −dα(xi, xj) 2βw  (3) dα(xi, xj) = α1(xi,1 −xj,1)2 + α2(xi,2 −xj,2)2 + α3(xi,3 −xj,3)2 (4) The hyperparameters θ = [α, β] are the length scales which control the uniformity of the latent velocity field. Covariance between measurements. Our approach to inferring the latent velocities relies on the ability to jointly model the radial velocity measurements with the latent velocities. In order to accomplish this, we need to have a covariance function relating radial velocity measurements. Intuitively this seems problematic, since the radial velocity measurements not only depend on the location of the measurement, but also the location of the station making the measurement. As it turns out, applying definitions and the process by which radial velocity measurements are made gives the following elegant covariance function. Cov(yij, yi′j′) = E[yijyi′j′] = aT ijE[zizT i′]ai′j′ = aT ijκθ(xi, xi′)ai′j′ Observe that this covariance function is not stationary, since it relies on the locations of the stations from which the measurements were made. Joint modeling measurements and latent velocities. The joint probability distribution between the radial velocity measurements and the latent velocities is p(y, z; x) = p(y|z; x)p(z; x). (5) Since both the likelihood and prior are Gaussian, the joint is also Gaussian. All we need to do to fully specify the joint distribution is to solve for the first two moments of the joint. The joint mean is clearly zero. Let qT = [zT yT ], let A = diag  aT ij | ∀i, j ∈Oi  ∈R3n×n be the matrix defined 4 Algorithm 1 Efficient Inference using Laplace’s Method 1: procedure INFERLATENTVELOCITIES 2: Initialize ν(0) randomly ▷ν(0) = K−1z(0) 3: Initialize ∆ν = ∞ 4: while |∆ν| > τ do ▷τ is some user-defined threshold 5: Compute b = Wzk + ∇l(zk) 6: Compute γ = (W −1 + K)−1Kb using the conjugate gradient method 7: Let ∆ν = b −γ −ν(k) 8: Set ν(k+1) = ν(k) + η∆ν ▷Use Brent’s method to do a line search for η 9: return z∗= Kν∗ so that y ∼N(Az, σ2I), and let K be the prior covariance matrix. The covariance of the joint is as follows E[qqT ] =  z y   zT yT  = " K KAT AKT AKAT + σ2I # (6) Hence, the joint distribution is p(y, z; x) = N  z y  ; 0, " K KAT AKT AKAT + σ2I #! . (7) Naive Exact Inference. Given this joint distribution, we can perform exact inference via Gaussian conditioning. The posterior mean is E[z|y; x] = KAT (AKAT + σ2I)−1y. (8) We can also predict directly at locations ˜z other than those where measurements were made using the cross-covariance matrix ˜K between the locations where measurements were made and prediction locations: E[˜z|y; x] = ˜KAT (AKAT + σ2I)−1y. (9) This method of inference is not scalable since it has cubic time complexity and quadratic space complexity in the number of measurements. 4 Efficient Inference In this section, we discuss how we can perform efficient exact inference despite the lack of a stationary kernel. 4.1 Laplace’s Method for Exact Inference In order to make inference tractable, we would like to use fast FFT-based methods such as SKI and KISS-GP [18], but unfortunately these methods require the kernel to be stationary. To overcome having a non-stationary kernel, we apply Laplace’s method [26]. This is conventionally for approximate inference when the likelihood is not Gaussian, but we use it to be able to utilize fast kernel operations for the latent GP, which is stationary, and the method will still be exact. Laplace’s method replaces one-shot matrix inversion based inference with an iterative algorithm where the most complicated operation is kernel-vector multiplication. If we pick locations to observe radial velocity measurements on a grid Ω, we can perform the matrix-vector multiplication Ks, for an arbitrary vector s, in O(n log n) time, where n = |Ω|. The exact inference procedure we employ is presented in Algorithm 1. Laplace’s method iteratively optimizes log p(z|y; x) by optimizing the second-order Taylor expansion around the current iterate of z via an auxiliary variable ν = K−1z. Let l(z) = log p(z|y; x) be the log likelihood function, ∇l(z) be the gradient of the log likelihood, and W = −∇2l(z) be the negative Hessian. The most challenging operation to make efficient is Line 6 of Algorithm 1. We use the conjugate gradient method to iteratively compute γ. The upshot is that we only need to be able to efficiently compute 5 W −1, multiply W −1 times arbitrary vectors, and multiply K times arbitrary vectors. W is block diagonal with 3 × 3 blocks, which makes for linear time matrix-vector multiplication and inversion. The only other bottleneck for both speed and storage is the kernel matrix. 4.2 Using Grid Structure for Fast Matrix-Vector Multiplication In this section, we detail how we can perform efficient kernel-vector multiplication by exploiting the special structure of the kernel matrix following techniques presented by Wilson [27]. To accomplish this we need to choose the measurements to use as observations from an evenly spaced grid. In most cases, we will not have measurements for all grid points, so we use pseudo-observations to enable the use of grid-based methods. 4.2.1 Missing Observations Given Ωto be the set of grid locations where we would like to have radial velocity measurements, let ˆΩand ˜Ωbe the locations where we have and do not have radial velocity measurements, respectively. For all grid locations xi ∈˜Ω, we sample a pseudo radial velocity measurement yi ∼N(0, ϵ−1), for some small ϵ. This implies the following joint log likelihood: l(z) = X i  1[xi ∈˜Ω] log N(yi; 0, ϵ−1) + 1[xi ∈ˆΩ]  X j∈Oi log N(yij; aT ijzi, σ2)    . (10) 4.2.2 Kronecker-Toeplitz Structure The latent GP can be decomposed into three independent GP’s – namely, over the u, v, and w components of the latent velocities, respectively. Let Ku, Kv, and Kw be kernel matrices for each of these GP’s, respectively, and all have shape n × n. When performing the multiplication Ks, we decompose s into it’s u, v, and w component sub-vectors denoted su, sv, and sw, respectively. Then, we perform each of the multiplications Kusu, Kvsv, and Kwsw, and recombine the results to get Ks. All of these three multiplications are similar since Ku, Kv, and Kw all have the same structure. We use Ku as an example and follow the method proposed by Wilson [27]. Kv and Kw follow the same form. Ku decomposes into the Kronecker product Ku,1 ⊗Ku,2 ⊗Ku,3, where Ku,1, Ku,2, and Ku,3 are all Toeplitz, since Ku is stationary. Ku,1 has shape n1 × n1, Ku,2 has shape n2 × n2, and Ku,3 has shape n3 × n3 where n1, n2, and n3 are the dimensions of the grid, respectively. Hence, n = n1n2n3. Let Su be the n1 × n2 × n3 tensor formed by reshaping su to match the grid dimensions. Then Kusu = 3 O i=1 Ku,i ! su = vec Su ×1 Ku,1 ×2 Ku,2 ×3 Ku,3 ! . Here, the operation T ×i Mi denotes the i-mode product of the tensor T ∈Rn1×n2×n3 and matrix Mi ∈Rni×ni. The result is another tensor T′ with the same dimensions. It is computed by first reshaping T into a matrix T(i) of size ni × Q j̸=i nj, then computing the matrix product MiT(i), and finally reshaping the result back into an n1 × n2 × n3 tensor — see [28] for details. In our case, since each matrix multiplication is between a Toeplitz matrix Ku,i and a matrix T(i) with n entries, it can be done in O(n log n) time using the FFT [29]. Therefore, the overall running time is also O(n log n). 4.3 Handling Aliased Data In this section, we extend our model to handle aliased radial velocity measurements. Recall that aliasing means that radial velocities are only known up to an additive multiple of twice the Nyquist velocity Vmax, which varies by operating mode of the radar. Conditions favorable for bird migration often correspond to low values of Vmax and exacerbate aliasing problems. To accommodate aliasing, we change the likelihood to model the aliasing process using a wrapped normal likelihood [20]: p(yij|zi; xi) = Nw(yij|aT ijzi, σ2) = ∞ X k=−∞ N(yij + 2kVmax,j; aT ijzi, σ2) (11) 6 This is simply the marginal density of all aliases of yij. The infinite sum cannot be computed analytically, so we approximate it with a finite number of aliases, ℓ, which is known to perform well [9, 30, 31]. p(yij|zi; xi) ≈N ℓ w(yij|aT ijzi, σ2) = ℓ X k=−ℓ N(yij −aT ijzi + 2kVmax,j; 0, σ2) (12) Recall that ¯r aliases r to the interval [−Vmax, Vmax], so the sum on the right-hand side is over the 2ℓ+ 1 aliases of yij that are closest to the predicted value aT ijzi. Since our efficient inference method only relies on the likelihood only through its gradient and Hessian, we can simply plug these new functions into the algorithm presented in Algorithm 1. Observe that this likelihood is no longer Gaussian, and thus we are no longer performing exact inference using Laplace’s method. 5 Experiments In this section, we present the results from experiments to evaluate the effectiveness of the method we presented in the previous section. The first two experiments analyze data scans from 13 radar stations from the northeast US on the night of September 11, 2010. In all experiments, hyperparameters are fixed at values chosen through preliminary experiments to match the expected smoothness of the data, so that the RMSE between inferred radial velocities and raw measurements match values from velocity models used in prior research [7, 9]. Comparison of inference methods. First, we compare our fast inference method against the naive inference method. In our experiments we first resample data from all radar stations onto a fixed resolution grid. Each grid point has zero or more observations from different radar stations. The naive method operates only on the actual observations m, and its running time is O(m3). Our grid-based method operates on all n grid points, and its per-iteration running time is O(n log n). To tractably perform naive inference we must subsample the m observations even further. We consider a range of different sizes both for the base grid and the subsampled data set for the naive method. Figure 2 shows the time vs. error for six different methods. The data set consists of radar scans from 13 radar stations from the northeast US on the night of September 11, 2010, and, for this test, is preprocessed to eliminate aliasing errors [9]. Error is measured by first inferring the full velocity vector for each observation and then projecting it using the station-specific geometry to compute the RMSE between the predicted and observed radial velocities. To fairly compare RMSE values across the six methods, the naive method must predict values for all observations, not just its subsample. To do this, we use the method presented in Equation 9. Each method was run on six different three-dimensional grids with total sizes ranging from 51,200 to 219,700 grid points. We compare our fast inference method against five different subsample sizes for the naive method. Every experiment was run 10 times and the average time and RMSE is reported in Figure 2. The grid-based Laplace’s method vastly outperforms the naive method. Not only does the naive method get slower with an increase in grid size, but it also starts to perform worse, since it has to make predictions at a finer resolution from the same number of subsampled observations. Note that the naive method is also making predictions at roughly an order of magnitude fewer locations than the fast method because there are many grid points with zero observations. Comparison of likelihood functions. Next, we show in Figure 4 the importance of the wrapped normal likelihood when dealing with aliased data. We use the raw radial velocity data from 13 radar stations in the northeast US from the night of September 11, 2010. Figure 4(a) shows the inferred velocity field using our method with the Gaussian likelihood and Figure 4(b) shows the inferred velocity field using our method with the wrapped normal likelihood. Observe the region of the velocity field highlighted by the rectangle. The inference method with Gaussian likelihood fails to infer a reasonable velocity field in the presence of heavily aliased radial velocity measurements and has a substantially higher RMSE1 than the method with the wrapped normal likelihood. The latter model correctly infers from raw aliased radial velocities that the birds over those stations are flying in the same general direction as birds over nearby stations. 1For aliased data, RMSE is measured between the observed value and the closest alias of the predicted value. 7 Figure 2: Time vs. RMSE of radial velocity measurements using six different methods for latent velocity inference. Figure 3: Density and velocity of bird migration on night of May 2, 2015. Northward migration occurs across the US, and is intense in the central US. (a) Gaussian Likelihood, RMSE=6.21 (b) Wrapped Normal Likelihood, RMSE=4.61 Figure 4: Inference method performance using two likelihood functions on aliased data. Grid size is 100 × 100 × 9; only the lowest elevation (500m above ground level) is displayed. Scaling to the continental US. A unique aspect of our method is that it can, for the first time, assimilate data from all radar stations to reconstruct spatially detailed velocity fields across the whole US. An example is shown in Figure 1(d), which depicts northward bird migration on the night of May 2, 2015. The grid size is 240 × 120 × 10; only the lowest elevation and every 5th velocity measurement is plotted. The reconstructed velocities can be combined with reflectivity data as shown in Figure 3 to observe both the density and velocity of migration. Future work can conduct quantitative analyses of migration biology using these measurements. 6 Conclusion and Future Work We presented the first comprehensive solution to the problem of inferring latent velocities from radial velocity measurements from weather radar stations across the US. Our end-to-end method probabilistic model begins with raw radial velocity from many radar stations, and outputs valuable information about migration patterns of birds at scale. We presented a novel method to perform fast grid-based posterior inference even though our GP does not have a stationary kernel. The results of our methods can be used by ecologists to expand human knowledge about bird movements to advance conservation efforts and science. Our current method is most suited to smooth velocity fields, such as those that occur during bird migration. A promising line of future work is to extend our techniques to infer wind velocity fields by measuring velocity of precipitation and wind-borne particles. We anticipate that our GP methodology 8 can also apply to this domain, but we will need to experiment with different kernels better suited to these velocity fields, which can be much more complex. Acknowledgments This material is based upon work supported by the National Science Foundation under Grant Nos. 1522054 and 1661259. References [1] Timothy D. Crum and Ron L. Alberty. The WSR-88D and the WSR-88D operational support facility. Bulletin of the American Meteorological Society, 74(9):1669–1687, 1993. [2] Thomas H. Kunz, Sidney A. Gauthreaux, Jr, Nickolay I. Hristov, Jason W. Horn, Gareth Jones, Elisabeth K. V. Kalko, Ronald P. Larkin, Gary F. McCracken, Sharon M. Swartz, Robert B. Srygley, Robert Dudley, John K. Westbrook, and Martin Wikelski. Aeroecology: probing and modeling the aerosphere. Integrative and Comparative Biology, 48(1):1–11, 2008. [3] J.T. Johnson, Pamela L. MacKeen, Arthur Witt, E. De Wayne Mitchell, Gregory J. Stumpf, Michael D. Eilts, and Kevin W. Thomas. The storm cell identification and tracking algorithm: An enhanced WSR-88D algorithm. Weather and forecasting, 13(2):263–276, 1998. [4] Richard A. Fulton, Jay P. Breidenbach, Dong-Jun Seo, Dennis A. Miller, and Timothy O’Bannon. The WSR-88D rainfall algorithm. Weather and Forecasting, 13(2):377–395, 1998. [5] Andrew Farnsworth, Benjamin M. Van Doren, Wesley M. Hochachka, Daniel Sheldon, Kevin Winner, Jed Irvine, Jeffrey Geevarghese, and Steve Kelling. A characterization of autumn nocturnal migration detected by weather surveillance radars in the northeastern USA. Ecological Applications, 26(3):752–770, 2016. ISSN 1939-5582. [6] Jeffrey J. Buler and Robert H. Diehl. Quantifying bird density during migratory stopover using weather surveillance radar. IEEE Transactions on Geoscience and Remote Sensing, 47(8): 2741–2751, 2009. [7] Adriaan M. Dokter, Felix Liechti, Herbert Stark, Laurent Delobbe, Pierre Tabary, and Iwan Holleman. Bird migration flight altitudes studied by a network of operational weather radars. Journal of the Royal Society Interface, page rsif20100116, 2010. [8] Judy Shamoun-Baranes, Andrew Farnsworth, Bart Aelterman, Jose A. Alves, Kevin Azijn, Garrett Bernstein, Sérgio Branco, Peter Desmet, Adriaan M. Dokter, Kyle Horton, Steve Kelling, Jeffrey F. Kelly, Hidde Leijnse, Jingjing Rong, Daniel Sheldon, Wouter Van den Broeck, Jan Klaas Van Den Meersche, Benjamin Mark Van Doren, and Hans van Gasteren. Innovative Visualizations Shed Light on Avian Nocturnal Migration. PLoS ONE, 11(8):1–15, 2016. [9] Daniel R. Sheldon, Andrew Farnsworth, Jed Irvine, Benjamin Van Doren, Kevin F. Webb, Thomas G. Dietterich, and Steve Kelling. Approximate Bayesian Inference for Reconstructing Velocities of Migrating Birds from Weather Radar. In AAAI, 2013. [10] Aruni RoyChowdhury, Daniel Sheldon, Subhransu Maji, and Erik Learned-Miller. Distinguishing Weather Phenomena from Bird Migration Patterns in Radar Imagery. In CVPR workshop on Perception Beyond the Visual Spectrum (PBVS), pages 1–8, 2016. [11] Horton Kyle G., Van Doren Benjamin M., La Sorte Frank A., Fink Daniel, Sheldon Daniel, Farnsworth Andrew, and Kelly Jeffrey F. Navigating north: how body mass and winds shape avian flight behaviours across a North American migratory flyway. Ecology Letters, 0(0). [12] Frank La Sorte, Wesley Hochachka, Andrew Farnsworth, Daniel Sheldon, Daniel Fink, Jeffrey Geevarghese, Kevin Winner, Benjamin Van Doren, and Steve Kelling. Migration timing and its determinants for nocturnal migratory birds during autumn migration. Journal of Animal Ecology, 84(5):1202–1212, 2015. 9 [13] Frank A. La Sorte, Wesley M. Hochachka, Andrew Farnsworth, Daniel Sheldon, Benjamin M. Van Doren, Daniel Fink, and Steve Kelling. Seasonal changes in the altitudinal distribution of nocturnally migrating birds during autumn migration. 2(12):1–15, 2015. [14] Kyle G. Horton, Benjamin M. Van Doren, Phillip M. Stepanian, Wesley M. Hochachka, Andrew Farnsworth, and Jeffrey F. Kelly. Nocturnally migrating songbirds drift when they can and compensate when they must. Scientific Reports, 6:21249, 2016. [15] Benjamin M. Van Doren, Kyle G. Horton, Adriaan M. Dokter, Holger Klinck, Susan B. Elbin, and Andrew Farnsworth. High-intensity urban light installation dramatically alters nocturnal bird migration. Proceedings of the National Academy of Sciences, 114(42):11175–11180, 2017. [16] Richard J. Doviak. Doppler radar and weather observations. Courier Corporation, 1993. [17] Michael L. Stein, Jie Chen, and Mihai Anitescu. Stochastic Approximation of Score Functions for Gaussian Processes. The Annals of Applied Statistics, 7(2):1162–1191, 2013. [18] Andrew Wilson and Hannes Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In International Conference on Machine Learning, pages 1775–1784, 2015. [19] Jonathan R. Stroud, Michael L. Stein, and Shaun Lysen. Bayesian and Maximum Likelihood Estimation for Gaussian Processes on an Incomplete Lattice. Journal of Computational and Graphical Statistics, 26(1):108–120, 2017. [20] Ernst Breitenberger. Analogues of the Normal Distribution on the Circle and the Sphere. Biometrika, 50(1/2):81–88, 1963. [21] Peter S. Ray and Karen L. Sangren. Multiple-Doppler Radar Network Design. Journal of climate and applied meteorology, 22(8):1444–1454, 1983. [22] Edin Insanic and Paul R. Siqueira. A Maximum Likelihood Approach to Estimation of Vector Velocity in Doppler Radar Networks. IEEE Transactions on Geoscience and Remote Sensing, 50(2):553–567, 2012. [23] William R. Bergen and Steven C. Albers. Two-and Three-dimensional De-aliasing of Doppler Radar Velocities. Journal of Atmospheric and Oceanic technology, 5(2):305–319, 1988. [24] Pierre Tabary, Georges Scialom, and Urs Germann. Real-Time Retrieval of the Wind from Aliased Velocities Measured by Doppler Radars. Journal of Atmospheric and Oceanic technology, 18(6):875–882, 2001. [25] Jidong Gao and Kelvin K. Droegemeier. A Variational Technique for Dealiasing Doppler Radial Velocity Data. Journal of Applied Meteorology, 43(6):934–940, 2004. [26] Carl Edward Rasmussen and Christopher K.I. Williams. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2005. ISBN 026218253X. [27] Andrew Gordon Wilson. Covariance kernels for fast automatic pattern discovery and extrapolation with Gaussian processes. PhD thesis, University of Cambridge, 2014. [28] Tamara G. Kolda and Brett W. Bader. Tensor Decompositions and Applications. SIAM review, 51(3):455–500, 2009. [29] Martin Ohsmann. Fast transforms of Toeplitz matrices. Linear algebra and its applications, 231:181–192, 1995. [30] Yannis Agiomyrgiannakis and Yannis Stylianou. Wrapped Gaussian mixture models for modeling and high-rate quantization of phase data of speech. IEEE Transactions on Audio, Speech, and Language Processing, 17(4):775–786, 2009. [31] Claus Bahlmann. Directional features in online handwriting recognition. Pattern Recognition, 39(1):115–125, 2006. 10
2018
161
7,321
Generating Informative and Diverse Conversational Responses via Adversarial Information Maximization Yizhe Zhang Michel Galley Jianfeng Gao Zhe Gan Xiujun Li Chris Brockett Bill Dolan Microsoft Research, Redmond, WA, USA {yizzhang,mgalley,jfgao,zhgan,xiul,chrisbkt,billdol}@microsoft.com Abstract Responses generated by neural conversational models tend to lack informativeness and diversity. We present a novel adversarial learning method, called Adversarial Information Maximization (AIM) model, to address these two related but distinct problems. To foster response diversity, we leverage adversarial training that allows distributional matching of synthetic and real responses. To improve informativeness, we explicitly optimize a variational lower bound on pairwise mutual information between query and response. Empirical results from automatic and human evaluations demonstrate that our methods significantly boost informativeness and diversity. 1 Introduction Neural conversational models are effective in generating coherent and relevant responses [1, 2, 3, 4, etc.]. However, the maximum-likelihood objective commonly used in these neural models fosters generation of responses that average out the responses in the training data, resulting in the production of safe but bland responses [5]. We argue that this problem is in fact twofold. The responses of a system may be diverse but uninformative (e.g.,“I don’t know”, “I haven’t a clue”, “I haven’t the foggiest”, “I couldn’t tell you”), and conversely informative but not diverse (e.g., always giving the same generic responses such as “I like music”, but never “I like jazz”). A major challenge, then, is to strike the right balance between informativeness and diversity. On the one hand, we seek informative responses that are relevant and fully address the input query. Mathematically, this can be measured via Mutual Information (MI) [5], by computing the reduction in uncertainty about the query given the response. On the other hand, diversity can help produce responses that are more varied and unpredictable, which contributes to making conversations seem more natural and human-like. The MI approach of [5] conflated the problems of producing responses that are informative and diverse, and subsequent work has not attempted to address the distinction explicitly. Researchers have applied Generative Adversarial Networks (GANs) [6] to neural response generation [7, 8]. The equilibrium for the GAN objective is achieved when the synthetic data distribution matches the real data distribution. Consequently, the adversarial objective discourages generating responses that demonstrate less variation than human responses. However, while GANs help reduce the level of blandness, the technique was not developed for the purpose of explicitly improving either informativeness or diversity. We propose a new adversarial learning method, Adversarial Information Maximization (AIM), for training end-to-end neural response generation models that produce informative and diverse conversational responses. Our approach exploits adversarial training to encourage diversity, and explicitly maximizes a Variational Information Maximization Objective (VIMO) [9, 10] to produce 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. informative responses. To leverage VIMO, we train a backward model that generates source from target. The backward model guides the forward model (from source to target) to generate relevant responses during training, thus providing a principled approach to mutual information maximization. This work is the first application of a variational mutual information objective in text generation. To alleviate the instability in training GAN models, we propose an embedding-based discriminator, rather than the binary classifier used in traditional GANs. To reduce the variance of gradient estimation, we leverage a deterministic policy gradient algorithm [11] and employ the discrete approximation strategy in [12]. We also employ a dual adversarial objective inspired by [13, 14, 15], which composes both source-to-target (forward) and target-to-source (backward) objectives. We demonstrate that this forward-backward model can work synergistically with the variational information maximization loss. The effectiveness of our approach is validated empirically on two social media datasets. 2 Method 2.1 Model overview S ˜T˜T S T p✓ pe(S, T) qφ p(S, T) D Figure 1: Overview of the Adversarial Information Maximization (AIM) model for neural response generation. Orange for real data, and blue for generated fake response. pepS, Tq represent encoder joint distribution, explained later. Let D “ tpSi, TiquN i“1 denote a set of N single-turn conversations, where Si represents a query (i.e., source), Ti is the response to Si (i.e., target). We aim to learn a generative model pθpT|Sq that produces both informative and diverse responses for arbitrary input queries. To achieve this, we propose the Adversarial Information Maximization (AIM), illustrated in Figure 1, where (i) adversarial training is employed to learn the conditional distribution pθpT|Sq, so as to improve the diversity of generated responses over standard maximum likelihood training, and (ii) variational information maximization is adopted to regularize the adversarial learning process and explicitly maximize mutual information to boost the informativeness of generated responses. In order to perform adversarial training, a discriminator Dψp¨, ¨q is used to distinguish real query-response pairs pS, Tq from generated synthetic pairs pS, ˜Tq, where ˜T is synthesized from pθpT|Sq given the query S. In order to evaluate the mutual information between S and ˜T, a backward proposal network qφpS|Tq calculates a variational lower bound over the mutual information. In summary, the objective of AIM is defined as following min ψ max θ,φ LAIMpθ, φ, ψq “ LGANpθ, ψq ` λ ¨ LMIpθ, φq , (1) where LGANpθ, ψq represents the objective that accounts for adversarial learning, while LMIpθ, φq denotes the regularization term corresponding to the mutual information, and λ is a hyperparameter that balances these two parts. 2.2 Diversity-encouraging objective x1 x1 x2 x2 … H0 H0 Word embedding Convolving Convolving Z y1 y1 y2 y2 LSTM LSTM H3 H3 y3 y3 LSTM soft-argmax H1 H1 H2 H2 Figure 2: Illustration of the CNN-LSTM conditional generator. Generator The conditional generator pθpT|Sq that produces neural response T “ py1, . . . , ynq given the source sentence S “ px1, . . . , xmq and an isotropic Gaussian noise vector Z is shown in Figure 2. The noise vector Z is used to inject noise into the generator to prompt diversity of generated text. Specifically, a 3-layer convolutional neural network (CNN) is employed to encode the source sentence S into a fixed-length hidden vector H0. A random noise vector Z with the same dimension of H0 is then added to H0 element-wisely. 2 This is followed by a series of long short-term memory (LSTM) units as decoder. In our model, the t-th LSTM unit takes the previously generated word yt´1, hidden state Ht´1, H0 and Z as input, and generates the next word yt that maximizes the probability over the vocabulary set. However, the argmax operation is used, instead of sampling from a multinomial distribution as in the standard LSTM. Thus, all the randomness during the generation is clamped into the noise vector Z, and the reparameterization trick [16] can be used (see Eqn. (4)). However, the argmax operation is not differentiable, thus no gradient can be backpropagated through yt. Instead, we adopt the soft-argmax approximation [12] below: onehotpytq « softmax ´ pV ¨ Htq ¨ 1{τ ¯ , (2) where V is a weight matrix used for computing a distribution over words. When the temperature τ Ñ 0, the argmax operation is exactly recovered [12], however the gradient will vanish. In practice, τ should be selected to balance the approximation bias and the magnitude of gradient variance, which scales up nearly quadratically with 1{τ. Note that when τ “ 1 this recovers the setting in [8]. However, we empirically found that using a small τ would result in accumulated ambiguity when generating words in our experiment. S ˜T˜T T Wt <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> Wt <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> <latexit sha1_base64="OJnVQbmakRfaSEjsqJVFSJkYmls=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsN+3SzSbsToQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MJXCoOt+O6WNza3tnfJuZW/4PCoenzSNkm mGfdZIhPdDanhUijuo0DJu6nmNA4l74ST27nfeLaiEQ94jTlQUxHSkSCUbTSQ2eAg2rNrbsLkHXiFaQGBVqD6ld/mLAs5gqZpMb0PDfFIKcaBZN8VulnhqeU TeiI9yxVNOYmyBenzsiFVYkSrQthWSh/p7IaWzMNA5tZ0xbFa9ufif18swuglyodIMuWLRVEmCSZk/jcZCs0ZyqklGlhbyVsTDVlaNOp2BC81ZfXSfuq7r l175RazaKOMpwBudwCR5cQxPuoAU+MBjBM7zCmyOdF+fd+Vi2lpxi5hT+wPn8ATrAjbQ=</latexit> Ws <latexit sha1_base64="uVByG7r0znAxWqYqavkz9fXIR8=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsJ+3SzSbsboQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MBVcG9f9dkobm1vbO+Xdyt7+weFR9fikrZN MfRZIhLVDalGwSX6huB3VQhjUOBnXByO/c7T6g0T+SjmaYxHQkecQZNVZ6Az0oFpz6+4CZJ14BalBgdag+tUfJiyLURomqNY9z01NkFNlOBM4q/QzjSl EzrCnqWSxqiDfHqjFxYZUiRNmShizU3xM5jbWexqHtjKkZ61VvLv7n9TIT3Q5l2lmULloigTxCRk/jcZcoXMiKklClubyVsTBVlxqZTsSF4qy+vk/ZV3X Pr3n2j1mwUcZThDM7hEjy4hibcQt8YDCZ3iFN0c4L86787FsLTnFzCn8gfP5Azk8jbM=</latexit> <latexit sha1_base64="uVByG7r0znAxWqYqavkz9fXIR8=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsJ+3SzSbsboQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MBVcG9f9dkobm1vbO+Xdyt7+weFR9fikrZN MfRZIhLVDalGwSX6huB3VQhjUOBnXByO/c7T6g0T+SjmaYxHQkecQZNVZ6Az0oFpz6+4CZJ14BalBgdag+tUfJiyLURomqNY9z01NkFNlOBM4q/QzjSl EzrCnqWSxqiDfHqjFxYZUiRNmShizU3xM5jbWexqHtjKkZ61VvLv7n9TIT3Q5l2lmULloigTxCRk/jcZcoXMiKklClubyVsTBVlxqZTsSF4qy+vk/ZV3X Pr3n2j1mwUcZThDM7hEjy4hibcQt8YDCZ3iFN0c4L86787FsLTnFzCn8gfP5Azk8jbM=</latexit> <latexit sha1_base64="uVByG7r0znAxWqYqavkz9fXIR8=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsJ+3SzSbsboQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MBVcG9f9dkobm1vbO+Xdyt7+weFR9fikrZN MfRZIhLVDalGwSX6huB3VQhjUOBnXByO/c7T6g0T+SjmaYxHQkecQZNVZ6Az0oFpz6+4CZJ14BalBgdag+tUfJiyLURomqNY9z01NkFNlOBM4q/QzjSl EzrCnqWSxqiDfHqjFxYZUiRNmShizU3xM5jbWexqHtjKkZ61VvLv7n9TIT3Q5l2lmULloigTxCRk/jcZcoXMiKklClubyVsTBVlxqZTsSF4qy+vk/ZV3X Pr3n2j1mwUcZThDM7hEjy4hibcQt8YDCZ3iFN0c4L86787FsLTnFzCn8gfP5Azk8jbM=</latexit> <latexit sha1_base64="uVByG7r0znAxWqYqavkz9fXIR8=">AB6nicb VBNS8NAEJ3Ur1q/qh69LBbBU0mkoMeCF48VTVtoQ9lsJ+3SzSbsboQS+hO8eFDEq7/Im/GbZuDtj4YeLw3w8y8MBVcG9f9dkobm1vbO+Xdyt7+weFR9fikrZN MfRZIhLVDalGwSX6huB3VQhjUOBnXByO/c7T6g0T+SjmaYxHQkecQZNVZ6Az0oFpz6+4CZJ14BalBgdag+tUfJiyLURomqNY9z01NkFNlOBM4q/QzjSl EzrCnqWSxqiDfHqjFxYZUiRNmShizU3xM5jbWexqHtjKkZ61VvLv7n9TIT3Q5l2lmULloigTxCRk/jcZcoXMiKklClubyVsTBVlxqZTsSF4qy+vk/ZV3X Pr3n2j1mwUcZThDM7hEjy4hibcQt8YDCZ3iFN0c4L86787FsLTnFzCn8gfP5Azk8jbM=</latexit> Figure 3: Embedding-based sentence discrimination. Discriminator For the discriminator, we adopt a novel approach inspired by the Deep Structured Similarity Model (DSSM) [17]. As shown in Figure 3, the source sentence S, the synthetic response ˜T and the human response T are all projected to an embedding space with fixed dimensionality via different CNNs1. The embedding network for S is denoted as Ws, while ˜T and T share a network Wt. Given these embeddings, the cosine similarities of WspSq versus Wtp ˜Tq and WtpTq are computed, denoted as DψpT, Sq and Dψp ˜T, Sq, respectively. ψ represents all the parameters in the discriminator. We empirically found that separate embedding for each sentence yields better performance than concatenating pS, Tq pairs. Presumably, mapping pS, Tq pairs to the embedding space requires the embedding network to capture the cross-sentence interaction features of how relevant the response is to the source. Mapping them separately to the embedding space would divide the tasks into a sentence feature extraction sub-task and a sentence feature matching sub-task, rather than entangle them together. Thus the former might be slightly easier to train. Objective The objective of our generator is to minimize the difference between DψpT, Sq and Dψp ˜T, Sq. Conversely, the discriminator tries to maximize such difference. The LGAN part in Eqn. (1) is specified as LGANpθ, ψq “ ´ET, ˜T ,S ” f ´ DψpT, Sq ´ Dψp ˜T, Sq ¯ı , (3) where fpxq fi2tanh´1pxq scales the difference to deliver more smooth gradients. Note that Eqn. (3) is conceptually related to [7] in which the discriminator loss is introduced to provide sequence-level training signals. Specifically, the discriminator is responsible for assessing both the genuineness of a response and the relevance to its corresponding source. The discriminator employed in [7] evaluates a source-target pair by operations like concatenation. However, our approach explicitly structures the discriminator to compare the embeddings using cosine similarity metrics, thus avoiding learning a neural network to match correspondence, which could be difficult. Presumably our discriminator delivers more direct updating signal by explicitly defining how the response is related to the source. The objective in Eqn. (3) also resembles Wasserstein GAN (WGAN) [19] in that without the monotonous scaling function f, the discriminator Dψ can be perceived as the critic in WGAN with embedding-structured regularization. See details in the Supplementary Material. 1Note that encoders based on RNN or pure word embedding [18] are also possible, nevertheless we limit our choice to CNN in this paper. 3 To backpropagate the learning signal from the discriminator Dψ to the generator pθpT|Sq, instead of using the standard policy gradient as in [7], we consider a novel approach related to deterministic policy gradient (DPG) [11], which estimates the gradient as below: ∇θEpp ˜T |S,ZqDψp ˜T, Sq “ EppZq∇˜T Dψp ˜T, Sq∇θ ˜TpS, Zq , (4) where the expectation in Eqn. (4) approximated by Monte Carlo approximation. ˜TpS, Zq is the generated response, as a function of source S and randomness Z. Note that ∇θ ˜TpS, Zq can be calculated because we use the soft-argmax approximation as in (2). The randomness in [7] comes from the softmax-multinomial sampling at each local time step; while in our approach, ˜T is a deterministic function of S and Z, therefore, the randomness is global and separated out from the deterministic propagation, which resembles the reparameterization trick used in variational autoencoder [16]. This separation of randomness allows gradients to be deterministically backpropagated through deterministic nodes rather than stochastic nodes. Consequently, the variance of gradient estimation is largely reduced. 2.3 Information-promoting objective We further seek to explicitly boost the MI between S and ˜T, with the aim of improving the informativeness of generated responses. Intuitively, maximizing MI allows the model to generate responses that are more specific to the source, while generic responses are largely down-weighted. Denoting the unknown oracle joint distribution as ppS, Tq, we aim to find an encoder joint distribution pepS, Tq “ pθpT|SqppSq by learning a forward model pθpT|Sq, such that pepS, Tq approximates ppS, Tq, while the mutual information under pepS, Tq remains high. See Figure 1 for illustration. Empirical success has been achieved in [5] for mutual information maximization. However their approach is limited by the fact that the MI-prompting objective is used only during testing time, while the training procedure remains the same as the standard maximum likelihood training. Consequently, during training the model is not explicitly specified for maximizing pertinent information. The MI objective merely provides a criterion for reweighing response candidates, rather than asking the generator to produce more informative responses in the first place. Further, the hyperparameter that balances the likelihood and anti-likelihood/reverse-likelihood terms is manually selected from p0, 1q, which deviates from the actual MI objective, thus making the setup ad hoc. Here, we consider explicitly maximizing mutual information IpepS, Tq fiEpepS,T q log pepS,T q ppSqpepT q over pepS, Tq during training. However, direct optimization of IpepS, Tq is intractable. To provide a principled approach to maximizing MI, we adopt variational information maximization [9, 10]. The mutual information IpepS, Tq under the encoder joint distribution pepS, Tq is IpepS, Tq fiEpepS,T q log pepS, Tq ppSqpepTq “HpSq ` EpepT qDKLppepS|Tq, qφpS|Tqq ` EpepS,T q log qφpS|Tq ěEppSqEpθpT |Sq log qφpS|Tq fiLMIpθ, φq , (5) pe(S, T) pd(S, T) p(S, T) S T Figure 4: Joint distribution matching of the queryresponse pairs. Details explained in Section 2.4. where Hp¨q denotes the entropy of a random variable, and DKLp¨, ¨q denotes the KL divergence between two distributions. qφpS|Tq is a backward proposal network that approximates the unknown pepS|Tq. For this backward model qφpS|Tq, we use the same CNN-LSTM architecture as the forward model [20]. We denote the MI objective EppSqEpθpT |Sq log qφpS|Tq as LMIpθ, φq, as used in Eqn. (1). The gradient of LMIpθ, φq w.r.t. θ can be approximated by Monte Carlo samples using the REINFORCE policy gradient method [21] ∇θLMIpθ, φq “ EpθpT |Sqrlog qφpS|Tq ´ bs ¨ ∇θ log pθpT|Sq , ∇φLMIpθ, φq “ EpθpT |Sq∇θ log qφpS|Tq , (6) where b is denoted as a baseline. Here we choose a simple empirical average for b [21]. Note that more sophisticated baselines based on 4 neural adaptation [22] or self-critic [23] can be also employed. We complement the policy gradient objective with small proportion of likelihood-maximization loss, which was shown to stabilize the training as in [24]. As an alternative to the REINFORCE approach used in (6), we also considered using the same DPG-like approach as in (4) for approximated gradient calculation. Compared to the REINFORCE approach, the DPG-like method yields lower variance, but is less memory efficient in this case. This is because the LMIpθ, φq objective requires the gradient first back-propagated to synthetic text through all backward LSTM nodes, then from synthetic text back-propagated to all forward LSTM nodes, where both steps are densely connected. Hence, the REINFORCE approach is used in this part. 2.4 Dual Adversarial Learning One issue of the above approach is that learning an appropriate qφpS|Tq is difficult. Similar to the forward model, this backward model qφpS|Tq may also tend to be “bland” in generating source from the target. As illustrated in Figure 4, supposing that we define a decoder joint distribution pdpS, Tq “ qφpS|TqppTq, this distribution tends to be flat along T axis (i.e., tending to generate the same source giving different target inputs). Similarly, pepS, Tq tends to be flat along the S axis as well. To address this issue, inspired by recent work on leveraging “cycle consistency” for image generation [13, 25], we implement a dual objective that treats source and target equally, by complementing the objective in Eqn. (1) with decoder joint distribution matching, which can be written as min ψ max θ,φ LDAIM “ ´EpT, ˜T ,Sq„pe θfpDψpS, Tq ´ DψpS, ˜Tqq ´ EpT, ˜S,Sq„pd φfpDψpS, Tq ´ Dψp ˜S, Tqq ` λ ¨ EppSqEpθpT |Sq log qφpS|Tq ` λ ¨ EppT qEqφpS|T q log pθpT|Sq , (7) S ˜T˜T S T ˜S˜S T p✓ p✓ qφ qφ D D pe(S, T) pd(S, T) p(S, T) Figure 5: Dual objective for Adversarial Information Maximization (AIM). where λ is a hyperparameter to balance the GAN loss and the MI loss. An illustration is shown in Figure 5. With this dual objective, the forward and backward model are symmetric and collaborative. This is because a better estimation of the backward model qφpS|Tq will render a more accurate evaluation of the mutual information IpepS, Tq, which the optimization for the forward model is based on. Correspondingly, the improvement over the forward model will also provide positive impact on the learning of the backward model. As a consequence, the forward and backward models work in a synergistic manner to simultaneously make the encoder joint distribution pepS, Tq and decoder joint distribution pdpS, Tq match the oracle joint distribution ppS, Tq. Further, as seen in Eqn. (7), the discriminators for pepS, Tq and pdpS, Tq are shared. Such sharing allows the model to borrow discriminative features from both sides, and augments the synthetic data pairs (both pS, ˜Tq and p ˜S, Tq) for the discriminator. Presumably, this can facilitate discriminator training especially when source-target correspondence is difficult to learn. We believe that this approach would also improve the generation diversity. To understand this, notice that we are maximizing a surrogate objective of IpdpS, Tq, which can be written as IpdpS, Tq “ HpTq ´ HpT|Sq. (8) When optimizing θ, the backward model qd φpS|Tq is fixed and HpT|Sq remains constant. Thereby optimizing IpdpS, Tq with respect to θ can be understood as equivalently maximizing HpTq, which promotes the diversity of generated text. 3 Related Work Our work is closely related to [5], where an information-promoting objective was proposed to directly optimize an MI-based objective between source and target pairs. Despite the great success of this 5 approach, the use of the additional hyperparameter for the anti-likelihood term renders the objective only an approximation to the actual MI. Additionally, the MI objective is employed only during testing (decoding) time, while the training procedure does not involve such an MI objective and is identical to standard maximum-likelihood training. Compared with [5], our approach considers optimizing a principled MI variational lower bound during training. Adversarial learning [6, 26] has been shown to be successful in dialog generation, translation, image captioning and a series of natural language generation tasks [7, 12, 27, 28, 29, 30, 31, 32, 33, 34]. [7] leverages adversarial training and reinforcement learning to generate high quality responses. Our adversarial training differs from [7] in both the discriminator and generator design: we adopt an embedding-based structured discriminator that is inspired by the ideas from Deep Structured Similarity Models (DSSM) [17]. For the generator, instead of performing multinomial sampling at each generating step and leveraging REINFORCE-like method as in [7], we clamp all the randomness in the generation process to an initial input noise vector, and employ a discrete approximation strategy as used in [12]. As a result, the variance of gradient estimation is largely reduced. Unilke previous work, we seek to make a conceptual distinction between informativeness and diversity, and combine the MI and GAN approaches, proposed previously, in a principled manner to explicitly render responses to be both informative (via MI) and diverse (via GAN). Our AIM objective is further extended to a dual-learning framework. This is conceptually related to several previous GAN models in the image domain that designed for joint distribution matching [13, 25, 35, 36, 37]. Among these, our work is mostly related to the Triangle GAN [13]. However, we employ an additional VIMO as objective, which has a similar effect to that of “cycle-consistent” regularization which enables better communication between the forward and backward models. [14] also leverages a dual objective for supervised translation training and demonstrates superior performance. Our work differs from [14] in that we formulate the problem in an adversarial learning setup. It can thus be perceived as conditional distribution matching rather than seeking a regularized maximum likelihood solution. 4 Experiments 4.1 Setups We evaluated our methods on two datasets: Reddit and Twitter. The Reddit dataset contains 2 million source-target pairs of single turn conversations extracted from Reddit discussion threads. The maximum length of sentence is 53. We randomly partition the data as (80%, 10%, 10%) to construct the training, validation and test sets. The Twitter dataset contains 7 million single turn conversations from Twitter threads. We mainly compare our results with MMI [5]2. We evaluated our method based on relevance and diversity metrics. For relevance evaluation, we adopt BLEU [38], ROUGE [39] and three embedding-based metrics following [8, 40]. The Greedy metric yields the maximum cosine similarity over embeddings of two utterances [41]. Similarly, the Average metric [42] considers the average embedding cosine similarity. The Extreme metric [43] obtains sentence representation by taking the largest extreme values among the embedding vectors of all the words it contains, then calculates the cosine similarity of sentence representations. To evaluate diversity, we follow [5] to use Dist-1 and Dist-2, which is characterized by the proportion between the number of unique n-grams and total number of n-grams of tested sentence. However, this metric neglects the frequency difference of n-grams. For example, token A and token B that both occur 50 times have the same Dist-1 score (0.02) as token A occurs 1 time and token B occurs 99 times, whereas commonly the former is considered more diverse that the latter. To accommodate this, we propose to use the Entropy (Ent-n) metric, which reflects how evenly the empirical n-gram distribution is for a given sentence: Ent “ ´ 1 ř w Fpwq ÿ wPV Fpwq log Fpwq ř w Fpwq , where V is the set of all n-grams, Fpwq denotes the frequency of n-gram w. 2We did not compare with [8] since the code is not available, and the original training data used in [8] contains a large portion of test data, owing to data leakage. 6 Table 1: Quantitative evaluation on the Reddit dataset. (˚ is implemented based on [5].) Models Relevance Diversity BLEU ROUGE Greedy Average Extreme Dist-1 Dist-2 Ent-4 seq2seq 1.85 0.9 1.845 0.591 0.342 0.040 0.153 6.807 cGAN 1.83 0.9 1.872 0.604 0.357 0.052 0.199 7.864 AIM 2.04 1.2 1.989 0.645 0.362 0.050 0.205 8.014 DAIM 1.93 1.1 1.945 0.632 0.366 0.054 0.220 8.128 MMI˚ 1.87 1.1 1.864 0.596 0.353 0.046 0.127 7.142 Human 0.129 0.616 9.566 We evaluated conditional GAN (cGAN), adversarial information maximization (AIM), dual adversarial information maximization (DAIM), together with maximum likelihood CNN-LSTM sequence-tosequence baseline on multiple datasets. For comparison with previous state of the art methods, we also include MMI [5]. To eliminate the impact of network architecture differences, we implemented MMI-bidi [5] using our CNN-LSTM framework. The settings, other than model architectures, are identical to [5]. We performed a beam search with width of 200 and choose the hyperparameter based on performance on the validation set. The forward and backward models were pretrained via seq2seq training. During cGAN training, we added a small portion of supervised signals to stabilize the training [24]. For embedding-based evaluation, we used a word2vec embedding trained on GoogleNews Corpus3, recommended by [44]. For all the experiments, we employed a 3-layer convolutional encoder and an LSTM decoder as in [45]. The filter size, stride and the word embedding dimension were set to 5, 2 and 300, respectively, following [46]. The hidden unit size of H0 was set to 100. We set λ to be 0.1 and the supervised-loss balancing parameter to be 0.001. All other hyperparameters were shared among different experiments. All experiments are conducted using NVIDIA K80 GPUs. 4.2 Evaluation on Reddit data Source: I don’t suppose you have my missing socks as well? Human: You can’t sleep either, I see. MMI: I don’t have socks, but I have no idea what you’re talking about. seq2seq: I have one. cGAN: I have one, but I have a pair of them. AIM: I have one left handed. DAIM: Check your pants. Source: Why does *** make such poor cell phones? Isn’t that against the Japanese code? Human: They’re a Korean company MMI: Because they use ads. seq2seq: I don’t know how to use it. cGAN: Because they are more expensive. AIM: Because they aren’t in the store. DAIM: Because they aren’t available in Japan. Source: Why would he throw a lighter at you? Human: He was passing me it. MMI: Why wouldn’t he? seq2seq: I don’t know. cGAN: You don’t? AIM: Though he didn’t use a potato. DAIM: He didn’t even notice that. Table 2: Sample outputs from different methods. Quantitative evaluation We first evaluated our methods on the Reddit dataset using the relevance and diversity metrics. We truncated the vocabulary to contain only the most frequent 20,000 words. For testing we used 2,000 randomly selected samples from the test set4. The results are summarized in Table 1. We observe that by incorporating the adversarial loss the diversity of generated responses is improved (cGAN vs. seq2seq). The relevance under most metrics (except for BLEU), increases by a small amount. Compared MMI with cGAN, AIM and DAIM, we observe substantial improvements on diversity and relevance due to the use of the additional mutual information promoting objective in cGAN, AIM and DAIM. Table 2 presents several examples. It can be seen that AIM and DAIM produce more informative responses, due to the fact that the MI objective explicitly rewards the responses that are predictive to the source, and downweights those that are generic and dull. Under the same hyperparameter setup, we also observe that 3https://drive.google.com/file/d/0B7XkCwpI5KDYNlNUTTlSS21pQmM 4We did not use the full test set because MMI decoding is relatively slow. 7 Table 3: Human evaluation results. Results of statistical significance are shown in bold. Methods Informativeness Relevance Method A Method B Method A Method B MMI-AIM MMI 0.496 AIM 0.504 MMI 0.501 AIM 0.499 MMI-cGAN MMI 0.505 cGAN 0.495 MMI 0.514 cGAN 0.486 MMI-DAIM MMI 0.484 DAIM 0.516 MMI 0.503 DAIM 0.497 MMI-seq2seq MMI 0.510 seq2seq 0.490 MMI 0.518 seq2seq 0.482 seq2seq-cGAN seq2seq 0.487 cGAN 0.513 seq2seq 0.492 cGAN 0.508 seq2seq-AIM seq2seq 0.478 AIM 0.522 seq2seq 0.492 AIM 0.508 seq2seq-DAIM seq2seq 0.468 DAIM 0.532 seq2seq 0.475 DAIM 0.525 Human-DAIM Human 0.615 DAIM 0.385 Human 0.600 DAIM 0.400 DAIM benefits from the additional backward model and outperforms AIM in diversity, which better approximates human responses. We show the histogram of the length of generated responses in the Supplementary Material. Our models are trained until convergence. cGAN, AIM and DAIM respectively consume around 1.7, 2.5 and 3.5 times the computation time compared with our seq2seq baseline. The distributional discrepancy between generated responses and ground-truth responses is arguably a more reasonable metric than the single response judgment. We leave it to future work. Human evaluation Informativeness is not easily measurable using automatic metrics, so we performed a human evaluation on 600 random sampled sources using crowd-sourcing. Systems were paired and each pair of system outputs was randomly presented to 7 judges, who ranked them for informativeness and relevance5. The human preferences are shown in Table 3. A statistically significant (p < 0.00001) preference for DAIM over MMI is observed with respect to informativeness, while relevance judgments are on par with MMI. MMI has proved a strong baseline: the other two GAN systems are (with one exception) statistically indistinguishable from MMI, which in turn perform significantly better than seq2seq. Box charts illustrating these results can be found in the Supplementary Material. Table 4: Quantitative evaluation on the Twitter dataset. Models Relevance Diversity BLEU ROUGE Greedy Average Extreme Dist-1 Dist-2 Ent-4 seq2seq 0.64 0.62 1.669 0.54 0.34 0.020 0.084 6.427 cGAN 0.62 0.61 1.68 0.536 0.329 0.028 0.102 6.631 AIM 0.85 0.82 1.960 0.645 0.370 0.030 0.092 7.245 DAIM 0.81 0.77 1.845 0.588 0.344 0.032 0.137 7.907 MMI 0.80 0.75 1.876 0.591 0.348 0.028 0.105 7.156 4.3 Evaluation on Twitter data We further compared our methods on the Twitter dataset. The results are shown in Table 4. We treated all dialog history before the last response in a multi-turn conversation session as a source sentence, and use the last response as the target to form our dataset. We employed CNN as our encoder because a CNN-based encoder is presumably advantageous in tracking long dialog history comparing to an LSTM encoder. We truncated the vocabulary to contain only 20k most frequent words due to limited flash memory capacity. We evaluated each methods on 2k test data. Adversarial training encourages generating more diverse sentences, at the cost of slightly decreasing the relevance score. We hypothesize that such a decrease is partially attributable to the evaluation metrics we used. All the relevance metrics are based on utterance-pair discrepancy, i.e., the score assesses how close the system output is to the ground-truth response. Thus, the MLE system output tends to obtain a high score despite being bland, because a MLE response by design is most “relevant” 5Relevance relates to the degree to which judges perceived the output to be semantically tied to the previous turn, and can be regarded as a constraint on informativeness. An affirmative response like “Sure” and “Yes” is relevant but not very informative. 8 to any random response. On the other hand, adding diversity without improving semantic relevance may occasionally hurt these relevance scores. However the additional MI term seems to compensate for the relevance decrease and improves the response diversity, especially in Dist-n and Ent-n with a larger value of n. Sampled responses are provided in the Supplementary Material. 5 Conclusion In this paper we propose a novel adversarial learning method, Adversarial Information Maximization (AIM), for training response generation models to promote informative and diverse conversations between human and dialogue agents. AIM can be viewed as a more principled version of the classical MMI method in that AIM is able to directly optimize the (lower bounder of) the MMI objective in model training while the MMI method only uses it to rerank response candidates during decoding. We then extend AIM to DAIM by incorporating a dual objective so as to simultaneously learn forward and backward models. We evaluated our methods on two real-world datasets. The results demonstrate the our methods do lead to more informative and diverse responses in comparison to existing methods. Acknowledgements We thank Adji Bousso Dieng, Asli Celikyilmaz, Sungjin Lee, Chris Quirk, Chengtao Li for helpful discussions. We thank anonymous reviewers for their constructive feedbacks. References [1] Jianfeng Gao, Michel Galley, and Lihong Li. Neural approaches to conversational ai. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pages 1371–1374. ACM, 2018. [2] Lifeng Shang, Zhengdong Lu, and Hang Li. Neural responding machine for short-text conversation. In ACL, 2015. [3] Alessandro Sordoni, Michel Galley, Michael Auli, Chris Brockett, Yangfeng Ji, Margaret Mitchell, Jian-Yun Nie, Jianfeng Gao, and Bill Dolan. A neural network approach to contextsensitive generation of conversational responses. In NAACL, 2016. [4] Oriol Vinyals and Quoc Le. A neural conversational model. In ICML Deep Learning Workshop, 2015. [5] Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. In NAACL, 2016. [6] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, 2014. [7] Jiwei Li, Will Monroe, Tianlin Shi, Alan Ritter, and Dan Jurafsky. Adversarial learning for neural dialogue generation. In EMNLP, 2017. [8] 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 EMNLP, 2017. [9] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In NIPS, 2016. [10] David Barber and Felix Agakov. The im algorithm: a variational approach to information maximization. In NIPS, 2003. [11] David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In ICML, 2014. 9 [12] Yizhe Zhang, Zhe Gan, Kai Fan, Zhi Chen, Ricardo Henao, Dinghan Shen, and Lawrence Carin. Adversarial feature matching for text generation. In ICML, 2017. [13] Zhe Gan, Liqun Chen, Weiyao Wang, Yuchen Pu, Yizhe Zhang, Hao Liu, Chunyuan Li, and Lawrence Carin. Triangle generative adversarial networks. In NIPS, 2017. [14] Yingce Xia, Tao Qin, Wei Chen, Jiang Bian, Nenghai Yu, and Tie-Yan Liu. Dual supervised learning. In ICML, 2017. [15] Yunchen Pu, Shuyang Dai, Zhe Gan, Weiyao Wang, Guoyin Wang, Yizhe Zhang, Ricardo Henao, and Lawrence Carin. Jointgan: Multi-domain joint distribution learning with generative adversarial nets. In ICML, 2018. [16] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014. [17] Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero, and Larry Heck. Learning deep structured semantic models for web search using clickthrough data. In CIKM, 2013. [18] Dinghan Shen, Guoyin Wang, Wenlin Wang, Martin Renqiang Min, Qinliang Su, Yizhe Zhang, Chunyuan Li, Ricardo Henao, and Lawrence Carin. Baseline needs more love: On simple word-embedding-based models and associated pooling mechanisms. In ACL, 2018. [19] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. In ICML, 2017. [20] Zhe Gan, Yunchen Pu, Ricardo Henao, Chunyuan Li, Xiaodong He, and Lawrence Carin. Learning generic sentence representations using convolutional neural networks. In EMNLP, 2017. [21] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 1992. [22] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In ICML, 2014. [23] Zhou Ren, Xiaoyu Wang, Ning Zhang, Xutao Lv, and Li-Jia Li. Deep reinforcement learningbased image captioning with embedding reward. In CVPR, 2017. [24] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. [25] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. [26] Alex Lamb, Anirudh Goyal, Ying Zhang, Saizheng Zhang, Aaron Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In NIPS, 2016. [27] Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: sequence generative adversarial nets with policy gradient. In AAAI, 2017. [28] Dzmitry Bahdanau, Philemon Brakel, Kelvin Xu, Anirudh Goyal, Ryan Lowe, Joelle Pineau, Aaron Courville, and Yoshua Bengio. An actor-critic algorithm for sequence prediction. In ICLR, 2017. [29] Wenlin Wang, Yunchen Pu, Vinay Kumar Verma, Kai Fan, Yizhe Zhang, Changyou Chen, Piyush Rai, and Lawrence Carin. Zero-shot learning via class-conditioned deep generative models. In AAAI, 2018. [30] Zhen Yang, Wei Chen, Feng Wang, and Bo Xu. Improving neural machine translation with conditional sequence generative adversarial nets. In NAACL, 2018. [31] Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. Deep reinforcement learning for dialogue generation. In EMNLP, 2016. 10 [32] Bo Dai, Dahua Lin, Raquel Urtasun, and Sanja Fidler. Towards diverse and natural image descriptions via a conditional gan. In ICCV, 2017. [33] Jiaxian Guo, Sidi Lu, Han Cai, Weinan Zhang, Yong Yu, and Jun Wang. Long text generation via adversarial training with leaked information. In AAAI, 2018. [34] Jingjing Xu, Xu Sun, Xuancheng Ren, Junyang Lin, Binzhen Wei, and Wei Li. DP-GAN: Diversity-promoting generative adversarial network for generating informative and diversified text. In EMNLP, 2018. [35] Chunyuan Li, Hao Liu, Changyou Chen, Yuchen Pu, Liqun Chen, Ricardo Henao, and Lawrence Carin. Alice: Towards understanding adversarial learning for joint distribution matching. In NIPS, 2017. [36] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jungkwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In ICML, 2017. [37] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. In ICLR, 2017. [38] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In ACL, 2002. [39] Chin-Yew Lin. ROUGE: A package for automatic evaluation of summaries. In ACL workshop, 2004. [40] Iulian Vlad Serban, Alessandro Sordoni, Ryan Lowe, Laurent Charlin, Joelle Pineau, Aaron Courville, and Yoshua Bengio. A hierarchical latent variable encoder-decoder model for generating dialogues. In AAAI, 2017. [41] 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, 2012. [42] Jeff Mitchell and Mirella Lapata. Vector-based models of semantic composition. In ACL, 2008. [43] Gabriel Forgues, Joelle Pineau, Jean-Marie Larchevêque, and Réal Tremblay. Bootstrapping dialog systems with word embeddings. In NIPS, modern machine learning and natural language processing workshop, 2014. [44] Iulian V Serban, Alessandro Sordoni, Yoshua Bengio, Aaron C Courville, and Joelle Pineau. Hierarchical neural network generative models for movie dialogues. In AAAI, 2016. [45] Dinghan Shen, Yizhe Zhang, Ricardo Henao, Qinliang Su, and Lawrence Carin. Deconvolutional latent-variable model for text sequence matching. In AAAI, 2018. [46] Yizhe Zhang, Dinghan Shen, Guoyin Wang, Zhe Gan, Ricardo Henao, and Lawrence Carin. Deconvolutional paragraph representation learning. In NIPS, 2017. 11
2018
162
7,322
Multi-Agent Generative Adversarial Imitation Learning Jiaming Song Stanford University tsong@cs.stanford.edu Hongyu Ren Stanford University hyren@cs.stanford.edu Dorsa Sadigh Stanford University dorsa@cs.stanford.edu Stefano Ermon Stanford University ermon@cs.stanford.edu Abstract Imitation learning algorithms can be used to learn a policy from expert demonstrations without access to a reward signal. However, most existing approaches are not applicable in multi-agent settings due to the existence of multiple (Nash) equilibria and non-stationary environments. We propose a new framework for multi-agent imitation learning for general Markov games, where we build upon a generalized notion of inverse reinforcement learning. We further introduce a practical multiagent actor-critic algorithm with good empirical performance. Our method can be used to imitate complex behaviors in high-dimensional environments with multiple cooperative or competing agents. 1 Introduction Reinforcement learning (RL) methods are becoming increasingly successful at optimizing reward signals in complex, high dimensional environments [1]. A key limitation of RL, however, is the difficulty of designing suitable reward functions for complex and not well-specified tasks [2, 3]. If the reward function does not cover all important aspects of the task, the agent could easily learn undesirable behaviors [4]. This problem is further exacerbated in multi-agent scenarios, such as multiplayer games [5], multi-robot control [6] and social interactions [7]; in these cases, agents do not even necessarily share the same reward function and might even have conflicting rewards. Imitation learning methods address these problems via expert demonstrations [8–11]; the agent directly learns desirable behaviors by imitating an expert. Notably, inverse reinforcement learning (IRL) frameworks assume that the expert is (approximately) optimizing an underlying reward function, and attempt to recover a reward function that rationalizes the demonstrations; an agent policy is subsequently learned through RL [12, 13]. Unfortunately, this paradigm is not suitable for general multi-agent settings due to environment being non-stationary to individual agents [14] and the existence of multiple equilibrium solutions [15]. The optimal policy of one agent could depend on the policies of other agents, and vice versa, so there could exist multiple solutions in which each agents’ policy is the optimal response to others. In this paper, we propose a new framework for multi-agent imitation learning – provided with demonstrations of a set of experts interacting with each other in the same environment, we aim to learn multiple parametrized policies that imitate the behavior of each expert respectively. Using the framework of Markov games, we integrate multi-agent RL with a suitable extension of multi-agent inverse RL. The resulting procedure strictly generalizes Generative Adversarial Imitation Learning (GAIL, [16]) in the single agent case. Imitation learning in our setting corresponds to a two-player 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. game between a generator and a discriminator. The generator controls the policies of all the agents in a distributed way, and the discriminator contains a classifier for each agent that is trained to distinguish that agent’s behavior from that of the corresponding expert. Upon training, the behaviors produced by the policies should be indistinguishable from the training data. We can incorporate prior knowledge into the discriminators, including the presence of cooperative or competitive agents. In addition, we propose a novel multi-agent natural policy gradient algorithm that addresses the issue of high variance gradient estimates commonly observed in reinforcement learning [14, 17]. Empirical results demonstrate that our method can imitate complex behaviors in high-dimensional environments, such as particle environments and cooperative robotic control tasks, with multiple cooperative or competitive agents; the imitated behaviors are close to the expert behaviors with respect to “true” reward functions which the agents do not have access to during training. 2 Preliminaries 2.1 Markov games We consider an extension of Markov decision processes (MDPs) called Markov games [18]. A Markov game (MG) for N agents is defined via a set of states S, and N sets of actions {Ai}N i=1. The function P : S × A1 × · · · × AN →P(S) describes the (stochastic) transition process between states, where P(S) denotes the set of probability distributions over the set S. Given that we are in state st at time t, the agents take actions (a1, . . . , aN) and the state transitions to st+1 with probability P(st+1|st, a1, . . . , aN). Each agent i obtains a (bounded) reward given by a function ri : S × A1 × · · · × AN →R. Each agent i aims to maximize its own total expected return Ri = P∞ t=0 γtri,t, where γ is the discount factor, by selecting actions through a (stationary and Markovian) stochastic policy πi : S × Ai →[0, 1]. The initial states are determined by a distribution η : S →[0, 1]. The joint policy is defined as π(a|s) = QN i=1 πi(ai|s), where we use bold variables without subscript i to denote the concatenation of all variables for all agents (e.g., π denotes the joint policy QN i=1 πi in a multi-agent setting, r denotes all rewards, a denotes actions of all agents). We use expectation with respect to a policy π to denote an expectation with respect to the trajectories it generates, and use subscript −i to denote all agents except for i. For example, (ai, a−i) represents (a1, . . . , aN), the actions of all N agents. 2.2 Reinforcement learning and Nash equilibrium In reinforcement learning (RL), the goal of each agent is to maximize total expected return Eπ[r(s, a)] given access to the reward signal r. In single agent RL, an optimal Markovian policy exists but the optimal policy might not be unique (e.g., all policies are optimal for an identically zero reward; see [19], Chapter 3.8). An entropy regularizer can be introduced to resolve this ambiguity. The optimal policy is found via the following RL procedure: RL(r) = arg max π∈Π H(π) + Eπ[r(s, a)], (1) where H(π) is the γ-discounted causal entropy [20] of policy π ∈Π. Definition 1 (γ-discounted Causal Entropy). The γ-discounted causal entropy for a policy π is defined as follows: H(π) ≜Eπ[−log π(a|s)] = Est,at∼π " − ∞ X t=0 γt log π(at|st) # . The addition of H(π) in (1) resolves this ambiguity – the policy with both the highest reward and the highest entropy1 is unique because the entropy function is strictly concave with respect to π. In Markov games, however, the optimal policy of an agent depends on other agents’ policies. One approach is to use an equilibrium solution concept, such as Nash equilibrium [15]. Informally, a set of policies {πi}N i=1 is a Nash equilibrium if no agent can achieve higher reward by unilaterally 1We use the term “entropy” to denote the γ-discounted causal entropy for policies in the rest of the paper. 2 changing its policy, i.e., ∀i ∈[1, N], ∀ˆπi ̸= πi, Eπi,π−i[ri] ≥Eˆπi,π−i[ri]. The process of finding a Nash equilibrium can be defined as a constrained optimization problem ([21], Theorem 3.7.2): min π∈Π,v∈RS×N fr(π, v) = N X i=1 X s∈S vi(s) −Eai∼πi(·|s)qi(s, ai) ! (2) vi(s) ≥qi(s, ai) ≜Eπ−i " ri(s, a) + γ X s′∈S P(s′|s, a)vi(s′) # ∀i ∈[N], s ∈S, ai ∈Ai (3) a ≜(ai, a−i) ≜(a1, . . . , aN) v ≜[v1; . . . ; vN] where the joint action a includes actions a−i sampled from π−i and ai. Intuitively, v can be thought of as a value function and q represents the Q-function that corresponds to v. The constraints enforce the Nash equilibrium condition – when the constraints are satisfied, (vi(s)−qi(s, ai)) is non-negative for every i ∈[N]. Hence fr(π, v) is always non-negative for a feasible (π, v). Moreover, this objective has a global minimum of zero if a Nash equilibrium exists, and π forms a Nash equilibrium if and only if fr(π, v) reaches zero while being a feasible solution ([22], Theorem 2.4). 2.3 Inverse reinforcement learning Suppose we do not have access to the reward signal r, but have demonstrations D provided by an expert (N expert agents in Markov games). Imitation learning aims to learn policies that behave similarly to these demonstrations. In Markov games, we assume all experts/players operate in the same environment, and the demonstrations D = {(sj, aj)}M j=1 are collected by sampling s0 ∼ η(s), at = πE(at|st), st+1 ∼P(st+1|st, at); we assume knowledge of N, γ, S, A, as well as access to T and η as black boxes. We further assume that once we obtain D, we cannot ask for additional expert interactions with the environment (unlike in DAgger [23] or CIRL [24]). Let us first consider imitation in Markov decision processes (as a special case to Markov games) and the framework of single-agent Maximum Entropy IRL [8, 16] where the goal is to recover a reward function r that rationalizes the expert behavior πE: IRL(πE) = arg max r∈RS×A EπE[r(s, a)] −  max π∈Π H(π) + Eπ[r(s, a)]  In practice, expectations with respect to πE are evaluated using samples from D. The IRL objective is ill-defined [12, 10] and there are often multiple valid solutions to the problem when we consider all r ∈RS×A. To resolve this ambiguity, [16] introduce a convex reward function regularizer ψ : RS×A →R, which can be used for example to restrict rewards to be linear in a pre-determined set of features [16]: IRLψ(πE) = arg max r∈RS×A −ψ(r) + EπE[r(s, a)] −  max π∈Π H(π) + Eπ[r(s, a)]  (4) 2.4 Imitation by matching occupancy measures [16] interprets the imitation learning problem as matching two occupancy measures, i.e., the distribution over states and actions encountered when navigating the environment with a policy. Formally, for a policy π, it is defined as ρπ(s, a) = π(a|s) P∞ t=0 γtP(st = s|π). [16] draws a connection between IRL and occupancy measure matching, showing that the former is a dual of the latter: Proposition 1 (Proposition 3.1 in [16]). RL ◦IRLψ(πE) = arg min π∈Π −H(π) + ψ⋆(ρπ −ρπE) Here ψ⋆(x) = supy x⊤y −ψ(y) is the convex conjugate of ψ, which could be interpreted as a measure of similarity between the occupancy measures of expert policy and agent’s policy. One instance of ψ = ψGA gives rise to the Generative Adversarial Imitation Learning (GAIL) method: ψ⋆ GA(ρπ −ρπE) = max D∈(0,1)S×A EπE[log(D(s, a))] + Eπ[log(1 −D(s, a))] (5) 3 The resulting imitation learning method from Proposition 1 involves a discriminator (a classifier D) competing with a generator (a policy π). The discriminator attempts to distinguish real vs. synthetic trajectories (produced by π) by optimizing (5). The generator, on the other hand, aims to perform optimally under the reward function defined by the discriminator, thus “fooling” the discriminator with synthetic trajectories that are difficult to distinguish from the expert ones. 3 Generalizing IRL to Markov games Extending imitation learning to multi-agent settings is difficult because there are multiple rewards (one for each agent) and the notion of optimality is complicated by the need to consider an equilibrium solution [15]. We use MARL(r) to denote the set of (stationary and Markovian) policies that form a Nash equilibrium under r and have the maximum γ-discounted causal entropy (among all equilibria): MARL(r) = arg min π∈Π,v∈RS×N fr(π, v) −H(π) (6) vi(s) ≥qi(s, ai) ∀i ∈[N], s ∈S, ai ∈Ai where q is defined as in Equation (3). Our goal is to define a suitable inverse operator MAIRL, in analogy to IRL in Equation (4), which chooses a reward that creates a margin between the expert and every other policy. However, the constraints in the Nash equilibrium optimization (Equation (6)) can make this challenging. To that end, we derive an equivalent Lagrangian formulation of (6), where we “move” the constraints into the objective function, so that we can define a margin between the expected reward of two sets of policies that captures their “difference”. 3.1 Equivalent constraints via temporal difference learning Intuitively, the Nash equilibrium constraints imply that any agent i cannot improve πi via 1-step temporal difference learning; if the condition for Equation (3) is not satisfied for some vi, qi, and (s, ai), this would suggest that we can update the policy for agent i and its value function. Based on this notion, we can derive equivalent versions of the constraints corresponding to t-step temporal difference (TD) learning. Theorem 1. For a certain policy π and reward r, let ˆvi(s; π, r) be the unique solution to the Bellman equation: ˆvi(s; π, r) = Ea∼π " ri(s, a) + γ X s′∈S P(s′|s, a)ˆvi(s′; π, r) # ∀s ∈S. Denote ˆq(t) i ({s(j), a(j)}t−1 j=0, s(t), a(t) i ; π, r) as the discounted expected return for the i-th agent conditioned on visiting the trajectory {s(j), a(j)}t−1 j=0, s(t) in the first (t −1) steps and choosing action a(t) i at the t step, when other agents use policy π−i: ˆq(t) i ({s(j), a(j)}t−1 j=0, s(t), a(t) i ; π, r) = t−1 X j=0 γjri(s(j), a(j)) + γtEa−i∼π−i " ri(s(t), a(t)) + γ X s′∈S P(s′|s, a(t))ˆvi(s′; π, r) # . Then π is Nash equilibrium if and only if for all t ∈N+, i ∈[N], j ∈[t], s(j) ∈S, a(j) ∈A ˆvi(s(0); π, r) ≥Ea−i∼π−i h ˆq(t) i ({s(j), a(j)}t−1 j=0, s(t), a(t) i ; π, r) i ≜Q(t) i ({s(j), a(j) i }t j=0; π, r). (7) Intuitively, Theorem 1 states that if we replace the 1-step constraints with (t + 1)-step constraints, we obtain the same solution as MARL(r), since (t + 1)-step TD updates (over one agent at a time) are still stationary with respect to a Nash equilibrium solution. So the constraints can be unrolled for t steps and rewritten as ˆvi(s(0)) ≥Q(t) i ({s(j), a(j) i }t j=0; π, r) (corresponding to Equation (7)). 4 3.2 Multi-agent inverse reinforcement learning We are now ready to construct the Lagrangian dual of the primal in Equation (6), using the equivalent formulation from Theorem 1. The first observation is that for any policy π, f(π, ˆv) = 0 when ˆv is defined as in Theorem 1 (see Lemma 1 in appendix). Therefore, we only need to consider the “unrolled” constraints from Theorem 1, obtaining the following dual problem max λ≥0 min π L(t+1) r (π, λ) ≜ N X i=1 X τi∈T t i λ(τi)  Q(t) i (τi; π, r) −ˆvi(s(0); π, r)  (8) where Ti(t) is the set of all length-t trajectories of the form {s(j), a(j) i }t j=0, with s(0) as initial state, λ is a vector of N ·|Ti(t)| Lagrange multipliers, and ˆv is defined as in Theorem 1. This dual formulation is a sum over agents and trajectories, which uniquely corresponds to the constraints in Equation 7. In the following theorem, we show that for a specific choice of λ we can recover the difference of the sum of expected rewards between two policies, a performance gap similar to the one used in single agent IRL in Equation (4). This amounts to “relaxing” the primal problem. Theorem 2. For any two policies π⋆and π, let λ⋆ π(τi) = η(s(0))πi(a(0) i |s(0)) tY j=1 πi(a(j) i |s(j)) X a(j−1) −i P(s(j)|s(j−1), a(j−1))π⋆ −i(a(j) −i|s(j)) be the probability of generating the sequence τi using policy πi and π⋆ −i. Then lim t→∞L(t+1) r (π⋆, λ⋆ π) = N X i=1 Eπi,π⋆ −i[ri(s, a)] − N X i=1 Eπ⋆ i ,π⋆ −i[ri(s, a)] (9) where L(t+1) r (π⋆, λ⋆ π) corresponds to the dual function where the multipliers are the probability of generating their respective trajectories of length t. We provide a proof in Appendix A.3. Intuitively, the λ⋆(τi) weights correspond to the probability of generating trajectory τi when the policy is πi for agent i and π⋆ −i for the other agents. As t →∞, the first term of left hand side in Equation (8), PN i=1 P τi∈T t i λ(τi)Q(t) i (τi), converges to the expected total reward Eπi,π⋆ −i[ri], which is the first term of right hand side. The marginal of λ⋆over the initial state is the initial state distribution, so the second term of left hand side, P s ˆv(s)η(s), converges to Eπ⋆ i ,π⋆ −i[ri], which is the second term of right hand side. Thus, the left hand side and right hand side of Equation (8) are the same as t →∞. We could also view the right hand side of Equation (8) as the case where policies of π⋆ −i are part of the environment. Theorem 2 motivates the following definition of multi-agent IRL with regularizer ψ. MAIRLψ(πE) = arg max r −ψ(r) + N X i=1 (EπE[ri]) − max π N X i=1 (βHi(πi) + Eπi,πE−i [ri]) ! , where Hi(πi) = Eπi,πE−i [−log πi(ai|s)] is the discounted causal entropy for policy πi when other agents follow πE−i, and β is a hyper-parameter controlling the strength of the entropy regularization term as in [16]. This formulation is a strict generalization to the single agent IRL in [16]. Corollary 2.1. If N = 1, β = 1 then MAIRLψ(πE) = IRLψ(πE). Furthermore, if the regularization ψ is additively separable, and for each agent i, πEi is the unique optimal response to other experts πE−i, we obtain the following: Theorem 3. Assume that ψ(r) = PN i=1 ψi(ri), ψi is convex for each i ∈[N], and that MARL(r) has a unique solution2 for all r ∈MAIRLψ(πE), then MARL ◦MAIRLψ(πE) = arg min π∈Π N X i=1 −βHi(πi) + ψ⋆ i (ρπi,E−i −ρπE) (10) where πi,E−i denotes πi for agent i and πE−i for other agents. 2The set of Nash equilibria is not always convex, so we have to assume MARL(r) returns a unique solution. 5 The above theorem suggests that ψ-regularized multi-agent inverse reinforcement learning is seeking, for each agent i, a policy whose occupancy measure is close to one where we replace policy πi with expert πEi, as measured by the convex function ψ⋆ i . However, we do not assume access to the expert policy πE during training, so it is not possible to obtain ρπi,E−i. Therefore, we consider an alternative approach where we match the occupancy measure between ρπE and ρπ. We can obtain our practical algorithm if we select an adversarial reward function regularizer and remove the effect from entropy regularizers. Proposition 2. If β = 0, and ψ(r) = PN i=1 ψi(ri) where ψi(ri) = EπE[g(ri)] if ri > 0; +∞ otherwise, and g(x) =  −x −log(1 −ex) if ri > 0 +∞ otherwise then arg min π N X i=1 ψ⋆ i (ρπi,πE−i −ρπE) = arg min π N X i=1 ψ⋆ i (ρπi,π−i −ρπE) (11) and both are equal to πE. Theorem 3 and Proposition 2 discuss the differences from the single agent scenario. In Theorem 3 we make the assumption that MARL(r) has a unique solution, which is always true in the single agent case due to convexity of the space of the optimal policies. In Proposition 2 we remove the entropy regularizer because here the causal entropy for πi may depend on the policies of the other agents. Specifically, the entropy for the left hand side of Equation (11) conditions on πE−i and the entropy for the right hand side conditions on π−i (both would disappear in the single-agent case). 4 Practical multi-agent imitation learning Despite the recent successes in deep RL, it is notoriously hard to train policies with RL algorithmsbecause of high variance gradient estimates. This is further exacerbated in Markov games since an agent’s optimal policy depends on other agents [14, 17]. In this section, we address these problems and propose practical algorithms for multi-agent imitation. 4.1 Multi-agent generative adversarial imitation learning We select ψi to be our reward function regularizer in Proposition 2; this corresponds to the two-player game introduced in Generative Adversarial Imitation Learning (GAIL, [16]). For each agent i, we have a discriminator (denoted as Dωi) mapping state action-pairs to scores optimized to discriminate expert demonstrations from behaviors produced by πi. Implicitly, Dωi plays the role of a reward function for the generator, which in turn attempts to train the agent to maximize its reward thus fooling the discriminator. We optimize the following objective: min θ max ω Eπθ " N X i=1 log Dωi(s, ai) # + EπE " N X i=1 log(1 −Dωi(s, ai)) # (12) We update πθ through reinforcement learning, where we also use a baseline Vφ to reduce variance. We outline the algorithm – Multi-Agent GAIL (MAGAIL) – in Appendix B. We can augment the reward regularizer ψ(r) using an indicator y(r) denoting whether r fits our prior knowledge; the augmented reward regularizer ˆψ : RS×A →R ∪{∞} is then: ψ(r) if y(r) = 1 and ∞if y(r) = 0. We introduce three types of y(r) for common settings. Centralized The easiest case is to assume that the agents are fully cooperative, i.e. they share the same reward function. Here y(r) = I(r1 = r2 = . . . rn) and ψ(r) = ψGA(r). One could argue this corresponds to the GAIL case, where the RL procedure operates on multiple agents (a joint policy). Decentralized We make no prior assumptions over the correlation between the rewards. Here y(r) = I(ri ∈ROi×Ai) and ψi(ri) = ψGA(ri). This corresponds to one discriminator for each agent which discriminates the trajectories as observed by agent i. However, these discriminators are not learned independently as they interact indirectly via the environment. 6 (o1, a1) (o2, a2) (o1, a1) (o2, a2) D T(st+1|st, at) (a) Centralized (Cooperative) (o1, a1) (o2, a2) (o1, a1) (o2, a2) D1 D2 T(st+1|st, at) (b) Decentralized (Mixed) (o1, a1) (o2, a2) (o1, a1) (o2, a2) D1 = −D2 (c) Zero-sum (Competitive) Figure 1: Different MAGAIL algorithms obtained with different priors on the reward structure. The discriminator tries to assign higher rewards to top row and low rewards to bottom row. In centralized and decentralized, the policy operates with the environment to match the expert rewards. In zero-sum, the policy do not interact with the environment; expert and policy trajectories are paired together as input to the discriminator. Zero Sum Assume there are two agents that receive opposite rewards, so r1 = −r2. As such, ψ is no longer additively separable. Nevertheless, an adversarial training procedure can be designed using the following fact: v(πE1, π2) ≥v(πE1, πE2) ≥v(π1, πE2) (13) where v(π1, π2) = Eπ1,π2[r1(s, a)] is the expected outcome for agent 1, and is modeled by the discriminator. The discriminator could then try to maximize v for trajectories from (πE1, π2) and minimize v for trajectories from (π2, πE1) according to Equation (13). These three settings are in summarized in Figure 1. 4.2 Multi-agent actor-critic with Kronecker factors To optimize over the generator parameters θ in Eq. (12) we wish to use an algorithm for multi-agent RL that has good sample efficiency in practice. Our algorithm, which we refer to as Multi-agent Actor-Critic with Kronecker-factors (MACK), is based on Actor-Critic with Kronecker-factored Trust Region (ACKTR, [25–27]), a state-of-the-art natural policy gradient [28, 29] method in deep RL. MACK uses the framework of centralized training with decentralized execution [17]; policies are trained with additional information to reduce variance but such information is not used during execution time. We let the advantage function of every agent agent be a function of all agents’ observations and actions: Aπi φi(s, at) = k−1 X j=0 (γjri(st+j, at+j) + γkV πi φi (st+k, a−i,t+k)) −V πi φi (st, a−i,t) (14) where V πi φi (sk, a−i) is the baseline for i, utilizing the additional information (a−i) for variance reduction. We use (approximated) natural policy gradients to update both θ and φ but without trust regions to schedule the learning rate, using a linear decay learning rate schedule instead. MACK has some notable differences from Multi-Agent Deep Deterministic Policy Gradient [14]. On the one hand, MACK does not assume knowledge of other agent’s policies nor tries to infer them; the value estimator merely collects experience from other agents (and treats them as black boxes). On the other hand, MACK does not require gradient estimators such as Gumbel-softmax [30, 31] to optimize over discrete actions, which is necessary for DDPG [32]. 5 Experiments We evaluate the performance of (centralized, decentralized, and zero-sum versions) of MAGAIL under two types of environments. One is a particle environment which allows for complex interactions and behaviors; the other is a control task, where multiple agents try to cooperate and move a plank forward. We collect results by averaging over 5 random seeds. Our implementation is based on OpenAI baselines [33]; please refer to Appendix C for implementation details3. 3Code for reproducing the experiments are in https://github.com/ermongroup/multiagent-gail. 7 100 200 300 400 # Expert Demonstrations 1 0.96 0.9 0.8 0.6 0 Normalized Rewards Cooperative Communication 100 200 300 400 # Expert Demonstrations 1 0.96 0.9 0.8 0.6 0 Cooperative Navigation Expert Random BC GAIL Centralized Decentralized Figure 2: Average true reward from cooperative tasks. Performance of experts and random policies are normalized to one and zero respectively. We use inverse log scale for better comparison. We compare our methods (centralized, decentralized, zero-sum MAGAIL) with two baselines. The first is behavior cloning (BC), which learns a maximum likelihood estimate for ai given each state s and does not require actions from other agents. The second baseline is a GAIL IRL baseline that operates on each agent separately – for each agent we first pretrain the other agents with BC, and then train the agent with GAIL; we then gather the trained GAIL policies from all the agents and evaluate their performance. 5.1 Particle environments We first consider the particle environment proposed in [14], which consists of several agents and landmarks. We consider two cooperative environments and two competitive ones. All environments have an underlying true reward function that allows us to evaluate the performance of learned agents. The environments include: Cooperative Communication – two agents must cooperate to reach one of three colored landmarks. One agent (“speaker”) knows the goal but cannot move, so it must convey the message to the other agent (“listener”) that moves but does not observe the goal. Cooperative Navigation – three agents must cooperate through physical actions to reach three landmarks; ideally, each agent should cover a single landmark. Keep-Away – two agents have contradictory goals, where agent 1 tries to reach one of the two targeted landmarks, while agent 2 (the adversary) tries to keep agent 1 from reaching its target. The adversary does not observe the target, so it must act based on agent 1’s actions. Predator-Prey – three slower cooperating adversaries must chase the faster agent in a randomly generated environment with obstacles; the adversaries are rewarded by touching the agent while the agent is penalized. For the cooperative tasks, we use an analytic expression defining the expert policy; for the competitive tasks, we use MACK to train expert policies based on the true underlying rewards (using larger policy and value networks than the ones that we use for imitation). We then use the expert policies to simulate trajectories D, and then do imitation learning on D as demonstrations, where we assume the underlying rewards are unknown. Following [34], we pretrain our Multi-Agent GAIL methods and the GAIL baseline using behavior cloning as initialization to reduce sample complexity for exploration. We consider 100 to 400 episodes of expert demonstrations, each with 50 timesteps, which is close to the amount of timesteps used for the control tasks in [16]. Moreover, we randomly sample the starting position of agent and landmarks each episode, so our policies have to learn to generalize when they encounter new settings. 5.1.1 Cooperative tasks We evaluate performance in cooperative tasks via the average expected reward obtained by all the agents in an episode. In this environment, the starting state is randomly initialized, so generalization is crucial. We do not consider the zero-sum case, since it violates the cooperative nature of the task. We display the performance of centralized, decentralized, GAIL and BC in Figure 2. Naturally, the performance of BC and MAGAIL increases with more expert demonstrations. MAGAIL performs consistently better than BC in all the settings; interestingly, in the cooperative communication task, centralized MAGAIL is able to achieve expert-level performance with only 200 demonstrations, but BC fails to come close even with 400 trajectories. Moreover, the centralized MA8 Table 1: Average agent rewards in competitive tasks. We compare behavior cloning (BC), GAIL (G), Centralized (C), Decentralized (D), and Zero-Sum (ZS) methods. Best marked in bold (high vs. low rewards is preferable depending on the agent vs. adversary role). Task Predator-Prey Agent Behavior Cloning G C D ZS Adversary BC G C D ZS Behavior Cloning Rewards -93.20 -93.71 -93.75 -95.22 -95.48 -90.55 -91.36 -85.00 -89.4 Task Keep-Away Agent Behavior Cloning G C D ZS Adversary BC G C D ZS Behavior Cloning Rewards 24.22 24.04 23.28 23.56 23.19 26.22 26.61 28.73 27.80 GAIL performs slightly better than decentralized MAGAIL due to the better prior, but decentralized MAGAIL still learns a highly correlated reward between two agents. 5.1.2 Competitive tasks We consider all three types of Multi-Agent GAIL (centralized, decentralized, zero-sum) and BC in both competitive tasks. Since there are two opposing sides, it is hard to measure performance directly. Therefore, we compare by letting (agents trained by) BC play against (adversaries trained by) other methods, and vice versa. From Table 1, decentralized and zero-sum MAGAIL often perform better than centralized MAGAIL and BC, which suggests that the selection of the suitable prior ˆψ is important for good empirical performance. 5.2 Cooperative control In some cases we are presented with sub-optimal expert demonstrations because the environment has changed; we consider this case in a cooperative control task [35], where N bipedal walkers cooperate to move a long plank forward; the agents have incentive to collaborate since the plank is much longer than any of the agents. The expert demonstrates its policy on an environment with no bumps on the ground and heavy weights, while we perform imitation in an new environment with bumps and lighter weights (so one is likely to use too much force). Agents trained with BC tend to act more aggressively and fail, whereas agents trained with centralized MAGAIL can adapt to the new environment. With 10 (imperfect) expert demonstrations, BC agents have a chance of failure of 39.8% (with a reward of 1.26), while centralized MAGAIL agents fail only 26.2% of the time (with a reward of 26.57). We show videos of respective policies in the supplementary. 6 Discussion There is a vast literature on single-agent imitation learning [36]. Behavior Cloning (BC) learns the policy through supervised learning [37]. Inverse Reinforcement Learning (IRL) assumes the expert policy optimizes over some unknown reward, recovers the reward, and learns the policy through reinforcement learning (RL). BC does not require knowledge of transition probabilities or access to the environment, but suffers from compounding errors and covariate shift [38, 23]. Most existing work in multi-agent imitation learning assumes the agents have very specific reward structures. The most common case is fully cooperative agents [39], where the challenges mainly lie in other factors, such as unknown role assignments [40], scalability to swarm systems [41] and agents with partial observations [42]. In non-cooperative settings, [43] consider the case of IRL for two-player zero-sum games and cast the IRL problem as Bayesian inference, while [44] assume agents are non-cooperative but the reward function is a linear combination of pre-specified features. Our work is the first to propose a general multi-agent IRL framework that combines state-of-the art multi-agent reinforcement learning methods [14, 17] and implicit generative models such as generative adversarial networks [45]. Experimental results demonstrate that it is able to imitate complex behaviors in high-dimensional environments with both cooperative and adversarial interactions. An interesting future direction is to explore new paradigms for learning from experts, such as allowing the expert to participate in the agent’s learning process [24]. 9 Acknowledgements This work was supported by Toyota Research Institute and Future of Life Institute. The authors would like to thank Lantao Yu for discussions over implementation. References [1] L. Espeholt, H. Soyer, R. Munos, K. Simonyan, V. Mnih, T. Ward, Y. Doron, V. Firoiu, T. Harley, I. Dunning, S. Legg, and K. Kavukcuoglu, “Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures,” arXiv preprint arXiv:1802.01561, 2018. [2] D. Hadfield-Menell, S. Milli, P. Abbeel, S. J. Russell, and A. Dragan, “Inverse reward design,” in Advances in Neural Information Processing Systems, pp. 6768–6777, 2017. [3] D. Amodei, C. Olah, J. Steinhardt, P. Christiano, J. Schulman, and D. Mané, “Concrete problems in ai safety,” arXiv preprint arXiv:1606.06565, 2016. [4] D. Amodei and J. Clark, “Faulty reward functions in the wild,” 2016. [5] P. Peng, Q. Yuan, Y. Wen, Y. Yang, Z. Tang, H. Long, and J. Wang, “Multiagent bidirectionallycoordinated nets for learning to play starcraft combat games,” arXiv preprint arXiv:1703.10069, 2017. [6] L. Matignon, L. Jeanpierre, A.-I. Mouaddib, et al., “Coordinated multi-robot exploration under communication constraints using decentralized markov decision processes.,” in AAAI, 2012. [7] J. Z. Leibo, V. Zambaldi, M. Lanctot, J. Marecki, and T. Graepel, “Multi-agent reinforcement learning in sequential social dilemmas,” in Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems, pp. 464–473, International Foundation for Autonomous Agents and Multiagent Systems, 2017. [8] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey, “Maximum entropy inverse reinforcement learning.,” in AAAI, vol. 8, pp. 1433–1438, Chicago, IL, USA, 2008. [9] P. Englert and M. Toussaint, “Inverse kkt–learning cost functions of manipulation tasks from demonstrations,” in Proceedings of the International Symposium of Robotics Research, 2015. [10] C. Finn, S. Levine, and P. Abbeel, “Guided cost learning: Deep inverse optimal control via policy optimization,” in International Conference on Machine Learning, pp. 49–58, 2016. [11] B. Stadie, P. Abbeel, and I. Sutskever, “Third person imitation learning,” in ICLR, 2017. [12] A. Y. Ng, S. J. Russell, et al., “Algorithms for inverse reinforcement learning.,” in Icml, pp. 663– 670, 2000. [13] P. Abbeel and A. Y. Ng, “Apprenticeship learning via inverse reinforcement learning,” in Proceedings of the twenty-first international conference on Machine learning, p. 1, ACM, 2004. [14] R. Lowe, Y. Wu, A. Tamar, J. Harb, P. Abbeel, and I. Mordatch, “Multi-agent actor-critic for mixed cooperative-competitive environments,” arXiv preprint arXiv:1706.02275, 2017. [15] J. Hu, M. P. Wellman, et al., “Multiagent reinforcement learning: theoretical framework and an algorithm.,” in ICML, vol. 98, pp. 242–250, Citeseer, 1998. [16] J. Ho and S. Ermon, “Generative adversarial imitation learning,” in Advances in Neural Information Processing Systems, pp. 4565–4573, 2016. [17] J. Foerster, Y. Assael, N. de Freitas, and S. Whiteson, “Learning to communicate with deep multi-agent reinforcement learning,” in Advances in Neural Information Processing Systems, pp. 2137–2145, 2016. [18] M. L. Littman, “Markov games as a framework for multi-agent reinforcement learning,” in Proceedings of the eleventh international conference on machine learning, vol. 157, pp. 157– 163, 1994. 10 [19] R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction, vol. 1. MIT press Cambridge, 1998. [20] M. Bloem and N. Bambos, “Infinite time horizon maximum causal entropy inverse reinforcement learning,” in Decision and Control (CDC), 2014 IEEE 53rd Annual Conference on, pp. 4911– 4916, IEEE, 2014. [21] J. Filar and K. Vrieze, Competitive Markov decision processes. Springer Science & Business Media, 2012. [22] H. Prasad and S. Bhatnagar, “A study of gradient descent schemes for general-sum stochastic games,” arXiv preprint arXiv:1507.00093, 2015. [23] S. Ross, G. J. Gordon, and D. Bagnell, “A reduction of imitation learning and structured prediction to no-regret online learning.,” in AISTATS, p. 6, 2011. [24] D. Hadfield-Menell, S. J. Russell, P. Abbeel, and A. Dragan, “Cooperative inverse reinforcement learning,” in Advances in neural information processing systems, pp. 3909–3917, 2016. [25] Y. Wu, E. Mansimov, R. B. Grosse, S. Liao, and J. Ba, “Scalable trust-region method for deep reinforcement learning using kronecker-factored approximation,” in Advances in neural information processing systems, pp. 5285–5294, 2017. [26] Y. Song, J. Song, and S. Ermon, “Accelerating natural gradient with higher-order invariance,” in International Conference on Machine Learning (ICML), 2018. [27] Y. Song, R. Shu, N. Kushman, and S. Ermon, “Constructing unrestricted adversarial examples with generative models,” arXiv preprint arXiv:1805.07894, 2018. [28] S.-I. Amari, “Natural gradient works efficiently in learning,” Neural computation, vol. 10, no. 2, pp. 251–276, 1998. [29] S. M. Kakade, “A natural policy gradient,” in Advances in neural information processing systems, pp. 1531–1538, 2002. [30] E. Jang, S. Gu, and B. Poole, “Categorical reparameterization with gumbel-softmax,” arXiv preprint arXiv:1611.01144, 2016. [31] C. J. Maddison, A. Mnih, and Y. W. Teh, “The concrete distribution: A continuous relaxation of discrete random variables,” arXiv preprint arXiv:1611.00712, 2016. [32] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, “Continuous control with deep reinforcement learning,” arXiv preprint arXiv:1509.02971, 2015. [33] P. Dhariwal, C. Hesse, O. Klimov, A. Nichol, M. Plappert, A. Radford, J. Schulman, S. Sidor, and Y. Wu, “Openai baselines.” https://github.com/openai/baselines, 2017. [34] Y. Li, J. Song, and S. Ermon, “Infogail: Interpretable imitation learning from visual demonstrations,” arXiv preprint arXiv:1703.08840, 2017. [35] J. K. Gupta and M. Egorov, “Multi-agent deep reinforcement learning environment.” https: //github.com/sisl/madrl, 2017. [36] J. A. Bagnell, “An invitation to imitation,” tech. rep., CARNEGIE-MELLON UNIV PITTSBURGH PA ROBOTICS INST, 2015. [37] D. A. Pomerleau, “Efficient training of artificial neural networks for autonomous navigation,” Neural Computation, vol. 3, no. 1, pp. 88–97, 1991. [38] S. Ross and D. Bagnell, “Efficient reductions for imitation learning.,” in AISTATS, pp. 3–5, 2010. [39] S. Barrett, A. Rosenfeld, S. Kraus, and P. Stone, “Making friends on the fly: Cooperating with new teammates,” Artificial Intelligence, vol. 242, pp. 132–171, 2017. 11 [40] H. M. Le, Y. Yue, and P. Carr, “Coordinated multi-agent imitation learning,” arXiv preprint arXiv:1703.03121, 2017. [41] A. Šošic, W. R. KhudaBukhsh, A. M. Zoubir, and H. Koeppl, “Inverse reinforcement learning in swarm systems,” stat, vol. 1050, p. 17, 2016. [42] K. Bogert and P. Doshi, “Multi-robot inverse reinforcement learning under occlusion with interactions,” in Proceedings of the 2014 international conference on Autonomous agents and multi-agent systems, pp. 173–180, International Foundation for Autonomous Agents and Multiagent Systems, 2014. [43] X. Lin, P. A. Beling, and R. Cogill, “Multi-agent inverse reinforcement learning for zero-sum games,” arXiv preprint arXiv:1403.6508, 2014. [44] T. S. Reddy, V. Gopikrishna, G. Zaruba, and M. Huber, “Inverse reinforcement learning for decentralized non-cooperative multiagent systems,” in Systems, Man, and Cybernetics (SMC), 2012 IEEE International Conference on, pp. 1930–1935, IEEE, 2012. [45] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, “Generative adversarial nets,” in Advances in neural information processing systems, pp. 2672–2680, 2014. [46] J. Martens and R. Grosse, “Optimizing neural networks with kronecker-factored approximate curvature,” in International Conference on Machine Learning, pp. 2408–2417, 2015. [47] J. Schulman, P. Moritz, S. Levine, M. Jordan, and P. Abbeel, “High-dimensional continuous control using generalized advantage estimation,” arXiv preprint arXiv:1506.02438, 2015. 12
2018
163
7,323
Discovery of Latent 3D Keypoints via End-to-end Geometric Reasoning Supasorn Suwajanakorn▷∗Noah Snavely♦ Jonathan Tompson♦ Mohammad Norouzi♦ supasorn@vistec.ac.th, {snavely, tompson, mnorouzi}@google.com ▷Vidyasirimedhi Institute of Science and Technology ♦Google AI Abstract This paper presents KeypointNet, an end-to-end geometric reasoning framework to learn an optimal set of category-specific 3D keypoints, along with their detectors. Given a single image, KeypointNet extracts 3D keypoints that are optimized for a downstream task. We demonstrate this framework on 3D pose estimation by proposing a differentiable objective that seeks the optimal set of keypoints for recovering the relative pose between two views of an object. Our model discovers geometrically and semantically consistent keypoints across viewing angles and instances of an object category. Importantly, we find that our end-to-end framework using no ground-truth keypoint annotations outperforms a fully supervised baseline using the same neural network architecture on the task of pose estimation. The discovered 3D keypoints on the car, chair, and plane categories of ShapeNet [6] are visualized at keypointnet.github.io. 1 Introduction Convolutional neural networks have shown that jointly optimizing feature extraction and classification pipelines can significantly improve object recognition [26, 25]. That being said, current approaches to geometric vision problems, such as 3D reconstruction [47] and shape alignment [29], comprise a separate keypoint detection module, followed by geometric reasoning as a post-process. In this paper, we explore whether one can benefit from an end-to-end geometric reasoning framework, in which keypoints are jointly optimized as a set of latent variables for a downstream task. Consider the problem of determining the 3D pose of a car in an image. A standard solution first detects a sparse set of category-specific keypoints, and then uses such points within a geometric reasoning framework (e.g., a PnP algorithm [28]) to recover the 3D pose or camera angle. Towards this end, one can develop a set of keypoint detectors by leveraging strong supervision in the form of manual keypoint annotations in different images of an object category, or by using expensive and error prone offline model-based fitting methods. Researchers have compiled large datasets of annotated keypoints for faces [44], hands [51], and human bodies [3, 30]. However, selection and consistent annotation of keypoints in images of an object category is expensive and ill-defined. To devise a reasonable set of points, one should take into account the downstream task of interest. Directly optimizing keypoints for a downstream geometric task should naturally encourage desirable keypoint properties such as distinctiveness, ease of detection, diversity, etc. This paper presents KeypointNet, an end-to-end geometric reasoning framework to learn an optimal set of category-specific 3D keypoints, along with their detectors, for a specific downstream task. Our novelty stands in contrast to prior work that learns latent keypoints through an arbitrary proxy self-supervision objective, such as reconstruction [63, 17]. Our framework is applicable to any downstream task represented by an objective function that is differentiable with respect to keypoint positions. We formulate 3D pose estimation as one such task, and our key technical contributions include (1) a novel differentiable pose estimation objective and (2) a multi-view consistency loss ∗Work done while S. Suwajanakorn was a member of the Google AI Residency program (g.co/airesidency). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. function. The pose objective seeks optimal keypoints for recovering the relative pose between two views of an object. The multi-view consistency loss encourages consistent keypoint detections across 3D transformations of an object. Notably, we propose to detect 3D keypoints (2D points with depth) from individual 2D images and formulate pose and consistency losses for such 3D keypoint detections. We show that KeypointNet discovers geometrically and semantically consistent keypoints across viewing angles as well as across object instances of a given class. Some of the discovered keypoints correspond to interesting and semantically meaningful parts, such as the wheels of a car, and we show how these 3D keypoints can infer their depths without access to object geometry. We conduct three sets of experiments on different object categories from the ShapeNet dataset [6]. We evaluate our technique against a strongly supervised baseline based on manually annotated keypoints on the task of relative 3D pose estimation. Surprisingly, we find that our end-to-end framework achieves significantly better results, despite the lack of keypoint annotations. 2 Related Work Both 2D and 3D keypoint detection are long-standing problems in computer vision, where keypoint inference is traditionally used as an early stage in object localization pipelines [27]. As an example, a successful early application of modern convolutional neural networks (CNNs) was on detecting 2D human joint positions from monocular RGB images. Due to its compelling utility for HCI, motion capture, and security applications, a large body of work has since developed in this joint detection domain [53, 52, 39, 37, 62, 38, 20, 14]. More related to our work, a number of recent CNN-based techniques have been developed for 3D human keypoint detection from monocular RGB images, which use various architectures, supervised objectives, and 3D structural priors to directly infer a predefined set of 3D joint locations [36, 34, 8, 35, 12]. Other techniques use inferred 2D keypoint detectors and learned 3D priors to perform “2D-to-3D-lifting” [41, 7, 66, 33] or find data-to-model correspondences from depth images [40]. Honari et al. [18] improve landmark localization by incorporating semi-supervised tasks such as attribute prediction and equivariant landmark prediction. In contrast, our set of keypoints is not defined a priori and is instead a latent set that is optimized end-to-end to improve inference for a geometric estimation problem. A body of work also exists for more generalized, albeit supervised, keypoint detection, e.g., [15, 61]. Enforcing latent structure in CNN feature representations has been explored for a number of domains. For instance, the capsule framework [17] and its variants [43, 16] encode activation properties in the magnitude and direction of hidden-state vectors and then combine them to build higher-level features. The output of our KeypointNet can be seen as a similar form of latent 3D feature, which is encouraged to represent a set of 3D keypoint positions due to the carefully constructed consistency and relative pose objective functions. Recent work has demonstrated 2D correspondence matching across intra-class instances with large shape and appearance variation. For instance, Choy et al. [9] use a novel contrastive loss based on appearance to encode geometry and semantic similarity. Han et al. [13] propose a novel SCNet architecture for learning a geometrically plausible model for 2D semantic correspondence. Wang et al. [60] rely on deep features and perform a multi-image matching across an image collection by solving a feature selection and labeling problem. Thewlis et al. [49] use ground-truth transforms (optical flow between image pairs) and point-wise matching to learn a dense object-centric coordinate frame with viewpoint and image deformation invariance. Similarly, Agrawal et al. [2] use egomotion prediction between image pairs to learn semi-supervised feature representations, and show that these features are competitive with supervised features for a variety of tasks. Other work has sought to learn latent 2D or 3D features with varying amounts of supervision. Arie-Nachimson & Basri [4] build 3D models of rigid objects and exploit these models to estimate 3D pose from a 2D image as well as a collection of 3D latent features and visibility properties. Inspired by cycle consistency for learning correspondence [19, 65], Zhou et al. [64] train a CNN to predict correspondence between different objects of the same semantic class by utilizing CAD models. Independent from our work, Zhang et al. [63] discover sparse 2D landmarks of images of a known object class as explicit structure representation through a reconstruction objective. Similarly, Jakab and Gupta et al. [23] use conditional image generation and reconstruction objective to learn 2D keypoints that capture geometric changes in training image pairs. Rhodin et al. [42] uses a 2 Figure 1: During training, two views of the same object are given as input to the KeypointNet. The known rigid transformation (R, t) between the two views is provided as a supervisory signal. We optimize an ordered list of 3D keypoints that are consistent in both views and enable recovery of the transformation. During inference, KeypointNet extracts 3D keypoints from an individual input image. multi-view consistency loss, similar to ours, to infer 3D latent variables specifically for human pose estimation task. In contrast to [64, 63, 23, 42], our latent keypoints are optimized for a downstream task, which encourages more directed keypoint selection. By representing keypoints in true physical 3D structures, our method can even find occluded correspondences between images with large pose differences, e.g., large out-of-plane rotations. Approaches for finding 3D correspondence have been investigated. Salti et al. [45] cast 3D keypoint detection as a binary classification between points whose ground-truth similarity label is determined by a predefined 3D descriptor. Zhou et al. [67] use view-consistency as a supervisory signal to predict 3D keypoints, although only on depth maps. Similarly, Su et al. [48] leverage synthetically rendered models to estimate object viewpoint by matching them to real-world image via CNN viewpoint embedding. Besides keypoints, self-supervision based on geometric and motion reasoning has been used to predict other forms of output, such as 3D shape represented as blendshape coefficients for human motion capture [57]. 3 End-to-end Optimization of 3D Keypoints Given a single image of a known object category, our model predicts an ordered list of 3D keypoints, defined as pixel coordinates and associated depth values. Such keypoints are required to be geometrically and semantically consistent across different viewing angles and instances of an object category (e.g., see Figure 4). Our KeypointNet has N heads that extract N keypoints, and the same head tends to extract 3D points with the same semantic interpretation. These keypoints will serve as a building block for feature representations based on a sparse set of points, useful for geometric reasoning and pose-aware or pose-invariant object recognition (e.g., [43]). In contrast to approaches that learn a supervised mapping from images to a list of annotated keypoint positions, we do not define the keypoint positions a priori. Instead, we jointly optimize keypoints with respect to a downstream task. We focus on the task of relative pose estimation at training time, where given two views of the same object with a known rigid transformation T, we aim to predict optimal lists of 3D keypoints, P1 and P2 in the two views that best match one view to the other (Figure 1). We formulate an objective function O(P1, P2), based on which one can optimize a parametric mapping from an image to a list of keypoints. Our objective consists of two primary components: • A multi-view consistency loss that measures the discrepancy between the two sets of points under the ground truth transformation. • A relative pose estimation loss, which penalizes the angular difference between the ground truth rotation R vs. the rotation ˆR recovered from P1 and P2 using orthogonal procrustes. We demonstrate that these two terms allow the model to discover important keypoints, some of which correspond to semantically meaningful locations that humans would naturally select for different object classes. Note that we do not directly optimize for keypoints that are semantically meaningful, as those may be sub-optimal for downstream tasks or simply hard to detect. In what follows, we first explain our objective function and then describe the neural architecture of KeypointNet. 3 Notation. Each training tuple comprises a pair of images (I, I′) of the same object from different viewpoints, along with their relative rigid transformation T ∈SE(3), which transforms the underlying 3D shape from I to I′. T has the following matrix form: T =  R3×3 t3×1 0 1  , (1) where R and t represent a 3D rotation and translation respectively. We learn a function fθ(I), parametrized by θ, that maps a 2D image I to a list of 3D points P = (p1, . . . , pN) where pi ≡ (ui, vi, zi), by optimizing an objective function of the form O(fθ(I), fθ(I′)). 3.1 Multi-view consistency The goal of our multi-view consistency loss is to ensure that the keypoints track consistent parts across different views. Specifically, a 3D keypoint in one image should project onto the same pixel location as the corresponding keypoint in the second image. For this task, we assume a perspective camera model with a known global focal length f. Below, we use [x, y, z] to denote 3D coordinates, and [u, v] to denote pixel coordinates. The projection of a keypoint [u, v, z] from image I into image I′ (and vice versa) is given by the projection operators: [ˆu, ˆv, ˆz, 1]⊤ ∼ πTπ−1([u, v, z, 1]⊤) [ ˆu′, ˆv′, ˆz′, 1]⊤ ∼ πT −1π−1([u′, v′, z′, 1]⊤) where, for instance, ˆu denotes the projection of u to the second view, and ˆu′ denotes the projection of u′ to the first view. Here, π : R4 →R4 represents the perspective projection operation that maps an input homogeneous 3D coordinate [x, y, z, 1]⊤in camera coordinates to a pixel position plus depth: π([x, y, z, 1]⊤) = fx z , fy z , z, 1 ⊤ = [u, v, z, 1]⊤ (2) We define a symmetric multi-view consistency loss as: Lcon = 1 2N N X i=1 [ui, vi, u′ i, v′ i]⊤−[ ˆu′ i, ˆv′ i, ˆui, ˆvi]⊤ 2 (3) We measure error only in the observable image space (u, v) as opposed to also using z, because depth is never directly observed, and usually has different units compared to u and v. Note however that predicting z is critical for us to be able to project points between the two views. Enforcing multi-view consistency is sufficient to infer a consistent set of 2D keypoint positions (and depths) across different views. However, this consistency alone often leads to a degenerate solution where all keypoints collapse to a single location, which is not useful. One can encode an explicit notion of diversity to prevent collapsing, but there still exists infinitely many solutions that satisfy multi-view consistency. Rather, what we need is a notion of optimality for selecting keypoints which has to be defined with respect to some downstream task. For that purpose, we use pose estimation as a task which naturally encourages keypoint separation so as to yield well-posed estimation problems. 3.2 Relative pose estimation One important application of keypoint detection is to recover the relative transformation between a given pair of images. Accordingly, we define a differentiable objective that measures the misfit between the estimated relative rotation ˆR (computed via Procrustes’ alignment of the two sets of keypoints) and the ground truth R. Given the translation equivariance property of our keypoint prediction network (Section 4) and the view consistency loss above, we omit the translation error in this objective. The pose estimation objective is defined as : Lpose = 2 arcsin  1 2 √ 2 ˆR −R F  (4) which measures the angular distance between the optimal least-squares estimate ˆR computed from the two sets of keypoints, and the ground truth relative rotation matrix R. Fortunately, we can formulate this objective in terms of fully differentiable operations. 4 To estimate ˆR, let X and X′ ∈R3×N denote two matrices comprising unprojected 3D keypoint coordinates for the two views. In other words, let X ≡[X1, . . . , XN] and Xi ≡(π−1pi)[:3] , where [:3] returns the first 3 coordinates of its input. Similarly X′ denotes unprojected points in P ′. Let ˜X and ˜X′ denote the mean-subtracted version of X and X′, respectively. The optimal least-squares rotation ˆR between the two sets of keypoints is then given by: ˆR = V diag(1, 1, . . . , det(V U ⊤))U ⊤, (5) where U, Σ, V ⊤= SVD( ˜X ˜X′⊤). This estimation problem to recover ˆR is known as the orthogonal Procrustes problem [46]. To ensure that ˜X ˜ X′⊤is invertible and to increase the robustness of the keypoints, we add Gaussian noise to the 3D coordinates of the keypoints (X and X′) and instead seek the best rotation under some noisy predictions of keypoints. To minimize the angular distance (4), we backpropagate through the SVD operator using matrix calculus [22, 10]. Empirically, the pose estimation objective helps significantly in producing a reasonable and natural selection of latent keypoints, leading to the automatic discovery of interesting parts such as the wheels of a car, the cockpit and wings of a plane, or the legs and back of a chair. We believe this is because these parts are geometrically consistent within an object class (e.g., circular wheels appear in all cars), easy to track, and spatially varied, all of which improve the performance of the downstream task. 4 KeypointNet Architecture One important property for the mapping from images to keypoints is translation equivariance at the pixel level. That is, if we shift the input image, e.g., to the left by one pixel, the output locations of all keypoints should also be changed by one unit. Training a standard CNN without this property would require a larger training set that contains objects at every possible location, while still providing no equivariance guarantees at inference time. We propose the following simple modifications to achieve equivariance. Instead of regressing directly to the coordinate values, we ask the network to output a probability distribution map gi(u, v) that represents how likely keypoint i is to occur at pixel (u, v), with P u,v gi(u, v) = 1. We use a spatial softmax layer to produce such a distribution over image pixels [11]. We then compute the expected values of these spatial distributions to recover a pixel coordinate: [ui, vi]⊤= X u,v [u · gi(u, v), v · gi(u, v)]⊤ (6) For the z coordinates, we also predict a depth value at every pixel, denoted di(u, v), and compute zi = X u,v di(u, v)gi(u, v). (7) To produce a probability map with the same resolution and equivariance property, we use strided-one fully convolutional architectures [31], also used for semantic segmentation. To increase the receptive field of the network, we stack multiple layers of dilated convolutions, similar to [59]. Our emphasis on designing an equivariant network not only helps significantly reduce the number of training examples required to achieve good generalization, but also removes the computational burden of converting between two representations (spatial-encoded in image to value-encoded in coordinates) from the network, so that it can focus on other critical tasks such as inferring depth. Architecture details. All kernels for all layers are 3×3, and we stack 13 layers of dilated convolutions with dilation rates of 1, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 1, all with 64 output channels except the last layer which has 2N output channels, split between gi and di. We use leakyRelu and Batch Normalization [21] for all layers except the last layer. The output layers for di have no activation function, and the channels are passed through a spatial softmax to produce gi. Finally, gi and di are then converted to actual coordinates pi using Equations (6) and (7). Breaking symmetry. Many object classes are symmetric across at least one axis, e.g., the left side of a sedan looks like the right side flipped. This presents a challenge to the network because different parts can appear visually identical, and can only be resolved by understanding global context. For example, distinguishing the left wheels from the right wheels requires knowing its orientation 5 (i.e., whether it is facing left or right). Both supervised and unsupervised techniques benefit from some global conditioning to aid in breaking ties and to make the keypoint prediction more deterministic. To help break symmetries, one can condition the keypoint prediction on some coarse quantization of the pose. Such a coarse-to-fine approach to keypoint detection is discussed in more depth in [56]. One simple such conditioning is a binary flag that indicates whether the dominant direction of an object is facing left or right. This dominant direction comes from the ShapeNet dataset we use (Section 6), where the 3D models are consistently oriented. To infer keypoints without this flag at inference time, we train a network with the same architecture, although half the size, to predict this binary flag. In particular, we train this network to predict the projected pixel locations of two 3D points [1, 0, 0] and [−1, 0, 0], transformed into each view in a training pair. These points correspond to the front and back of a normalized object. This network has a single L2 loss between the predicted and the ground-truth locations. The binary flag is 1 if the x−coordinate of the projected pixel of the first point is greater than that of the second point. This flag is then fed into the keypoint prediction network. 5 Additional Keypoint Characteristics In addition to the main objectives introduced above, there are common, desirable characteristics of keypoints that can benefit many possible downstream tasks, in particular: • No two keypoints should share the same 3D location. • Keypoints should lie within the object’s silhouette. Separation loss penalizes two keypoints if they are closer than a hyperparameter δ in 3D: Lsep = 1 N 2 N X i=1 N X j̸=i max  0, δ2 −∥Xi −Xj∥2 (8) Unlike the consistency loss, this loss is computed in 3D to allow multiple keypoints to occupy the same pixel location as long as they have different depths. We prefer a robust, bounded support loss over an unbounded one (e.g., exponential discounting) because it does not exhibit a bias towards certain structures, such as a honeycomb, or towards placing points infinitely far apart. Instead, it encourages the points to be sufficiently far from one another. Ideally, a well-distributed set of keypoints will automatically emerge without constraining the distance of keypoints. However, in the absence of keypoint location supervision, our objective with latent keypoints can converge to a local minimum with two keypoints collapsing to one. The main goal of this separation loss is to prevent such degenerate cases, and not to directly promote separation. Silhouette consistency encourages the keypoints to lie within the silhouette of the object of interest. As described above, our network predicts (ui, vi) coordinates of the ith keypoint via a spatial distribution, denoted gi(u, v), over possible keypoint positions. One way to ensure silhouette consistency, is by only allowing a non-zero probability inside the silhouette of the object, as well as encouraging the spatial distribution to be concentrated, i.e., uni-modal with a low variance. During training, we have access to the binary segmentation mask of the object b(u, v) ∈{0, 1} in each image, where 1 means foreground object. The silhouette consistency loss is defined as Lobj = 1 N N X i=1 −log X u,v b(u, v)gi(u, v) (9) Note that this binary mask is only used to compute the loss and not used at inference time. This objective incurs a zero cost if all of the probability mass lies within the silhouette. We also include a term to minimize the variance of each of the distribution maps: Lvar = 1 N N X i=1 X u,v gi(u, v) [u, v]⊤−[ui, vi]⊤ 2 (10) This term encourages the distributions to be peaky, which has the added benefit of helping keep their means within the silhouette in the case of non-convex object boundaries. 6 0 20 40 60 80 100 120 140 160 180 a) Supervised 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Probability 0 20 40 60 80 100 120 140 160 180 b) Supervised with Pretrained Orientation Network 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0 20 40 60 80 100 120 140 160 180 c) Unsupervised with Pretrained Orientation Network 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0 20 40 60 80 100 120 140 160 180 d) Unsupervised (Ours) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Angular Errors Figure 2: Histogram plots of angular distance errors, average across car, plane, and chair categories, between the ground-truth relative rotations and the least-squares estimates computed from two sets of keypoints predicted from test pairs. a) is a supervised method trained with a single L2 loss between the pixel location prediction to the human labels. b) is the same as a) except the network is given an additional orientation flag predicted from a pretrained orientation network. c) is our network that uses the same pretrained orientation network as b), and d) is our unsupervised method trained jointly (the orientation and keypoint networks). 6 Experiments Training data. Our training data is generated from ShapeNet [6], a large-scale database of approximately 51K 3D models across 270 categories. We create separate training datasets for various object categories, including car, chair, and plane. For each model in each category, we normalize the object so that the longest dimension lies in [−1, 1], and render 200 images of size 128 × 128 under different viewpoints to form 100 training pairs. The camera viewpoints are randomly sampled around the object from a fixed distance, all above the ground with zero roll angle. We then add small random shifts to the camera positions. Implementation details. We implemented our network in TensorFlow [1], and trained with the Adam optimizer with a learning rate of 10−3, β1 = 0.9, β2 = 0.999, and a total batch size of 256. We use the following weights for the losses: (αcon, αpose, αsep, αobj) = (1, 0.2, 1.0, 1.0). We train the network for 200K steps using synchronous training with 32 replicas. 6.1 Comparison with a supervised approach To evaluate against a supervised approach, we collected human landmark labels for three object categories (cars, chairs, and planes) from ShapeNet using Amazon Mechanical Turk. For each object, we ask three different users to click on points corresponding to reference points shown as an example to the user. These reference points are based on the Pascal3D+ dataset (12 points for cars, 10 for chairs, 8 for planes). We render the object from multiple views so that each specified point is facing outward from the screen. We then compute the average pixel location over user annotations for each keypoint, and triangulate corresponding points across views to obtain 3D keypoint coordinates. For each category, we train a network with the same architecture as in Section 4 using the supervised labels to output keypoint locations in normalized coordinates [−1, 1], as well as depths, using an L2 loss to the human labels. We then compute the angular distance error on 10% of the models for each category held out as a test set. (This test set corresponds to 720 models of cars, 200 chairs, and 400 planes. Each individual model produces 100 test image pairs.) In Figure 2, we plot the histograms of angular errors of our method vs. the supervised technique trained to predict the same number of keypoints, and show error statistics in Table 1. For a fair comparison against the supervised technique, we provide an additional orientation flag to the supervised network. This is done by training another version of the supervised network that receives the orientation flag predicted from a pre-trained orientation network. Additionally, we tested a more comparable version of our unsupervised network where we use and fix the same pre-trained orientation network during training. The mean and median accuracy of the predicted orientation flags on the test sets are as follows: cars: (96.0%, 99.0%), planes: (95.5%, 99.0%), chairs: (97.1%, 99.0%). Our unsupervised technique produces lower mean and median rotation errors than both versions of the supervised technique. Note that our technique sometimes incorrectly predicts keypoints that are 180◦from the correct orientation due to incorrect orientation prediction. 7 Cars Planes Chairs Method Mean Median 3D-SE Mean Median 3D-SE Mean Median 3D-SE a) Supervised 16.268 5.583 0.240 18.350 7.168 0.233 21.882 8.771 0.269 b) Supervised with 13.961 4.475 0.197 17.800 6.802 0.230 20.502 8.261 0.248 pretrained O-Net c) Ours with pretrained O-Net 13.500 4.418 0.165 18.561 6.407 0.223 14.238 5.607 0.203 d) Ours 11.310 3.372 0.171 17.330 5.721 0.230 14.572 5.420 0.196 Table 1: Mean and median angular distance errors between the ground-truth rotation and the Procrustes estimate computed from two sets of predicted keypoints on test pairs. O-Net is the network that predicts a binary orientation. 3D-SE is the standard errors described in Section 6.1. Figure 3: Keypoint results on single objects from different views. Note that these keypoints are predicted consistently across views even when they are completely occluded. (e.g., the red point that tracks the back right leg of the chair.) Please see keypointnet.github.io for visualizations. Figure 4: Results on ShapeNet [6] test sets for cars, planes, and chairs. Our network is able to generalize across unseen appearances and shape variations, and consistently predict occluded parts such as wheels and chair legs. Keypoint location consistency. To evaluate the consistency of predicted keypoints across views, we transform the keypoints predicted for the same object under different views to object space using the known camera matrices used for rendering. Then we compute the standard error of 3D locations for all keypoints across all test cars (3D-SE in Table 1). To disregard outliers when the network incorrectly infers the orientation, we compute this metric only for keypoints whose error in rotation estimate is less than 90◦(left halves of the histograms in Figure 2), for both the supervised method and our unsupervised approach. 6.2 Generalization across views and instances In this section, we show qualitative results of our keypoint predictions on test cars, chairs, and planes using a default number of 10 keypoints for all categories. (We show results with varying numbers of keypoints in the Appendix.) In Figure 3, we show keypoint prediction results on single objects from different views. Some of these views are quite challenging such as the top-down view of the chair. However, our network is able to infer the orientation and predict occluded parts such as the chair legs. In Figure 4, we run our network on many instances of test objects. Note that during training, the network only sees a pair of images of the same model, but it is able to utilize the same keypoints for semantically similar parts across all instances from the same class. For example, the blue keypoints always track the cockpit of the planes. In contrast to prior work [49, 17, 63] that learns latent representations by training with restricted classes of transformations, such as affine or 2D optical flow, and demonstrates results on images with small pose variations, we learn through physical 3D transformation and are able to produce a consistent set of 3D keypoints from any angle. 8 Our method can also be used to establish correspondence between two views under out-of-plane or even 180◦rotations when there is no visual overlap. Failure cases. When our orientation network fails to predict the correct orientation, the output keypoints will be flipped as shown in Figure 5. This happens for cars whose front and back look very similar, or for unusual wing shapes that make inference of the dominant direction difficult. Figure 5: Failure cases. 7 Discussion & Future work We explore the possibility of optimizing a representation based on a sparse set of keypoints or landmarks, without access to keypoint annotations, but rather based on an end-to-end geometric reasoning framework. We show that, indeed, one can discover consistent keypoints across multiple views and object instances by adopting two novel objective functions: a relative pose estimation loss and a multi-view consistency objective. Our translation equivariant architecture is able to generalize to unseen object instances of ShapeNet categories [6]. Importantly, our discovered keypoints outperform those from a direct supervised learning baseline on the problem of rigid 3D pose estimation. We present preliminary results on the transfer of the learned keypoint detectors to real world images by training on ShapeNet images with random backgrounds (see supplemental material). Further improvements may be achieved by leveraging recent work in domain adaptation [24, 54, 50, 5, 58]. Alternatively, one can train KeypointNet directly on real images provided relative pose labels. Such labels may be estimated automatically using Structure-from-Motion [32]. Another interesting direction would be to jointly solve for the relative transformation or rely on a coarse pose initialization, inspired by [55], to extend this framework to objects that lack 3D models or pose annotations. Our framework could also be extended to handle an arbitrary number of keypoints. For example, one could predict a confidence value for each keypoint, then threshold to identify distinct ones, while using a loss that operates on unordered sets of keypoints. Visual descriptors could also be incorporated under our framework, either through a post-processing task or via joint end-to-end optimization of both the detector and the descriptor. 8 Acknowledgement We would like to thank Chi Zeng who helped setup the Mechanical Turk tasks for our evaluations. References [1] 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´e, 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´egas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: Large-scale machine learning on heterogeneous distributed systems, 2015. [2] Pulkit Agrawal, Joao Carreira, and Jitendra Malik. Learning to see by moving. ICCV, 2015. [3] Mykhaylo Andriluka, Leonid Pishchulin, Peter Gehler, and Bernt Schiele. 2D human pose estimation: New benchmark and state of the art analysis. CVPR, 2014. [4] M. Arie-Nachimson and R. Basri. Constructing implicit 3D shape models for pose estimation. ICCV, 2009. [5] Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. CVPR, 2017. [6] Angel X. Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: An Information-Rich 3D Model Repository. arXiv:1512.03012, 2015. 9 [7] Ching-Hang Chen and Deva Ramanan. 3D human pose estimation= 2D pose estimation+ matching. CVPR, 2017. [8] Yu Chen, Chunhua Shen, Xiu-Shen Wei, Lingqiao Liu, and Jian Yang. Adversarial learning of structure-aware fully convolutional networks for landmark localization. arXiv:1711.00253, 2017. [9] Christopher B Choy, JunYoung Gwak, Silvio Savarese, and Manmohan Chandraker. Universal correspondence network. NIPS, 2016. [10] Mike Giles. An extended collection of matrix derivative results for forward and reverse mode automatic differentiation. Oxford University, 2008. [11] Ross Goroshin, Michael F Mathieu, and Yann LeCun. Learning to linearize under uncertainty. NIPS, 2015. [12] Rıza Alp G¨uler, Natalia Neverova, and Iasonas Kokkinos. Densepose: Dense human pose estimation in the wild. arXiv:1802.00434, 2018. [13] Kai Han, Rafael S Rezende, Bumsub Ham, Kwan-Yee K Wong, Minsu Cho, Cordelia Schmid, and Jean Ponce. SCNet: Learning semantic correspondence. ICCV, 2017. [14] Kaiming He, Georgia Gkioxari, Piotr Doll´ar, and Ross Girshick. Mask R-CNN. ICCV, 2017. [15] Mohsen Hejrati and Deva Ramanan. Analyzing 3d objects in cluttered images. NIPS, 2012. [16] Geoffrey Hinton, Nicholas Frosst, and Sara Sabour. Matrix capsules with em routing. ICLR, 2018. [17] Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. Int. Conf. on Artificial Neural Networks, 2011. [18] Sina Honari, Pavlo Molchanov, Stephen Tyree, Pascal Vincent, Christopher Pal, and Jan Kautz. Improving landmark localization with semi-supervised learning. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. [19] Qi-Xing Huang and Leonidas Guibas. Consistent shape maps via semidefinite programming. Computer Graphics Forum, 2013. [20] Shaoli Huang, Mingming Gong, and Dacheng Tao. A coarse-fine network for keypoint localization. ICCV, 2017. [21] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. ICML, 2015. [22] Catalin Ionescu, Orestis Vantzos, and Cristian Sminchisescu. Matrix backpropagation for deep networks with structured layers. ICCV, 2015. [23] Tomas Jakab, Ankush Gupta, Hakan Bilen, and Andrea Vedaldi. Conditional image generation for learning the structure of visual objects. arXiv preprint arXiv:1806.07823, 2018. [24] Matthew Johnson-Roberson, Charles Barto, Rounak Mehta, Sharath Nittur Sridhar, Karl Rosaen, and Ram Vasudevan. Driving in the Matrix: Can virtual worlds replace human-generated annotations for real world tasks? ICRA, pages 746–753, 2017. [25] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet classification with deep convolutional neural networks. NIPS, 2012. [26] Yann LeCun, L´eon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. [27] Vincent Lepetit and Pascal Fua. Keypoint recognition using randomized trees. IEEE Trans. PAMI, 28(9):1465–1479, 2006. [28] Vincent Lepetit, Francesc Moreno-Noguer, and Pascal Fua. EPnP: An accurate O(n) solution to the PnP problem. IJCV, 2008. [29] Yan Li, Leon Gu, and Takeo Kanade. A robust shape model for multi-view car alignment. CVPR, 2009. [30] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Doll´ar, and C Lawrence Zitnick. Microsoft COCO: Common objects in context. ECCV, 2014. 10 [31] Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. CVPR, 2015. [32] H Christopher Longuet-Higgins. A computer algorithm for reconstructing a scene from two projections. Nature, 293(5828):133, 1981. [33] Julieta Martinez, Rayat Hossain, Javier Romero, and James J Little. A simple yet effective baseline for 3D human pose estimation. ICCV, 2017. [34] Dushyant Mehta, Helge Rhodin, Dan Casas, Pascal Fua, Oleksandr Sotnychenko, Weipeng Xu, and Christian Theobalt. Monocular 3D human pose estimation in the wild using improved CNN supervision. 3DV, 2017. [35] Dushyant Mehta, Oleksandr Sotnychenko, Franziska Mueller, Weipeng Xu, Srinath Sridhar, Gerard Pons-Moll, and Christian Theobalt. Single-shot multi-person 3D body pose estimation from monocular RGB input. arXiv:1712.03453, 2017. [36] Dushyant Mehta, Srinath Sridhar, Oleksandr Sotnychenko, Helge Rhodin, Mohammad Shafiei, Hans-Peter Seidel, Weipeng Xu, Dan Casas, and Christian Theobalt. VNect: Real-time 3D Human Pose Estimation with a Single RGB Camera. ACM Transactions on Graphics, 2017. [37] Alejandro Newell, Kaiyu Yang, and Jia Deng. Stacked hourglass networks for human pose estimation. ECCV, 2016. [38] George Papandreou, Tyler Zhu, Nori Kanazawa, Alexander Toshev, Jonathan Tompson, Chris Bregler, and Kevin Murphy. Towards accurate multiperson pose estimation in the wild. arXiv:1701.01779, 2017. [39] Leonid Pishchulin, Eldar Insafutdinov, Siyu Tang, Bjoern Andres, Mykhaylo Andriluka, Peter Gehler, and Bernt Schiele. DeepCut: Joint subset partition and labeling for multi person pose estimation. CVPR, June 2016. [40] Gerard Pons-Moll, Jonathan Taylor, Jamie Shotton, Aaron Hertzmann, and Andrew Fitzgibbon. Metric regression forests for correspondence estimation. IJCV, 113(3):163–175, 2015. [41] Varun Ramakrishna, Takeo Kanade, and Yaser Sheikh. Reconstructing 3d human pose from 2d image landmarks. ECCV, 2012. [42] Helge Rhodin, Mathieu Salzmann, and Pascal Fua. Unsupervised geometry-aware representation for 3d human pose estimation. arXiv preprint arXiv:1804.01110, 2018. [43] Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. NIPS, 2017. [44] Christos Sagonas, Epameinondas Antonakos, Georgios Tzimiropoulos, Stefanos Zafeiriou, and Maja Pantic. 300 faces in-the-wild challenge: Database and results. Image and Vision Computing, 2016. [45] Samuele Salti, Federico Tombari, Riccardo Spezialetti, and Luigi Di Stefano. Learning a descriptor-specific 3d keypoint detector. ICCV, 2015. [46] Peter Sch¨onemann. A generalized solution of the orthogonal Procrustes problem. Psychometrika, 1966. [47] Noah Snavely, Steven M Seitz, and Richard Szeliski. Photo tourism: exploring photo collections in 3D. ACM transactions on graphics (TOG), 2006. [48] Hao Su, Charles R Qi, Yangyan Li, and Leonidas J Guibas. Render for CNN: Viewpoint estimation in images using CNNs trained with rendered 3D model views. ICCV, 2015. [49] James Thewlis, Hakan Bilen, and Andrea Vedaldi. Unsupervised learning of object frames by dense equivariant image labelling. NIPS, 2017. [50] 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. IROS, pages 23–30, 2017. [51] Jonathan Tompson, Murphy Stein, Yann Lecun, and Ken Perlin. Real-time continuous pose recovery of human hands using convolutional networks. ACM Transactions on Graphics, 33, 2014. [52] Jonathan J Tompson, Arjun Jain, Yann LeCun, and Christoph Bregler. Joint training of a convolutional network and a graphical model for human pose estimation. NIPS, 2014. 11 [53] Alexander Toshev and Christian Szegedy. Deeppose: Human pose estimation via deep neural networks. CVPR, 2014. [54] Jonathan Tremblay, Aayush Prakash, David Acuna, Mark Brophy, Varun Jampani, Cem Anil, Thang To, Eric Cameracci, Shaad Boochoon, and Stan Birchfield. Training deep networks with synthetic data: Bridging the reality gap by domain randomization. arXiv preprint arXiv:1804.06516, 2018. [55] Bill Triggs, Philip F McLauchlan, Richard I Hartley, and Andrew W Fitzgibbon. Bundle adjustmenta modern synthesis. International workshop on vision algorithms, pages 298–372, 1999. [56] Shubham Tulsiani and Jitendra Malik. Viewpoints and keypoints. CVPR, 2015. [57] Hsiao-Yu Tung, Hsiao-Wei Tung, Ersin Yumer, and Katerina Fragkiadaki. Self-supervised learning of motion capture. In Advances in Neural Information Processing Systems, pages 5236–5246, 2017. [58] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. CVPR, 2017. [59] 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:1609.03499, 2016. [60] Qianqian Wang, Xiaowei Zhou, and Kostas Daniilidis. Multi-image semantic matching by mining consistent features. arXiv preprint arXiv:1711.07641, 2017. [61] Jiajun Wu, Tianfan Xue, Joseph J Lim, Yuandong Tian, Joshua B Tenenbaum, Antonio Torralba, and William T Freeman. Single Image 3D Interpreter Network. ECCV, 2016. [62] Wei Yang, Shuang Li, Wanli Ouyang, Hongsheng Li, and Xiaogang Wang. Learning feature pyramids for human pose estimation. ICCV, 2017. [63] Yuting Zhang, Yijie Guo, Yixin Jin, Yijun Luo, Zhiyuan He, and Honglak Lee. Unsupervised discovery of object landmarks as structural representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2694–2703, 2018. [64] Tinghui Zhou, Philipp Krahenbuhl, Mathieu Aubry, Qixing Huang, and Alexei A Efros. Learning dense correspondence via 3d-guided cycle consistency. CVPR, 2016. [65] Xiaowei Zhou, Menglong Zhu, and Kostas Daniilidis. Multi-image matching via fast alternating minimization. CVPR, 2015. [66] Xiaowei Zhou, Menglong Zhu, Spyridon Leonardos, Konstantinos G Derpanis, and Kostas Daniilidis. Sparseness meets deepness: 3D human pose estimation from monocular video. CVPR, 2016. [67] Xingyi Zhou, Arjun Karpur, Chuang Gan, Linjie Luo, and Qixing Huang. Unsupervised domain adaptation for 3d keypoint prediction from a single depth scan. arXiv:1712.05765, 2017. 12
2018
164
7,324
Variational Learning on Aggregate Outputs with Gaussian Processes Ho Chung Leon Law∗ University of Oxford Dino Sejdinovic† University of Oxford Ewan Cameron‡ University of Oxford Tim CD Lucas‡ University of Oxford Seth Flaxman§ Imperial College London Katherine Battle‡ University Of Oxford Kenji Fukumizu¶ Institute of Statistical Mathematics Abstract While a typical supervised learning framework assumes that the inputs and the outputs are measured at the same levels of granularity, many applications, including global mapping of disease, only have access to outputs at a much coarser level than that of the inputs. Aggregation of outputs makes generalization to new inputs much more difficult. We consider an approach to this problem based on variational learning with a model of output aggregation and Gaussian processes, where aggregation leads to intractability of the standard evidence lower bounds. We propose new bounds and tractable approximations, leading to improved prediction accuracy and scalability to large datasets, while explicitly taking uncertainty into account. We develop a framework which extends to several types of likelihoods, including the Poisson model for aggregated count data. We apply our framework to a challenging and important problem, the fine-scale spatial modelling of malaria incidence, with over 1 million observations. 1 Introduction A typical supervised learning setup assumes existence of a set of input-output examples {(xℓ, yℓ)}ℓ from which a functional relationship or a conditional probabilistic model of outputs given inputs can be learned. A prototypical use-case is the situation where obtaining outputs y⋆for new, previously unseen, inputs x⋆is costly, i.e., labelling is expensive and requires human intervention, but measurements of inputs are cheap and automated. Similarly, in many applications, due to a much greater cost in acquiring labels, they are only available at a much coarser resolution than the level at which the inputs are available and at which we wish to make predictions. This is the problem of weakly supervised learning on aggregate outputs [14, 20], which has been studied in the literature in a variety of forms, with classification and regression notably being developed separately and without any unified treatment which can allow more flexible observation models. In this contribution, we consider a framework of observation models of aggregated outputs given bagged inputs, which reside in exponential families. While we develop a more general treatment, the main focus in the paper is on the Poisson likelihood for count data, which is motivated by the applications in spatial statistics. In particular, we consider the important problem of fine-scale mapping of diseases. High resolution maps of infectious disease risk can offer a powerful tool for developing National Strategic Plans, ∗Department of Statistics, Oxford, UK. <ho.law@stats.ox.ac.uk> †Department of Statistics, Oxford, UK. Alan Turing Institute, London, UK. <dino.sejdinovic@stats.ox.ac.uk> ‡Big Data Institute, Oxford, UK. <dr.ewan.cameron@gmail.com, timcdlucas@gmail.com, katherine.battle@bdi.ox.ac.uk> §Department of Mathematics and Data Science Institute, London, UK. <s.flaxman@imperial.ac.uk> ¶Tachikawa, Tokyo, Japan. <fukumizu@ism.ac.jp> 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. allowing accurate stratification of intervention types to areas of greatest impact [5]. In low resource settings these maps must be constructed through probabilistic models linking the limited observational data to a suite of spatial covariates (often from remote-sensing images) describing social, economic, and environmental factors thought to influence exposure to the relevant infectious pathways. In this paper, we apply our method to the incidence of clinical malaria cases. Point incidence data of malaria is typically available at a high temporal frequency (weekly or monthly), but lacks spatial precision, being aggregated by administrative district or by health facility catchment. The challenge for risk modelling is to produce fine-scale predictions from these coarse incidence data, leveraging the remote-sensing covariates and appropriate regularity conditions to ensure a well-behaved problem. Methodologically, the Poisson distribution is a popular choice for modelling count data. In the mapping setting, the intensity of the Poisson distribution is modelled as a function of spatial and other covariates. We use Gaussian processes (GPs) as a flexible model for the intensity. GPs are a widely used approach in spatial modelling but also one of the pillars of Bayesian machine learning, enabling predictive models which explicitly quantify their uncertainty. Recently, we have seen many advances in variational GP posterior approximations, allowing them to couple with more complex observation likelihoods (e.g. binary or Poisson data [21, 17]) as well as a number of effective scalable GP approaches [24, 30, 8, 9], extending the applicability of GPs to dataset sizes previously deemed prohibitive. Contribution Our contributions can be summarised as follows. A general framework is developed for aggregated observation models using exponential families and Gaussian processes. This is novel, as previous work on aggregation or bag models focuses on specific types of output models such as binary classification. Tractable and scalable variational inference methods are proposed for several instances of the aggregated observation models, making use of novel lower bounds on the model evidence. In experiments, it is demonstrated that the proposed methods can scale to dataset sizes of more than 1 million observations. We thoroughly investigate an application of the developed methodology to disease mapping from coarse measurements, where the observation model is Poisson, giving encouraging results. Uncertainty quantification, which is explicit in our models, is essential for this application. Related Work The framework of learning from aggregate data was believed to have been first introduced in [20], which considers the two regimes of classification and regression. However, while the task of classification of individuals from aggregate data (also known as learning from label proportions) has been explored widely in the literature [23, 22, 13, 18, 35, 34, 14], there has been little literature on the analogous regression regime in the machine learning community. Perhaps the closest literature available is [13], who considers a general framework for learning from aggregate data, but also only considers the classification case for experiments. In this work, we will appropriately adjust the framework in [13] and take this to be our baseline. A related problem arises in the spatial statistics community under the name of ‘down-scaling’, ‘fine-scale modelling’ or ‘spatial disaggregation’ [11, 10], in the analysis of disease mapping, agricultural data, and species distribution modelling, with a variety of proposed methodologies (cf. [33] and references therein), including kriging [6]. However, to the best of our knowledge, approaches making use of recent advances in scalable variational inference for GPs are not considered. Another closely related topic is multiple instance learning (MIL), concerned with classification with max-aggregation over labels in a bag, i.e. a bag is positively labeled if at least one individual is positive, and it is otherwise negatively labelled. While the task in MIL is typically to predict labels of new unobserved bags, [7] demonstrates that individual labels of a GP classifier can also be inferred in MIL setting with variational inference. Our work parallels that approach, considering bag observation models in exponential families and deriving new approximation bounds for some common generalized linear models. In deriving these bounds, we have taken an approach similar to [17], who considers the problem of Gaussian process-modulated Poisson process estimation using variational inference. However, our problem is made more complicated by the aggregation of labels, as standard lower bounds to the marginal likelihood used in [17] are also intractable in our model. Other related research topics include distribution regression and set regression, as in [28, 15, 16] and [36]. In these regression problems, while the input data for learning is the same as the current setup, the goal is to learn a function at the bag level, rather than the individual level, the application of these methods in our setting, naively treating single individuals as “distributions”, may lead to suboptimal 2 performance. An overview of some other approaches for classification using bags of instances is given in [4]. 2 Bag observation model: aggregation in mean parameters Suppose we have a statistical model p(y|η) for output y ∈Y, with parameter η given by a function of input x ∈X, i.e., η = η(x). Although one can formulate p(y|η) in an arbitrary fashion, practitioners often only focus on interpretable simple models, hence we restrict our attention to p(y|η) arising from exponential families. We assume that η is the mean parameter of the exponential family. Assume that we have a fixed set of points xa i ∈X such that xa = {xa 1, . . . , xa Na} is a bag of points with Na individuals, and we wish to estimate the regression value η(xa i ) for each individual. However, instead of the typical setup where we have a paired sample {(xℓ, yℓ)}ℓof individuals and their outputs to use as a training set, we observe only aggregate outputs ya for each of the bags. Hence, our training data is of the form ({x1 i }N1 i=1, y1), . . . ({xn i }Nn i=1, yn), (1) and the goal is to estimate parameters η(xa i ) corresponding to individuals. To relate the aggregate ya and the bag xa = (xa i )Na i=1, we use the following bag observation model: ya|xa ∼p(y|ηa), ηa = Na X i=1 wa i η(xa i ), (2) where wa i is an optional fixed non-negative weight used to adjust the scales (see Section 3 for an example). Note that the aggregation in the bag observation model is on the mean parameters for individuals, not necessarily on the individual responses ya i . This implies that each individual contributes to the mean bag response and that the observation model for bags belongs to the same parametric form as the one for individuals. For tractable and scalable estimation, we will use variational methods, as the aggregated observation model leads to intractable posteriors. We consider the Poisson, normal, and exponential distributions, but devote a special focus to the Poisson model in this paper, and refer readers to Appendix A for other cases and experimental results for the Normal model in Appendix H.2. It is also worth noting that we place no restrictions on the collection of the individuals, with the bagging process possibly dependent on covariates xa i or any unseen factors. The bags can also be of different sizes. After we obtain our individual model η(x), we can use it for prediction of in-bag individuals, as well as out-of-bag individuals. 3 Poisson bag model: Modelling aggregate counts The Poisson distribution p(y|λ) = λye−λ/(y!) is considered for count observations, and this paper discusses the Poisson regression with intensity λ(xa i ) multiplied by a ‘population’ pa i , which is a constant assumed to be known for each individual (or ‘sub-bag’) in the bag. The population for a bag a is given by pa = P i pa i . An observed bag count ya is assumed to follow ya|xa ∼Poisson(paλa), λa := Na X i=1 pa i pa λ(xa i ). Note that, by introducing unobserved counts ya i ∼Poisson(ya i |pa i λ(xa i )), the bag observation ya has the same distribution as PNa i=1 ya i since the Poisson distribution is closed under convolutions. If a bag and its individuals correspond to an area and its partition in geostatistical applications, as in the malaria example in Section 4.2, the population in the above bag model can be regarded as the population of an area or a sub-area. With this formulation, the goal is to estimate the basic intensity function λ(x) from the aggregated observations (1). Assuming independence given {xa}a, the negative log-likelihood (NLL) ℓ0 across bags is −log[Πn a=1p(ya|xa)] c= n X a=1 paλa−ya log(paλa) c= n X a=1 " Na X i=1 pa i λ(xa i ) −ya log Na X i=1 pa i λ(xa i ) !# , (3) where c= denotes an equality up to additive constant. During training, this term will pass information from the bag level observations {ya} to the individual basic intensity λ(xa i ). It is noted that once we 3 have trained an appropriate model for λ(xa i ), we will be able to make individual level predictions, and also bag level predictions if desired. We will consider baselines with (3) using penalized likelihoods inspired by manifold regularization in semi-supervised learning [2] – presented in Appendix B. In the next section, we propose a model for λ based on GPs. 3.1 VBAgg-Poisson: Gaussian processes for aggregate counts Suppose now we model f as a Gaussian process (GP), then we have: ya|xa ∼Poisson Na X i=1 pa i λa i ! , λa i = Ψ(f(xa i )), f ∼GP(µ, k) (4) where µ and k are some appropriate mean function and covariance kernel k(x, y). (For implementation, we consider a constant mean function.) Since the intensity is always non-negative, in all models, we will need to use a transformation λ(x) = Ψ(f(x)), where Ψ is a non-negative valued function. We will consider cases Ψ(f) = f 2 and Ψ(f) = ef. A discussion of various choices of this link function in the context of Poisson intensities modulated by GPs is given in [17]. Modelling f with a GP allows us to propagate uncertainty on the predictions to λa i , which is especially important in this weakly supervised problem setting, where we do not directly observe any individual output ya i . Since the total number of individuals in our target application of disease mapping is typically in the millions (see Section 4.2), we will approximate the posterior over λa i := λ(xa i ) using variational inference, with details found in Appendix E. For scalability of the GP method, as in previous literature [7, 17], we use a set of inducing points {uℓ}m ℓ=1, which are given by the function evaluations of the Gaussian process f at landmark points W = {w1, . . . , wm}; i.e., uℓ= f(wℓ). The distribution p(u|W) is thus given by u ∼N(µW , KW W ), µW = (µ(wℓ))ℓ, KW W = (k(ws, wt))s,t. (5) The joint likelihood is given by: p(y, f, u|X, W, Θ) = n Y a=1 Na Y i=1 Poisson(ya|paλa)p(f|u)p(u|W), with f|u ∼GP(˜µu, ˜K), (6) ˜µ(z) = µz + kzW K−1 W W (u −µW ), ˜K(z, z′) = k(z, z′) −kzW K−1 W W kW z′ (7) where here λa, f depends on i implicitly, kzW = (k(z, w1), . . . , k(z, wℓ))T , with µW , µz denoting their respective evaluations of the mean function µ and Θ are parameters of the mean and kernel functions of the GP. Proceeding similarly to [17], which discusses (non-bag) Poisson regression with GP, we obtain a lower bound of the marginal log-likelihood log p(y|Θ), introducing a variational distribution q(u) (that we optimise): log p(y|Θ) = log Z Z p(y, f, u|X, W, Θ)dfdu ≥ Z Z log n p(y|f, Θ)p(u|W) q(u) o p(f|u, Θ)q(u)dfdu (Jensen’s inequality) = X a Z Z n ya log  Na X i=1 pa i Ψ(f(xa i )  −  Na X i=1 pa i Ψ(f(xa i )) o p(f|u)q(u)dfdu − X a log(ya!) −KL(q(u)||p(u|W)) =: L(q, Θ), (8) The general solution to the maximization over q of the evidence lower bound L(q, Θ) above is given by the posterior of the inducing points p(u|y), which is intractable. We introduce a restriction to the class of q(u) to approximate the posterior p(u|y). Suppose that the variational distribution q(u) is Gaussian, q(u) = N(ηu, Σu). We then need to maximize the lower bound L(q, Θ) over the variational parameters ηu and Σu. The resulting q(u) gives an approximation to the posterior p(u|y) which also leads to a Gaussian approximation q(f) = R p(f|u)q(u)du to the posterior p(f|y), which we finally then transform 4 through Ψ to obtain the desired approximate posterior on each λ(xi a) (which is either log-normal or non-central χ2 depending on the form of Ψ). The approximate posterior on λ will then allow us to make predictions for individuals while, crucially, taking into account the uncertainties in f (note that even the posterior predictive mean of λ will depend on the predictive variance in f due to the nonlinearity Ψ). We also want to emphasis the use of inducing variables is essential for scalability in our model: we cannot directly obtain approximations to the posterior of λ(xa i ) for all individuals, since this is often large in our problem setting (Section 4.2). As the p(u|W) and q(u) are both Gaussian, the last term (KL-divergence) of (8) can be computed explicitly with exact form found in Appendix E.3. To consider the first two terms, let qa(va) be the marginal normal distribution of va = (f(xa 1), . . . , f(xa Na)), where f follows the variational posterior q(f). The distribution of va is then N(ma, Sa), using (7) : ma = µxa + KxaW K−1 W W (ηu −µW ), Sa = Kxa,xa −KxaW K−1 W W −K−1 W W ΣuK−1 W W  KW xa (9) In the first term of (8), each summand is of the form ya Z log  Na X i=1 pa i Ψ (va i )  qa(va)dva − Na X i=1 pa i Z Ψ (va i ) qa(va)dva, (10) in which the second term is tractable for both of Ψ(f) = f 2 and Ψ(f) = ef. The integral of the first term, however with qa Gaussian is not tractable. To solve this, we take different approaches for Ψ(f) = f 2 and Ψ(f) = ef; for the former, approximation by Taylor expansion is applied, while for the latter, further lower bound is taken. First consider the case Ψ(f) = f 2, and rewrite the first term of (8) as: yaE log ∥V a∥2 , where V a ∼N( ˜ma, ˜Sa), with P a = diag pa 1, . . . , pa Na  , ˜ma = P a1/2ma and ˜Sa = P a1/2SaP a1/2. By a Taylor series approximation for E log ∥V a∥2 (similar to [29]) around E ∥V a∥2 = ∥˜ma∥2 + tr ˜Sa, we obtain Z log  Na X i=1 pa i (va i )2 qa(va)dva ≈log ma⊤P ama + tr(SaP a)  − 2ma⊤P aSaP ama + tr  (SaP a)2 (ma⊤P ama + tr(SaP a))2 =: ζa. (11) with details are in Appendix E.4. An alternative approach which we use for the case Ψ(f) = ef is to take a further lower bound, which is applicable to a general class of Ψ (we provide further details for the analogous approach for Ψ(v) = v2 in Appendix E.2). We use the following Lemma (proof found in Appendix E.1): Lemma 1. Let v = [v1, . . . , vN]⊤be a random vector with probability density q(v) with marginal densities qi(v), and let wi ≥0, i = 1, . . . , N. Then, for any non-negative valued function Ψ(v), Z log N X i=1 wiΨ(vi)  q(v)dv ≥log  N X i=1 wieξi , where ξi := Z log Ψ(vi)qi(vi)dvi. Hence we obtain that Z log Na X i=1 pa i eva i  qa(va)dva ≥log  Na X i=1 pa i ema i  , (12) Using the above two approximation schemes, our objective (up to constant terms) can be formulated as: 1) Ψ(v) = v2 Ls 1(Θ, ηu, Σu, W) := n X a=1 yaζa − n X a=1 Na X i=1  (ma i )2 + Sa ii/2 −KL(q(u)||p(u|W)), (13) 5 Figure 1: Left: Random samples on the Swiss roll manifold. Middle, Right: Individual Average NLL on train set for varying number of training bags n and increasing Nmean, over 5 repetitions. Constant prediction within bag gives a NLL of 2.22. bag-pixel model gives NLL above 2.4 for the varying number of bags experiment. 2) Ψ(v) = ev Le 1(Θ, ηu, Σu, W) := n X a=1 ya log Na X i=1 ema i  − n X j=1 Na X i=1 ema i +Sa ii/2 −KL(q(u)||p(u|W)). (14) Given these objectives, we can now optimise these lower bounds with respect to variational parameters {ηu, Σu}, parameters Θ of the mean and kernel functions, using stochastic gradient descent (SGD) on bags. Additionally, we might also learn W, locations for the landmark points. In this form, we can also see that the bound for Ψ(v) = ev has the added computational advantage of not requiring the full computation of the matrix Sa, but only its diagonals, while for Ψ(v) = v2 computation of ζa involves full Sa, which may be problematic for extremely large bag sizes. 4 Experiments We will now demonstrate various approaches: Variational Bayes with Gaussian Process (VBAgg), a MAP estimator of Bayesian Poisson regression with explicit feature maps (Nyström) and a neural network (NN) – the latter two employing manifold regularisation with RBF kernel (unless stated otherwise). For additional baselines, we consider a constant within bag model (constant), i.e. ˆλa i = ya pa and also consider creating ‘individual’ covariates by aggregation of the covariates within a bag (bagpixel). For details of all these approaches, see Appendix B. We also denote Ψ(v) = ev and v2 as Exp and Sq respectively. We implement our models in TensorFlow6 and use SGD with Adam [12] to optimise their respective objectives, and we split the dataset into 4 parts, namely train, early-stop, validation and test set. Here the early-stop set is used for early stopping for the Nyström, NN and bag-pixel models, while the VBAgg approach ignores this partition as it optimises the lower bound to the marginal likelihood. The validation set is used for parameter tuning of any regularisation scaling, as well as learning rate, layer size and multiple initialisations. Throughout, VBAgg and Nyström have access to the same set of landmarks for fair comparison. It is also important to highlight that we perform early stopping and tuning based on bag level performance on NLL only, as this is the only information available to us. For the VBAgg model, there are two approaches to tuning, one approach is to choose parameters based on NLL on the validation bag sets, another approach is to select all parameters based on the training objective L1, the lower bound to the marginal likelihood. We denote the latter approach VBAgg-Obj and report its toy experimental results in Appendix H.1.1 for presentation purposes. In general, the results are relatively insensitive to this choice, especially when Ψ(v) = v2. To make predictions, we use the mean of our approximated posterior (provided by a log-normal and non-central χ2 distribution for Exp and Sq). As an additional evaluation, we report mean square error (MSE) and bag performance results in Appendix H. 6Code is available on https://github.com/hcllaw/VBAgg 6 4.1 Poisson Model: Swiss Roll We first demonstrate our method on the swiss roll dataset7, illustrated in Figure 1 (left). To make this an aggregate learning problem, we first construct n bags with sizes drawn from a negative binomial distribution Na ∼NB(Nmean, Nstd), where Nmean and Nstd represents the respective mean and standard deviation of Na. We then randomly select Pn a=1 Na points from the swiss roll manifold to be the locations, giving us a set of colored locations in R3. Ordering these random locations by their z-axis coordinate, we group them, filling up each bag in turn as we move along the z-axis. The aim of this is to simulate that in real life the partitioning of locations into bags is often not independent of covariates. Taking the colour of each location as the underlying rate λa i at that location, we simulate ya i ∼Poisson(λa i ), and take our observed outputs to be ya = PNa i=1 ya i ∼Poisson(λa), where λa = PNa i=1 λa i . Our goal is then to predict the underlying individual rate parameter λa i , given only bag-level observations ya. To make this problem even more challenging, we embed the data manifold into R18 by rotating it with a random orthogonal matrix. For the choice of k for VBAgg and Nyström, we use the RBF kernel, with the bandwidth parameter learnt. For landmark locations, we use the K-means++ algorithm, so that landmark points lie evenly across the data manifold. Varying number of Bags: n To see the effect of increasing number of bags available for training, we fix Nmean = 150 and Nstd = 50, and vary the number of bags n for the training set from 100 to 350 with the same number of bags for early stopping and validation. Each experiment is repeated for 5 runs, and results are shown in Figure 1 for individual NLL on the train set. Again we emphasise that the individual labels are not used in training. We see that all versions of VBAgg outperform all other models, in terms of MSE and NLL, with statistical significance confirmed by a signed rank permutation test (see Appendix H.1.1). We also observe that the bag-pixel model has poor performance, as a result of losing individual level covariate information in training by simply aggregating them. Varying number of individuals per bag: Nmean To study the effect of increasing bag sizes (with larger bag sizes, we expect "disaggregation" to be more difficult), we fix the number of training bags to be 600 with early stopping and validation set to be 150 bags, while varying the number of individuals per bag through Nmean and Nstd in the negative binomial distribution. To keep the relative scales between Nmean and Nstd the same, we take Nstd = Nmean/2. The results are shown in Figure 1, focusing on the best performing methods in the previous experiment. Here, we observe that VBAgg models again perform better than the Nyström and NN models with statistical significance as reported in Appendix H.1.1, with performance stable as Nmean increases. Discussion To gain more insight into the VBAgg model, we look at the calibration of our two different Bayesian models: VBAgg-Exp and VBAgg-Square. We compute their respective posterior quantiles and observe the ratio of times the true λa i lie in these quantiles. We present these in Appendix H.1.1. The calibration plots reveal an interesting nature about using the two different approximations for using ev versus v2 for Ψ(v). While experiments showed that the two model perform similarly in terms of NLL, the calibration of the models is very different. While the VBAgg-Square is well calibrated in general, the VBAgg-Exp suffers from poor calibration. This is not surprising, as VBAgg-Exp uses an additional lower bound on model evidence. Thus, uncertainty estimates given by VBAgg-Exp should be treated with care. 4.2 Malaria Incidence Prediction We now demonstrate the proposed methodology on an important real life malaria prediction problem for an endemic country from the Malaria Atlas Project database8. In this problem, we would like to predict the underlying malaria incidence rate in each 1km by 1km region (referred to as a pixel), while having only observed aggregated incidences of malaria ya at much larger regional levels, which are treated as bags of pixels. These bags are non-overlapping administrative units, with Na pixels per bag ranging from 13 to 6,667, with a total of 1,044,683 pixels. In total, data is available for 957 bags9. 7The swiss roll manifold function (for sampling) can be found on the Python scikit-learn package. 8Due to confidentiality reasons, we do not report country or plot the full map of our results. 9We consider 576 bags for train, 95 bags each for validation and early-stop, with 191 bags for testing, with different splits across different trials, selecting them to ensure distributions of labels are similar across sets. 7 Figure 2: Triangle denotes approximate start and end of river location, crosses denotes non-train set bags. Malaria incidence rate λa i is per 1000 people. Left, Middle: log(ˆλa i ), with constant model (Left), and VBAgg-Obj-Sq (tuned on Ls 1) (Middle). Right: Standard deviation of the posterior v in (9) with VBAgg-Obj-Sq. Along with these pixels, we also have population estimates pa i (per 1000 people) for pixel i in bag a, spatial coordinates given by sa i , as well as covariates xa i ∈R18, collected by remote sensing. Some examples of covariates includes accessibility, distance to water, mean of land surface temperature and stable night lights. It is clear that rather than expecting malaria incidence rate to be constant throughout the entire bag (as in Figure 2), we expect pixel incidence rate to vary, depending on social, economic and environmental factors [32]. Our goal is therefore to build models that can predict malaria incidence rates at a pixel level. We assume a Poisson model on each individual pixel, i.e. ya ∼Poisson(P i pa i λa i ), where λa i is the underlying pixel incidence rate of malaria per 1000 people that we are interested in predicting. We consider the VBAgg, Nyström and NN as prediction models and use a kernel given as a sum of an ARD (automatic relevance determination) kernel on covariates and a Matérn kernel on spatial locations for the VBAgg and Nyström methods, learning all kernel parameters (the kernel expression is provided in Appendix G). We use the same kernel for manifold regularisation in the NN model. This kernel choice incorporates spatial information, while allowing feature selection amongst other covariates. For choice of landmarks, we ensure landmarks are placed evenly throughout space by using one landmark point per training bag (selected by k-means++). This is so that the uncertainty estimates we obtain are not too sensitive to the choice of landmarks. In this problem, no individuallevel labels are available, so we report Bag NLL and MSE (on observed incidences) on the test bags in Appendix G over 10 different re-splits of the data. Although we can see that Nyström is the best performing method, the improvement over VBAgg models is not statistically significant. On the other hand, both VBAgg and Nyström models statistically significantly outperform NN, which also has some instability in its predictions, as discussed in Appendix G.1. However, a caution should be exercised when using the measure of performance at the bag level as a surrogate for the measure of performance at the individual level: in order to perform well at the bag level, one can simply utilise spatial coordinates and ignore other covariates, as malaria intensity appears to smoothly vary between the bags (Left of Figure 2). However, we do not expect this to be true at the individual level. To further investigate this, we consider a particular region, and look at the predicted individual malaria incidence rate, with results found in Figure 2 and in Appendix G.1 across 3 different data splits, where the behaviours of each of these models can be observed. While Nyström and VBAgg methods both provide good bag-level performance, Nyström and VBAgg-Exp can sometimes provide overlysmooth spatial patterns, which does not seem to be the case for the VBAgg-Sq method (recall that VBAgg-Sq performed best in both prediction and calibration for the toy experiments). In particular, VBAgg-Sq consistently predicts higher intensity along rivers (a known factor [31]; indicated by triangles in Figure 2) using only coarse aggregated intensities, demonstrating that prediction of (unobserved) pixel-level intensities is possible using fine-scale environmental covariates, especially ones known to be relevant such as covariates indicated by the Topographic Wetness Index, a measure of wetness, see Appendix G.2 for more details. In summary, by optimising the lower bound to the marginal likelihood, the proposed variational methods are able to learn useful relations between the covariates and pixel level intensities, while avoiding the issue of overfitting to spatial coordinates. Furthermore, they also give uncertainty estimates (Figure 2, right), which are essential for problems like these, where validation of predictions is difficult, but they may guide policy and planning. 8 5 Conclusion Motivated by the vitally important problem of malaria, which is the direct cause of around 187 million clinical cases [3] and 631,000 deaths [5] each year in sub-Saharan Africa, we have proposed a general framework of aggregated observation models using Gaussian processes, along with scalable variational methods for inference in those models, making them applicable to large datasets. The proposed method allows learning in situations where outputs of interest are available at a much coarser level than that of the inputs, while explicitly quantifying uncertainty of predictions. The recent uptake of digital health information systems offers a wealth of new data which is abstracted to the aggregate or regional levels to preserve patient anonymity. The volume of this data, as well as the availability of much more granular covariates provided by remote sensing and other geospatially tagged data sources, allows to probabilistically disaggregate outputs of interest for finer risk stratification, e.g. assisting public health agencies to plan the delivery of disease interventions. This task demands new highperformance machine learning methods and we see those that we have developed here as an important step in this direction. Acknowledgement We thank Kaspar Martens for useful discussions, and Dougal Sutherland for providing the code base in which this work was based on. HCLL is supported by the EPSRC and MRC through the OxWaSP CDT programme (EP/L016710/1). HCLL and KF are supported by JSPS KAKENHI 26280009. EC and KB are supported by OPP1152978, TL by OPP1132415 and the MAP database by OPP1106023. DS is supported in part by the ERC (FP7/617071) and by The Alan Turing Institute (EP/N510129/1). The data were provided by the Malaria Atlas Project supported by the Bill and Melinda Gates Foundation. 9 References [1] LU Ancarani and G Gasaneo. Derivatives of any order of the confluent hypergeometric function f 1 1 (a, b, z) with respect to the parameter a or b. Journal of Mathematical Physics, 49(6):063508, 2008. [2] Mikhail Belkin, Partha Niyogi, and Vikas Sindhwani. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples. Journal of machine learning research, 7(Nov):2399–2434, 2006. [3] Samir Bhatt, DJ Weiss, E Cameron, D Bisanzio, B Mappin, U Dalrymple, KE Battle, CL Moyes, A Henry, PA Eckhoff, et al. The effect of malaria control on plasmodium falciparum in africa between 2000 and 2015. Nature, 526(7572):207, 2015. [4] Veronika Cheplygina, David M.J. Tax, and Marco Loog. On classification with bags, groups and sets. Pattern Recognition Letters, 59:11 – 17, 2015. [5] Peter W Gething, Daniel C Casey, Daniel J Weiss, Donal Bisanzio, Samir Bhatt, Ewan Cameron, Katherine E Battle, Ursula Dalrymple, Jennifer Rozier, Puja C Rao, et al. Mapping plasmodium falciparum mortality in africa between 1990 and 2015. New England Journal of Medicine, 375(25):2435–2445, 2016. [6] Pierre Goovaerts. Combining areal and point data in geostatistical interpolation: Applications to soil science and medical geography. Mathematical Geosciences, 42(5):535–554, Jul 2010. [7] Manuel Haußmann, Fred A Hamprecht, and Melih Kandemir. Variational bayesian multiple instance learning with gaussian processes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6570–6579, 2017. [8] James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. 2013. [9] James Hensman, Alexander Matthews, and Zoubin Ghahramani. Scalable Variational Gaussian Process Classification. In Guy Lebanon and S. V. N. Vishwanathan, editors, Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, volume 38 of Proceedings of Machine Learning Research, pages 351–360, San Diego, California, USA, 09–12 May 2015. PMLR. [10] Richard Howitt and Arnaud Reynaud. Spatial disaggregation of agricultural production data using maximum entropy. European Review of Agricultural Economics, 30(3):359–387, 2003. [11] Petr Keil, Jonathan Belmaker, Adam M Wilson, Philip Unitt, and Walter Jetz. Downscaling of species distribution models: a hierarchical approach. Methods in Ecology and Evolution, 4(1):82–94, 2013. [12] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [13] Dimitrios Kotzias, Misha Denil, Nando De Freitas, and Padhraic Smyth. From group to individual labels using deep features. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 597–606. ACM, 2015. [14] H. Kueck and N. de Freitas. Learning about individuals from group statistics. In UAI, pages 332–339, 2005. [15] H. C. L. Law, C. Yau, and D. Sejdinovic. Testing and learning on distributions with symmetric noise invariance. In NIPS, 2017. [16] Ho Chung Leon Law, Dougal Sutherland, Dino Sejdinovic, and Seth Flaxman. Bayesian approaches to distribution regression. In International Conference on Artificial Intelligence and Statistics, pages 1167–1176, 2018. [17] Chris Lloyd, Tom Gunter, Michael Osborne, and Stephen Roberts. Variational inference for gaussian process modulated poisson processes. In International Conference on Machine Learning, pages 1814–1822, 2015. 10 [18] Vitalik Melnikov and Eyke Hüllermeier. Learning to aggregate using uninorms. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 756–771. Springer, 2016. [19] Krikamol Muandet, Kenji Fukumizu, Bharath Sriperumbudur, and Bernhard Schölkopf. Kernel mean embedding of distributions: A review and beyonds. arXiv preprint arXiv:1605.09522, 2016. [20] David R Musicant, Janara M Christensen, and Jamie F Olson. Supervised learning by training on aggregate outputs. In Data Mining, 2007. ICDM 2007. Seventh IEEE International Conference on, pages 252–261. IEEE, 2007. [21] H. Nickisch and CE. Rasmussen. Approximations for binary gaussian process classification. Journal of Machine Learning Research, 9:2035–2078, October 2008. [22] Giorgio Patrini, Richard Nock, Tiberio Caetano, and Paul Rivera. (Almost) no label no cry. In NIPS. 2014. [23] Novi Quadrianto, Alex J Smola, Tiberio S Caetano, and Quoc V Le. Estimating labels from label proportions. JMLR, 10:2349–2374, 2009. [24] Joaquin Quiñonero Candela and Carl Edward Rasmussen. A unifying view of sparse approximate gaussian process regression. J. Mach. Learn. Res., 6:1939–1959, December 2005. [25] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In NIPS, pages 1177–1184, 2007. [26] Carl Edward Rasmussen and Christopher KI Williams. Gaussian processes for machine learning, 2006. [27] Alex J Smola and Peter L Bartlett. Sparse greedy gaussian process regression. In Advances in neural information processing systems, pages 619–625, 2001. [28] Zoltán Szabó, Bharath K Sriperumbudur, Barnabás Póczos, and Arthur Gretton. Learning theory for distribution regression. The Journal of Machine Learning Research, 17(1):5272–5311, 2016. [29] Yee W Teh, David Newman, and Max Welling. A collapsed variational bayesian inference algorithm for latent dirichlet allocation. In Advances in neural information processing systems, pages 1353–1360, 2007. [30] Michalis Titsias. Variational learning of inducing variables in sparse gaussian processes. In David van Dyk and Max Welling, editors, Proceedings of the Twelth International Conference on Artificial Intelligence and Statistics, volume 5 of Proceedings of Machine Learning Research, pages 567–574, Hilton Clearwater Beach Resort, Clearwater Beach, Florida USA, 16–18 Apr 2009. PMLR. [31] DA Warrel, T Cox, J Firth, and Jr E Benz. Oxford textbook of medicine, 2017. [32] Daniel J Weiss, Bonnie Mappin, Ursula Dalrymple, Samir Bhatt, Ewan Cameron, Simon I Hay, and Peter W Gething. Re-examining environmental correlates of plasmodium falciparum malaria endemicity: a data-intensive variable selection approach. Malaria journal, 14(1):68, 2015. [33] António Xavier, Maria de Belém Costa Freitas, Maria do Socorro Rosário, and Rui Fragoso. Disaggregating statistical data at the field level: An entropy approach. Spatial Statistics, 23:91 – 108, 2018. [34] Felix X Yu, Krzysztof Choromanski, Sanjiv Kumar, Tony Jebara, and Shih-Fu Chang. On learning from label proportions. arXiv preprint arXiv:1402.5902, 2014. [35] Felix X Yu, Dong Liu, Sanjiv Kumar, Tony Jebara, and Shih-Fu Chang. propto svm for learning with label proportions. arXiv preprint arXiv:1306.0886, 2013. [36] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan Salakhutdinov, and Alexander Smola. Deep sets. In NIPS, 2017. 11
2018
165
7,325
Adaptation to Easy Data in Prediction with Limited Advice Tobias Sommer Thune Department of Computer Science University of Copenhagen tobias.thune@di.ku.dk Yevgeny Seldin Department of Computer Science University of Copenhagen seldin@di.ku.dk Abstract We derive an online learning algorithm with improved regret guarantees for “easy” loss sequences. We consider two types of “easiness”: (a) stochastic loss sequences and (b) adversarial loss sequences with small effective range of the losses. While a number of algorithms have been proposed for exploiting small effective range in the full information setting, Gerchinovitz and Lattimore [2016] have shown the impossibility of regret scaling with the effective range of the losses in the bandit setting. We show that just one additional observation per round is sufficient to circumvent the impossibility result. The proposed Second Order Difference Adjustments (SODA) algorithm requires no prior knowledge of the effective range of the losses, ε, and achieves an O(ε √ KT ln K) + ˜O(εK 4√ T) expected regret guarantee, where T is the time horizon and K is the number of actions. The scaling with the effective loss range is achieved under significantly weaker assumptions than those made by Cesa-Bianchi and Shamir [2018] in an earlier attempt to circumvent the impossibility result. We also provide a regret lower bound of Ω(ε √ TK), which almost matches the upper bound. In addition, we show that in the stochastic setting SODA achieves an O P a:∆a>0 Kε2 ∆a  pseudo-regret bound that holds simultaneously with the adversarial regret guarantee. In other words, SODA is safe against an unrestricted oblivious adversary and provides improved regret guarantees for at least two different types of “easiness” simultaneously. 1 Introduction Online learning algorithms with both worst-case regret guarantees and refined guarantees for “easy” loss sequences have come into research focus in recent years. In our work we consider prediction with limited advice games [Seldin et al., 2014], which are an interpolation between full information games [Vovk, 1990, Littlestone and Warmuth, 1994, Cesa-Bianchi and Lugosi, 2006] and games with limited (a.k.a. bandit) feedback [Auer et al., 2002b, Bubeck and Cesa-Bianchi, 2012].1 In prediction with limited advice the learner faces K unobserved sequences of losses {ℓa t }t,a, where a indexes the sequence number and t indexes the elements within the a-th sequence. At each round t of the game the learner picks a sequence At ∈{1, . . . , K} and suffers the loss ℓAt t , which is then observed. After that, the learner is allowed to observe the losses of M additional sequences in the same round t, where 0 ≤M ≤K −1. For M = K −1 the setting is equivalent to a full information game and for M = 0 it becomes a bandit game. 1There exists an orthogonal interpolation between full information and bandit games through the use of feedback graphs Alon et al. [2017], which is different and incomparable with prediction with limited advice, see Seldin et al. [2014] for a discussion. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. For a practical motivation behind prediction with limited advice imagine that the loss sequences correspond to losses of K different algorithms for solving some problem, or K different parametrizations of one algorithm, or K different experts. If we had the opportunity we would have executed all the algorithms or queried all the experts before making a prediction. This would correspond to a full information game. But in reality we may be constrained by time, computational power, or monetary budget. In such case we are forced to select algorithms or experts to query. Being able to query just one expert or algorithm per prediction round corresponds to a bandit game, but we may have time or money to get a bit more, even though not all of it. This is the setting modeled by prediction with limited advice. Our goal is to derive an algorithm for prediction with limited advice that is robust in the worst case and provides improved regret guarantees in “easy” cases. There are multiple ways to define “easiness” of loss sequences. Among them, loss sequences generated by i.i.d. sources, like the classical stochastic bandit model [Robbins, 1952, Lai and Robbins, 1985, Auer et al., 2002a], and adversarial sequences with bounded effective range of the losses within each round [Cesa-Bianchi et al., 2007]. For the former a simple calculation shows that in the full information setting the basic Hedge algorithm [Vovk, 1990, Littlestone and Warmuth, 1994] achieves an improved “constant” (independent of time horizon) pseudo-regret guarantee without sacrificing the worst-case guarantee. Much more work is required to achieve adaptation to this form of easiness in the bandit setting if we want to keep the adversarial regret guarantee simultaneously [Bubeck and Slivkins, 2012, Seldin and Slivkins, 2014, Auer and Chiang, 2016, Seldin and Lugosi, 2017, Wei and Luo, 2018, Zimmert and Seldin, 2018]. An algorithm that adapts to the second form of easiness in the full information setting was first proposed by Cesa-Bianchi et al. [2007] and a number of variations have followed [Gaillard et al., 2014, Koolen and van Erven, 2015, Luo and Schapire, 2015, Wintenberger, 2017]. However, a recent result by Gerchinovitz and Lattimore [2016] have shown that such adaptation is impossible in the bandit setting. Cesa-Bianchi and Shamir [2018] proposed a way to circumvent the impossibility result by either assuming that the ranges of the individual losses are provided to the algorithm in advance or assuming that the losses are smooth and an “anchor” loss of one additional arm is provided to the algorithm. The latter assumption has so far only lead to a substantial improvement when the “anchor” loss is always the smallest loss in the corresponding round. We consider adaptation to both types of easiness in prediction with limited advice. We show that M = 1 (just one additional observation per round) is sufficient to circumvent the impossibility result of Gerchinovitz and Lattimore [2016]. This assumption is weaker than the assumptions in CesaBianchi and Shamir [2018]. We propose an algorithm, which achieves improved regret guarantees both when the effective loss range is small and when the losses are stochastic (generated i.i.d.). The algorithm is inspired by the BOA algorithm of Wintenberger [2017], but instead of working with exponential weights of the cumulative losses and their second moment corrections it uses estimates of the loss differences. The algorithm achieves an O(ε √ KT ln K) + ˜O(εK 4√ T) expected regret guarantee with no prior knowledge of the effective loss range ε or time horizon T. We also provide regret lower bound of Ω(ε √ KT), which matches the upper bound up to logarithmic terms and smaller order factors. Furthermore, we show that in the stochastic setting the algorithm achieves an O P a:∆a>0 Kε2 ∆a  pseudo-regret guarantee. The improvement in the stochastic setting is achieved without compromising the adversarial regret guarantee. The paper is structured in the following way. In Section 2 we lay out the problem setting. In Section 3 we present the algorithm and in Section 4 the main results about the algorithm. Proofs of the main results are presented in Section 5. 2 Problem Setting We consider sequential games defined by K infinite sequences of losses {ℓa 1, ℓa 2, . . . }a∈{1,...,K}, where ℓa t ∈[0, 1] for all a and t. At each round t ∈{1, 2, . . . } of the game the learner selects an action (a.k.a. “arm”) At ∈[K] := {1, . . . , K} and then suffers and observes the corresponding loss ℓAt t . Additionally, the learner is allowed to choose a second arm, Bt, and observe ℓBt t . The loss of the second arm, ℓBt t , is not suffered by the learner. (This is analogous to the full information setting, where the losses of all arms a ̸= At are observed, but not suffered). It is assumed that ℓBt t is observed 2 after At has been selected, but other relative timing of events within a round is unimportant for our analysis. The performance of the learner up to round T is measured by expected regret defined as RT := E " T X t=1 ℓAt t # −min a∈[K] E " T X t=1 ℓa t # , (1) where the expectation is taken with respect to potential randomization of the loss generation process and potential randomization of the algorithm. We note that in the adversarial setting the losses are considered deterministic and the second expectation can be omitted, whereas in the stochastic setting the definition coincides with the definition of pseudo-regret [Bubeck and Cesa-Bianchi, 2012, Seldin and Lugosi, 2017]. In some literature RT is termed excess of cumulative predictive risk [Wintenberger, 2017]. Below we define adversarial and stochastic loss generation models and effective range of loss sequences. Adversarial losses In the adversarial setting the loss sequences are selected arbitrarily by an adversary. We restrict ourselves to the oblivious model, where the losses are fixed before the start of the game and do not depend on the actions of the learner. Stochastic losses In the stochastic setting the losses are drawn i.i.d., so that E[ℓa t ] = µa independently of t. Since we have a finite number of arms, there exists a best arm a⋆(not necessarily unique) such that µa⋆≤µa for all a. We further define the suboptimality gaps by ∆a := µa −µa⋆≥0. In the stochastic setting the expected regret can be rewritten as RT = X a∈[K]:∆a>0 ∆a E " T X t=1 1(At = a) # , (2) where 1 is the indicator function. Effective loss range For both the adversarial and stochastic losses, we define the effective loss range as the smallest number ε, such that for all t ∈[T] and a, a′ ∈[K]: |ℓa t −ℓa′ t | ≤ε almost surely. (3) Since we have assumed that ℓa t ∈[0, 1], we have ε ≤1, where ε = 1 corresponds to an unrestricted setting. 3 Algorithm We introduce the Second Order Difference Adjustments (SODA) algorithm, summarized in Algorithm 1. SODA belongs to the general class of exponential weights algorithms. The algorithm has two important distinctions from the common members of this class. First, it uses cumulative loss difference estimators instead of cumulative loss estimators for the exponential weights updates. Instantaneous loss difference estimators at round t are defined by f ∆ℓ a t = (K −1)1(Bt = a)  ℓBt t −ℓAt t  . (4) SODA samples the “secondary” action Bt (the additional observation) uniformly from K −1 arms, all except At, and the (K −1) term above corresponds to importance weighting with respect to the 3 sampling of Bt. The loss difference estimators scale with the effective range of the losses and they can be positive and negative. Both of these properties are distinct from the traditional loss estimators. The second difference is that we are using a second order adjustment in the weighting inspired by Wintenberger [2017]. We define the cumulative loss difference estimator and its second moment by Dt(a) := t X s=1 f ∆ℓ a s, St(a) := t X s=1  f ∆ℓ a s 2 . (5) We then have the distribution pt for selecting the primary action At defined by pa t = exp −ηtDt−1(a) −η2 t St−1(a)  PK a=1 exp (−ηtDt−1(a) −η2 t St−1(a)) , (6) where ηt is a learning rate scheme, defined as ηt = min (s ln K maxa St−1(a) + (K −1)2 , 1 2(K −1) ) . (7) The learning rate satisfies ηt ≤1/(2ε(K −1)) for all t, which is required for the subsequent analysis. The algorithm is summarized below: Initialize p1 ←(1/K, . . . , 1/K). for t = 1, 2, . . . do Draw At according to pt; Draw Bt uniformly at random from the remaining actions [K] \ {At}; Observe ℓAt t , ℓBt t and suffer ℓAt t ; Construct f ∆ℓ a t by equation (4); Update Dt(a), St(a) by (5); Define pt+1 by (6); end Algorithm 1: Second Order Difference Adjustments (SODA) 4 Main Results We are now ready to present the regret bounds for SODA. We start with regret upper and lower bounds in the adversarial regime and then show that the algorithm simultaneously achieves improved regret guarantee in the stochastic regime. 4.1 Regret Upper Bound in the Adversarial Regime First we provide an upper bound for the expected regret of SODA against oblivious adversaries that produce loss sequences with effective loss range bounded by ε. Note that this result does not depend on prior knowledge of the effective loss range ε or time horizon T. Theorem 1. The expected regret of SODA against an oblivious adversary satisfies RT ≤4ε p (K −1) ln K v u u tT + (K −1) √ T 2 + r ln √ T(K −1)  /2 ! + 4(K −1) ln K. A proof of this theorem is provided in Section 5.1.2 The upper bound scales as O(ε √ KT ln K) + ˜O(εK 4√ T), which nearly matches the lower bound provided below. 2It is straightforward to extended the analysis to time-varying ranges, εt : |ℓa t −ℓa′ t | ≤εt for all a, a′ a.s., which leads to an O qPT t=1(ε2 t)K ln K  + ˜O  K 4qPT t=1 ε2 t  regret bound . For the sake of clarity we restrict the presentation to a constant ε. 4 4.2 Regret Lower Bound in the Adversarial Regime We show that in the worst case the regret must scale linearly with the effective loss range ε. Theorem 2. In prediction with limited advice with M = 1 (one additional observation per round or, equivalently, two observations per round in total), for loss sequences with effective loss range ε, we have for T ≥3K/32: inf sup RT ≥0.02ε √ KT, where the infimum is with respect to the choices of the algorithm and the supremum is over all oblivious loss sequences with effective loss range bounded by ε. The theorem is proven by adaptation of the Ω( √ KT) lower bound by Seldin et al. [2014] for prediction with limited advice with unrestricted losses in [0, 1] and one extra observation. We provide it in Appendix A. Note that the upper bound in Theorem 1 matches the lower bound up to logarithmic terms and lower order additive factors. In particular, changing the selection strategy for the second arm, Bt, from uniform to anything more sophisticated is not expected to yield significant benefits in the adversarial regime. 4.3 Regret Upper Bound in the Stochastic Regime Finally, we show that SODA enjoys constant expected regret in the stochastic regime. This is achieved without sacrificing the adversarial regret guarantee. Theorem 3. The expected regret of SODA applied to stochastic loss sequences with gaps ∆a satisfies RT ≤ X a:∆a>0  8K ln K + 16  ε2 ∆a + 4K + ∆a K  . (8) A brief sketch of a proof of this theorem is given in Section 5.2, with the complete proof provided in Appendix C. Note that ε is the effective range of realizations of the losses, whereas the gaps ∆a are based on the expected losses. Naturally, ∆a ≤ε. For example, if the losses are Bernoulli then the range is ε = 1, but the gaps are based on the distances between the biases of the Bernoulli variables. When the losses are not {0, 1}, but confined to a smaller range ε, Theorem 3 yields a tighter regret bound. The scaling of the regret bound in K is suboptimal and it is currently unknown whether it could be improved without compromising the worst-case guarantee. Perhaps changing the selection strategy for Bt could help here. We leave this improvement for future work. To summarize, SODA achieves adversarial regret guarantee that scales with the effective loss range and almost matches the lower bound and simultaneously has improved regret guarantee in the stochastic regime. 5 Proofs This section contains the proof of Theorem 1 and a proof sketch for Theorem 3. The proof of Theorem 2 is provided in Appendix A. 5.1 Proof of Theorem 1 The proof of the theorem is prefaced by two lemmas, but first we show some properties of the loss difference estimators. We use EBt to denote expectation with respect to selection of Bt conditioned on all random outcomes prior to this selection. For oblivious adversaries, the expected cumulative loss difference estimators are equal to the negative expect regret against the corresponding arm a: E " T X t=1 f ∆ℓ a t # = E " T X t=1 E Bt h f ∆ℓ a t i# = E " T X t=1  ℓa t −ℓAt t # = T X t=1 ℓa t −E " T X t=1 ℓAt t # =: −Ra T , 5 where we have used the fact that f ∆ℓ a t is an unbiased estimate of ℓa t −ℓAt t due to importance weighting with respect to the choice of Bt. Similarly, we have E " T X t=1  f ∆ℓ a t 2 # = (K −1) E " T X t=1  ℓa t −ℓAt t 2 # . (9) Similar to the analysis of the anytime version of EXP3 in Bubeck and Cesa-Bianchi [2012], which builds on Auer et al. [2002b], we consider upper and lower bounds on the expectation of the incremental update. This is captured by the following lemma: Lemma 1. With a learning rate scheme ηt for t = 1, 2, . . . , where ηt ≤1/2ε(K −1), SODA fulfills: − T X t=1 f ∆ℓ a t ≤ln K ηT + ηT T X t=1  f ∆ℓ a t 2 − T X t=1 E a∼pt h f ∆ℓ a t i + X t (Φt(ηt+1) −Φt(ηt)) (10) for all a, where we define the potential Φt(η) := 1 η ln 1 K K X a=1 exp −ηDt(a) −η2St(a)  ! . (11) Note that unlike in the analysis of EXP3, here the learning rates ηt do not have to be non-increasing. A proof of this lemma is based on modification of standard arguments and is found in Appendix B.1. The second lemma is a technical one and is proven in Appendix B.2. Lemma 2. Let σt with t ∈N be an increasing positive sequence with bounded differences such that σt −σt−1 ≤c for a finite constant c. Let further σ0 = 0. Then T X t=1 σt  1 √σt−1 + c − 1 √σt + c  ≤2 p σT −1 + c. Proof of Theorem 1 We apply Lemma 1, which leads to the following inequality for any learning rate scheme ηt for t = 1, 2, . . . , where ηt ≤1/2ε(K −1): − T X t=1 f ∆ℓ a t ≤ln K ηT | {z } 1st + ηT T X t=1  f ∆ℓ a t 2 | {z } 2nd − T X t=1 E a∼pt h f ∆ℓ a t i | {z } 3rd + T X t=1 (Φt(ηt+1) −Φt(ηt)) | {z } 4th . (12) Note that in expectation, the left hand side of (12) is the regret against arm a. We are thus interested in bounding the expectation of the terms on the right hand side, where we note that the third term vanishes in expectation. We first consider the case where ηt = p ln K/(maxa St(a) + (K −1)2), postponing the initial value for now. The first term becomes: ln K ηT = √ ln K q max a ST −1(a) + (K −1)2. (13) The second term becomes: ηT ST (a) = √ ln K ST (a) p maxa ST −1(a) + (K −1)2 ≤ √ ln K q max a ST −1(a) + (K −1)2, (14) where we use that St(a) ≤St−1(a) + (K −1)2 for all t by design. Finally, for the fourth term in equation (12), we need to consider the potential differences. Unlike in the anytime analysis of EXP3, where this term is negative [Bubeck and Cesa-Bianchi, 2012], in our case it turns to be related to the second moment of the loss difference estimators. We let qη t = exp −ηDt(a) −η2St(a)  PK a=1 exp (−ηDt(a) −η2St(a)) (15) 6 denote the exponential update using the loss estimators up to t, but with a free learning rate η. We further suppress some indices for readability, such that Da = Dt(a) and Sa = St(a) in the following. We have Φ′ t(η) = −1 η2 ln 1 K X a exp −ηDa −η2Sa  ! + 1 η P a exp −ηDa −η2Sa  · (−Da −2ηSa) P a exp (−ηDa −η2Sa) = X a exp −ηDa −η2Sa  · −ηDa −2η2Sa −ln 1 K X a exp −ηDa −η2Sa  !!! η2 P a exp (−ηDa −η2Sa) . By using −ηDa −2η2Sa = ln exp(−ηDa −η2Sa) exp(−η2Sa)  the above becomes Φ′ t(η) = 1 η2 E a∼qη t  ln qη t (a) 1/K exp(−η2Sa)  = 1 η2 KL (qη t ∥1/K) −E a∼qη t [St(a)] , (16) where we have used that 1/K is the pmf. of the uniform distribution over K arms. Since the KL-divergence is always positive, we can rewrite the potential differences as Φt(ηt+1) −Φt(ηt) = − Z ηt ηt+1 Φ′ t(η)dη ≤ Z ηt ηt+1 E a∼qη t [St(a)] dη ≤ Z ηt ηt+1 max a St(a)dη = √ ln K max a St(a)   1 q max a St−1(a) + (K −1)2 − 1 q max a St(a) + (K −1)2  . By Lemma 2 we then have T X t=1 Φt(ηt+1) −Φt(ηt) ≤2 √ ln K q max a ST −1(a) + (K −1)2. (17) Collecting the terms (13), (14) and (17) and noting that these bounds hold for all a, by taking expectations and using Jensen’s inequality we get RT ≤E  4 √ ln K q max a ST −1(a) + (K −1)2  ≤4 √ ln K r E h max a ST −1(a) i + (K −1)2. (18) The remainder of the proof is to bound this inner expectation: E h max a ST −1(a) i ≤(K −1)2ε2 E " max a T −1 X t=1 1[Bt = a] # . Let Za t = Pt s=1 1[Bs = a] and note that Za T −1 ≤T −1. We now consider a partioning of the probability for a cutoff α > 0: E[max a Za T −1] ≤α P n max a Za T −1 ≤α o + (T −1) P n max a Za T −1 > α o ≤α + (T −1)K P  Za T −1 > α , using a union bound for the final inequality. To continue we need to address the fact that the Bt’s are not independent. We can however note that P{Bt = a} ≤(K −1)−1 for all t and a. By letting xa t be Bernoulli with parameter (K −1)−1 and Xa T = PT t=1 xa t we then get P  Za T −1 > α ≤P  Xa T −1 > α . (19) In the upper bound we can thus substitute Xa T −1 for Za T −1 and exploit the fact that the xa t ’s are independent by construction. Note further that E[Xa T −1] = T −1 K−1, so by choosing α = T −1 K−1 + δ for 7 δ > 0, we obtain by Hoeffding’s inequality: E[max a Za T −1] ≤T −1 K −1 + δ + (T −1)K P  Xa T −1 −T −1 K −1 > δ  ≤T −1 K −1 + δ + (T −1)K exp  −2δ2 T −1  . We now choose δ = r T 2 ln √ T(K −1)  , which gives us E[max a Za T −1] ≤T −1 K −1 + r T 2 ln √ T(K −1)  + 2 √ T. Inserting this in (18) gives us the desired bound. For the case where the learning rate at T is instead given by 1/2(K −1) implying 4(K −1)2 ln K ≥ maxa ST −1(a) + (K −1)2, the first term is ln K ηT = 2(K −1) ln K, and the second term is ηT ST (a) = 1 2(K −1)ST (a) ≤ST −1(a) + (K −1)2 2(K −1) ≤4(K −1)2 ln K 2(K −1) ≤2(K −1) ln K. Since the learning rate is constant the potential differences vanish, completing the proof. □ 5.2 Proof sketch of Theorem 3 Here we present the key ideas used to prove Theorem 3. The complete proof is provided in Appendix C. Recall that the expected regret in the stochastic setting is given by (2), where E[1(At = a)] = E[pa t ]. Thus, we need to bound E[P t pa t ]. The first step is to bound this as E [pa t ] ≤σ + P {pa t > σ} ≤σ + P n Ke−ηt Pt−1 i=1 Xi > σ o (20) for a positive threshold σ, where we show that pa t ≤Ke−ηt Pt−1 i=1 Xi for Xi := f ∆ℓ a i −f ∆ℓ a⋆ i . This approach is motivated by the fact that EBi[f ∆ℓ a i −f ∆ℓ a⋆ i ] ∝∆a, where the expectation is with respect to selection of Bi and the loss generation, conditioned on all prior randomness. The next step is to tune σ ∝exp(P Ei[Xi]), which allows us to bound the second term using Azuma’s inequality and balance the two terms. Finally, this bound is summed over t using a technical lemma for the limit of this sum. 6 Discussion We have presented the SODA algorithm for prediction with limited advice with two observations per round (the “primary” observation of the loss of the action that was played and one additional observation). We have shown that the algorithm adapts to two types of simplicity of loss sequences simultaneously: (a) it provides improved regret guarantees for adversarial sequences with bounded effective range of the losses and (b) for stochastic loss sequences. In both cases the regret scales linearly with the effective range and the knowledge of the range is not required. In the adversarial case we achieve O(ε √ KT ln K)+ ˜O(εK 4√ T) regret guarantee and in the stochastic case we achieve O P a:∆a>0 Kε2 ∆a  regret guarantee. Our result demonstrates that just one extra observation per round is sufficient to circumvent the impossibility result of Gerchinovitz and Lattimore [2016] and significantly relaxes the assumptions made by Cesa-Bianchi and Shamir [2018] to achieve the same goal. There are a number of open questions and interesting directions for future research. One is to improve the regret guarantee in the stochastic regime. Another is to extend the results to bandits with limited advice in the spirit of Seldin et al. [2013], Kale [2014]. 8 Acknowledgments The authors thank Julian Zimmert for valuable input and discussions. References Noga Alon, Nicolo Cesa-Bianchi, Claudio Gentile, Shie Mannor, Yishay Mansour, and Ohad Shamir. Nonstochastic multi-armed bandits with graph-structured feedback. SIAM Journal on Computing, 46(6):1785–1826, 2017. Peter Auer and Chao-Kai Chiang. An algorithm with nearly optimal pseudo-regret for both stochastic and adversarial bandits. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2016. Peter Auer, Nicolò Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47, 2002a. Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The nonstochastic multiarmed bandit problem. SIAM Journal of Computing, 32(1), 2002b. Sébastien Bubeck and Nicolò Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multiarmed bandit problems. Foundations and Trends in Machine Learning, 5, 2012. Sébastien Bubeck and Aleksandrs Slivkins. The best of both worlds: stochastic and adversarial bandits. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2012. Nicolò Cesa-Bianchi and Gábor Lugosi. Prediction, Learning, and Games. Cambridge University Press, 2006. Nicolò Cesa-Bianchi and Ohad Shamir. Bandit regret scaling with the effective loss range. In Proceedings of the International Conference on Algorithmic Learning Theory (ALT), 2018. Nicolò Cesa-Bianchi, Yishay Mansour, and Gilles Stoltz. Improved second-order bounds for prediction with expert advice. Machine Learning, 66, 2007. Pierre Gaillard, Gilles Stoltz, and Tim van Erven. A second-order bound with excess losses. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2014. Sébastien Gerchinovitz and Tor Lattimore. Refined lower bounds for adversarial bandits. In Advances in Neural Information Processing Systems (NIPS), 2016. Satyen Kale. Multiarmed bandits with limited expert advice. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2014. Wouter M. Koolen and Tim van Erven. Second-order quantile methods for experts and combinatorial games. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2015. Tze Leung Lai and Herbert Robbins. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics, 6, 1985. Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Information and Computation, 108, 1994. Haipeng Luo and Robert E. Schapire. Achieving all with no parameters: Adanormalhedge. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2015. Herbert Robbins. Some aspects of the sequential design of experiments. Bulletin of the American Mathematical Society, 1952. Yevgeny Seldin and Gábor Lugosi. An improved parametrization and analysis of the EXP3++ algorithm for stochastic and adversarial bandits. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2017. 9 Yevgeny Seldin and Aleksandrs Slivkins. One practical algorithm for both stochastic and adversarial bandits. In Proceedings of the International Conference on Machine Learning (ICML), 2014. Yevgeny Seldin, Koby Crammer, and Peter L. Bartlett. Open problem: Adversarial multiarmed bandits with limited advice. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2013. Yevgeny Seldin, Peter L. Bartlett, Koby Crammer, and Yasin Abbasi-Yadkori. Prediction with limited advice and multiarmed bandits with paid observations. In Proceedings of the International Conference on Machine Learning (ICML), 2014. Vladimir Vovk. Aggregating strategies. In Proceedings of the International Conference on Computational Learning Theory (COLT), 1990. Chen-Yu Wei and Haipeng Luo. More adaptive algorithms for adversarial bandits. In Proceedings of the International Conference on Computational Learning Theory (COLT), 2018. Olivier Wintenberger. Optimal learning with Bernstein online aggregation. Machine Learning, 106, 2017. Julian Zimmert and Yevgeny Seldin. An optimal algorithm for stochastic and adversarial bandits. Technical report, https://arxiv.org/abs/1807.07623, 2018. 10
2018
166
7,326
Maximum Causal Tsallis Entropy Imitation Learning Kyungjae Lee1, Sungjoon Choi2, and Songhwai Oh1 Dep. of Electrical and Computer Engineering and ASRI, Seoul National University1 Kakao Brain2 kyungjae.lee@rllab.snu.ac.kr, sam.choi@kakaobrain.com, songhwai@snu.ac.kr Abstract In this paper, we propose a novel maximum causal Tsallis entropy (MCTE) framework for imitation learning which can efficiently learn a sparse multi-modal policy distribution from demonstrations. We provide the full mathematical analysis of the proposed framework. First, the optimal solution of an MCTE problem is shown to be a sparsemax distribution, whose supporting set can be adjusted. The proposed method has advantages over a softmax distribution in that it can exclude unnecessary actions by assigning zero probability. Second, we prove that an MCTE problem is equivalent to robust Bayes estimation in the sense of the Brier score. Third, we propose a maximum causal Tsallis entropy imitation learning (MCTEIL) algorithm with a sparse mixture density network (sparse MDN) by modeling mixture weights using a sparsemax distribution. In particular, we show that the causal Tsallis entropy of an MDN encourages exploration and efficient mixture utilization while Shannon entropy is less effective. 1 Introduction In this paper, we focus on the problem of imitating demonstrations of an expert who behaves nondeterministically depending on the situation. In imitation learning, it is often assumed that the expert’s policy is deterministic. However, there are instances, especially for complex tasks, where multiple action sequences perform the same task equally well. We can model such nondeterministic behavior of an expert using a stochastic policy. For example, expert drivers normally show consistent behaviors such as keeping lane or keeping the distance from a frontal car, but sometimes they show different actions for the same situation, such as overtaking a car and turning left or right at an intersection, as suggested in [1]. Furthermore, learning multiple optimal action sequences to perform a task is desirable in terms of robustness since an agent can easily recover from failure due to unexpected events [2, 3]. In addition, a stochastic policy promotes exploration and stability during learning [4, 2, 5]. Hence, modeling experts’ stochasticity can be a key factor in imitation learning. To this end, we propose a novel maximum causal Tsallis entropy (MCTE) framework for imitation learning, which can learn from a uni-modal to multi-modal policy distribution by adjusting its supporting set. We first show that the optimal policy under the MCTE framework follows a sparsemax distribution [6], which has an adaptable supporting set in a discrete action space. Traditionally, the maximum causal entropy (MCE) framework [1, 7] has been proposed to model stochastic behavior in demonstrations, where the optimal policy follows a softmax distribution. However, it often assigns non-negligible probability mass to non-expert actions when the number of actions increases [3, 8]. On the contrary, as the optimal policy of the proposed method can adjust its supporting set, it can model various expert’s behavior from a uni-modal distribution to a multi-modal distribution. To apply the MCTE framework to a complex and model-free problem, we propose a maximum causal Tsallis entropy imitation learning (MCTEIL) with a sparse mixture density network (sparse MDN) whose mixture weights are modeled as a sparsemax distribution. By modeling expert’s behavior 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. using a sparse MDN, MCTEIL can learn varying stochasticity depending on the state in a continuous action space. Furthermore, we show that the MCTEIL algorithm can be obtained by extending the MCTE framework to the generative adversarial setting, similarly to generative adversarial imitation learning (GAIL) by Ho and Ermon [9], which is based on the MCE framework. The main benefit of the generative adversarial setting is that the resulting policy distribution is more robust than that of a supervised learning method since it can learn recovery behaviors from less demonstrated regions to demonstrated regions by exploring the state-action space during training. Interestingly, we also show that the Tsallis entropy of a sparse MDN has an analytic form and is proportional to the distance between mixture means. Hence, maximizing the Tsallis entropy of a sparse MDN encourages exploration by providing bonus rewards to wide-spread mixture means and penalizing collapsed mixture means, while the causal entropy [1] of an MDN is less effective in terms of preventing the collapse of mixture means since there is no analytical form and its approximation is used in practice instead. Consequently, maximizing the Tsallis entropy of a sparse MDN has a clear benefit over the causal entropy in terms of exploration and mixture utilization. To validate the effectiveness of the proposed method, we conduct two simulation studies. In the first simulation study, we verify that MCTEIL with a sparse MDN can successfully learn multimodal behaviors from expert’s demonstrations. A sparse MDN efficiently learns a multi-modal policy without performance loss, while a single Gaussian and a softmax-based MDN suffer from performance loss. The second simulation study is conducted using four continuous control problems in MuJoCo [10]. MCTEIL outperforms existing methods in terms of the average cumulative return. In particular, MCTEIL shows the best performance for the reacher problem with a smaller number of demonstrations while GAIL often fails to learn the task. 2 Related Work The early researches on IRL [1, 11–18] can be categorized into two groups: a margin based and entropy based method. A margin based method maximizes the margin between the value of the expert’s policy and all other policies [11, 12]. In [11], Abbeel and Ng proposed an apprenticeship learning where the rewards function is estimated to maximize the margin between the expert’s policy and randomly sampled policies. In [12], Ratliff et al. proposed the maximum margin planning (MMP) where Bellman-flow constraints are introduced to consider the margin between the experts’ policy and all other possible policies. On the contrary, an entropy based method is first proposed in [1] to handle the stochastic behavior of the expert. Ziebart et al. [1] proposed a maximum entropy inverse reinforcement learning (MaxEnt IRL) using the principle of maximum (Shannon) entropy to handle ambiguity issues of IRL. Ramachandran et al. [13] proposed Bayesian inverse reinforcement learning (BIRL) where the Bayesian probabilistic model over demonstrations is proposed and the expert policy and rewards are inferred by using a Metropolis-Hastings (MH) method. In[1, 13], the expert behavior is modeled as a softmax distribution of an action value which is the optimal solution of the maximum entropy problem. We also note that [14–18] are variants based on [1, 13]. In [9], Ho and Ermon have extended [1] to a unified framework for two groups by adding a reward regularization. Most existing IRL methods can be interpreted as the unified framework with different reward regularization. Those methods including the aforementioned algorithms [1, 11–18] require to solve an MDP problem every iterations to update a reward function. In model-free case, reinforcement learning (RL) method should be applied to solve the MDP, which leads to high computational costs and huge amounts of samples. To address this issue, Ho and Ermon proposed the generative adversarial imitation learning (GAIL) method where the policy function is updated to maximize the reward function and the reward function is updated to assign high values to expert’s demonstrations and low values to trained policy’s demonstrations. GAIL achieves sample efficiency by avoiding the need to solve RL as a subroutine and alternatively updating policy and reward functions. Recently, several variants of GAIL [19–21] have been developed based on the maximum entropy framework. These methods [19–21] focus on handling the multi-modality in demonstrations by learning the latent structure. In [19], Hausman et al. proposed an imitation learning method to learn policies using unlabeled demonstrations collected from multiple different tasks where the latent intention is introduced in order to separate mixed demonstrations. Similarly, in [20], a robust imitation learning method is proposed, which separates unlabeled demonstrations by assigning the latent code using a variational autoencoder. The encoding network assigns the latent code to the input demonstration. Then, the policy network is trained to mimic the input demonstration given the 2 latent code and the encoding network is trained to recover the given latent code from the generated trajectory. In [21], the latent code is also proposed to handle multi-modal demonstrations. The latent structure in [21] is learned by maximizing the lower bound of mutual information between the latent code and the corresponding demonstrations. Consequently, existing imitation learning methods which can handle the multi-modal behavior have common features in that they are developed based on the maximum entropy framework and capture the multi-modality of demonstrations by learning the mapping from demonstrations to the latent space. Unlikely to recent methods for multi-modal demonstrations, the proposed method is established on the maximum causal Tsallis entropy framework which induces a sparse distribution whose supporting set can be adjusted, instead of the original maximum entropy. Furthermore, a policy is modeled as a sparse mixture density network (sparse MDN) which can learn multi-modal behavior directly instead of learning the latent structure. 3 Background Markov Decision Processes Markov decision processes (MDPs) are a well-known mathematical framework for a sequential decision making problem. A general MDP is defined as a tuple {S, F, A, φ, Π, d, T, γ, r}, where S is the state space, F is the corresponding feature space, A is the action space, φ is a feature map from S × A to F, Π is a set of stochastic policies, i.e., Π = {π | ∀s ∈S, a ∈A, π(a|s) ≥0 and P a′ π(a′|s) = 1}, d(s) is the initial state distribution, T(s′|s, a) is the transition probability from s ∈S to s′ ∈S by taking a ∈A, γ ∈(0, 1) is a discount factor, and r is the reward function from a state-action pair to a real value. In general, the goal of an MDP is to find an optimal policy distribution π∗∈Π which maximizes the expected discount sum of rewards, i.e., Eπ [r(s, a)] ≜E [P∞ t=0 r(st, at)|π, d]. Note that, for any function f(s, a), E [P∞ t=0 f(st, at)|π, d] will be denoted as Eπ [f(s, a)]. Maximum Causal Entropy Inverse Reinforcement Learning Zeibart et al. [1] proposed the maximum causal entropy framework, which is also known as maximum entropy inverse reinforcement learning (MaxEnt IRL). MaxEnt IRL maximizes the causal entropy of a policy distribution while the feature expectation of the optimized policy distribution is matched with that of expert’s policy. The maximum causal entropy framework is defined as follows: maximize π∈Π αH(π) subject to Eπ [φ(s, a)] = EπE [φ(s, a)] , (1) where H(π) ≜Eπ [−log(π(a|s))] is the causal entropy of policy π, α is a scale parameter, πE is the policy distribution of the expert. Maximum causal entropy estimation finds the most uniformly distributed policy satisfying feature matching constraints. The feature expectation of the expert policy is used as a statistic to represent the behavior of an expert and is approximated from expert’s demonstrations D = {ζ0, · · · , ζN}, where N is the number of demonstrations and ζi is a sequence of state and action pairs whose length is T, i.e., ζi = {(s0, a0), · · · , (sT , aT )}. In [22], it is shown that the optimal solution of (1) is a softmax distribution. Generative Adversarial Imitation Learning In [9], Ho and Ermon have extended (1) to a unified framework for IRL by adding a reward regularization as follows: max c min π∈Π −αH(π) + Eπ [c(s, a)] −EπE [c(s, a)] −ψ(c), (2) where c is a cost function and ψ is a convex regularization for cost c. As shown in [9], many existing IRL methods can be interpreted with this framework, such as MaxEnt IRL [1], apprenticeship learning [11], and multiplicative weights apprenticeship learning [23]. Existing IRL methods based on (2) often require to solve the inner minimization over π for fixed c in order to compute the gradient of c. In [22], Ziebart showed that the inner minimization is equivalent to a soft Markov decision process (soft MDP) under the reward −c and proposed soft value iteration to solve the soft MDP. However, solving a soft MDP every iteration is often intractable for problems with large state and action spaces and also requires the transition probability which is not accessible in many cases. To address this issue, the generative adversarial imitation learning (GAIL) framework is proposed in [9] to avoid 3 solving the soft MDP problem directly. The unified imitation learning problem (2) can be converted into the GAIL framework as follows: min π∈Π max D Eπ [log(D(s, a))] + EπE [log(1 −D(s, a))] −αH(π), (3) where D ∈(0, 1)|S||A| indicates a discriminator, which returns the probability that a given demonstration is from a learner, i.e., 1 for learner’s demonstrations and 0 for expert’s demonstrations. Notice that we can interpret log(D) as cost c (or reward of −c). Since existing IRL methods, including GAIL, are often based on the maximum causal entropy, they model the expert’s policy using a softmax distribution, which can assign non-zero probability to non-expert actions in a discrete action space. Furthermore, in a continuous action space, expert’s behavior is often modeled using a uni-modal Gaussian distribution, which is not proper to model multi-modal behaviors. To handle these issues, we propose a sparsemax distribution as the policy of an expert and provide a natural extension to handle a continuous action space using a mixture density network with sparsemax weight selection. Sparse Markov Decision Processes In [3], a sparse Markov decision process (sparse MDP) is proposed by utilizing the causal sparse Tsallis entropy W(π) ≜1 2Eπ [1 −π(a|s)] to the expected discounted rewards sum, i.e., Eπ [r(s, a)]+αW(π). Note that W(π) is an extension of a special case of the generalized Tsallis entropy, i.e., Sk,q(p) = k q−1 (1 −P i pq i ), for k = 1 2, q = 2, to sequential random variables 1. It is shown that the optimal policy of a sparse MDP is a sparse and multi-modal policy distribution [3]. Furthermore, sparse Bellman optimality conditions were derived as follows: Q(s, a) ≜r(s, a) + γ X s′ V (s′)T(s′|s, a), π(a|s) = max Q(s, a) α −τ Q(s, ·) α  , 0  , V (s) = α  1 2 X a∈S(s) Q(s, a) α 2 −τ Q(s, ·) α 2! + 1 2  , (4) where τ  Q(s,·) α  = P a∈S(s) Q(s,a) α −1 Ks , S(s) is a set of actions satisfying 1 + i Q(s,a(i)) α > Pi j=1 Q(s,a(j)) α with a(i) indicating the action with the ith largest state-action value Q(s, a), and Ks is the cardinality of S(s). In [3], a sparsemax policy shows better performance compared to a softmax policy since it assigns zero probability to non-optimal actions whose state-action value is below the threshold τ. In this paper, we utilize this property in imitation learning by modeling expert’s behavior using a sparsemax distribution. In Section 4, we show that the optimal solution of an MCTE problem also has a sparsemax distribution and, hence, the optimality condition of sparse MDPs is closely related to that of MCTE problems. 4 Principle of Maximum Causal Tsallis Entropy In this section, we formulate maximum causal Tsallis entropy imitation learning (MCTEIL) and show that MCTE induces a sparse and multi-modal distribution which has an adaptable supporting set. The problem of maximizing the causal Tsallis entropy W(π) can be formulated as follows: maximize π∈Π αW(π) subject to Eπ [φ(s, a)] = EπE [φ(s, a)] . (5) In order to derive optimality conditions, we will first change the optimization variable from a policy distribution to a state-action visitation measure. Then, we prove that the MCTE problem is concave with respect to the visitation measure. The necessary and sufficient conditions for an optimal solution are derived from the Karush-Kuhn-Tucker (KKT) conditions using the strong duality and the optimal policy is shown to be a sparsemax distribution. Furthermore, we also provide an interesting interpretation of the MCTE framework as robust Bayes estimation in terms of the Brier score. Hence, 1The casual entropy is generally defined upon causally conditioned random variables. However, in this paper, the causal Tsallis entropy is defined over the random variables with Markov properties, i.e., π(at|st) = π(at|st, at−1, st−1, · · · , a0, s0), since we only consider an MDP. 4 the proposed method can be viewed as maximization of the worst case performance in the sense of the Brier score [24]. We can change the optimization variable from a policy distribution to a state-action visitation measure based on the following theorem. Theorem 1 (Theorem 2 of Syed et al. [25]) Let M be a set of state-action visitation measures, i.e., M ≜{ρ|∀s, a, ρ(s, a) ≥0, P a ρ(s, a) = d(s) + γ P s′,a′ T(s|s′, a′)ρ(s′, a′)}. If ρ ∈M, then it is a state-action visitation measure for πρ(a|s) ≜ ρ(s,a) P a ρ(s,a), and πρ is the unique policy whose state-action visitation measure is ρ. The proof of Theorem 1 can be found in [25] or in Puterman [26]. Theorem 1 guarantees the oneto-one correspondence between a policy distribution and state-action visitation measure. Then, the objective function W(π) is converted into the function of ρ as follows. Theorem 2 Let ¯W(ρ) = 1 2 P s,a ρ(s, a)  1 − ρ(s,a) P a′ ρ(s,a′)  . Then, for any stationary policy π ∈Π and any state-action visitation measure ρ ∈M, W(π) = ¯W(ρπ) and ¯W(ρ) = W(πρ) hold. The proof is provided in the supplementary material. Theorem 2 tells us that if ¯W(ρ) has the maximum at ρ∗, then W(π) also has the maximum at πρ∗. Based on Theorem 1 and 2, we can freely convert the problem (5) into maximize ρ∈M α ¯ W(ρ) subject to X s,a ρ(s, a)φ(s, a) = X s,a ρE(s, a)φ(s, a), (6) where ρE is the state-action visitation measure corresponding to πE. 4.1 Optimality Condition of Maximum Causal Tsallis Entropy We show that the optimal policy of the problem (6) is a sparsemax distribution using the KKT conditions. In order to use the KKT conditions, we first show that the MCTE problem is concave. Theorem 3 ¯W(ρ) is strictly concave with respect to ρ ∈M. The proof of Theorem 3 is provided in the supplementary material. Since all constraints are linear and the objective function is concave, (6) is a concave problem and, hence, strong duality holds. The dual problem is defined as follows: max θ,c,λ min ρ LW (θ, c, λ, ρ) subject to ∀s, a λsa ≥0, (7) where LW (θ, c, λ, ρ) = −α ¯W(ρ) −P s,a ρ(s, a)θ⊺φ(s, a) + P s,a ρE(s, a)θ⊺φ(s, a) − P s,a λsaρ(s, a) + P s cs P a ρ(s, a) −d(s) −γ P s′,a′ T(s|s′, a′)ρ(s′, a′)  and θ, c, and λ are Lagrangian multipliers and the constraints come from M. Then, the optimal solution of primal and dual variables necessarily and sufficiently satisfy the KKT conditions. Theorem 4 The optimal solution of (6) sufficiently and necessarily satisfies the following conditions: qsa ≜θ⊺φ(s, a) + γ X s′ cs′T(s′|s, a), cs = α  1 2 X a∈S(s) qsa α 2 −τ qs α 2 + 1 2  , and πρ(a|s) = max qsa α −τ qs α  , 0  , where πρ(a|s) = ρ(s,a) P a ρ(s,a), qsa is an auxiliary variable, and qs = [qsa1 · · · qsa|A|]⊺. The optimality conditions of the problem (6) tell us that the optimal policy is a sparsemax distribution which assigns zero probability to an action whose auxiliary variable qsa is below the threshold τ, 5 Algorithm 1 Maximum Causal Tsallis Entropy Imitation Learning 1: Expert’s demonstrations D are given 2: Initialize policy and discriminator parameters ν, ω 3: while until convergence do 4: Sample trajectories {ζ} from πν 5: Update ω with the gradient of P {ζ} log(Dω(s, a)) + P D log(1 −Dω(s, a)). 6: Update ν using a policy optimization method with reward function −Eπν [log(Dω(s, a))] + αW(πν) 7: end while which determines a supporting set. If expert’s policy is multi-modal at state s, the resulting πρ(·|s) becomes multi-modal and induces a multi-modal distribution with a large supporting set. Otherwise, the resulting policy has a sparse and smaller supporting set. Therefore, a sparsemax policy has advantages over a softmax policy for modeling sparse and multi-modal behaviors of an expert whose supporting set varies according to the state. Furthermore, we also discover an interesting connection between the optimality condition of an MCTE problem and the sparse Bellman optimality condition (4). Since the optimality condition is equivalent to the sparse Bellman optimality equation [3], we can compute the optimal policy and Lagrangian multiplier cs by solving a sparse MDP under the reward function r(s, a) = θ∗⊺φ(s, a), where θ∗is the optimal dual variable. In addition, cs and qsa can be viewed as a state value and state-action value for the reward θ∗⊺φ(s, a), respectively. 4.2 Interpretation as Robust Bayes In this section, we provide an interesting interpretation about the MCTE framework. In general, maximum entropy estimation can be viewed as a minimax game between two players. One player is called a decision maker and the other player is called the nature, where the nature assigns a distribution to maximize the decision maker’s misprediction while the decision maker tries to minimize it [27]. The same interpretation can be applied to the MCTE framework. We show that the proposed MCTE problem is equivalent to a minimax game with the Brier score [24]. Theorem 5 The maximum causal Tsallis entropy distribution minimizes the worst case prediction Brier score, min π∈Π max ˜π∈Π E˜π "X a′ 1 2 1{a′=a} −π(a|s) 2 # subject to Eπ [φ(s, a)] = EπE [φ(s, a)] (8) where P a′ 1 2 1{a′=a} −π(a|s) 2 is the Brier score. Note that minimizing the Brier score minimizes the misprediction ratio while we call it a score here. Theorem 5 is a straightforward extension of the robust Bayes results in [27] to sequential decision problems. This theorem tells us that the MCTE problem can be viewed as a minimax game between a sequential decision maker π and the nature ˜π based on the Brier score. In this regards, the resulting estimator can be interpreted as the best decision maker against the worst that the nature can offer. 5 Maximum Causal Tsallis Entropy Imitation Learning In this section, we propose a maximum causal Tsallis entropy imitation learning (MCTEIL) algorithm to solve a model-free IL problem in a continuous action space. In many real-world problems, state and action spaces are often continuous and transition probability of a world cannot be accessed. To apply the MCTE framework for a continuous space and model-free case, we follow the extension of GAIL [9], which trains a policy and reward alternatively, instead of solving RL at every iteration. We extend the MCTE framework to a more general case with reward regularization and it is formulated by replacing the causal entropy H(π) in the problem (2) with the causal Tsallis entropy W(π) as follows: max θ min π∈Π −αW(π) −Eπ [θ⊺φ(s, a)] + EπE [θ⊺φ(s, a)] −ψ(θ). (9) Similarly to [9], we convert the problem (9) into the generative adversarial setting as follows. 6 Theorem 6 The maximum causal sparse Tsallis entropy problem (9) is equivalent to the problem: min π∈Π ψ∗(Eπ [φ(s, a)] −EπE [φ(s, a)]) −αW(π), where ψ∗(x) = supy{y⊺x −ψ(y)}. The proof is detailed in the supplementary material. The proof of Theorem 6 depends on the fact that the objective function of (9) is concave with respect to ρ and is convex with respect to θ. Hence, we first switch the optimization variables from π to ρ and, using the minimax theorem [28], the maximization and minimization are interchangeable and the generative adversarial setting is derived. Similarly to [9], Theorem 6 says that a MCTE problem can be interpreted as minimization of the distance between expert’s feature expectation and training policy’s feature expectation, where ψ∗(x1 −x2) is a proper distance function since ψ(x) is a convex function. Let esa ∈R|S||A| be a feature indicator vector, such that the sath element is one and zero elsewhere. If we set ψ to ψGA(θ) ≜EπE[g(θ⊺esa)], where g(x) = −x −log(1 −ex) for x < 0 and g(x) = ∞for x ≥0, we can convert the MCTE problem into the following generative adversarial setting: min π∈Π max D Eπ [log(D(s, a))] + EπE [log(1 −D(s, a))] −αW(π), (10) where D is a discriminator. The problem (10) can be solved by MCTEIL which consists of three steps. First, trajectories are sampled from the training policy πν and discriminator Dω is updated to distinguish whether the trajectories are generated by πν or πE. Finally, the training policy πν is updated with a policy optimization method under the sum of rewards Eπ [−log(Dω(s, a))] with a causal Tsallis entropy bonus αW(πν). The algorithm is summarized in Algorithm 1. Sparse Mixture Density Network We further employ a novel mixture density network (MDN) with sparsemax weight selection, which can model sparse and multi-modal behavior of an expert, which is called a sparse MDN. In many imitation learning algorithms, a Gaussian network is often employed to model expert’s policy in a continuous action space. However, a Gaussian distribution is inappropriate to model the multi-modality of an expert since it has a single mode. An MDN is more suitable for modeling a multi-modal distribution. In particular, a sparse MDN is a proper extension of a sparsemax distribution for a continuous action space. The input of a sparse MDN is state s and the output of a sparse MDN is components of K mixtures of Gaussians: mixture weights {wi}, means {µi}, and covariance matrices {Σi}. A sparse MDN policy is defined as π(a|s) = K X i wi(s)N(a; µi(s), Σi(s)), where N(a; µ, Σ) indicates a multivariate Gaussian density at point a with mean µ and covariance Σ. In our implementation, w(s) is computed as a sparsemax distribution, while most existing MDN implementations utilize a softmax distribution. Modeling the expert’s policy using an MDN with K mixtures can be interpreted as separating continuous action space into K representative actions. Since we model mixture weights using a sparsemax distribution, the number of mixtures used to model the expert’s policy can vary depending on the state. In this regards, the sparsemax weight selection has an advantage over the soft weight selection since the former utilizes mixture components more efficiently as unnecessary components will be assigned with zero weights. Tsallis Entropy of Mixture Density Network An interesting fact is that the causal Tsallis entropy of an MDN has an analytic form while the Gibbs-Shannon entropy of an MDN is intractable. Theorem 7 Let π(a|s) = PK i wi(s)N(a; µi(s), Σi(s)) and ρπ(s) = P a ρπ(s, a). Then, W(π) = 1 2 X s ρπ(s) 1 − K X i K X j wi(s)wj(s)N (µi(s); µj(s), Σi(s) + Σj(s)) ! . (11) The proof is included in the supplementary material. The analytic form of the Tsallis entropy shows that the Tsallis entropy is proportional to the distance between mixture means. Hence, maximizing the Tsallis entropy of a sparse MDN encourages exploration of diverse directions during the policy optimization step of MCTEIL. In imitation learning, the main benefit of the generative adversarial 7 setting is that the resulting policy is more robust than that of supervised learning since it can learn how to recover from a less demonstrated region to a demonstrated region by exploring the state-action space during training. Maximum Tsallis entropy of a sparse MDN encourages efficient exploration by giving bonus rewards when mixture means are spread out. (11) also has an effect of utilizing mixtures more efficiently by penalizing for modeling a single mode using several mixtures. Consequently, the Tsallis entropy W(π) has clear benefits in terms of both exploration and mixture utilization. 6 Experiments To verify the effectiveness of the proposed method, we compare MCTEIL with several other imitation learning methods. First, we use behavior cloning (BC) as a baseline. Second, generative adversarial imitation learning (GAIL) with a single Gaussian distribution is compared. We also compare a straightforward extension of GAIL for a multi-modal policy by using a softmax weighted mixture density network (soft MDN) in order to validate the efficiency of the proposed sparsemax weighted MDN. In soft GAIL, due to the intractability of the causal entropy of a mixture of Gaussians, we approximate the entropy term by adding −α log(π(at|st)) to −log(D(st, at)) since Eπ [−log(D(s, a))]+αH(π) = Eπ [−log(D(s, a)) −α log(π(a|s))]. We also compare info GAIL [21] which learns simultaneously both policy and the latent structure of experts’ demonstrations. In info GAIL, a posterior distribution of a latent code is learned to cluster multi-modal demonstrations. The posterior distribution is trained to consistently assign the latent code to similar demonstrations and Once the latent codes are assigned to the demonstrations, the policy function conditioned on a latent code is trained to generate the corresponding demonstrations. Different modes in demonstrations are captured by assigning different latent codes. 6.1 Multi-Goal Environment To validate that the proposed method can learn multi-modal behavior of an expert, we design a simple multi-goal environment with four attractors and four repulsors, where an agent tries to reach one of attractors while avoiding all repulsors as shown in Figure 1(a). The agent follows the point-mass dynamics and get a positive reward (resp., a negative reward) when getting closer to an attractor (resp., repulsor). Intuitively, this problem has multi-modal optimal actions at the center. We first train the optimal policy using [3] and generate 300 demonstrations from the expert’s policy. For tested methods, 500 episodes are sampled at each iteration. In every iteration, we measure the average return using the underlying rewards and the reachability which is measured by counting how many goals are reached. If the algorithm captures the multi-modality of expert’s demonstrations, then, the resulting policy will show high reachability. All algorithms run repeatedly with seven different random seeds. The results are shown in Figure 1(b) and 1(c). Since the rewards are multi-modal, it is easy to get a high return if the algorithm learns only uni-modal behavior. Hence, the average returns of soft GAIL, info GAIL and MCTEIL increases similarly. However, when it comes to the reachability, MCTEIL outperforms other methods when they use the same number of mixtures. In particular, MCTEIL can learn all modes in demonstrations at the end of learning while soft GAIL and info GAIL suffer from collapsing modes. This advantage clearly comes from the maximum Tsallis entropy of a sparse MDN since the analytic form of the Tsallis entropy directly penalizes collapsed mixture means while −log(π(a|s)) indirectly prevents modes collapsing in soft GAIL. Furthermore, info-GAIL also shows mode collapsing while the proposed method can learn every modes. Since info-GAIL has to train a posterior distribution over the latent code to separate demonstrations, it requires more iterations for reaching all modes as well as prone to the mode collapsing problems. Consequently, we can conclude that the MCTEIL efficiently utilizes each mixture for wide-spread exploration. 6.2 Continuous Control Environment We test MCTEIL with a sparse MDN on MuJoCo [10], which is a physics-based simulator, using Halfcheetah, Walker2d, Reacher, and Ant. We train the expert policy distribution using trust region policy optimization (TRPO) [29] under the true reward function and generate 50 demonstrations from the expert policy. We run algorithms with varying numbers of demonstrations, 4, 11, 18, and 25, and all experiments have been repeated three times with different random seeds. To evaluate the performance of each algorithm, we sample 50 episodes from the trained policy and measure the 8 (a) Multi-Goal Environment (b) Average Return (c) Reachability Figure 1: (a) The environment and multi-modal demonstrations are shown. The contour shows the underlying reward map. (b) The average return during training. (c) The reachability during training, where k is the number of mixtures, c is a dimension of the latent code, and α is a regularization coefficient. Figure 2: Average returns of trained policies. For soft GAIL and MCTEIL, k indicates the number of mixture and α is an entropy regularization coefficient. A dashed line indicates the performance of an expert. average return value using the underlying rewards. For methods using an MDN, we use the best number of mixtures using a brute force search. The results are shown in Figure 2. For three problems, except Walker2d, MCTEIL outperforms the other methods with respect to the average return as the number of demonstrations increases. For Walker2d, MCTEIL and soft GAIL show similar performance. Especially, in the reacher problem, we obtain the similar results reported in [9], where BC works better than GAIL. However, our method shows the best performance for all demonstration counts. It is observed that the MDN policy tends to show high performance consistently since MCTEIL and soft GAIL are consistently ranked within the top two high performing algorithms. From these results, we can conclude that an MDN policy explores better than a single Gaussian policy since an MDN can keep searching multiple directions during training. In particular, since the maximum Tsallis entropy makes each mixture mean explore in different directions and a sparsemax distribution assigns zero weight to unnecessary mixture components, MCTEIL efficiently explores and shows better performance compared to soft GAIL with a soft MDN. Consequently, we can conclude that MCTEIL outperforms other imitation learning methods and the causal Tsallis entropy has benefits over the causal Gibbs-Shannon entropy as it encourages exploration more efficiently. 7 Conclusion In this paper, we have proposed a novel maximum causal Tsallis entropy (MCTE) framework, which induces a sparsemax distribution as the optimal solution. We have also provided the full mathematical analysis of the proposed framework, including the concavity of the problem, the optimality condition, and the interpretation as robust Bayes. We have also developed the maximum causal Tsallis entropy imitation learning (MCTEIL) algorithm, which can efficiently solve a MCTE problem in a continuous action space since the Tsallis entropy of a mixture of Gaussians encourages exploration and efficient mixture utilization. In experiments, we have verified that the proposed method has advantages over existing methods for learning the multi-modal behavior of an expert since a sparse MDN can search in diverse directions efficiently. Furthermore, the proposed method has outperformed BC, GAIL, and GAIL with a soft MDN on the standard IL problems in the MuJoCo environment. From the analysis and experiments, we have shown that the proposed MCTEIL method is an efficient and principled way to learn the multi-modal behavior of an expert. 9 Acknowledgments This work was supported in part by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science and ICT (NRF-2017R1A2B2006136) and by the Brain Korea 21 Plus Project in 2018. References [1] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey, “Maximum entropy inverse reinforcement learning,” in Proceedings of the 23rd International Conference on Artificial Intelligence, July 2008, pp. 1433–1438. [2] T. Haarnoja, H. Tang, P. Abbeel, and S. Levine, “Reinforcement learning with deep energybased policies,” in Proceedings of the 34th International Conference on Machine Learning, August 2017, pp. 1352–1361. [3] K. Lee, S. Choi, and S. Oh, “Sparse Markov decision processes with causal sparse Tsallis entropy regularization for reinforcement learning,” IEEE Robotics and Automation Letters, vol. 3, no. 3, pp. 1466–1473, 2018. [4] N. Heess, D. Silver, and Y. W. Teh, “Actor-critic reinforcement learning with energy-based policies,” in Proceedings of the 10th European Workshop on Reinforcement Learning, June 2012, pp. 43–58. [5] P. Vamplew, R. Dazeley, and C. Foale, “Softmax exploration strategies for multiobjective reinforcement learning,” Neurocomputing, vol. 263, pp. 74–86, Jun 2017. [6] A. F. T. Martins and R. F. Astudillo, “From softmax to sparsemax: A sparse model of attention and multi-label classification,” in Proceedings of the 33nd International Conference on Machine Learning, June 2016, pp. 1614–1623. [7] M. Bloem and N. Bambos, “Infinite time horizon maximum causal entropy inverse reinforcement learning,” in Proceedings of the 53rd International Conference on Decision and Control, December 2014, pp. 4911–4916. [8] Y. Chow, O. Nachum, and M. Ghavamzadeh, “Path consistency learning in tsallis entropy regularized mdps,” in Proceedings of the International Conference on Machine Learning, July 2018, pp. 978–987. [9] J. Ho and S. Ermon, “Generative adversarial imitation learning,” in Advances in Neural Information Processing Systems, December 2016, pp. 4565–4573. [10] E. Todorov, T. Erez, and Y. Tassa, “MuJoCo: A physics engine for model-based control,” in Proceedings of the International Conference on Intelligent Robots and Systems, October 2012, pp. 5026–5033. [11] P. Abbeel and A. Y. Ng, “Apprenticeship learning via inverse reinforcement learning,” in Proceedings of the 21st International Conference of Machine Learning, July 2004. [12] N. D. Ratliff, J. A. Bagnell, and M. Zinkevich, “Maximum margin planning,” in Proc. of the 23rd International Conference on Machine learning, June 2006. [13] D. Ramachandran and E. Amir, “Bayesian inverse reinforcement learning,” in Proceedings of the 20th International Joint Conference on Artificial Intelligence, January 2007. [14] S. Levine, Z. Popovic, and V. Koltun, “Nonlinear inverse reinforcement learning with gaussian processes,” in Advances in Neural Information Processing Systems, 2011, pp. 19–27. [15] J. Zheng, S. Liu, and L. M. Ni, “Robust bayesian inverse reinforcement learning with sparse behavior noise,” in Proc. of the 28th AAAI Conference on Artificial Intelligence. AAAI Press, July 2014. [16] J. Choi and K.-E. Kim, “Hierarchical bayesian inverse reinforcement learning,” Cybernetics, IEEE Transactions on, vol. 45, no. 4, pp. 793–805, 2015. 10 [17] J. Choi and K. Kim, “Bayesian nonparametric feature construction for inverse reinforcement learning,” in Proceedings of the 23rd International Joint Conference on Artificial Intelligence. IJCAI/AAAI, August 2013. [18] M. Wulfmeier, P. Ondruska, and I. Posner, “Maximum entropy deep inverse reinforcement learning,” arXiv preprint arXiv:1507.04888, 2015. [19] K. Hausman, Y. Chebotar, S. Schaal, G. S. Sukhatme, and J. J. Lim, “Multi-modal imitation learning from unstructured demonstrations using generative adversarial nets,” in Advances in Neural Information Processing Systems, December 2017, pp. 1235–1245. [20] Z. Wang, J. S. Merel, S. E. Reed, N. de Freitas, G. Wayne, and N. Heess, “Robust imitation of diverse behaviors,” in Advances in Neural Information Processing Systems, December 2017, pp. 5326–5335. [21] Y. Li, J. Song, and S. Ermon, “Infogail: Interpretable imitation learning from visual demonstrations,” in Advances in Neural Information Processing Systems, December 2017, pp. 3815–3825. [22] B. D. Ziebart, “Modeling purposeful adaptive behavior with the principle of maximum causal entropy,” Ph.D. dissertation, Carnegie Mellon University, Pittsburgh, PA, USA, 2010, aAI3438449. [23] U. Syed and R. E. Schapire, “A game-theoretic approach to apprenticeship learning,” in Advances in neural information processing systems, December 2007, pp. 1449–1456. [24] G. W. Brier, “Verification of forecasts expressed in terms of probability,” Monthey Weather Review, vol. 78, no. 1, pp. 1–3, 1950. [25] U. Syed, M. Bowling, and R. E. Schapire, “Apprenticeship learning using linear programming,” in Proceedings of the 25th international conference on Machine learning. ACM, 2008, pp. 1032–1039. [26] M. L. Puterman, Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014. [27] P. D. Grünwald and A. P. Dawid, “Game theory, maximum entropy, minimum discrepancy and robust Bayesian decision theory,” Annals of Statistics, pp. 1367–1433, 2004. [28] P. W. Millar, “The minimax principle in asymptotic statistical theory,” in Ecole d’Eté de Probabilités de Saint-Flour XI—1981. Springer, 1983, pp. 75–265. [29] J. Schulman, S. Levine, P. Abbeel, M. I. Jordan, and P. Moritz, “Trust region policy optimization,” in Proceedings of the 32nd International Conference on Machine Learning, July 2015, pp. 1889– 1897. 11
2018
167
7,327
Importance Weighting and Variational Inference Justin Domke1 and Daniel Sheldon1,2 1 College of Information and Computer Sciences, University of Massachusetts Amherst 2 Department of Computer Science, Mount Holyoke College Abstract Recent work used importance sampling ideas for better variational bounds on likelihoods. We clarify the applicability of these ideas to pure probabilistic inference, by showing the resulting Importance Weighted Variational Inference (IWVI) technique is an instance of augmented variational inference, thus identifying the looseness in previous work. Experiments confirm IWVI’s practicality for probabilistic inference. As a second contribution, we investigate inference with elliptical distributions, which improves accuracy in low dimensions, and convergence in high dimensions. 1 Introduction Probabilistic modeling is used to reason about the world by formulating a joint model p(z, x) for unobserved variables z and observed variables x, and then querying the posterior distribution p(z | x) to learn about hidden quantities given evidence x. Common tasks are to draw samples from p(z | x) or compute posterior expectations. However, it is often intractable to perform these tasks directly, so considerable research has been devoted to methods for approximate probabilistic inference. Variational inference (VI) is a leading approach for approximate inference. In VI, p(z | x) is approximated by a distribution q(z) in a simpler family for which inference is tractable. The process to select q is based on the following decomposition [22, Eqs. 11-12]: log p(x) = E q(z) log p(z, x) q(z) | {z } ELBO[q(z)kp(z,x)] + KL [q(z)kp(z|x)] | {z } divergence . (1) The first term is a lower bound of log p(x) known as the "evidence lower bound" (ELBO). Selecting q to make the ELBO as big as possible simultaneously obtains a lower bound of log p(x) that is as tight as possible and drives q close to p in KL-divergence. The ELBO is closely related to importance sampling. For fixed q, let R = p(z, x)/q(z) where z ⇠q. This random variable satisfies p(x) = E R, which is the foundation of importance sampling. Similarly, we can write by Jensen’s inequality that log p(x) ≥E log R = ELBO [qkp], which is the foundation of modern “black-box” versions of VI (BBVI) [19] in which Monte Carlo samples are used to estimate E log R, in the same way that IS estimates E R. Critically, the only property VI uses to obtain a lower bound is p(x) = E R. Further, it is straightforward to see that Jensen’s inequality yields a tighter bound when R is more concentrated about its mean p(x). So, it is natural to consider different random variables with the same mean that are more concentrated, for example the sample average RM = 1 M PM m=1 Rm. Then, by identical reasoning, log p(x) ≥E log RM. The last quantity is the objective of importance-weighted auto-encoders [5]; we call it the importance weighted ELBO (IW-ELBO), and the process of selecting q to maximize it importance-weighted VI (IWVI). 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. However, at this point we should pause. The decomposition in Eq. 1 makes it clear exactly in what sense standard VI, when optimizing the ELBO, makes q close to p. By switching to the one-dimensional random variable RM, we derived the IW-ELBO, which gives a tighter bound on log p(x). For learning applications, this may be all we want. But for probabilistic inference, we are left uncertain exactly in what sense q "is close to" p, and how we should use q to approximate p, say, for computing posterior expectations. Our first contribution is to provide a new perspective on IWVI by highlighting a precise connection between IWVI and self-normalized importance sampling (NIS) [17], which instructs us how to use IWVI for “pure inference” applications. Specifically, IWVI is an instance of augmented VI. Maximizing the IW-ELBO corresponds exactly to minimizing the KL divergence between joint distributions qM and pM, where qM is derived from NIS over a batch of M samples from q, and pM is the joint distribution obtained by drawing one sample from p and M −1 “dummy” samples from q. This has strong implications for probabilistic inference (as opposed to learning) which is our primary focus. After optimizing q, one should compute posterior expectations using NIS. We show that not only does IWVI significantly tighten bounds on log p(x), but, by using q this way at test time, it significantly reduces estimation error for posterior expectations. Previous work has connected IWVI and NIS by showing that the importance weighted ELBO is a lower bound of the ELBO applied to the NIS distribution [6, 16, 2]. Our work makes this relationship precise as an instance of augmented VI, and exactly quantifies the gap between the IW-ELBO and conventional ELBO applied to the NIS distribution, which is a conditional KL divergence. Our second contribution is to further explore the connection between variational inference and importance sampling by adapting ideas of “defensive sampling” [17] to VI. Defensive importance sampling uses a widely dispersed q distribution to reduce variance by avoiding situations where q places essentially no mass in an area with p has density. This idea is incompatible with regular VI due to its “mode seeking” behavior, but it is quite compatible with IWVI. We show how to use elliptical distributions and reparameterization to achieve a form of defensive sampling with almost no additional overhead to black-box VI (BBVI). “Elliptical VI” provides small improvements over Gaussian BBVI in terms of ELBO and posterior expectations. In higher dimensions, these improvements diminish, but elliptical VI provides significant improvement in the convergence reliability and speed. This is consistent with the notion that using a “defensive” q distribution is advisable when it is not well matched to p (e.g., before optimization has completed). 2 Variational Inference Consider again the "ELBO decomposition" in Eq. 1. Variational inference maximizes the “evidence lower bound” (ELBO) over q. Since the divergence is non-negative, this tightens a lower-bound on log p(x). But, of course, since the divergence and ELBO vary by a constant, maximizing the ELBO is equivalent to minimizing the divergence. Thus, variational inference can be thought of as simultaneously solving two problems: • “probabilistic inference” or finding a distribution q(z) that is close to p(z|x) in KL-divergence. • “bounding the marginal likelihood” or finding a lower-bound on log p(x). The first problem is typically used with Bayesian inference: A user specifies a model p(z, x), observes some data x, and is interested in the posterior p(z|x) over the latent variables. While Markov chain Monte Carlo is most commonly for these problems [9, 23], the high computational expense motivates VI [11, 3]. While a user might be interested in any aspect of the posterior, for concreteness, we focus on “posterior expectations”, where the user specifies some arbitrary t(z) and wants to approximate Ep(z|x) t(z). The second problem is typically used to support maximum likelihood learning. Suppose that p✓(z, x) is some distribution over observed data x and hidden variables z. In principle, one would like to set ✓ to maximize the marginal likelihood over the observed data. When the integral p✓(x) = R p✓(z, x)dz is intractable, one can optimize the lower-bound Eq(z) log (p✓(z, x)/q(z)) instead [22], over both ✓and the parameters of q. This idea has been used to great success recently with variational auto-encoders (VAEs) [10]. 2 3 Importance Weighting Recently, ideas from importance sampling have been applied to obtain tighter ELBOs for learning in VAEs [5]. We review the idea and then draw novel connections to augmented VI that make it clear how adapt apply these ideas to probabilistic inference. Figure 1: How the density of RM changes with M. (Distribution and setting as in Fig. 2.) Take any random variable R such that E R = p(x), which we will think of as an “estimator” of p(x). Then it’s easy to see via Jensen’s inequality that log p(x) = E log R | {z } bound + E log p(x) R | {z } looseness , (2) where the first term is a lower bound on log p(x), and the second (non-negative) term is the looseness. The bound will be tight if R is highly concentrated. While Eq. 2 looks quite trivial, it is a generalization of the “ELBO” decomposition in Eq. 1. To see that, use the random variable R = !(z) = p(z, x) q(z) , z ⇠q, (3) which clearly obeys E R = p(x), and for which Eq. 2 becomes Eq. 1. The advantage of Eq. 2 over Eq. 1 is increased flexibility: alternative estimators R can give a tighter bound on log p(x). One natural idea is to draw multiple i.i.d. samples from q and average the estimates as in importance sampling (IS) . This gives the estimator RM = 1 M M X m=1 p (zm, x) q(zm) , zm ⇠q. (4) It’s always true that E RM = p(x), but the distribution of RM places less mass near zero for larger M, which leads to a tighter bound (Fig. 1). This leads to a tighter “importance weighted ELBO” (IW-ELBO) lower bound on log p(x), namely IW-ELBOM [q(z)kp(z, x)] := E q(z1:M) log 1 M M X m=1 p (zm, x) q(zm) , (5) where z1:M is a shorthand for (z1, ..., zM) and q(z1:M) = q(z1) · · · q(zM). This bound was first introduced by Burda et al. [5] in the context of supporting maximum likelihood learning of a variational auto-encoder. 3.1 A generative process for the importance weighted ELBO While Eq. 2 makes clear that optimizing the IW-ELBO tightens a bound on log p(x), it isn’t obvious what connection this has to probabilistic inference. Is there some divergence that is being minimized? Theorem 1 shows this can be understood by constructing “augmented” distributions pM(z1:M, x) and qM(z1:M) and then applying the ELBO decomposition in Eq. 1 to the joint distributions. Theorem 1 (IWVI). Let qM(z1:M) be the density of the generative process described by Alg. 1, which is based on self-normalized importance sampling over a batch of M samples from q. Let pM (z1:M, x) = p(z1, x)q(z2:M) be the density obtained by drawing z1 and x from p and drawing the “dummy” samples z2:M from q. Then qM (z1:M) = pM(z1:M, x) 1 M PM m=1 !(zm) . (6) Further, the ELBO decomposition in Eq. 1 applied to qM and pM is log p(x) = IW-ELBOM [q(z)kp(z, x)] + KL [qM(z1:M)kpM(z1:M|x)] . (7) 3 Algorithm 1 A generative process for qM(z1:M) 1. Draw ˆz1, ˆz1, ..., ˆzM independently from q (z) . 2. Choose m 2 {1, ..., M} with probability ! (ˆzm) PM m0=1 ! (ˆzm0) . 3. Set z1 = ˆzm and z2:M = ˆz−m and return z1:M. We will call the process of maximizing the IW-ELBO “Importance Weighted Variational Inference” (IWVI). (Burda et al. used “Importance Weighted Auto-encoder” for optimizing Eq. 5 as a bound on the likelihood of a variational auto-encoder, but this terminology ties the idea to a particular model, and is not suggestive of the probabilistic inference setting.) The generative process for qM in Alg. 1 is very similar to self-normalized importance sampling. The usual NIS distribution draws a batch of size M, and then “selects” a single variable with probability in proportion to its importance weight. NIS is exactly equivalent to the marginal distribution qM(z1). The generative process for qM(z1:M) additionally keeps the unselected variables and relabels them as z2:M. Previous work [6, 2, 16, 12] investigated a similar connection between NIS and the importanceweighted ELBO. In our notation, they showed that log p(x) ≥ELBO [qM(z1)kp(z1, x)] ≥IW-ELBOM [q(z)kp(z, x)] . (8) That is, they showed that the IW-ELBO lower bounds the ELBO between the NIS distribution and p, without quantifying the gap in the second inequality. Our result makes it clear exactly what KL-divergence is being minimized by maximizing the IW-ELBO and in what sense doing this makes q “close to” p. As a corollary, we also quantify the gap in the inequality above (see Thm. 2 below). A recent decomposition [12, Claim 1] is related to Thm. 1, but based on different augmented distributions qIS M and pIS M . This result is fundamentally different in that it holds qIS M "fixed" to be an independent sample of size M from q, and modifies pIS M so its marginals approach q. This does not inform inference. Contrast this with our result, where qM(z1) gets closer and closer to p(z1 | x), and can be used for probabilistic inference. See appendix (Section A.3.2) for details. Identifying the precise generative process is useful if IWVI will be used for general probabilistic queries, which is a focus of our work, and, to our knowledge, has not been investigated before. For example, the expected value of t(z) can be approximated as E p(z|x) t(z) = E pM(z1|x) t(z1) ⇡ E qM(z1) t(z1) = E q(z1:M) PM m=1 ! (zm) t(zm) PM m=1 ! (zm) . (9) The final equality is established by Lemma 4 in the Appendix. Here, the inner approximation is justified since IWVI minimizes the joint divergence between qM(z1:M) and pM(z1:M|x) . However, this is not equivalent to minimizing the divergence between qM(z1) and pM(z1|x), as the following result shows. Theorem 2. The marginal and joint divergences relevant to IWVI are related by KL [qM(z1:M)kpM(z1:M|x)] = KL [qM(z1)kp(z1|x)] + KL [qM(z2:M|z1)kq(z2:M)] . As a consequence, the gap in the first inequality of Eq 8 is exactly KL [qM(z1)kp(z1|x)] and the gap in the second inequality is exactly KL [qM(z2:M|z1)kq(z2:M)]. The first term is the divergence between the marginal of qM, i.e., the “standard” NIS distribution, and the posterior. In principle, this is exactly the divergence we would like to minimize to justify Eq. 9. However, the second term is not zero since the selection phase in Alg. 1 leaves z2:M distributed differently under qM than under q. Since this term is irrelevant to the quality of the approximation in Eq. 9, IWVI truly minimizes an upper-bound. Thus, IWVI can be seen as an instance of auxiliary variational inference [1] where a joint divergence upper-bounds the divergence of interest. 4 (a) The target p and four candidate variational distributions. (b) Reweighted densities qM(z1) for each distribution. (c) The IW-ELBO. (Higher is better.) (d) Moment error k EqM t(z1) −Ep t(z)k2 2 for t(z) = (z, z2). (Lower is better.) Figure 2: Two Gaussian (N) and two Student-T (T ) variational distributions, all with constant variance and one of two means (A or B). For M = 1 it is better to use a mean closer to one mode of p. For large M, a mean in the center is superior, and the heavy tails of the Student T lead to better approximation of p and better performance both in terms of IW-ELBO and moment error. 4 Importance Sampling Variance This section considers the family for the variational distribution. For small M, the mode-seeking behavior of VI will favor weak tails, while for large M, variance reduction provided by importance weighting will favor wider tails. The most common variational distribution is the Gaussian. One explanation for this is the Bayesian central limit theorem, which, in many cases, guarantees that the posterior is asymptotically Gaussian. Another is that it’s “safest” to have weak tails: since the objective is E log R, small values of R are most harmful. So, VI wants to avoid cases where q(z) ≫p(z, x), which is difficult if q is heavy-tailed. (This is the “mode-seeking” behavior of the KL-divergence [24].) With IWVI, the situation changes. Asymptotically in M, RM in Eq. 4 concentrates around p(x), and so it is the variance of RM that matters, as formalized in the following result. Theorem 3. For large M, the looseness of the IW-ELBO is given by the variance of R. Formally, if there exists some ↵> 0 such that E |R −p(x)|2+↵< 1 and lim supM!1 E[1/RM] < 1, then lim M!1 M ⇣ log p(x) −IW-ELBOM [q(z)kp(z, x)] | {z } KL[qMkpM] ⌘ = V[R] 2p(x)2 . Maddison et al. [13] give a related result. Their Proposition 1 applied to RM gives the same conclusion (after an argument based on the Marcinkiewicz-Zygmund inequality; see appendix) but requires the sixth central moment to exist, whereas we require only existence of E |R −p(x)|2+↵for any ↵> 0. The lim sup assumption on E 1/RM is implied by assuming that E 1/RM < 1 for any finite M (or for R itself). Rainforth et al. [18, Theorem 1 in Appendix] provide a related asymptotic for errors in gradient variance, assuming at least the third moment exists. Directly minimizing the variance of R is equivalent to minimizing the χ2 divergence between q(z) and p(z|x), as explored by Dieng et al. [7]. Overdispersed VI [21] reduces the variance of score-function estimators using heavy-tailed distributions. 5 The quantity inside the parentheses on the left-hand side is exactly the KL-divergence between qM and pM in Eq. 7, and accordingly, even for constant q, this divergence asymptotically decreases at a 1/M rate. The variance of R is a well-explored topic in traditional importance sampling. Here the situation is reversed from traditional VI– since R is non-negative, it is very large values of R that can cause high variance, which occurs when q(z) ⌧p(z, x). The typical recommendation is “defensive sampling” or using a widely-dispersed proposal [17]. For these reasons, we believe that the best form for q will vary depending on the value of M. Figure 1 explores a simple example of this in 1-D. 5 Elliptical Distributions Elliptical distributions are a generalization of Gaussians that includes the Student-T, Cauchy, scalemixtures of Gaussians, and many others. The following short review assumes a density function exists, enabling a simpler presentation than the typical one based on characteristic functions [8]. We first describe the special case of spherical distributions. Take some density ⇢(r) for a non-negative r with R 1 0 ⇢(r) = 1. Define the spherical random variable ✏corresponding to ⇢as ✏= ru, r ⇠⇢, u ⇠S, (10) where S represents the uniform distribution over the unit sphere in d dimensions. The density of ✏ can be found using two observations. First, it is constant for all ✏with a fixed radius k✏k. Second, if if q✏(✏) is integrated over {✏: k✏k = r} the result must be ⇢(r). Using these, it is not hard to show that the density must be q✏(✏) = g(k✏k2 2), g(a) = 1 Sd−1a(d−1)/2 ⇢ *pa + , (11) where Sd−1 is the surface area of the unit sphere in d dimensions (and so Sd−1a(d−1)/2 is the surface area of the sphere with radius a) and g is the density generator. Generalizing, this, take some positive definite matrix ⌃and some vector µ. Define the elliptical random variable z corresponding to ⇢, ⌃, and µ by z = rA>u + µ, r ⇠⇢, u ⇠S, (12) where A is some matrix such that A>A = ⌃. Since z is an affine transformation of ✏, it is not hard to show by the “Jacobian determinant” formula for changes of variables that the density of z is q(z|µ, ⌃) = 1 |⌃|1/2 g ⇣ (z −µ)T ⌃−1 (z −µ) ⌘ , (13) where g is again as in Eq. 11. The mean and covariance are E[z] = µ, and C[z] = * E[r2]/d + ⌃. For some distributions, ⇢(r) can be found from observing that r has the same distribution as k✏k. For example, with a Gaussian, r2 = k✏k2 is a sum of d i.i.d. squared Gaussian variables, and so, by definition, r ⇠χd. 6 Reparameterization and Elliptical Distributions Suppose the variational family q(z|w) has parameters w to optimize during inference. The reparameterization trick is based on finding some density q✏(✏) independent of w and a “reparameterization function” T (✏; w) such that T (✏; w) is distributed as q(z|w). Then, the ELBO can be re-written as ELBO[q(z|w)kp(z, x)] = E q✏(✏) log p(T (✏; w), x) q(T (✏; w)|w). The advantage of this formulation is that the expectation is independent of w. Thus, computing the gradient of the term inside the expectation for a random ✏gives an unbiased estimate of the gradient. By far the most common case is the multivariate Gaussian distribution, in which case the base density q✏(✏) is just a standard Gaussian and for some Aw such that A> wAw = ⌃w, T (✏; w) = A> w✏+ µw. (14) 6 6.1 Elliptical Reparameterization To understand Gaussian reparameterization from the perspective of elliptical distributions, note the similarity of Eq. 14 to Eq. 12. Essentially, the reparameterization in Eq. 14 combines r and u into ✏= ru. This same idea can be applied more broadly: for any elliptical distribution, provided the density generator g is independent of w, the reparameterization in Eq. 14 will be valid, provided that ✏comes from the corresponding spherical distribution. While this independence is true for Gaussians, this is not the case for other elliptical distributions. If ⇢w itself is a function of w, Eq. 14 must be generalized. In that case, think of the generative process (for v sampled uniformly from [0, 1]) T (u, v; w) = F −1 w (v)AT wu + µw, (15) where F −1 w (v) is the inverse CDF corresponding to the distribution ⇢w(r). Here, we should think of the vector (u, v) playing the role of ✏above, and the base density as qu,v(u, v) being a spherical density for u and a uniform density for v. To calculate derivatives with respect to w, backpropagation through Aw and µw is simple using any modern autodiff system. So, if the inverse CDF F −1 w has a closed-form, autodiff can be directly applied to Eq. 15. If the inverse CDF does not have a simple closed-form, the following section shows that only the CDF is actually needed, provided that one can at least sample from ⇢(r). 6.2 Dealing CDFs without closed-form inverses For many distributions ⇢, the inverse CDF may not have a simple closed form, yet highly efficient samplers still exist (most commonly custom rejection samplers with very high acceptance rates). In such cases, one can still achieve the effect of Eq. 15 on a random v using only the CDF (not the inverse). The idea is to first directly generate r ⇠⇢w using the specialized sampler, and only then find the corresponding v = Fw(r) using the closed-form CDF. To understand this, observe that if r ⇠⇢and v ⇠Uniform[0, 1], then the pairs (r, Fw(r)) and (F −1 w (v), v) are identically distributed. Then, via the implicit function theorem, rwF −1 w (v) = −rwFw(r) , rrFw(r). All gradients can then be computed by “pretending” that one had started with v and computed r using the inverse CDF. 6.3 Student T distributions The following experiments will consider student T distributions. The spherical T distribution can be defined as ✏= p⌫δ/s where δ ⇠N(0, I) and s ⇠χ⌫[8]. Equivalently, write r = k✏k = p⌫t/s with t ⇠χd. This shows that r is the ratio of two independent χ variables, and thus determined by an F-distribution, the CDF of which could be used directly in Eq. 15. We found a slightly “bespoke” simplification helpful. As there is no need for gradients with respect to d (which is fixed), we represent ✏as ✏= (p⌫t/s)u, leading to reparameterizing the elliptical T distribution as T (u, t, v; w) = p⌫t F −1 ⌫ (v)A> wu + µw, where F⌫is the CDF for the χ⌫distribution. This is convenient since the CDF of the χ distribution is more widely available than that of the F distribution. 7 Experiments All the following experiments compare “E-IWVI” using student T distributions to “IWVI” using Gaussians. Regular “VI” is equivalent to IWVI with M = 1. We consider experiments on three distributions. In the first two, a computable log p(x) enables estimation of the KL-divergence and computable true mean and variance of the posterior enable a precise evaluation of test integral estimation. On these, we used a fixed set of 10, 000 ⇥M random inputs to T and optimized using batch L-BFGS, avoiding heuristic tuning of a learning rate sequence. A first experiment considered random Dirichlet distributions p(✓|↵) over the probability simplex in K dimensions, ✓2 ∆K. Each parameter ↵k is drawn i.i.d. from a Gamma distribution with a shape parameter of 10. Since this density is defined only over the probability simplex, we borrow from Stan 7 −5 5 z1 −10 2 z2 100 101 102 M 101 102 103 ν ν chosen by E-IWVI K=50 K=20 K=10 K=5 K=3 100 101 102 M 0.00 0.05 0.10 0.15 0.20 0.25 estimated KL, K=3 VI IWVI E-IWVI 100 101 102 M 0.0 0.5 1.0 1.5 2.0 2.5 estimated KL, K=20 VI IWVI E-IWVI 100 101 102 M 0.000 0.005 0.010 0.015 error (cov), K=3 VI IWVI E-IWVI 100 101 102 M 0.000 0.001 0.002 0.003 0.004 error (cov), K=20 VI IWVI E-IWVI Figure 3: Random Dirichlets, averaged over 20 repetitions. Top left shows an example posterior for K = 3. The test-integral error is kC[✓] −ˆC[✓]kF where ˆC is the empirical covariance of samples drawn from qM(z1) and then transformed to ∆K. In all cases, IWVI is able to reduce the error of VI to negligible levels. E-IWVI provides an accuracy benefit in low dimensions but little when K = 20. −12 4 z1 −6 8 z2 100 101 102 M 101 102 103 104 ν ν chosen by E-IWVI d=10, n=20 d=2, n=15 100 101 102 M 0.00 0.03 0.05 0.08 0.10 0.12 0.15 estimated KL, d = 2, n = 15 VI IWVI E-IWVI 100 101 102 M 0 50 100 150 estimated KL, d = 10, n = 20 VI IWVI E-IWVI 100 101 102 M 0 1 2 3 4 5 moment error, d = 2, n = 15 VI IWVI E-IWVI 100 101 102 M 0 200 400 600 moment error, d = 10, n = 20 VI IWVI E-IWVI Figure 4: Clutter Distributions, averaged over 50 repetitions. The error shows the error in the estimated second moment E[zzT ]. IWVI reduces the errors of VI by orders of magnitude. E-IWVI provides a diminishing benefit in higher dimensions. the strategy of transforming to an unconstrained z 2 RK−1 space via a stick-breaking process [23]. To compute test integrals over variational distributions, the reverse transformation is used. Results are shown in Fig. 3. A second experiment uses Minka’s “clutter” model [15]: z 2 Rd is a hidden object location, and x = (x1, . . . , xn) is a set of n noisy observations, with p(z) = N(z; 0, 100I) and p(xi|z) = 0.25 N(xi; z, I) + 0.75 N(xi; 0, 10I). The posterior p(z | x) is a mixture of 2n Gaussians, for which we can do exact inference for moderate n. Results are shown in Fig. 4. Finally, we considered a (non-conjugate) logistic regression model with a Cauchy prior with a scale of 10, using stochastic gradient descent with various step sizes. On these higher dimensional problems, we found that when the step-size was perfectly tuned and optimization had many iterations, both methods performed similarly in terms of the IW-ELBO. E-IWVI never performed worse, and 8 M = 1 M = 5 M = 20 M = 100 −4000 −3500 −3000 −2500 −2000 IW-ELBO −180 −170 −160 −150 IW-ELBO 10−4 10−3 10−2 10−1 100 step size −150 −100 IW-ELBO IWVI-2000 IWVI-10000 E-IWVI-2000 E-IWVI-10000 10−4 10−3 10−2 10−1 100 step size 10−4 10−3 10−2 10−1 100 step size 10−4 10−3 10−2 10−1 100 step size Figure 5: Logistic regression comparing IWVI (red) and E-IWVI (blue) with various M and step sizes. The IW-ELBO is shown after 2,000 (dashed lines) and 10,000 (solid) iterations. A larger M consistently improves both methods. E-IWVI converges more reliably, particularly on higherdimensional data. From top: Madelon (d = 500) Sonar (d = 60), Mushrooms (d = 112). sometimes performed very slightly better. E-IWVI exhibited superior convergence behavior and was easier to tune, as illustrated in Fig. 5, where E-IWVI converges at least as well as IWVI for all step sizes. We suspect this is because when w is far from optimal, both the IW-ELBO and gradient variance is better with E-IWVI. Acknowledgements We thank Tom Rainforth for insightful comments regarding asymptotics and Theorem 3 and Linda Siew Li Tan for comments regarding Lemma 7. This material is based upon work supported by the National Science Foundation under Grant No. 1617533. References [1] Felix V. Agakov and David Barber. An auxiliary variational method. In Neural Information Processing, Lecture Notes in Computer Science, pages 561–566. Springer, Berlin, Heidelberg, 2004. [2] Philip Bachman and Doina Precup. Training deep generative models: Variations on a theme. In NIPS Workshop: Advances in Approximate Bayesian Inference, 2015. [3] Robert Bamler, Cheng Zhang, Manfred Opper, and Stephan Mandt. Perturbative black box variational inference. In NIPS, 2017. [4] Peter J Bickel and Kjell A Doksum. Mathematical statistics: basic ideas and selected topics, volume I, volume 117. CRC Press, 2015. [5] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. 2015. [6] Chris Cremer, Quaid Morris, and David Duvenaud. Reinterpreting importance-weighted autoencoders. 2017. [7] Adji Bousso Dieng, Dustin Tran, Rajesh Ranganath, John Paisley, and David Blei. Variational inference via χ upper bound minimization. In NIPS, pages 2729–2738. 2017. [8] Kaitai Fang, Samuel Kotz, and Kai Wang Ng. Symmetric multivariate and related distributions. Number 36 in Monographs on statistics and applied probability. Chapman and Hall, 1990. 9 [9] W. R. Gilks, A. Thomas, and D. J. Spiegelhalter. A language and program for complex bayesian modelling. 43(1):169–177, 1994. [10] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In ICLR. [11] Alp Kucukelbir, Dustin Tran, Rajesh Ranganath, Andrew Gelman, and David M. Blei. Automatic differentiation variational inference. 18(14):1–45, 2017. [12] Tuan Anh Le, Maximilian Igl, Tom Rainforth, Tom Jin, and Frank Wood. Auto-Encoding Sequential Monte Carlo. In ICLR, 2018. [13] Chris J Maddison, John Lawson, George Tucker, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Teh. Filtering variational objectives. In NIPS, pages 6576–6586. 2017. [14] Józef Marcinkiewicz and Antoni Zygmund. Quelques théoremes sur les fonctions indépendantes. Fund. Math, 29:60–90, 1937. [15] Minka, Thomas. Expectation propagation for approximate bayesian inference. In UAI, 2001. [16] Christian A. Naesseth, Scott W. Linderman, Rajesh Ranganath, and David M. Blei. Variational sequential monte carlo. In AISTATS, 2018. [17] Art Owen. Monte Carlo theory, methods and examples. 2013. [18] 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. [19] Rajesh Ranganath, Sean Gerrish, and David M. Blei. Black box variational inference. In AISTATS, 2014. [20] Gabriel Romon. Bounds on moments of sample mean. https://math.stackexchange. com/questions/2901196/bounds-on-moments-of-sample-mean, 2018. [21] Francisco J. R. Ruiz, Michalis K. Titsias, and David M. Blei. Overdispersed black-box variational inference. In UAI, 2016. [22] L. K. Saul, T. Jaakkola, and M. I. Jordan. Mean field theory for sigmoid belief networks. Journal of Artificial Intelligence Research, 4:61–76, 1996. [23] Stan Development Team. Modeling language user’s guide and reference manual, version 2.17.0, 2017. [24] Tom Minka. Divergence measures and message passing. 2005. 10
2018
168
7,328
Mapping Images to Scene Graphs with Permutation-Invariant Structured Prediction Roei Herzig∗ Tel Aviv University roeiherzig@mail.tau.ac.il Moshiko Raboh∗ Tel Aviv University mosheraboh@mail.tau.ac.il Gal Chechik Bar-Ilan University, NVIDIA Research gal.chechik@biu.ac.il Jonathan Berant Tel Aviv University, AI2 joberant@cs.tau.ac.il Amir Globerson Tel Aviv University gamir@post.tau.ac.il Abstract Machine understanding of complex images is a key goal of artificial intelligence. One challenge underlying this task is that visual scenes contain multiple interrelated objects, and that global context plays an important role in interpreting the scene. A natural modeling framework for capturing such effects is structured prediction, which optimizes over complex labels, while modeling within-label interactions. However, it is unclear what principles should guide the design of a structured prediction model that utilizes the power of deep learning components. Here we propose a design principle for such architectures that follows from a natural requirement of permutation invariance. We prove a necessary and sufficient characterization for architectures that follow this invariance, and discuss its implication on model design. Finally, we show that the resulting model achieves new state-of-the-art results on the Visual Genome scene-graph labeling benchmark, outperforming all recent approaches. 1 Introduction Understanding the semantics of a complex visual scene is a fundamental problem in machine perception. It often requires recognizing multiple objects in a scene, together with their spatial and functional relations. The set of objects and relations is sometimes represented as a graph, connecting objects (nodes) with their relations (edges) and is known as a scene graph (Figure 1). Scene graphs provide a compact representation of the semantics of an image, and can be useful for semantic-level interpretation and reasoning about a visual scene [11]. Scene-graph prediction is the problem of inferring the joint set of objects and their relations in a visual scene. Since objects and relations are inter-dependent (e.g., a person and chair are more likely to be in relation “sitting on” than “eating”), a scene graph predictor should capture this dependence in order to improve prediction accuracy. This goal is a special case of a more general problem, namely, inferring multiple inter-dependent labels, which is the research focus of the field of structured prediction. Structured prediction has attracted considerable attention because it applies to many learning problems and poses ∗Equal Contribution. 32nd Conference on Neural Information Processing Systems (NIPS 2018), Montréal, Canada. Figure 1: An image and its scene graph from the Visual Genome dataset [15]. The scene graph captures the entities in the image (nodes, blue circles) like dog and their relations (edges, red circles) like hat, on, dog . unique theoretical and algorithmic challenges [e.g., see 2, 7, 28]. It is therefore a natural approach for predicting scene graphs from images. Structured prediction models typically define a score function s(x, y) that quantifies how well a label assignment y is compatible with an input x. In the case of understanding complex visual scenes, x is an image, and y is a complex label containing the labels of objects detected in an image and the labels of their relations. In this setup, the inference task amounts to finding the label that maximizes the compatibility score y∗= arg maxy s(x, y). This score-based approach separates a scoring component – implemented by a parametric model, from an optimization component – aimed at finding a label that maximizes that score. Unfortunately, for a general scoring function s(·), the space of possible label assignments grows exponentially with input size. For instance, for scene graphs the set of possible object label assignments is too large even for relatively simple images, since the vocabulary of candidate objects may contain thousands of objects. As a result, inferring the label assignment that maximizes a scoring function is computationally hard in the general case. An alternative approach to score-based methods is to map an input x to a structured output y with a “black box" neural network, without explicitly defining a score function. This raises a natural question: what is the right architecture for such a network? Here we take an axiomatic approach and argue that one important property such networks should satisfy is invariance to a particular type of input permutation. We then prove that this invariance is equivalent to imposing certain structural constraints on the architecture of the network, and describe architectures that satisfy these constraints. To evaluate our approach, we first demonstrate on a synthetic dataset that respecting permutation invariance is important, because models that violate this invariance need more training data, despite having a comparable model size. Then, we tackle the problem of scene graph generation. We describe a model that satisfies the permutation invariance property, and show that it achieves state-of-the-art results on the competitive Visual Genome benchmark [15], demonstrating the power of our new design principle. In summary, the novel contributions of this paper are: a) Deriving sufficient and necessary conditions for graph-permutation invariance in deep structured prediction architectures. b) Empirically demonstrating the benefit of graph-permutation invariance. c) Developing a state-of-the-art model for scene graph prediction on a large dataset of complex visual scenes. 2 Structured Prediction Scored-based methods in structured prediction define a function s(x, y) that quantifies the degree to which y is compatible with x, and infer a label by maximizing s(x, y) [e.g., see 2, 7, 16, 20, 28]. Most score functions previously used decompose as a sum over simpler functions, s(x, y) = P i fi(x, y), making it possible to optimize maxy fi(x, y) efficiently. This local maximization forms the basic building block of algorithms for approximately maximizing s(x, y). One way to decompose the score function is to restrict each fi(x, y) to depend only on a small subset of the y variables. The renewed interest in deep learning led to efforts to integrate deep networks with structured prediction, including modeling the fi functions as deep networks. In this context, the most widelyused score functions are singleton fi(yi, x) and pairwise fij(yi, yj, x). The early work taking this approach used a two-stage architecture, learning the local scores independently of the structured prediction goal [6, 8]. Later studies considered end-to-end architectures where the inference algorithm 2 Figure 2: Left: Graph permutation invariance. A graph labeling function F is graph permutation invariant (GPI) if permuting the node features maintains the output. Right: a schematic representation of the GPI architecture in Theorem 1. Singleton features zi are omitted for simplicity. (a) First, the features zi,j are processed element-wise by φ. (b) Features are summed to create a vector si, which is concatenated with zi. (c) A representation of the entire graph is created by applying α n times and summing the created vector. (d) The graph representation is then finally processed by ρ together with zk. is part of the computation graph [7, 23, 26, 33]. Recent studies go beyond pairwise scores, also modelling global factors [2, 10]. Score-based methods provide several advantages. First, they allow intuitive specification of local dependencies between labels and how these translate to global dependencies. Second, for linear score functions, the learning problem has natural convex surrogates [16, 28]. Third, inference in large label spaces is sometimes possible via exact algorithms or empirically accurate approximations. However, with the advent of deep scoring functions s(x, y; w), learning is no longer convex. Thus, it is worthwhile to rethink the architecture of structured prediction models, and consider models that map inputs x to outputs y directly without explicitly maximizing a score function. We would like these models to enjoy the expressivity and predictive power of neural networks, while maintaining the ability to specify local dependencies between labels in a flexible manner. In the next section, we present such an approach and consider a natural question: what should be the properties of a deep neural network used for structured prediction. 3 Permutation-Invariant Structured Prediction In what follows we define the permutation-invariance property for structured prediction models, and argue that permutation invariance is a natural principle for designing their architecture. We first introduce our notation. We focus on structures with pairwise interactions, because they are simpler in terms of notation and are sufficient for describing the structure in many problems. We denote a structured label by y = [y1, . . . , yn]. In a score-based approach, the score is defined via a set of singleton scores fi(yi, x) and pairwise scores fij(yi, yj, x), where the overall score s(x, y) is the sum of these scores. For brevity, we denote fij = fij(yi, yj, x) and fi = fi(yi, x). An inference algorithm takes as input the local scores fi, fij and outputs an assignment that maximizes s(x, y). We can thus view inference as a black-box that takes node-dependent and edge-dependent inputs (i.e., the scores fi, fij) and returns a label y, even without an explicit score function s(x, y). While numerous inference algorithms exist for this setup, including belief propagation (BP) and mean field, here we develop a framework for a deep labeling algorithm (we avoid the term “inference” since the algorithm does not explicitly maximize a score function). Such an algorithm will be a black-box, taking the f functions as input and the labels y1, . . . , yn as output. We next ask what architecture such an algorithm should have. We follow with several definitions. A graph labeling function F : (V, E) →Y is a function whose input is an ordered set of node features V = [z1, . . . , zn] and an ordered set of edge features E = [z1,2 . . . , zi,j, . . . , zn,n−1]. For example, zi can be the array of values fi, and zi,j can be the table of values fi,j. Assume zi ∈Rd and zi,j ∈Re. The output of F is a set of node labels y = [y1, . . . , yn]. Thus, algorithms such as BP are graph labeling functions. However, graph labeling functions do not necessarily maximize a score function. We denote the joint set of node features and edge features by z (i.e., a set of n + n(n −1) = n2 vectors). In Section 3.1 we discuss extensions to this case where only a subset of the edges is available. 3 A natural requirement is that the function F produces the same result when given the same features, up to a permutation of the input. For example, consider a label space with three variables y1, y2, y3, and assume that F takes as input z = (z1, z2, z3, z12, z13, z23) = (f1, f2, f3, f12, f13, f23), and outputs a label y = (y∗ 1, y∗ 2, y∗ 3). When F is given an input that is permuted in a consistent way, say, z′ = (f2, f1, f3, f21, f23, f13), this defines exactly the same input. Hence, the output should still be y = (y∗ 2, y∗ 1, y∗ 3). Most inference algorithms, including BP and mean field, satisfy this symmetry requirement by design, but this property is not guaranteed in general in a deep model. Here, our goal is to design a deep learning black-box, and hence we wish to guarantee invariance to input permutations. A black-box that violates this invariance “wastes” capacity on learning it at training time, which increases sample complexity, as shown in Sec. 5.1. We proceed to formally define the permutation invariance property. Definition 1. Let z be a set of node features and edge features, and let σ be a permutation of {1, . . . , n}. We define σ(z) to be a new set of node and edge features given by [σ(z)]i = zσ(i) and [σ(z)]i,j = zσ(i),σ(j). We also use the notation σ([y1, . . . , yn]) = [yσ(1), . . . , yσ(n)] for permuting the labels. Namely, σ applied to a set of labels yields the same labels, only permuted by σ. Be aware that applying σ to the input features is different from permuting labels, because edge input features must permuted in a way that is consistent with permuting node input features. We now provide our key definition of a function whose output is invariant to permutations of the input. See Figure 2 (left). Definition 2. A graph labeling function F is said to be graph-permutation invariant (GPI), if for all permutations σ of {1, . . . , n} and for all z it satisfies: F(σ(z)) = σ(F(z)). 3.1 Characterizing Permutation Invariance Motivated by the above discussion, we ask: what structure is necessary and sufficient to guarantee that F is GPI? Note that a function F takes as input an ordered set z. Therefore its output on z could certainly differ from its output on σ(z). To achieve permutation invariance, F should contain certain symmetries. For instance, one permutation invariant architecture could be to define yi = g(zi) for any function g, but this architecture is too restrictive and does not cover all permutation invariant functions. Theorem 1 below provides a complete characterization (see Figure 2 for the corresponding architecture). Intuitively, the architecture in Theorem 1 is such that it can aggregate information from the entire graph, and do so in a permutation invariant manner. Theorem 1. Let F be a graph labeling function. Then F is graph-permutation invariant if and only if there exist functions α, ρ, φ such that for all k = 1, . . . , n: [F(z)]k = ρ  zk, n X i=1 α  zi, X j̸=i φ(zi, zi,j, zj)    , (1) where φ : R2d+e →RL, α : Rd+L →RW and ρ : RW +d →R. Proof. First, we show that any F satisfying the conditions of Theorem 1 is GPI. Namely, for any permutation σ, [F(σ(z))]k = [F(z)]σ(k). To see this, write [F(σ(z))]k using Eq. 1 and Definition 1: [F(σ(z))]k = ρ(zσ(k), X i α(zσ(i), X j̸=i φ(zσ(i), zσ(i),σ(j), zσ(j)))). (2) The second argument of ρ above is invariant under σ, because it is a sum over nodes and their neighbors, which is invariant under permutation. Thus Eq. 2 is equal to: ρ(zσ(k), X i α(zi, X j̸=i φ(zi, zi,j, zj))) = [F(z)]σ(k) where equality follows from Eq. 1. We thus proved that Eq. 1 implies graph permutation invariance. Next, we prove that any given GPI function F0 can be expressed as a function F in Eq. 1. Namely, we show how to define φ, α and ρ that can implement F0. Note that in this direction of the proof the function F0 is a black-box. Namely, we only know that it is GPI, but do not assume anything else about its implementation. 4 The key idea is to construct φ, α such that the second argument of ρ in Eq. 1 contains the information about all the graph features z. Then, the function ρ corresponds to an application of F0 to this representation, followed by extracting the label yk. To simplify notation assume edge features are scalar (e = 1). The extension to vectors is simple, but involves more indexing. We assume WLOG that the black-box function F0 is a function only of the pairwise features zi,j (otherwise, we can always augment the pairwise features with the singleton features). Since zi,j ∈R we use a matrix Rn,n to denote all the pairwise features. Finally, we assume that our implementation of F0 will take additional node features zk such that no two nodes have the same feature (i.e., the features identify the node). Our goal is thus to show that there exist functions α, φ, ρ such that the function in Eq. 2 applied to Z yields the same labels as F0(Z). Let H be a hash function with L buckets mapping node features zi to an index (bucket). Assume that H is perfect (this can be achieved for a large enough L). Define φ to map the pairwise features to a vector of size L. Let 1 [j] be a one-hot vector of dimension RL, with one in the jth coordinate. Recall that we consider scalar zi,j so that φ is indeed in RL, and define φ as: φ(zi, zi,j, zj) = 1 [H(zj)] zi,j, i.e., φ “stores” zi,j in the unique bucket for node j. Let si = P zi,j∈E φ(zi, zi,j, zj) be the second argument of α in Eq. 1 (si ∈RL). Then, since all zj are distinct, si stores all the pairwise features for neighbors of i in unique positions within its L coordinates. Since si(H(zk)) contains the feature zi,k whereas sj(H(zk)) contains the feature zj,k, we cannot simply sum the si, since we would lose the information of which edges the features originated from. Instead, we define α to map si to RL×L such that each feature is mapped to a distinct location. Formally: α(zi, si) = 1 [H(zi)] sT i . (3) α outputs a matrix that is all zeros except for the features corresponding to node i that are stored in row H(zi). The matrix M = P i α(zi, si) (namely, the second argument of ρ in Eq. 1) is a matrix with all the edge features in the graph including the graph structure. To complete the construction we set ρ to have the same outcome as F0. We first discard rows and columns in M that do not correspond to original nodes (reducing M to dimension n × n). Then, we use the reduced matrix as the input z to the black-box F0. Assume for simplicity that M does not need to be contracted (this merely introduces another indexing step). Then M corresponds to the original matrix Z of pairwise features, with both rows and columns permuted according to H. We will thus use M as input to the function F0. Since F0 is GPI, this means that the label for node k will be given by F0(M) in position H(zk). Thus we set ρ(zk, M) = [F0(M)]H(zk), and by the argument above this equals [F0(Z)]k, implying that the above α, φ and ρ indeed implement F0. Extension to general graphs So far, we discussed complete graphs, where edges correspond to valid feature pairs. However, many graphs of interest might be incomplete. For example, an n-variable chain graph in sequence labeling has only n −1 edges. For such graphs, the input to F would not contain all zi,j pairs but rather only features corresponding to valid edges of the graph, and we are only interested in invariances that preserve the graph structure, namely, the automorphisms of the graph. Thus, the desired invariance is that σ(F(z)) = F(σ(z)), where σ is not an arbitrary permutation but an automorphism. It is easy to see that a simple variant of Theorem 1 holds in this case. All we need to do is replace in Eq. 2 the sum P j̸=i with P j∈N(i), where N(i) are the neighbors of node i in the graph. The arguments are then similar to the proof above. Implications of Theorem 1 Our result has interesting implications for deep structured prediction. First, it highlights that the fact that the architecture “collects” information from all different edges of the graph, in an invariant fashion via the α, φ functions. Specifically, the functions φ (after summation) aggregate all the features around a given node, and then α (after summation) can collect them. Thus, these functions can provide a summary of the entire graph that is sufficient for downstream algorithms. This is different from one round of message passing algorithms which would not be sufficient for collecting global graph information. Note that the dimensions of φ, α may need to be large to aggregate all graph information (e.g., by hashing all the features as in the proof of Theorem 1), but the architecture itself can be shallow. 5 Second, the architecture is parallelizable, as all φ functions can be applied simultaneously. This is in contrast to recurrent models [32] which are harder to parallelize and are thus slower in practice. Finally, the theorem suggests several common architectural structures that can be used within GPI. We briefly mention two of these. 1) Attention: Attention is a powerful component in deep learning architectures [1], but most inference algorithms do not use attention. Intuitively, in attention each node i aggregates features of neighbors through a weighted sum, where the weight is a function of the neighbor’s relevance. For example, the label of an entity in an image may depend more strongly on entities that are spatially closer. Attention can be naturally implemented in our GPI characterization, and we provide a full derivation for this implementation in the appendix. It plays a key role in our scene graph model described below. 2) RNNs: Because GPI functions are closed under composition, for any GPI function F we can run F iteratively by providing the output of one step of F as part of the input to the next step and maintain GPI. This results in a recurrent architecture, which we use in our scene graph model. 4 Related Work The concept of architectural invariance was recently proposed in DEEPSETS [31]. The invariance we consider is much less restrictive: the architecture does not need to be invariant to all permutations of singleton and pairwise features, just those consistent with a graph re-labeling. This characterization results in a substantially different set of possible architectures. Deep structured prediction. There has been significant recent interest in extending deep learning to structured prediction tasks. Much of this work has been on semantic segmentation, where convolutional networks [27] became a standard approach for obtaining “singleton scores” and various approaches were proposed for adding structure on top. Most of these approaches used variants of message passing algorithms, unrolled into a computation graph [29]. Some studies parameterized parts of the message passing algorithm and learned its parameters [18]. Recently, gradient descent has also been used for maximizing score functions [2, 10]. An alternative to deep structured prediction is greedy decoding, inferring each label at a time based on previous labels. This approach has been popular in sequence-based applications (e.g., parsing [5]), relying on the sequential structure of the input, where BiLSTMs are effectively applied. Another related line of work is applying deep learning to graph-based problems, such as TSP [3, 9, 13]. Clearly, the notion of graph invariance is important in these, as highlighted in [9]. They however do not specify a general architecture that satisfies invariance as we do here, and in fact focus on message passing architectures, which we strictly generalize. Furthermore, our focus is on the more general problem of structured prediction, rather than specific graph-based optimization problems. Scene graph prediction. Extracting scene graphs from images provides a semantic representation that can later be used for reasoning, question answering, and image retrieval [12, 19, 25]. It is at the forefront of machine vision research, integrating challenges like object detection, action recognition and detection of human-object interactions [17, 24]. Prior work on scene graph predictions used neural message passing algorithms [29] as well as prior knowledge in the form of word embeddings [19]. Other work suggested to predict graphs directly from pixels in an end-to-end manner [21]. NeuralMotif [32], currently the state-of-the-art model for scene graph prediction on Visual Genome, employs an RNN that provides global context by sequentially reading the independent predictions for each entity and relation and then refines those predictions. The NEURALMOTIF model maintains GPI by fixing the order in which the RNN reads its inputs and thus only a single order is allowed. However, this fixed order is not guaranteed to be optimal. 5 Experimental Evaluation We empirically evaluate the benefit of GPI architectures. First, using a synthetic graph-labeling task, and then for the problem of mapping images to scene graphs. 5.1 Synthetic Graph Labeling We start with studying GPI on a synthetic problem, defined as follows. An input graph G = (V, E) is given, where each node i ∈V is assigned to one of K sets. The set for node i is denoted by 6 Figure 3: Accuracy as a function of sample size for graph labeling. Right is a zoomed in version of left. Γ(i). The goal is to compute for each node the number of neighbors that belong to the same set. Namely, the label of a node is yi = P j∈N(i) 1[Γ(i) = Γ(j)]. We generated random graphs with 10 nodes (larger graphs produced similar results) by sampling each edge independently and uniformly, and sampling Γ(i) for every node uniformly from {1, . . . , K}. The node features zi ∈{0, 1}K are one-hot vectors of Γ(i) and the edge features zi,j ∈{0, 1} indicate whether ij ∈E. We compare two standard non-GPI architectures and one GPI architecture: (a) A GPI-architecture for graph prediction, described in detail in Section 5.2. We used the basic version without attention and RNN. (b) LSTM: We replace P φ(·) and P α(·), which perform aggregation in Theorem 1 with two LSTMs with a state size of 200 that read their input in random order. (c) A fully-connected (FC) feed-forward network with 2 hidden layers of 1000 nodes each. The input to the fully connected model is a concatenation of all node and pairwise features. The output is all node predictions. The focus of the experiment is to study sample complexity. Therefore, for a fair comparison, we use the same number of parameters for all models. Figure 3, shows the results, demonstrating that GPI requires far fewer samples to converge to the correct solution. This illustrates the advantage of an architecture with the correct inductive bias for the problem. 5.2 Scene-Graph Classification We evaluate the GPI approach on the motivating task of this paper, inferring scene graphs from images (Figure 1). In this problem, the input is an image annotated with a set of bounding boxes for the entities in the image.2 The goal is to label each bounding box with the correct entity category and every pair of entities with their relation, such that they form a coherent scene graph. We begin by describing our Scene Graph Predictor (SGP) model. We aim to predict two types of variables. The first is entity variables [y1, . . . , yn] for all bounding boxes. Each yi can take one of L values (e.g., “dog”, “man”). The second is relation variables [yn+1, . . . , yn2] for every pair of bounding boxes. Each such yj can take one of R values (e.g., “on”, “near”). Our graph connects variables that are expected to be inter-related. It contains two types of edges: 1) entity-entity edge connecting every two entity variables (yi and yj for 1 ≤i ̸= j ≤n. 2) entity-relation edges connecting every relation variable yk (where k > n) to its two entity variables. Thus, our graph is not a complete graph and our goal is to design an architecture that will be invariant to any automorphism of the graph, such as permutations of the entity variables. For the input features z, we used the features learned by the baseline model from [32].3 Specifically, the entity features zi included (1) The confidence probabilities of all entities for yi as learned by the baseline model. (2) Bounding box information given as (left, bottom, width, height); (3) The number of smaller entities (also bigger); (4) The number of entities to the left, right, above and below. (5) The number of entities with higher and with lower confidence; (6) For the linguistic model only: word embedding of the most probable class. Word vectors were learned with GLOVE from the ground-truth captions of Visual Genome. Similarly, the relation features zj ∈RR contained the probabilities of relation entities for the relation j. For the Linguistic model, these features were extended to include word embedding of the most probable class. For entity-entity pairwise features zi,j, we use the relation probability for each pair. 2For simplicity, we focus on the task where boxes are given. 3The baseline does not use any LSTM or context, and is thus unrelated to the main contribution of [32]. 7 Constrained Evaluation Unconstrained Evaluation SGCls PredCls SGCls PredCls R@50 R@100 R@50 R@100 R@50 R@100 R@50 R@100 Lu et al., 2016 [19] 11.8 14.1 35.0 27.9 Xu et al., 2017 [29] 21.7 24.4 44.8 53.0 Pixel2Graph [21] 26.5 30.0 68.0 75.2 Graph R-CNN [30] 29.6 31.6 54.2 59.1 Neural Motifs [32] 35.8 36.5 65.2 67.1 44.5 47.7 81.1 88.3 Baseline [32] 34.6 35.3 63.7 65.6 43.4 46.6 78.8 85.9 No Attention 35.3 37.2 64.5 66.3 44.1 48.5 79.7 86.7 Neighbor Attention 35.7 38.5 64.6 66.6 44.7 49.9 80.0 87.1 Linguistic 36.5 38.8 65.1 66.9 45.5 50.8 80.8 88.2 Table 1: Test set results for graph-constrained evaluation (i.e., the returned triplets must be consistent with a scene graph) and for unconstrained evaluation (triplets need not be consistent with a scene graph). Because the output of SGP are probability distributions over entities and relations, we use them as an the input z to SGP, once again in a recurrent manner and maintain GPI. We next describe the main components of the GPI architecture. First, we focus on the parts that output the entity labels. φent is the network that integrates features for two entity variables yi and yj. It simply takes zi, zj and zi,j as input, and outputs a vector of dimension n1. Next, the network αent takes as input the outputs of φent for all neighbors of an entity, and uses the attention mechanism described above to output a vector of dimension n2. Finally, the ρent network takes these n2 dimensional vectors and outputs L logits predicting the entity value. The ρrel network takes as input the αent representation of the two entities, as well as zi,j and transforms the output into R logits. See appendix for specific network architectures. 5.2.1 Experimental Setup and Results Dataset. We evaluated our approach on Visual Genome (VG) [15], a dataset with 108,077 images annotated with bounding boxes, entities and relations. On average, images have 12 entities and 7 relations per image. For a proper comparison with previous results [21, 29, 32], we used the data from [29], including the train and test splits. For evaluation, we used the same 150 entities and 50 relations as in [21, 29, 32]. To tune hyper-parameters, we also split the training data into two by randomly selecting 5K examples, resulting in a final 70K/5K/32K split for train/validation/test sets. Training. All networks were trained using Adam [14] with batch size 20. Hyperparameter values below were chosen based on the validation set. The SGP loss function was the sum of cross-entropy losses over all entities and relations in the image. In the loss, we penalized entities 4 times more strongly than relations, and penalized negative relations 10 times more weakly than positive relations. Evaluation. In [29] three different evaluation settings were considered. Here we focus on two of these: (1) SGCls: Given ground-truth bounding boxes for entities, predict all entity categories and relations categories. (2) PredCls: Given bounding boxes annotated with entity labels, predict all relations. Following [19], we used Recall@K as the evaluation metric. It measures the fraction of correct ground-truth triplets that appear within the K most confident triplets proposed by the model. Two evaluation protocols are used in the literature differing in whether they enforce graph constraints over model predictions. The first graph-constrained protocol requires that the top-K triplets assign one consistent class per entity and relation. The second unconstrained protocol does not enforce any such constraints. We report results on both protocols, following [32]. Models and baselines. We compare four variants of our GPI approach with the reported results of four baselines that are currently the state-of-the-art on various scene graph prediction problems (all models use the same data split and pre-processing as [29]): 1) LU ET AL., 2016 [19]: This work leverages word embeddings to fine-tune the likelihood of predicted relations. 2) XU ET AL, 2017 [29]: This model passes messages between entities and relations, and iteratively refines the feature map used for prediction. 3) NEWELL & DENG, 2017 [21]: The PIXEL2GRAPH model uses associative embeddings [22] to produce a full graph from the image. 4) YANG ET AL., 2018 [30]: The GRAPH R-CNN model uses object-relation regularities to sparsify and reason over scene graphs. 5) ZELLERS ET AL., 2017 [32]: The NEURALMOTIF method encodes global context for 8 Figure 4: (a) An input image with bounding boxes from VG. (b) The ground-truth scene graph. (c) The Baseline fails to recognize some entities (tail and tree) and relations (in front of instead of looking at). (d) GPI:LINGUISTIC fixes most incorrect LP predictions. (e) Window is the most significant neighbor of Tree. (f) The entity bird receives substantial attention, while Tree and building are less informative. capturing high-order motifs in scene graphs, and the BASELINE outputs the entities and relations distributions without using the global context. The following variants of GPI were compared: 1) GPI: NO ATTENTION: Our GPI model, but with no attention mechanism. Instead, following Theorem 1, we simply sum the features. 2) GPI: NEIGHBORATTENTION: Our GPI model, with attention over neighbors features. 3) GPI: LINGUISTIC: Same as GPI: NEIGHBORATTENTION but also concatenating the word embedding vector, as described above. Results. Table 1 shows recall@50 and recall@100 for three variants of our approach, and compared with five baselines. All GPI variants performs well, with LINGUISTIC outperforming all baselines for SGCls and being comparable to the state-of-the-art model for PredCls. Note that PredCl is an easier task, which makes less use of the structure, hence it is not surprising that GPI achieves similar accuracy to [32]. Figure 4 illustrates the model behavior. Predicting isolated labels with zi (4c) mislabels several entities, but these are corrected at the final output (4d). Figure 4e shows that the system learned to attend more to nearby entities (the window and building are closer to the tree), and 4f shows that stronger attention is learned for the class bird, presumably because it is usually more informative than common classes like tree. Implementation details. The φ and α networks were each implemented as a single fully-connected (FC) layer with a 500-dimensional outputs. ρ was implemented as a FC network with 3 500dimensional hidden layers, with one 150-dimensional output for the entity probabilities, and one 51-dimensional output for relation probabilities. The attention mechanism was implemented as a network like to φ and α, receiving the same inputs, but using the output scores for the attention . The full code is available at https://github.com/shikorab/SceneGraph 6 Conclusion We presented a deep learning approach to structured prediction, which constrains the architecture to be invariant to structurally identical inputs. As in score-based methods, our approach relies on pairwise features, capable of describing inter-label correlations, and thus inheriting the intuitive aspect of score-based approaches. However, instead of maximizing a score function (which leads to computationally-hard inference), we directly produce an output that is invariant to equivalent representations of the pairwise terms. This axiomatic approach to model architecture can be extended in many ways. For image labeling, geometric invariances (shift or rotation) may be desired. In other cases, invariance to feature permutations may be desirable. We leave the derivation of the corresponding architectures to future work. Finally, there may be cases where the invariant structure is unknown and should be discovered from data, which is related to work on lifting graphical models [4]. It would be interesting to explore algorithms that discover and use such symmetries for deep structured prediction. Acknowledgements This work was supported by the ISF Centers of Excellence grant, and by the Yandex Initiative in Machine Learning. Work by GC was performed while at Google Brain Research. 9 References [1] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015. [2] David Belanger, Bishan Yang, and Andrew McCallum. End-to-end learning for structured prediction energy networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70, pages 429–439. PMLR, 2017. [3] Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016. [4] Hung Hai Bui, Tuyen N. Huynh, and Sebastian Riedel. Automorphism groups of graphical models and lifted variational inference. In Proceedings of the Twenty-Ninth Conference on Uncertainty in Artificial Intelligence, UAI’13, pages 132–141, 2013. [5] Danqi Chen and Christopher Manning. A fast and accurate dependency parser using neural networks. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 740–750, 2014. [6] Liang Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Semantic image segmentation with deep convolutional nets and fully connected CRFs. In Proceedings of the Second International Conference on Learning Representations, 2014. [7] Liang Chieh Chen, Alexander G Schwing, Alan L Yuille, and Raquel Urtasun. Learning deep structured models. In Proc. ICML, 2015. [8] Clement Farabet, Camille Couprie, Laurent Najman, and Yann LeCun. Learning hierarchical features for scene labeling. IEEE transactions on pattern analysis and machine intelligence, 35(8):1915–1929, 2013. [9] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017. [10] Michael Gygli, Mohammad Norouzi, and Anelia Angelova. Deep value networks learn to evaluate and iteratively refine structured outputs. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 1341–1351, International Convention Centre, Sydney, Australia, 2017. PMLR. [11] Justin Johnson, Agrim Gupta, and Li Fei-Fei. Image generation from scene graphs. arXiv preprint arXiv:1804.01622, 2018. [12] Justin Johnson, Ranjay Krishna, Michael Stark, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Fei-Fei Li. Image retrieval using scene graphs. In Proc. Conf. Comput. Vision Pattern Recognition, pages 3668–3678, 2015. [13] Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems, pages 6351–6361, 2017. [14] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv: 1412.6980, abs/1412.6980, 2014. [15] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. International Journal of Computer Vision, 123(1):32–73, 2017. [16] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proceedings of the 18th International Conference on Machine Learning, pages 282–289, 2001. [17] Wentong Liao, Michael Ying Yang, Hanno Ackermann, and Bodo Rosenhahn. On support relations and semantic scene graphs. arXiv preprint arXiv:1609.05834, 2016. 10 [18] Guosheng Lin, Chunhua Shen, Ian Reid, and Anton van den Hengel. Deeply learning the messages in message passing inference. In Advances in Neural Information Processing Systems, pages 361–369, 2015. [19] Cewu Lu, Ranjay Krishna, Michael S. Bernstein, and Fei-Fei Li. Visual relationship detection with language priors. In European Conf. Comput. Vision, pages 852–869, 2016. [20] O. Meshi, D. Sontag, T. Jaakkola, and A. Globerson. Learning efficiently with approximate inference via dual losses. In Proceedings of the 27th International Conference on Machine Learning, pages 783–790, New York, NY, USA, 2010. ACM. [21] Alejandro Newell and Jia Deng. Pixels to graphs by associative embedding. In Advances in Neural Information Processing Systems 30 (to appear), pages 1172–1180. Curran Associates, Inc., 2017. [22] Alejandro Newell, Zhiao Huang, and Jia Deng. Associative embedding: End-to-end learning for joint detection and grouping. In Neural Inform. Process. Syst., pages 2274–2284. Curran Associates, Inc., 2017. [23] Wenzhe Pei, Tao Ge, and Baobao Chang. An effective neural network model for graphbased dependency parsing. In Proceedings of the 53rd Annual Meeting of the Association for Computationa Linguistics, pages 313–322, 2015. [24] Bryan A. Plummer, Arun Mallya, Christopher M. Cervantes, Julia Hockenmaier, and Svetlana Lazebnik. Phrase localization and visual relationship detection with comprehensive imagelanguage cues. In ICCV, pages 1946–1955, 2017. [25] David Raposo, Adam Santoro, David Barrett, Razvan Pascanu, Timothy Lillicrap, and Peter Battaglia. Discovering objects and their relations from entangled scene representations. arXiv preprint arXiv:1702.05068, 2017. [26] Alexander G Schwing and Raquel Urtasun. Fully connected deep structured networks. ArXiv e-prints, 2015. [27] Evan Shelhamer, Jonathan Long, and Trevor Darrell. Fully convolutional networks for semantic segmentation. Proc. Conf. Comput. Vision Pattern Recognition, 39(4):640–651, 2017. [28] B. Taskar, C. Guestrin, and D. Koller. Max margin Markov networks. In S. Thrun, L. Saul, and B. Schölkopf, editors, Advances in Neural Information Processing Systems 16, pages 25–32. MIT Press, Cambridge, MA, 2004. [29] Danfei Xu, Yuke Zhu, Christopher B. Choy, and Li Fei-Fei. Scene Graph Generation by Iterative Message Passing. In Proc. Conf. Comput. Vision Pattern Recognition, pages 3097–3106, 2017. [30] Jianwei Yang, Jiasen Lu, Stefan Lee, Dhruv Batra, and Devi Parikh. Graph R-CNN for scene graph generation. In European Conf. Comput. Vision, pages 690–706, 2018. [31] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems 30, pages 3394–3404. Curran Associates, Inc., 2017. [32] Rowan Zellers, Mark Yatskar, Sam Thomson, and Yejin Choi. Neural motifs: Scene graph parsing with global context. arXiv preprint arXiv:1711.06640, abs/1711.06640, 2017. [33] Shuai Zheng, Sadeep Jayasumana, Bernardino Romera-Paredes, Vibhav Vineet, Zhizhong Su, Dalong Du, Chang Huang, and Philip HS Torr. Conditional random fields as recurrent neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 1529–1537, 2015. 11
2018
169
7,329
How Many Samples are Needed to Estimate a Convolutional Neural Network? Simon S. Du˚ Carnegie Mellon University Yining Wang* Carnegie Mellon University Xiyu Zhai Massachusetts Institute of Technology Sivaraman Balakrishnan Carnegie Mellon University Ruslan Salakhutdinov Carnegie Mellon University Aarti Singh Carnegie Mellon University Abstract A widespread folklore for explaining the success of Convolutional Neural Networks (CNNs) is that CNNs use a more compact representation than the Fullyconnected Neural Network (FNN) and thus require fewer training samples to accurately estimate their parameters. We initiate the study of rigorously characterizing the sample complexity of estimating CNNs. We show that for an m-dimensional convolutional filter with linear activation acting on a d-dimensional input, the sample complexity of achieving population prediction error of ✏is rOpm{✏2q 2, whereas the sample-complexity for its FNN counterpart is lower bounded by ⌦pd{✏2q samples. Since, in typical settings m ! d, this result demonstrates the advantage of using a CNN. We further consider the sample complexity of estimating a onehidden-layer CNN with linear activation where both the m-dimensional convolutional filter and the r-dimensional output weights are unknown. For this model, we show that the sample complexity is rO ` pm ` rq{✏2˘ when the ratio between the stride size and the filter size is a constant. For both models, we also present lower bounds showing our sample complexities are tight up to logarithmic factors. Our main tools for deriving these results are a localized empirical process analysis and a new lemma characterizing the convolutional structure. We believe that these tools may inspire further developments in understanding CNNs. 1 Introduction Convolutional Neural Networks (CNNs) have achieved remarkable impact in many machine learning applications, including computer vision (Krizhevsky et al., 2012), natural language processing (Yu et al., 2018) and reinforcement learning (Silver et al., 2016). The key building block of these improvements is the use of convolutional (weight sharing) layers to replace traditional fully connected layers, dating back to LeCun et al. (1995). A common folklore of explaining the success of CNNs is that they are a more compact representation than Fully-connected Neural Networks (FNNs) and thus require fewer samples to estimate. However, to our knowledge, there is no rigorous characterization of the sample complexity of learning a CNN. The main difficulty lies in the convolution structure. Consider the simplest CNN, a single convolutional filter with linear activation followed by average pooling (see Figure 1a), which represents a ˚Equal contribution. 2We use the standard big-O notation in this paper and use rOp¨q when we ignore poly-logarithmic factors. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montr´eal, Canada. function F1 : Rd fiÑ R of the form: F1px; wq “ r´1 ÿ `“0 wJP` sx, (1) where w P Rm is the filter of size m and a stride size of s, r « d{s is the total number of times filter w is applied to an input vector x P Rd, and P` sx :“ rx`s`1, x`s`2, . . . , x`s`ms is an m-dimensional segment of the feature vector x. Noting that F1 is a linear function of x, we can also represent F1 by a one-layer fully connected neural network (linear predictor): F FNN 1 px, ✓q “ ✓Jx (2) for some ✓P Rd. Suppose we have n samples txi, yiun i“1 where x is the input and y is the label and use the least squares estimator: p✓:“ arg min ✓PRd n ÿ i“1 pyi ´ ✓Jxiq2. By a classical results analyzing the prediction error for linear regression (see for instance (Wasserman, 2013)), under mild regularity conditions, we need n — d{✏2 to have b Ex„µ|p✓Jx ´ ✓J 0 x|2 § ✏, where µ is the input distribution and ✓0 is the optimal linear predictor. The proof for FNN is fairly simple because we can write p✓“ ` XJX ˘´1 XJY (normal equation) where X and Y are the aggregated features and labels, respectively and then directly analyze this expression. On the other hand, the network F1 can be viewed as a linear regression model with respect to w, by considering a “stacked” version of feature vectors rxi “ ∞r´1 `“0 P` sx P Rm. The classical analysis of ordinary least squares in linear regression does not directly yield the optimal sample complexity in this case, because the distributional properties of rxi as well as the spectral properties of the sample covariance ∞ i rxirxJ i are difficult to analyze due to the heavy correlation between coordinates of rx corresponding to overlapping patches. We discuss further details of this aspect after our main positive result in Theorem 1. In this paper, we take a step towards understanding the statistical behavior of the CNN model described above. We adopt tools from localized empirical process theory (van de Geer, 2000) and combine them with a structural property of convolutional filters (see Lemma 2) to give a complete characterization of the statistical behavior of this simple CNN. We first consider the problem of learning a convolutional filter with average pooling as in Eq.(1) using the least squares estimator. We show in the standard statistical learning setting, under fairly natural conditions on the input distribution, pw satisfies b Ex„µ|F1px, pwq ´ F1px, w0q|2 “ rO ´a m{n ¯ , where µ is the input distribution and w0 is the underlying true convolutional filter. Notably, to achieve an ✏error, the CNN only needs rOpm{✏2q samples whereas the FNN needs ⌦pd{✏2q. Since the filter size m ! d, this result clearly justifies the folklore that the convolutional layer is a more compact representation. Furthermore, we complement this upper bound with a minimax lower bound which shows the error bound rOp a m{nq is tight up to logarithmic factors. Next, we consider a one-hidden-layer CNN (see Figure 1b): F2px; w, aq “ r´1 ÿ `“0 a`wJP` sx, (3) where both the shared convolutional filter w P Rm and output weights a P Rr are unknown. This architecture is previously considered in Du et al. (2017b). However the focus of that work is to understand the dynamics of gradient descent. Using similar tools as in analyzing a single convolutional filter, we show that the least squares estimator achieves the error bound rOp a pm ` rq{nq if the ratio between the stride size and the filter size is a constant. Further, we present a minimax lower bound showing that the obtain rate is tight up to logarithmic factors. To our knowledge, these theoretical results are the first sharp analyses of the statistical efficiency of the CNN. These results suggest that if the input follows a (linear) CNN model, then it can be learned more easily than treating it as a FNN since a CNN model reuses weights. 2 + Input s P 1 s x P ` sx w w w x 1 1 1 F1(x; w) P `+1 s x (a) Prediction function formalized in Eq. (1). It consists of a convolutional filter followed by averaged pooling. The convolutional filter is unknown. + Input s P 1 s x P ` sx w w w x a1 a` a`+1 P `+1 s x F2(x; w, a) (b) Prediction function formalized in Eq. (3) It consists of a convolutional filter followed by a linear prediction layer. Both layers are unknown. Figure 1: CNN architectures that we consider in this paper. 1.1 Comparison with Existing Work Our work is closely related to the analysis of the generalization ability of neural networks (Arora et al., 2018; Anthony & Bartlett, 2009; Bartlett et al., 2017b,a; Neyshabur et al., 2017; Konstantinos et al., 2017). These generalization bounds are often of the form: Lp✓q ´ Ltrp✓q § D{?n (4) where ✓represents the parameters of a neural network, Lp¨q and Ltrp¨q represent population and empirical error under some additive loss, and D is the model capacity and is finite only if the (spectral) norm of the weight matrix for each layer is bounded. Comparing with generalization bounds based on model capacity, our result has two advantages: 1. If Lp¨q is taken to be the mean-squared3 error E|¨|2, Eq. (4) implies an rOp1{✏4q sample complexity to achieve a standardized mean-square error of a E| ¨ |2 § ✏, which is considerably larger than the rOp1{✏2q sample complexity we established in this paper. 2. Since the complexity of a model class in regression problems typically depends on the magnitude of model parameters (e.g., }w}2), generalization error bounds like Eq. (4) are not scaleindependent and deteriorate if }w}2 is large. In contrast, our analysis has no dependency on the scale of w and also places no constraints on }w}2. On the other hand, we consider the special case where the neural network model is well-specified and the label is generated according to a neural network with unbiased additive noise (see Eq. (5)) whereas the generalization bounds discussed in this section are typically model agnostic. 1.2 Other Related Work Recently, researchers have been making progress in theoretically understanding various aspects of neural networks, including hardness of learning (Goel et al., 2016; Song et al., 2017; Brutzkus & Globerson, 2017), landscape of the loss function (Kawaguchi, 2016; Choromanska et al., 2015; Hardt & Ma, 2016; Haeffele & Vidal, 2015; Freeman & Bruna, 2016; Safran & Shamir, 2016; Zhou & Feng, 2017; Nguyen & Hein, 2017b,a; Ge et al., 2017b; Zhou & Feng, 2017; Safran & Shamir, 2017; Du & Lee, 2018), dynamics of gradient descent (Tian, 2017; Zhong et al., 2017b; Li & Yuan, 2017), provable learning algorithms (Goel & Klivans, 2017a,b; Zhang et al., 2015), etc. Focusing on the convolutional neural network, most existing work has analyzed the convergence rate of gradient descent or its variants (Du et al., 2017a,b; Goel et al., 2018; Brutzkus & Globerson, 2017; Zhong et al., 2017a). Our paper differs from them in that we do not consider the computational complexity but only the sample complexity and information theoretical limits of learning a CNN. It is an open question when taking computational budget into account, what is the optimal estimator for CNN. 3Because the standardized mean-square error a E| ¨ |2 is not a sum of independent random variables, it is difficult, if not impossible, to apply generalization error bounds directly for a E| ¨ |2. 3 Convolutional structure has also been studied in the dictionary learning (Singh et al., 2018; Huang & Anandkumar, 2015) and blind de-convolution (Zhang et al., 2017) literature. These papers studied the unsupervised setting where their goal is to recover structured signals from observations generated according to convolution operations whereas our paper focuses on the supervised learning setting with predictor having the convolution structure. 1.3 Organization This paper is organized as follows. In Section 2, we formally setup the problem and assumptions. In Section 3 we present our main theoretical results for learning a convolutional filter (see Eq. (1)). In Section 4 we present our main theoretical results for learning a one-hidden-layer CNN (see Eq. (3)). In Section 5, we use numerical experiments to verify our theoretical findings. We conclude and list future directions in Section 6. Most technical proofs are deferred to the appendix. 2 Problem specification and assumptions Let txi, yiun i“1 be a sample of n training data points, where xi P Rd denotes the d-dimensional feature vector of the ith data point and yi P R is the corresponding real-valued response. We consider a generic model of yi “ Fpxi; w0q ` "i, where Er"i|xis “ 0. (5) In the model of Eq. (5), F represents a certain network parameterized by a fixed but unknown parameter w0 that takes a d-dimensional vector xi as input and outputs a single real-valued prediction Fpxi; w0q. t"iun i“1 represents stochastic noise inherent in the data, and is assumed to have mean zero. The feature vectors of training data txiun i“1 are sampled i.i.d. from an unknown distribution µ supported on Rd. Throughout this paper we make the following assumptions: (A1) Sub-gaussian noise: there exists constant σ2 † 8 such that for any t P R, Eet"i § eσ2t2{2; (A2) Sub-gaussian design: there exists constant ⌫2 † 8 such that for any a P Rd, Eµx “ 0 and Eµ exptaJxu § expt⌫2}a}2 2{2u; (A3) Non-degeneracy: there exists constant ° 0 such that λminpEµxxJq • . We remark that the assumptions (A1) through (A3) are quite mild. In particular, we only impose sub-Gaussianity conditions on the distributions of xi and "i, and do not assume they are generated/sampled from any exact distributions. The last non-degeneracy condition (A3) assumes that there is a non-negligible probability mass along any direction of the input distributions. It is very likely to be satisfied after simple pre-processing steps of input data, such as mean removal and whitening of the sample covariance. We are interested in learning a parameter pwn using a training sample tpxi, yiqun i“1 of size n so as to minimize the standardized population mean-square prediction error errµp pwn, w0; Fq “ b Ex„µ |Fpx; pwnq ´ Fpx; w0q|2. (6) 3 Convolutional filters with average pooling We first consider a convolutional network with one convolutional layer, one convolutional filter, an average pooling layer and linear activations. More specifically, for a single convolutional filter w P Rm of size m and a stride of size s, the network can be written as F1px; wq “ r´1 ÿ `“0 wJP` sx, (7) where r « d{s is the total number of times filter w is applied to an input vector x, and P` sx :“ rx`s`1, x`s`2, . . . , x`s`ms is an m-dimensional segment of the d-dimensional feature vector xi. For simplicity, we assume that m is divisible s and let J “ m{s P N denote the number of strides within a single filter of size m. 4 3.1 The upper bound Given training sample tpxi, yiqun i“1, we consider the following least-squares estimator: pwn P arg min wPRm 1 n n ÿ i“1 pyi ´ F1pxi; wqq2 . (8) Note the subscript n which emphasizes that pwn is trained using a sample of n data points. In addition, because the objective is a quadratic function in w, Eq. (8) is actually a convex optimization problem and a global optimal solution pwn can be obtained efficiently. More specifically, pwn admits the closed-form solution of pwn “ p∞n i“1 rxirxJ i q´1 ∞n i“1 yirxi, where rxi “ ∞r´1 `“0 P` sxi is the stacked version of input feature vector xi. The following theorem upper bounds the expected population mean-square prediction error errµp pwn, w0; F1q of the least-square estimate pwn in Eq. (8). Theorem 1. Fix an arbitrary δ P p0, 1{2q. Suppose (A1) through (A3) hold and ⌫ a logpn{δq • , n Á ´2⌫2m logp⌫d log δ´1q logpnδ´1q. Then there exists a universal constant C ° 0 such that with probability 1 ´ δ over the random draws of x1, . . . , xn „ µ, Eerrµp pwn, w0; F1q § C c σ2m logp´1⌫d logpδ´1qq n conditioned on x1, . . . , xn. (9) Here the expectation is taken with respect to the randomness in t"iun i“1. Theorem 1 shows that, with n “ r⌦pmq samples, the expected population mean-square error errµp pwn, w0; F1q scales as rOp a σ2m{nq. This matches the 1{?n statistical error for classical parametric statistics problems, and also confirms the “parameter count” intution that the estimation error scales approximately with the number of parameters in a network (m in network F1). We next briefly explain the strategies we employ to prove Theorem 1. While it’s tempting to directly use the closed-form expression pwn “ p∞n i“1 rxirxJ i q´1 ∞n i“1 yirxi to analyze pwn, such an approach has two limitations. First, because we consider the population mean-square error errµp pwn, w0; F1q, such an approach would inevtiably require the analysis of spectral properties (e.g., the least eigenvalue) of ∞n i“1 rxirxJ i , which is very challenging as heavy correlation occurs in rxi when filters are overlapping (i.e., s † m and J ° 1). It is likely that strong assumptions such as exact isotropic Gaussianity of the feature vectors are needed to analyze the distributional properties rxi (Qu et al., 2017). Also, such an approach relies on closed-forms of pwn and is difficult to extend to other potential activations such as the ReLU activation. when no closed-form expressions of pwn exist. To overcome the above difficulties, we adopt a localized empirical process approach introduced in (van de Geer, 2000) to upper bound the expected population mean-square prediction error. At the core analysis is an upper bound on the covering number of a localized parameter set, with an interesting argument that partitions a d-dimensional equivalent regressor for compactification purposes (see Lemmas 2 and 4 in the appendix for details). Our proof does not rely on the exact/closed-form expression of pwn, and has the potential to be extended to other activation functions, as we discuss in Section 6. The complete proof of Theorem 1 is placed in the appendix. 3.2 The lower bound We prove the following information-theoretic lower bound on Eerrµp pwn, w0q of any estimator pwn calculated on a training sample of size n. Theorem 2. Suppose x1, . . . , xn„Np0, Iq and "1, . . . , "n „ Np0, σ2q. Suppose also that m ´ s is an even number. Then there exists a universal constant C1 ° 0 such that inf pwn sup w0PRm Eerrµpwn, w0; F1q • C1 c σ2m n . (10) Remark 1. Theorem 2 is valid for any pair of (filter size, stride) combinations pm, sq, provided that m is divisible by s and m ´ s is an even number. The latter requirement is a technical condtion in our proof and is not critical, because one can double the size of m and s, and the lower bound in Theorem 2 remains asymptotically on the same order. 5 Theorem 2 shows that any estimator pwn computed on a training set of size n must have a worst-case error of at least a σ2m{n. This suggests that our upper error bound in Theorem 1 is tight up to logarithmic factors. Our proof of Theorem 2 draws on tools from standard information-theoretical lower bounds such as the Fano’s inequality (Yu, 1997; Tsybakov, 2009). The high-level idea is to construct a finite candidate set of parameters W Ñ Rm and upper bound the Kullback-Leibler (KL) divergence of induced observable distributions and the population prediction mean-square error between parameters in the candidate set W. The complete proof of Theorem 2 is placed in the appendix. 4 Convolutional filters with prediction layers We consider a slightly more complicated convolutional network with two layers: the first layer is a single convolutional filter of size m, applied r times to a d-dimensional input vector with stride s; the second layer is a linear regression prediction layer that produces a single real-valued output. For such a two-layer network the parameter w can be specified as w “ pw, aq, where w P Rm is the weights in the first-layer convolutional filter and a P Rr is the weight in the second linear prediction layer. The network F2px; wq “ F2px; w, aq can then be written as F2px; w, aq “ r´1 ÿ `“0 a`wJP` sx. (11) Note that in Eq. (11) the vector a P Rr is labeled as a “ pa0, a1, . . . , ar´1q for convenience that matches with the labels of the operator P` s for ` “ 0, . . . , r ´ 1. Compared to network F1 with average pooling, the new network F2 can be viewed as a weighted pooling of convolutional filters, with weights a P Rr unknown and to be learnt. A graph illustration of the network F2 is given in Figure 1b. 4.1 The upper bound We again consider the least-squares estimator p wn “ p pwn, panq P arg min wPRm,aPRr 1 n n ÿ i“1 pyi ´ F2pxi; w, aqq2 . (12) Again, we use subscript n to emphasize that both pwn and pan are computed on a training set txi, yiun i“1 of size n. Unlike the least squares problem in Eq. (8) for the F1 network, the optimization problem in Eq. (12) has two optimization variables w, a and is therefore no longer convex. This means that popular optimization algorithms like gradient descent do not necessarily converge to a global minima in Eq. (12). Nevertheless, in this paper we choose to focus on the statistical properties of p pwn, panq and assume global minimality of Eq. (12) is achieved. On the other hand, because Eq. (12) resembles the matrix sensing problem, it is possible that all local minima are global minima and saddle points can be efficiently escaped (Ge et al., 2017a), which we leave as future work. The following theorem upper bounds the population mean-square prediction error of any global minimizer pwn “ p pwn, panq of Eq. (12). Theorem 3. Fix arbitrary δ P p0, 1{2q and define J :“ m{s, where m is the filter size and s is the stride. Suppose (A1) through (A3) hold and ⌫ a logpn{δq • , n Á ´2⌫2prJ ` mq logp⌫d log δ´1q logpnδ´1q. Then there exists a universal constant C ° 0 such that with probability 1 ´ δ over the random draws of x1, . . . , xn „ µ, Eerrµp p wn, w0; F2q § C c σ2prJ ` mq logp´1⌫d logpδ´1qq n conditioned on x1, . . . , xn. (13) Here the expectation is taken with respect to the randomness in t"iun i“1. Theorem 3 is proved by a similar localized empirical process arguments as in the proof of Theorem 1. Due to space costraints we defer the complete proof of Theorem 3 to the appendix. 6 500 1000 1500 2000 Number of Training Data 10 -4 10 -2 10 0 Testing Error CNN FNN (a) Filter size m “ 2. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (b) Filter size m “ 8. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (c) Filter size m “ 16. Figure 2: Experiments on the problem of learning a convolutional filter with average pooling described in Section 3 with stride size s “ 1. Theorem 3 shows that errµp p wn, w0; F2q can be upper bounded by rOp a σ2prJ ` mq{nq, provided that at least n “ r⌦prJ ` mq samples are available. Compared to the intuitive “parameter count” of r`m (r parameters for a and m parameters for w), our upper bound has an additional multiplicative J “ m{s term, which is the number of strides within each m-dimensional filter. Therefore, our upper bound only matches parameter counts when J is very small (e.g., non-overlapping filters or fast-moving filters where the stride s is at least a constant fraction of filter size m), and becomes large when the stride s is very small, leading to many convolutions being computed. We conjecture that such an increase in error/sample complexity is due to an inefficiency in one of our key technical lemmas. More specifically, in Lemma 7 in which we derive upper bounds on covering number of localized parameter sets, we use the boundedness and low-dimensionality of each segment of differences of equivalent parameters for compactification purposes; such an argument is not ideal, as it overlooks the correlation between different segments, connected by an r-dimensional parameter a. A sharper covering number argument would potentially improve the error analysis and achieve sample complexity scaling with r ` m. 4.2 The lower bound We prove the following information-theoretical lower bound on Eerrµp pwn, w0q of any estimator pwn “ p pwn, panq calculated on a training sample of size n. Theorem 4. Suppose x1, . . . , xn„Np0, Iq and "1, . . . , "n „ Np0, σ2q. Then there exists a universal constant C1 ° 0 such that inf p wn sup w0 Eerrµp pwn, w0; F2q • C1 c σ2pr ` mq n . (14) Theorem 4 shows that the error of any estimator p wn computed on a training sample of size n must scale as a σ2pr ` mq{n, matching the parameter counts of r ` m for F2. It is proved by reducing the regression problem under F2 to two separate ordinary linear regression problems and invoking classical lower bounds for linear regression models (Wasserman, 2013; Van der Vaart, 1998). A complete proof of Theorem 4 is given in the appendix. 5 Experiments In this section we use simulations to verify our theoretical findings. For all experiments, we let the ambient dimension d be 64 and the input distribution be Gaussian with mean 0 and identity covariance. We use the population mean-square prediction error defined in Eq. (6) as the evaluation metric. In all plots, CNN represents using convolutional parameterization corresponding to Eq. (1) or Eq. (3) and FNN represents using fully connected parametrization corresponding to Eq. (2). In Figure 2 and Figure 3, we consider the problem of learning a convolutional filter with average pooling which we analyzed in Section 3. We vary the number of samples, the dimension of filters and the stride size. Here we compare parameterizing the prediction function as a d-dimensional linear predictor and as a convolutional filter followed by average pooling. Experiments show CNN 7 500 1000 1500 2000 Number of Training Data 10 -4 10 -2 10 0 Testing Error CNN FNN (a) Filter size m “ 2. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (b) Filter size m “ 8. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (c) Filter size m “ 16. Figure 3: Experiments on the problem of learning a convolutional filter with average pooling described in Section 3 with stride size s “ m, i.e., non-overlapping. 500 1000 1500 2000 Number of Training Data 10 -2 10 -1 10 0 Testing Error CNN FNN (a) Stride size s “ 1. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (b) Stride size s “ m{2. 500 1000 1500 2000 Number of Training Data 10 -3 10 -2 10 -1 10 0 Testing Error CNN FNN (c) Stride size s “ m, i.e., nonoverlapping. Figure 4: Experiment on the problem of one-hidden-layer convolutional neural network with a shared filter and a prediction layer described in Section 4. The filter size m is chosen to be 8. parameterization is consistently better than the FNN parameterization. Further, as number of training samples increases, the prediction error goes down and as the dimension of filter increases, the error goes up. These facts qualitatively justify our derived error bound rO ` m n ˘ . Lastly, in Figure 2 we choose stride s “ 1 and in Figure 3 we choose stride size equals to the filter size s “ m, i.e., non-overlapping. Our experiment shows the stride does not affect the prediction error in this setting which coincides our theoretical bound in which there is no stride size factor. In Figure 4, we consider the one-hidden-layer CNN model analyzed in Section 4. Here we fix the filter size m “ 8 and vary the number of training samples and the stride size. When stride s “ 1, convolutional parameterization has the same order parameters as the linear predictor parameterization (r “ 57 so r ` m “ 65 « d “ 64) and Figure 4a shows they have similar performances. In Figure 4b and Figure 4c we choose the stride to be m{2 “ 4 and m “ 8 (non-overlapping), respectively. Note these settings have less parameters (r ` m “ 23 for s “ 4 and r ` m “ 16 for s “ 8) than the case when s “ 1 and so CNN gives better performance than FNN. 6 Conclusion and Future Directions In this paper we give rigorous characterizations of the statistical efficiency of CNN with simple architectures. Now we discuss how to extend our work to more complex models and main difficulties. Non-linear Activation: Our paper only considered CNN with linear activation. A natural question is what is the sample complexity of learning a CNN with non-linear activation like Recitifed Linear Units (ReLU). We find that even without convolution structure, this is a difficult problem. For linear activation function, we can show the empirical loss is a good approximation to the population loss and we used this property to derive our upper bound. However, for ReLU activation, we can find a counter example for any finite n, which breaks our Lemma 3. We believe if there is a better understanding of non-smooth activation which can replace our Lemma 3, we can extend our analysis framework to derive sharp sample complexity bounds for CNN with non-linear activation function. Multiple Filters: For both models we considered in this paper, there is only one shared filter. In commonly used CNN architectures, there are multiple filters in each layer and multiple layers. Note 8 that if one considers a model of k filters with linear activation with k ° 1, one can always replace this model by a single convolutional filter that equals to the summation of these k filters. Thus, we can formally study the statistical behavior of wide and deep architectures only after we have understood the non-linear activation function. Nevertheless, we believe our empirical process based analysis is still applicable. Acknowledgment This research was partly funded by AFRL grant FA8750-17-2-0212 and DARPA D17AP00001. References Anthony, M., & Bartlett, P. L. (2009). Neural network learning: Theoretical foundations. cambridge university press. Arora, S., Ge, R., Neyshabur, B., & Zhang, Y. (2018). Stronger generalization bounds for deep nets via a compression approach. arXiv preprint arXiv:1802.05296. Bartlett, P. L., Foster, D. J., & Telgarsky, M. J. (2017a). Spectrally-normalized margin bounds for neural networks. In Advances in Neural Information Processing Systems, (pp. 6241–6250). Bartlett, P. L., Harvey, N., Liaw, C., & Mehrabian, A. (2017b). Nearly-tight vcdimension and pseudodimension bounds for piecewise linear neural networks. arxiv preprint. arXiv, 1703. Bickel, P. J., Ritov, Y., & Tsybakov, A. B. (2009). Simultaneous analysis of lasso and dantzig selector. The Annals of Statistics, 37(4), 1705–1732. Brutzkus, A., & Globerson, A. (2017). Globally optimal gradient descent for a Convnet with Gaussian inputs. arXiv preprint arXiv:1702.07966. Choromanska, A., Henaff, M., Mathieu, M., Arous, G. B., & LeCun, Y. (2015). The loss surfaces of multilayer networks. In Artificial Intelligence and Statistics, (pp. 192–204). Du, S. S., & Lee, J. D. (2018). On the power of over-parametrization in neural networks with quadratic activation. arXiv preprint arXiv:1803.01206. Du, S. S., Lee, J. D., & Tian, Y. (2017a). When is a convolutional filter easy to learn? arXiv preprint arXiv:1709.06129. Du, S. S., Lee, J. D., Tian, Y., Poczos, B., & Singh, A. (2017b). Gradient descent learns one-hiddenlayer cnn: Don’t be afraid of spurious local minima. arXiv preprint arXiv:1712.00779. Dudley, R. M. (1967). The sizes of compact subsets of hilbert space and continuity of gaussian processes. Journal of Functional Analysis, 1(3), 290–330. Freeman, C. D., & Bruna, J. (2016). Topology and geometry of half-rectified network optimization. arXiv preprint arXiv:1611.01540. Ge, R., Jin, C., & Zheng, Y. (2017a). No spurious local minima in nonconvex low rank problems: A unified geometric analysis. In Proceedings of the 34th International Conference on Machine Learning, (pp. 1233–1242). Ge, R., Lee, J. D., & Ma, T. (2017b). Learning one-hidden-layer neural networks with landscape design. arXiv preprint arXiv:1711.00501. Goel, S., Kanade, V., Klivans, A., & Thaler, J. (2016). Reliably learning the ReLU in polynomial time. arXiv preprint arXiv:1611.10258. Goel, S., & Klivans, A. (2017a). Eigenvalue decay implies polynomial-time learnability for neural networks. arXiv preprint arXiv:1708.03708. Goel, S., & Klivans, A. (2017b). Learning depth-three neural networks in polynomial time. arXiv preprint arXiv:1709.06010. 9 Goel, S., Klivans, A., & Meka, R. (2018). Learning one convolutional layer with overlapping patches. arXiv preprint arXiv:1802.02547. Graham, R., & Sloane, N. (1980). Lower bounds for constant weight codes. IEEE Transactions on Information Theory, 26(1), 37–43. Haeffele, B. D., & Vidal, R. (2015). Global optimality in tensor factorization, deep learning, and beyond. arXiv preprint arXiv:1506.07540. Hardt, M., & Ma, T. (2016). Identity matters in deep learning. arXiv preprint arXiv:1611.04231. Hoeffding, W. (1963). Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301), 13–30. Huang, F., & Anandkumar, A. (2015). Convolutional dictionary learning through tensor factorization. In Feature Extraction: Modern Questions and Challenges, (pp. 116–129). Kawaguchi, K. (2016). Deep learning without poor local minima. In Advances in Neural Information Processing Systems, (pp. 586–594). Konstantinos, P., Davies, M., & Vandergheynst, P. (2017). Pac-bayesian margin bounds for convolutional neural networks-technical report. arXiv preprint arXiv:1801.00171. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, (pp. 1097–1105). LeCun, Y., Bengio, Y., et al. (1995). Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10), 1995. Li, Y., & Yuan, Y. (2017). Convergence analysis of two-layer neural networks with ReLU activation. arXiv preprint arXiv:1705.09886. Neyshabur, B., Bhojanapalli, S., McAllester, D., & Srebro, N. (2017). A pac-bayesian approach to spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1707.09564. Nguyen, Q., & Hein, M. (2017a). The loss surface and expressivity of deep convolutional neural networks. arXiv preprint arXiv:1710.10928. Nguyen, Q., & Hein, M. (2017b). The loss surface of deep and wide neural networks. arXiv preprint arXiv:1704.08045. Qu, Q., Zhang, Y., Eldar, Y. C., & Wright, J. (2017). Convolutional phase retrieval via gradient descent. arXiv preprint arXiv:1712.00716. Safran, I., & Shamir, O. (2016). On the quality of the initial basin in overspecified neural networks. In International Conference on Machine Learning, (pp. 774–782). Safran, I., & Shamir, O. (2017). Spurious local minima are common in two-layer relu neural networks. arXiv preprint arXiv:1712.08968. Silver, D., Huang, A., Maddison, C. J., Guez, A., Sifre, L., Van Den Driessche, G., Schrittwieser, J., Antonoglou, I., Panneershelvam, V., Lanctot, M., et al. (2016). Mastering the game of go with deep neural networks and tree search. Nature, 529(7587), 484–489. Singh, S., P´oczos, B., & Ma, J. (2018). Minimax reconstruction risk of convolutional sparse dictionary learning. In International Conference on Artificial Intelligence and Statistics, (pp. 1327– 1336). Song, L., Vempala, S., Wilmes, J., & Xie, B. (2017). On the complexity of learning neural networks. In Advances in Neural Information Processing Systems, (pp. 5520–5528). Tian, Y. (2017). An analytical formula of population gradient for two-layered ReLU network and its applications in convergence and critical point analysis. arXiv preprint arXiv:1703.00560. Tsybakov, A. B. (2009). Introduction to nonparametric estimation. Springer Series in Statistics. Springer, New York. 10 van de Geer, S. A. (2000). Empirical Processes in M-estimation, vol. 6. Cambridge university press. Van der Vaart, A. W. (1998). Asymptotic statistics, vol. 3. Cambridge university press. Vershynin, R. (2012). How close is the sample covariance matrix to the actual covariance matrix? Journal of Theoretical Probability, 25(3), 655–686. Wang, Y., & Singh, A. (2016). Noise-adaptive margin-based active learning and lower bounds under tsybakov noise condition. In AAAI. Wasserman, L. (2013). All of statistics: a concise course in statistical inference. Springer Science & Business Media. Yu, A. W., Dohan, D., Luong, M.-T., Zhao, R., Chen, K., Norouzi, M., & Le, Q. V. (2018). Qanet: Combining local convolution with global self-attention for reading comprehension. arXiv preprint arXiv:1804.09541. Yu, B. (1997). Assouad, fano, and le cam. In Festschrift for Lucien Le Cam, (pp. 423–435). Springer. Zhang, Y., Lau, Y., Kuo, H.-w., Cheung, S., Pasupathy, A., & Wright, J. (2017). On the global geometry of sphere-constrained sparse blind deconvolution. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, (pp. 4894–4902). Zhang, Y., Lee, J. D., Wainwright, M. J., & Jordan, M. I. (2015). Learning halfspaces and neural networks with random initialization. arXiv preprint arXiv:1511.07948. Zhong, K., Song, Z., & Dhillon, I. S. (2017a). Learning non-overlapping convolutional neural networks with multiple kernels. arXiv preprint arXiv:1711.03440. Zhong, K., Song, Z., Jain, P., Bartlett, P. L., & Dhillon, I. S. (2017b). Recovery guarantees for one-hidden-layer neural networks. arXiv preprint arXiv:1706.03175. Zhou, P., & Feng, J. (2017). The landscape of deep learning algorithms. arXiv preprint arXiv:1705.07038. 11
2018
17
7,330
Are ResNets Provably Better than Linear Predictors? Ohad Shamir Department of Computer Science and Applied Mathematics Weizmann Institute of Science Rehovot, Israel ohad.shamir@weizmann.ac.il Abstract A residual network (or ResNet) is a standard deep neural net architecture, with stateof-the-art performance across numerous applications. The main premise of ResNets is that they allow the training of each layer to focus on fitting just the residual of the previous layer’s output and the target output. Thus, we should expect that the trained network is no worse than what we can obtain if we remove the residual layers and train a shallower network instead. However, due to the non-convexity of the optimization problem, it is not at all clear that ResNets indeed achieve this behavior, rather than getting stuck at some arbitrarily poor local minimum. In this paper, we rigorously prove that arbitrarily deep, nonlinear residual units indeed exhibit this behavior, in the sense that the optimization landscape contains no local minima with value above what can be obtained with a linear predictor (namely a 1-layer network). Notably, we show this under minimal or no assumptions on the precise network architecture, data distribution, or loss function used. We also provide a quantitative analysis of approximate stationary points for this problem. Finally, we show that with a certain tweak to the architecture, training the network with standard stochastic gradient descent achieves an objective value close or better than any linear predictor. 1 Introduction Residual networks (or ResNets) are a popular class of artificial neural networks, providing state-ofthe-art performance across numerous applications [He et al., 2016a,b, Kim et al., 2016, Xie et al., 2017, Xiong et al., 2017]. Unlike vanilla feedforward neural networks, ResNets are characterized by skip connections, in which the output of one layer is directly added to the output of some following layer. Mathematically, whereas feedforward neural networks can be expressed as stacking layers of the form y = gΦ(x) , (where (x, y) is the input-output pair and Φ are the tunable parameters of the function gΦ), ResNets are built from “residual units” of the form y = f (h(x) + gΦ(x)), where f, h are fixed functions. In fact, it is common to let f, h be the identity [He et al., 2016b], in which case each unit takes the form y = x + gΦ(x) . (1) Intuitively, this means that in each layer, the training of fΦ can focus on fitting just the “residual” of the target y given x, rather than y itself. In particular, adding more depth should not harm performance, since we can effectively eliminate layers by tuning Φ such that gΦ is the zero function. Due to this property, residual networks have proven to be very effective in training extremely deep networks, with hundreds of layers or more. Despite their widespread empirical success, our rigorous theoretical understanding of training residual networks is very limited. Most recent theoretical works on optimization in deep learning (e.g. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Soltanolkotabi et al. [2017], Yun et al. [2018], Soudry and Hoffer [2017], Brutzkus et al. [2017], Ge et al. [2017], Safran and Shamir [2017], Du and Lee [2018] to name just a few examples) have focused on simpler, feedforward architectures, which do not capture the properties of residual networks. Some recent results do consider residual-like elements (see discussion of related work below), but generally do not apply to standard architectures. In particular, we are not aware of any theoretical justification for the basic premise of ResNets: Namely, that their architecture allows adding layers without harming performance. The problem is that training neural networks involves solving a highly non-convex problem using local search procedures. Thus, even though deeper residual networks can express shallower ones, it is not at all clear that the training process will indeed converge to such a network (or a better one). Perhaps, when we attempt to train the residual network using gradient-based methods, we might hit some poor local minimum, with a worse error than what can be obtained with a shallower network? This question is the main motivation to our work. A secondary motivation are several recent results (e.g. Yun et al. [2018], Safran and Shamir [2017], Du et al. [2017], Liang et al. [2018]),which demonstrate how spurious local minima (with value larger than the global minima) do exist in general when training neural networks, even under fairly strong assumptions. Thus, instead of aiming for a result demonstrating that no such minima exist, which might be too good to be true on realistic networks, we can perhaps consider a more modest goal, showing that no such minima exist above a certain (non-trivial) level set. This level set can correspond, for instance, to the optimal value attainable by shallower networks, without the additional residual layers. In this paper, we study these questions by considering the competitiveness of a simple residual network (composed of an arbitrarily deep, nonlinear residual unit and a linear output layer) with respect to linear predictors (or equivalently, 1-layer networks). Specifically, we consider the optimization problem associated with training such a residual network, which is in general non-convex and can have a complicated structure. Nevertheless, we prove that the optimization landscape has no local minima with a value higher than what can be achieved with a linear predictor on the same data. In other words, if we run a local search procedure and reach a local minimum, we are assured that the solution is no worse than the best obtainable with a linear predictor. Importantly, we show this under fairly minimal assumptions on the residual unit, no assumptions on the data distribution (such as linear separability), and no assumption on the loss function used besides smoothness and convexity in the network’s output (which is satisfied for losses used in practice). In addition, we provide a quantitative analysis, which shows how every point which is ϵ-close to being stationary in certain directions (see Sec. 2 for a precise definition) can’t be more than poly(ϵ) worse than any fixed linear predictor. The results above are geometric in nature. As we explain later on, they do not necessarily imply that standard gradient-based methods will indeed converge to such desirable solutions (for example, since the iterates might diverge). Nevertheless, we also provide an algorithmic result, showing that if the residual architecture is changed a bit, then a standard stochastic gradient descent (SGD) procedure will result in a predictor similar or better than the best linear predictor. This result relies on a simple, but perhaps unexpected reduction to the setting of online learning, and might be of independent interest. The supplementary material to this paper contains most proofs (Appendix A) and a discussion of how some of our results can be generalized to vector-valued outputs (Appendix B). Related Work As far as we know, existing rigorous theoretical results on residual networks all pertain to linear networks, which combine linear residual units of the form y = x + Wx = (I + W)x . Although such networks are not used in practice, they capture important aspects of the non-convexity associated with training residual networks. In particular, Hardt and Ma [2016] showed that linear residual networks with the squared loss have no spurious local minima (namely, every local minimum is also a global one). More recently, Bartlett et al. [2018] proved convergence results for gradient descent on such problems, assuming the inputs are isotropic and the target linear mapping is symmetric and positive definite. Showing similar results for non-linear networks is mentioned in Hardt and Ma [2016] as a major open problem. In our paper, we focus on non-linear residual units, but consider only local minima above some level set. 2 In terms of the setting, perhaps the work closest to ours is Liang et al. [2018], which considers networks which can be written as x 7→fS(x) + fD(x), where fS is a one-hidden-layer network, and fD is an arbitrary, possibly deeper network. Under technical assumptions on the data distribution, activations used, network size, and assuming certain classification losses, the authors prove that the training objective is benign, in the sense that the network corresponding to any local minimum has zero classification error. However, as the authors point out, their architecture is different than standard ResNets (which would require a final tunable layer to combine the outputs of fS, fD), and their results provably do not hold under such an architecture. Moreover, the technical assumptions are non-trivial, do not apply as-is to standard activations and losses (such as the ReLU activation and the logistic loss), and require specific conditions on the data, such as linear separability or a certain low-rank structure. In contrast, we study a more standard residual unit, and make minimal or no assumptions on the network, data distribution, and loss used. On the flip side, we only prove results for local minima above a certain level set, rather than all such points. Finally, the idea of studying stationary points in non-convex optimization problems, which are above or below some reference level set, has also been explored in some other works (e.g. Ge and Ma [2017]), but under settings quite different than ours. 2 Setting and Preliminaries We start with a few words about basic notation and terminology. We generally use bold-faced letters to denote vectors (assumed to be in column form), and capital letters to denote matrices or functions. ∥·∥refers to the Euclidean norm for vectors and spectral norm for matrices, unless specified otherwise. ∥· ∥F r for matrices denotes the Frobenius norm (which always upper bounds the spectral norm). For a matrix M, vec(M) refers to the entries of M written as one long vector (according to some canonical order). Given a function g on Euclidean space, ∇g denotes its gradient and ∇2g denotes its Hessian. A point x in the domain of a function g is a local minimum, if g(x) ≤g(x′) for any x′ in some open neighborhood of x. Finally, we use standard O(·) and Θ(·) notation to hide constants, and let poly(x1, . . . , xr) referto an expression which is polynomial in x1, . . . , xr. We consider a residual network architecture, consisting of a residual unit as in Eq. (1), composed with a linear output layer, with scalar output1: x 7→w⊤(x + gΦ(x)) . We will make no assumptions on the structure of each gΦ, nor on the overall depth of the network which computes it, except that it’s last layer is a tunable linear transformation (namely, that gΦ(x) = V fθ(x) for some matrix V , not necessarily a square one, and parameters θ). This condition follows the “full pre-activation” structure proposed in He et al. [2016b], which was empirically found to be the best-performing residual unit architecture, and is commonly used in practice (e.g. in TensorFlow). We depart from that structure only in that V is fully tunable rather than a convolution, to facilitate and simplify our theoretical study. Under this assumption, we have that given x, the network outputs x 7→w⊤(x + V fθ(x)) , parameterized by a vector w, a matrix V , and with some (possibly complicated) function fθ parameterized by θ. Remark 1 (Biases). We note that this model can easily incorporate biases, namely predictors of the form x 7→w⊤(x + V fθ(x) + a) + a for some tunable a, a, by the standard trick of augmenting x with an additional coordinate whose value is always 1, and assuming that fθ(x) outputs a vector with an additional coordinate of value 1. Since our results do not depend on the data geometry or specifics of fθ, they would not be affected by such modifications. We assume that our network is trained with respect to some data distribution (e.g. an average over some training set {xi, yi}), using a loss function ℓ(p, y), where p is the network’s prediction and y is the target value. Thus, we consider the optimization problem min w,V,θ F(w, V, θ) := Ex,y  ℓ(w⊤(x + V fθ(x)); y)  , (2) 1See Appendix B for a discussion of how some of our results can be generalized to networks with vectorvalued outputs. 3 where w, V, θ are unconstrained. This objective will be the main focus of our paper. In general, this objective is not convex in (w, V, θ), and can easily have spurious local minima and saddle points. In our results, we will make no explicit assumptions on the distribution of (x, y), nor on the structure of fθ. As to the loss, we will assume throughout the paper the following: Assumption 1. For any y, the loss ℓ(p, y) is twice differentiable and convex in p. This assumption is mild, and is satisfied for standard losses such as the logistic loss, squared loss, smoothed hinge loss etc. Note that under this assumption, F(w, V, θ) is twice-differentiable with respect to w, V , and in particular the function defined as Fθ(w, V ) := F(w, V, θ) (for any fixed θ) is twice-differentiable. We emphasize that throughout the paper, we will not assume that F is necessarily differentiable with respect to θ (indeed, if fθ represents a network with non-differentiable operators such as ReLU or the max function, we cannot expect that F will be differentiable everywhere). When considering derivatives of Fθ, we think of the input as one long vector in Euclidean space (in order specified by vec()), so ∇Fθ is a vector and ∇2Fθ is a matrix. As discussed in the introduction, we wish to compare our objective value to that obtained by linear predictors. Specifically, we will use the notation Flin(w) := F(w, 0, θ) = Ex,y  ℓ(w⊤x; y)  to denote the expected loss of a linear predictor parameterized by the vector w. By Assumption 1, this function is convex and twice-differentiable. Finally, we introduce the following class of points, which behave approximately like local minima of F with respect to (w, V ), in terms of its first two derivatives: Definition 1 (ϵ-SOPSP). Let M be an open subset of the domain of F(w, V, θ), on which ∇2Fθ(w, V ) is µ2-Lipschitz in (w, V ). Then (w, V, θ) ∈M is an ϵ-second-order partial stationary point (ϵ-SOPSP) of F on M, if ∥∇Fθ(w, V )∥≤ϵ and λmin(∇2Fθ(w, V )) ≥−√µ2ϵ . Importantly, note that any local minimum (w, V, θ) of F must be a 0-SOPSP: This is because (w, V ) is a local minimum of the (differentiable) function Fθ, hence ∥∇Fθ(w, V )∥= 0 and λmin(∇2Fθ(w, V )) ≥0. Our definition above directly generalizes the well-known notion of ϵsecond-order stationary points (or ϵ-SOSP) [McCormick, 1977, Nesterov and Polyak, 2006, Jin et al., 2017], which are defined for functions which are twice-differentiable in all of their parameters. In fact, our definition of ϵ-SOPSP is equivalent to requiring that (w, V ) is an ϵ-SOSP of Fθ. We need to use this more general definition, because we are not assuming that F is differentiable in θ. Interestingly, ϵ-SOSP is one of the most general classes of points in non-convex optimization, to which gradient-based methods can be shown to converge in poly(1/ϵ) iterations. 3 Competitiveness with Linear Predictors Our main results are Thm. 3 and Corollary 1 below, which are proven in two stages: First, we show that at any point such that w ̸= 0, ∥∇Fθ(w, V )∥is lower bounded in terms of the suboptimality with respect to the best linear predictor (Thm. 1). We then consider the case w = 0, and show that for such points, if they are suboptimal with respect to the best linear predictor, then either ∥∇Fθ(w, V )∥is strictly positive, or λmin(∇2Fθ(w, V )) is strictly negative (Thm. 2). Thus, building on the definition of ϵ-SOPSP from the previous section, we can show that no point which is suboptimal (compared to a linear predictor) can be a local minimum of F. Theorem 1. At any point (w, V, θ) such that w ̸= 0, and for any vector w∗of the same dimension as w, ∥∇Fθ(w, V )∥≥ F(w, V, θ) −Flin(w∗) r 2∥w∥2 + ∥w∗∥2  2 + ∥V ∥2 ∥w∥2  . 4 The theorem implies that for any point (w, V, θ) for which the objective value F(w, V, θ) is larger than that of some linear predictor Flin(w∗), and unless w = 0, its partial derivative with respect to (w, V ) (namely ∇Fθ(w, V )) is non-zero, so it cannot be a stationary point with respect to w, V , nor a local minimum of F. The proof of the theorem appears in the supplementary material, but relies on the following key lemma, which we shall state and roughly sketch its proof here: Lemma 1. Fix some w, V (where w ̸= 0) and a vector w∗of the same size as w. Define the matrix G =  w −w∗; 1 ∥w∥2 w(w∗)⊤V  . Then ⟨vec(G), ∇Fθ(w, V )⟩≥F(w, V, θ) −Flin(w∗) . In other words, the inner product of the gradient with some carefully-chosen vector is lower bounded by the suboptimality of F(w, V, θ) compared to a linear predictor (and in particular, if the point is suboptimal, the gradient cannot be zero). Proof Sketch of Lemma 1. We have ⟨vec(G), ∇Fθ(w, V )⟩=  w −w∗, ∂ ∂wF(w, V, θ)  +  vec  1 ∥w∥2 w(w∗)⊤V  , vec  ∂ ∂V F(w, V, θ)  . Let dℓ= ∂ ∂pℓ(p; y)|p=w⊤(x+V fθ(x)). A careful technical calculation reveals that the expression above equals Ex,y  dℓ(w∗)⊤V fθ(x)  + Ex,y  dℓ(w −w∗)⊤(x + V fθ(x))  . This in turn equals Ex,y  dℓ w⊤(x + V fθ(x)) −(w∗)⊤x  . Recalling the definition of dℓ, and noting that by convexity of ℓ, ∂ ∂pℓ(p; y)(p −˜p) ≥ℓ(p; y) −ℓ(˜p; y) for all p, ˜p, it follows that the above is lower bounded by Ex,y  ℓ(w⊤(x + V fθ(x); y)) −ℓ((w∗)⊤x; y)  = F(w, V, θ) −Flin(w∗) . To analyze the case w = 0, we have the following result: Theorem 2. For any V, θ, w∗, λmin ∇2Fθ(0, V )  ≤0 and ∥∇Fθ(0, V )∥+ ∥V ∥ s |λmin (∇2Fθ(0, V ))| · ∂2 ∂w2 Fθ(0, V ) + λmin (∇2Fθ(0, V ))2 ≥F(0, V, θ) −Flin(w∗) ∥w∗∥ , where λmin(M) denotes the minimal eigenvalue of a symmetric matrix M. Combining the two theorems above, we can show the following main result: Theorem 3. Fix some positive b, r, µ0, µ1, µ2 and ϵ ≥0, and suppose M is some convex open subset of the domain of F(w, V, θ) in which • max{∥w∥, ∥V ∥} ≤b • Fθ(w, V ), ∇Fθ(w, V ) and ∇2Fθ(w, V ) are µ0-Lipschitz, µ1-Lipschitz, and µ2-Lipschitz in (w, V ) respectively. 5 • For any (w, V, θ) ∈W, we have (0, V, θ) ∈W and ∥∇2Fθ(0, V )∥≤µ1. Then for any (w, V, θ) ∈M which is an ϵ-SOPSP of F on M, F(w, V, θ) ≤ min w:∥w∥≤r Flin(w) + (ϵ + 4√ϵ) · poly(b, r, µ0, µ1, µ2). We note that the poly(b, r, µ0, µ1, µ2) term hides only dependencies which are at most linear in the individual factors (see the proof in the supplementary material for the exact expression). As discussed in Sec. 2, any local minima of F must correspond to a 0-SOPSP. Hence, the theorem above implies that for such a point, F(w, V, θ) ≤minw:∥w∥≤r Flin(w) (as long as F satisfies the Lipschitz continuity assumptions for some finite µ0, µ1, µ2 on any bounded subset of the domain). Since this holds for any r, we have arrived at the following corollary: Corollary 1. Suppose that on any bounded subset of the domain of F, it holds that Fθ(w, V ), ∇Fθ(w, V ) and ∇2Fθ(w, V ) are all Lipschitz continuous in (w, V ). Then every local minimum (w, V, θ) of F satisfies F(w, V, θ) ≤inf w Flin(w) . In other words, the objective F has no spurious local minima with value above the smallest attainable with a linear predictor. Remark 2 (Generalization to vector-valued outputs). One can consider a generalization of our setting to networks with vector-valued outputs, namely x 7→W(x + V fθ(x)), where W is a matrix, and with losses ℓ(p, y) taking vector-valued arguments and convex in p (e.g. the cross-entropy loss). In this more general setting, it is possible to prove a variant of Thm. 1 using a similar proof technique (see Appendix B). However, it is not clear to us how to prove an analog of Thm. 2 and hence Thm. 3. We leave this as a question for future research. 4 Effects of Norm and Regularization Thm. 3 implies that any ϵ-SOPSP must have a value not much worse than that obtained by a linear predictor. Moreover, as discussed in Sec. 2, such points are closely related to second-order stationary points, and gradient-based methods are known to converge quickly to such points (e.g. Jin et al. [2017]). Thus, it is tempting to claim that such methods will indeed result in a network competitive with linear predictors. Unfortunately, there is a fundamental catch: The bound of Thm. 3 depends on the norm of the point (via ∥w∥, ∥V ∥), and can be arbitrarily bad if the norm is sufficiently large. In other words, Thm. 3 guarantees that a point which is ϵ-SOPSP is only “good” as long as it is not too far away from the origin. If the dynamics of the gradient method are such that the iterates remain in some bounded domain (or at least have a sufficiently slowly increasing norm), then this would not be an issue. However, we are not a-priori guaranteed that this would be the case: Since the optimization problem is unconstrained, and we are not assuming anything on the structure of fθ, it could be that the parameters w, V diverge, and no meaningful algorithmic result can be derived from Thm. 3. Of course, one option is that this dependence on ∥w∥, ∥V ∥is an artifact of the analysis, and any ϵ-SOPSP of F is competitive with a linear predictor, regardless of the norms. However, the following example shows that this is not the case: Example 1. Fix some ϵ > 0. Suppose x, w, V, w∗are all scalars, w∗= 1, fθ(x) = ϵx (with no dependence on a parameter θ), ℓ(p; y) = 1 2(p −y)2 is the squared loss, and x = y = 1 w.p. 1. Then the objective can be equivalently written as F(w, v) = 1 2 (w(1 + ϵv) −1)2 (see leftmost plot in Figure 1). The gradient and Hessian of F(w, v) equal  (w −1 + ϵwv)(1 + ϵv) (w −1 + ϵwv)ϵw  and  (1 + ϵv)2 ϵ(2w + 2ϵwv −1) ϵ(2w + 2ϵwv −1) ϵ2w2  6 Figure 1: From left to right: Contour plots of (a) F(w, v) = (w(1+v)−1)2, (b) F(w, v)+ 1 4(w2+v2), and (c) F(w, v) superimposed with the constraint ∥(w, v)∥≤2 (inside the circle). The x-axis corresponds to w, and the y-axis corresponds to v. Both (b) and (c) exhibit a spurious local minima in the bottom left quadrant of the domain. Best viewed in color. respectively. In particular, at (w, v) = (0, −1/ϵ), the gradient is 0 and the Hessian equals  0 −ϵ −ϵ 0  , which is arbitrarily close to 0 if ϵ is small enough. However, the objective value at that point equals F  0, −1 ϵ  = 1 2 > 0 = Flin(1). Remark 3. In the example above, F does not have gradients and Hessians with a uniformly bounded Lipschitz constant (over all of Euclidean space). However, for any ϵ > 0, the Lipschitz constants are bounded by a numerical constant over (w, v) ∈[−2/ϵ, 2/ϵ]2 (which includes the stationary point studied in the construction). This indicates that the problem indeed lies with the norm of (w, v) being unbounded, and not with the Lipschitz constants of the derivatives of F. One standard approach to ensure that the iterates remain bounded is to add regularization, namely optimize min w,V,θ F(w, V, θ) + R(w, V, θ) , where R is a regularization term penalizing large norms of w, V, θ. Unfortunately, not only does this alter the objective, it might also introduce new spurious local minima that did not exist in F(w, V, θ). This is graphically illustrated in Figure 1, which plots F(w, v) from Example 1 (when ϵ = 1), with and without regularization of the form R(w, v) = λ 2 (w2 + v2) where λ = 1/2. Whereas the stationary points of F(w, v) are either global minima (along two valleys, corresponding to {(w, v) : w(1 + ϵv) = 1}) or a saddle point (at (w, v) = (1, −1/ϵ)), the regularization created a new spurious local minimum around (w, v) ≈(−1, −1.6). Intuitively, this is because the regularization makes the objective value increase well before the valley of global minima of F. Other regularization choices can also lead to the same phenomenon. A similar issue can also occur if we impose a hard constraint, namely optimize min w,V,θ:(w,V,θ)∈M F(w, V, θ) for some constrained domain M. Again, as Figure 1 illustrates, this optimization problem can have spurious local minima inside its constrained domain, using the same F as before. Of course, one way to fix this issue is by making the regularization parameter λ sufficiently small (or the domain M sufficiently large), so that the regularization only comes into effect when ∥(w, v)∥ is sufficiently large. However, the correct choice of λ and M depends on ϵ, and here we run into a problem: If fθ is not simply some fixed ϵ (as in the example above), but changes over time, then we have no a-priori guarantee on how λ or M should be chosen. Thus, it is not clear that any fixed choice of regularization would work, and lead a gradient-based method to a good local minimum. 5 Success of SGD Assuming a Skip Connection to the Output Having discussed the challenges of getting an algorithmic result in the previous section, we now show how such a result is possible, assuming the architecture of our network is changed a bit. 7 Concretely, instead of the network architecture x 7→w⊤(x + V fθ(x)), we consider the architecture x 7→w⊤x + v⊤fθ(x), parameterized by vectors w, v and θ, so our new objective can be written as F(w, v, θ) = Ex,y  ℓ w⊤x + v⊤fθ(x); y  . This architecture corresponds to having a skip connection directly to the network’s output, rather than to a final linear output layer. It is similar in spirit to the skip-connection studied in Liang et al. [2018], except that they had a two-layer nonlinear network instead of our linear w⊤x component. In what follows, we consider a standard stochastic gradient descent (SGD) algorithm to train our network: Fixing a step size η and some convex parameter domain M, we 1. Initialize (w1, v1, θ1) at some point in M 2. For t = 1, 2, . . . , T, we randomly sample a data point (xt, yt) from the underlying data distribution, and perform (wt+1, vt+1, θt+1) = ΠM ((wt, vt, θt) −η∇ht(wt, vt, θt)) , where ht(w, v, θ) := ℓ(w⊤xt + v⊤fθ(xt); yt) and ΠM denote an Euclidean projection on the set M. Note that ht(w, v, θ) is always differentiable with respect to w, v, and in the above, we assume for simplicity that it is also differentiable with respect to θ (if not, one can simply define ∇ht(w, v, θ) above to be ∂ ∂wht(w, v, θ), ∂ ∂vht(w, v, θ), rt,w,v,θ  for some arbitrary vector rt,w,v,θ, and the result below can still be easily verified to hold). As before, we use the notation Flin(w) = Ex,y  ℓ w⊤x; y  to denote the expected loss of a linear predictor parameterized by w. The following theorem establishes that under mild conditions, running stochastic gradient descent with sufficiently many iterations results in a network competitive with any fixed linear predictor: Theorem 4. Suppose the domain M satisfies the following for some positive constants b, r, l: • M = {(w, v, θ) : (w, v) ∈M1, θ ∈M2} for some closed convex sets M1, M2 in Euclidean spaces (namely, M is a Cartesian product of M1, M2). • For any (x, y) in the support of the data distribution, and any θ ∈M2, ℓ(w⊤x + v⊤fθ(x); y) is l-Lipschitz in (w, v) over M1, and bounded in absolute value by r. • For any (w, v) ∈M1, p ∥w∥2 + ∥v∥2 ≤b. Suppose we perform T iterations of stochastic gradient descent as described above, with any step size η = Θ(b/(l √ T)). Then with probability at least 1 −δ, one of the iterates {(wt, vt, θt)}T t=1 satisfies F(wt, vt, θt) ≤ min u:(u,0)∈M1 Flin(u) + O bl + r p log(1/δ) √ T ! . The proof relies on a technically straightforward – but perhaps unexpected – reduction to adversarial online learning, and appears in the supplementary material. Roughly speaking, the idea is that our stochastic gradient descent procedure over (w, v, θ) is equivalent to online gradient descent on (w, v), with respect to a sequence of functions defined by the iterates θ1, θ2, . . .. Even though these iterates can change in unexpected and complicated ways, the strong guarantees of online learning (which allow the sequence of functions to be rather arbitrary) allow us to obtain the theorem above. Acknowledgements. We thank the anonymous NIPS 2018 reviewers for their helpful comments. This research is supported in part by European Research Council (ERC) grant 754705. 8 References Peter L Bartlett, David P Helmbold, and Philip M Long. Gradient descent with identity initialization efficiently learns positive definite linear transformations by deep residual networks. arXiv preprint arXiv:1802.06093, 2018. Alon Brutzkus, Amir Globerson, Eran Malach, and Shai Shalev-Shwartz. Sgd learns overparameterized networks that provably generalize on linearly separable data. arXiv preprint arXiv:1710.10174, 2017. Simon S Du and Jason D Lee. On the power of over-parametrization in neural networks with quadratic activation. arXiv preprint arXiv:1803.01206, 2018. Simon S Du, Jason D Lee, Yuandong Tian, Barnabas Poczos, and Aarti Singh. Gradient descent learns one-hidden-layer cnn: Don’t be afraid of spurious local minima. arXiv preprint arXiv:1712.00779, 2017. Rong Ge and Tengyu Ma. On the optimization landscape of tensor decompositions. In Advances in Neural Information Processing Systems, pages 3656–3666, 2017. Rong Ge, Jason D Lee, and Tengyu Ma. Learning one-hidden-layer neural networks with landscape design. arXiv preprint arXiv:1711.00501, 2017. Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016. Elad Hazan. Introduction to online convex optimization. Foundations and Trends R⃝in Optimization, 2(3-4):157–325, 2016. 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, 2016a. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pages 630–645. Springer, 2016b. Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. arXiv preprint arXiv:1703.00887, 2017. Jiwon Kim, Jung Kwon Lee, and Kyoung Mu Lee. Accurate image super-resolution using very deep convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1646–1654, 2016. Shiyu Liang, Ruoyu Sun, Yixuan Li, and R Srikant. Understanding the loss surface of neural networks for binary classification. arXiv preprint arXiv:1803.00909, 2018. Garth P McCormick. A modification of armijo’s step-size rule for negative curvature. Mathematical Programming, 13(1):111–115, 1977. Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006. Itay Safran and Ohad Shamir. Spurious local minima are common in two-layer relu neural networks. arXiv preprint arXiv:1712.08968, 2017. Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends R⃝in Machine Learning, 4(2):107–194, 2012. Mahdi Soltanolkotabi, Adel Javanmard, and Jason D Lee. Theoretical insights into the optimization landscape of over-parameterized shallow neural networks. arXiv preprint arXiv:1707.04926, 2017. Daniel Soudry and Elad Hoffer. Exponentially vanishing sub-optimal local minima in multilayer neural networks. arXiv preprint arXiv:1702.05777, 2017. 9 Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on, pages 5987–5995. IEEE, 2017. Wayne Xiong, Jasha Droppo, Xuedong Huang, Frank Seide, Mike Seltzer, Andreas Stolcke, Dong Yu, and Geoffrey Zweig. The microsoft 2016 conversational speech recognition system. In Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, pages 5255–5259. IEEE, 2017. Chulhee Yun, Suvrit Sra, and Ali Jadbabaie. A critical view of global optimality in deep learning. arXiv preprint arXiv:1802.03487, 2018. Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pages 928–936, 2003. 10
2018
170
7,331
Meta-Gradient Reinforcement Learning Zhongwen Xu DeepMind zhongwen@google.com Hado van Hasselt DeepMind hado@google.com David Silver DeepMind davidsilver@google.com Abstract The goal of reinforcement learning algorithms is to estimate and/or optimise the value function. However, unlike supervised learning, no teacher or oracle is available to provide the true value function. Instead, the majority of reinforcement learning algorithms estimate and/or optimise a proxy for the value function. This proxy is typically based on a sampled and bootstrapped approximation to the true value function, known as a return. The particular choice of return is one of the chief components determining the nature of the algorithm: the rate at which future rewards are discounted; when and how values should be bootstrapped; or even the nature of the rewards themselves. It is well-known that these decisions are crucial to the overall success of RL algorithms. We discuss a gradient-based meta-learning algorithm that is able to adapt the nature of the return, online, whilst interacting and learning from the environment. When applied to 57 games on the Atari 2600 environment over 200 million frames, our algorithm achieved a new state-of-the-art performance. The central goal of reinforcement learning (RL) is to optimise the agent’s return (cumulative reward); this is typically achieved by a combination of prediction and control. The prediction subtask is to estimate the value function – the expected return from any given state. Ideally, this would be achieved by updating an approximate value function towards the true value function. The control subtask is to optimise the agent’s policy for selecting actions, so as to maximise the value function. Ideally, the policy would simply be updated in the direction that increases the true value function. However, the true value function is unknown and therefore, for both prediction and control, a sampled return is instead used as a proxy. A large family of RL algorithms [Sutton, 1988, Rummery and Niranjan, 1994, van Seijen et al., 2009, Sutton and Barto, 2018], including several state-of-the-art deep RL algorithms [Mnih et al., 2015, van Hasselt et al., 2016, Harutyunyan et al., 2016, Hessel et al., 2018, Espeholt et al., 2018], are characterised by different choices of the return. The discount factor γ determines the time-scale of the return. A discount factor close to γ = 1 provides a long-sighted goal that accumulates rewards far into the future, while a discount factor close to γ = 0 provides a short-sighted goal that prioritises short-term rewards. Even in problems where long-sightedness is clearly desired, it is frequently observed that discounts γ < 1 achieve better results [Prokhorov and Wunsch, 1997], especially during early learning. It is known that many algorithms converge faster with lower discounts [Bertsekas and Tsitsiklis, 1996], but of course too low a discount can lead to highly sub-optimal policies that are too myopic. In practice it can be better to first optimise for a myopic horizon, e.g., with γ = 0 at first, and then to repeatedly increase the discount only after learning is somewhat successful [Prokhorov and Wunsch, 1997]. The return may also be bootstrapped at different time horizons. An n-step return accumulates rewards over n time-steps and then adds the value function at the nth time-step. The λ-return [Sutton, 1988, Sutton and Barto, 2018] is a geometrically weighted combination of n-step returns. In either case, the meta-parameter n or λ can be important to the performance of the algorithm, trading off bias and variance. Many researchers have sought to automate the selection of these parameters [Kearns and Singh, 2000, Downey and Sanner, 2010, Konidaris et al., 2011, White and White, 2016]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. There are potentially many other design choices that may be represented in the return, including off-policy corrections [Espeholt et al., 2018, Munos et al., 2016], target networks [Mnih et al., 2015], emphasis on certain states [Sutton et al., 2016], reward clipping [Mnih et al., 2013], or even the nature of the rewards themselves [Randløv and Alstrøm, 1998, Singh et al., 2005, Zheng et al., 2018]. In this work, we are interested in one of the fundamental problems in reinforcement learning: what would be the best form of return for the agent to maximise? Specifically, we propose to learn the return function by treating it as a parametric function with tunable meta-parameters η, for instance including the discount factor γ, or the bootstrapping parameter λ [Sutton, 1988]. The meta-parameters η are adjusted online during the agent’s interaction with the environment, allowing the return to both adapt to the specific problem, and also to dynamically adapt over time to the changing context of learning. We derive a practical gradient-based meta-learning algorithm and show that this can significantly improve performance on large-scale deep reinforcement learning applications. 1 Meta-Gradient Reinforcement Learning Algorithms In deep reinforcement learning, the value function and policy are approximated by a neural network with parameters θ, denoted by vθ(S) and πθ(A|S) respectively. At the core of the algorithm is an update function, θ′ = θ + f(τ, θ, η) , (1) that adjusts parameters from a sequence of experience τt = {St, At, Rt+1, . . .} consisting of states S, actions A and rewards R. The nature of the function is determined by meta-parameters η. Our meta-gradient RL approach is based on the principle of online cross-validation [Sutton, 1992], using successive samples of experience. The underlying RL algorithm is applied to the first sample (or samples), and its performance is measured in a subsequent sample. Specifically, the algorithm starts with parameters θ, and applies the update function to the first sample(s), resulting in new parameters θ′. The gradient dθ′/dη of these updates indicates how the meta-parameters affected these new parameters. The algorithm then measures the performance of the new parameters θ′ on a second sample τ ′. For instance, when learning online τ ′ could be the next time-step immediately following τ. Performance is measured by a differentiable meta-objective ¯J(τ ′, θ′, ¯η) that uses a fixed meta-parameter ¯η. The gradient of the meta-objective with respect to the meta-parameters η is obtained by applying the chain rule: ∂¯J(τ ′, θ′, ¯η) ∂η = ∂¯J(τ ′, θ′, ¯η) ∂θ′ dθ′ dη . (2) To compute the gradient of the updates, dθ′/dη, we note that the parameters form an additive sequence, and the gradient can therefore be accumulated online [Williams and Zipser, 1989], dθ′ dη = dθ dη + ∂f(τ, θ, η) ∂η + ∂f(τ, θ, η) ∂θ dθ dη =  I + ∂f(τ, θ, η) ∂θ  dθ dη + ∂f(τ, θ, η) ∂η (3) This update has the form z′ = Az + ∂f(τ, θ, η) ∂η , where z = dθ/dη and z′ = dθ′/dη. The exact gradient is given by A = I + ∂f(τ, θ, η)/∂θ. In practice, the gradient ∂f(τ, θ, η)/∂θ is large and challenging to compute — it is a n × n matrix, where n is the number of parameters in θ. In practice, we approximate the gradient, z ≈dθ/dη. One possibility is to use an alternate update A = I + ˆ∂f(τ, θ, η)/ˆ∂θ using a cheap approximate derivative ˆ∂f(τ, θ, η)/ˆ∂θ ≈∂f(τ, θ, η)/∂θ, for instance using a diagonal approximation [Sutton, 1992, Schraudolph, 1999]. Furthermore, the gradient accumulation defined above assumes that the meta-parameters η are held fixed throughout training. In practice, we are updating η and therefore it may be desirable to decay the trace into the past [Schraudolph, 1999], A = µ(I + ∂f(τ, θ, η)/∂θ), using decay rate µ ∈[0, 1]. The simplest approximation is to use A = 0 (or equivalently µ = 0), which means that we only consider the effect of the meta-parameters η on a single update; this approximation is especially cheap to compute. 2 Finally, the meta-parameters η are updated to optimise the meta-objective, for example by applying stochastic gradient descent (SGD) to update η in the direction of the meta-gradient, ∆η = −β ∂¯J(τ ′, θ′, ¯η) ∂θ′ z′, (4) where β is the learning rate for updating meta parameter η. The pseudo-code for the meta-gradient reinforcement learning algorithm is provided in Appendix A. In the following sections we instantiate this idea more specifically to RL algorithms based on predicting or controlling returns. We begin with a pedagogical example of using meta-gradients for prediction using a temporal-difference update. We then consider meta-gradients for control, using a canonical actor-critic update function and a policy gradient meta-objective. Many other instantiations of meta-gradient RL would be possible, since the majority of deep reinforcement learning updates are differentiable functions of the return, including, for instance, value-based methods like SARSA(λ) [Rummery and Niranjan, 1994, Sutton and Barto, 2018] and DQN [Mnih et al., 2015], policygradient methods [Williams, 1992], or actor-critic algorithms like A3C [Mnih et al., 2016] and IMPALA [Espeholt et al., 2018]. 1.1 Applying Meta-Gradients to Returns We define the return gη(τt) to be a function of an episode or a truncated n-step sequence of experience τt = {St, At, Rt+1, . . . , St+n}. The nature of the return is determined by the meta-parameters η. The n-step return [Sutton and Barto, 2018] accumulates rewards over the sequence and then bootstraps from the value function, gη(τt) = Rt+1 + γRt+2 + γ2Rt+3 + . . . , +γn−1Rt+n + γnvθ(St+n) (5) where η = {γ}. The λ-return is a geometric mixture of n-step returns, [Sutton, 1988] gη(τt) = Rt+1 + γ(1 −λ)vθ(St+1) + γλgη(τt+1) (6) where η = {γ, λ}. The λ-return has the advantage of being fully differentiable with respect to the meta-parameters. The meta-parameters η may be viewed as gates that cause the return to terminate (γ = 0) or bootstrap (λ = 0), or to continue onto the next step (γ = 1 and λ = 1). The n-step or λ-return can be augmented with off-policy corrections [Precup et al., 2000, Sutton et al., 2014, Espeholt et al., 2018] if it is necessary to correct for the distribution used to generate the data. A typical RL algorithm would hand-select the meta-parameters, such as the discount factor γ and bootstrapping parameter λ, and these would be held fixed throughout training. Instead, we view the return g as a function parameterised by meta-parameters η, which may be differentiated to understand its dependence on η. This in turn allows us to compute the gradient ∂f/∂η of the update function with respect to the meta-parameters η, and hence the meta-gradient ∂¯J(τ ′, θ′, ¯η)/∂η. In essence, our agent asks itself the question, “which return results in the best performance?", and adjusts its meta-parameters accordingly. 1.2 Meta-Gradient Prediction We begin with a simple instantiation of the idea, based on the canonical TD(λ) algorithm for prediction. The objective of the TD(λ) algorithm (according to the forward view [Sutton and Barto, 2018]) is to minimise the squared error between the value function approximator vθ(S) and the λ-return gη(τ), J(τ, θ, η) = (gη(τ) −vθ(S))2 ∂J(τ, θ, η) ∂θ = −2(gη(τ) −vθ(S))∂vθ(S) ∂θ (7) where τ is a sampled trajectory starting with state S, and ∂J(τ, θ, η)/∂θ is a semi-gradient [Sutton and Barto, 2018], i.e. the λ-return is treated as constant with respect to θ. The TD(λ) update function f(·) applies SGD to update the agent’s parameters θ to descend the gradient of the objective with respect to the parameters, f(τ, θ, η) = −α 2 ∂J(τ, θ, η) ∂θ = α(gη(τ) −vθ(S))∂vθ(S) ∂θ (8) 3 where α is the learning rate for updating agent θ. We note that this update is itself a differentiable function of the meta-parameters η, ∂f(τ, θ, η) ∂η = −α 2 ∂2J(τ, θ, η) ∂θ ∂η = α∂gη(τ) ∂η ∂vθ(S) ∂θ (9) The key idea of the meta-gradient prediction algorithm is to adjust meta-parameters η in the direction that achieves the best predictive accuracy. This is measured by cross-validating the new parameters θ′ on a second trajectory τ ′ that starts from state S′, using a mean squared error (MSE) meta-objective and taking its semi-gradient, ¯J(τ ′, θ′, ¯η) = (g¯η(τ ′) −vθ′(S′))2 ∂¯J(τ ′, θ′, ¯η) ∂θ′ = −2(g¯η(τ ′) −vθ′(S′))∂vθ′(S′) ∂θ′ (10) The meta-objective in this case could make use of an unbiased and long-sighted return1, for example using ¯η = {¯γ, ¯λ} where ¯γ = 1 and ¯λ = 1. 1.3 Meta-Gradient Control We now provide a practical example of meta-gradients applied to control. We focus on the A2C algorithm – an actor-critic update function that combines both prediction and control into a single update. This update function is widely used in several state-of-the-art agents [Mnih et al., 2016, Jaderberg et al., 2017b, Espeholt et al., 2018]. The semi-gradient of the A2C objective, ∂J(τ; θ, η)/∂θ, is defined as follows, −∂J(τ, θ, η) ∂θ = (gη(τ)−vθ(S))∂log πθ(A|S) ∂θ +b(gη(τ)−vθ(S))∂vθ(S) ∂θ +c∂H(πθ(·|S)) ∂θ . (11) The first term represents a control objective, encouraging the policy πθ to select actions that maximise the return. The second term represents a prediction objective, encouraging the value function approximator vθ to more accurately estimate the return gη(τ). The third term regularises the policy according to its entropy H(πθ), and b, c are scalar coefficients that weight the different components in the objective function. The A2C update function f(·) applies SGD to update the agent’s parameters θ. This update function is a differentiable function of the meta-parameters η, f(τ, θ, η) = −α∂J(τ, θ, η) ∂θ ∂f(τ, θ, η) ∂η = α∂gη(τ) ∂η ∂log πθ(A|S) ∂θ + b∂vθ(S) ∂θ  (12) Now we come to the choice of meta-objective ¯J to use for control. Our goal is to identify the return function that maximises overall performance in our agents. This may be directly measured by a meta-objective focused exclusively on optimising returns – in other words a policy gradient objective, ∂¯J(τ ′, θ′, ¯η) ∂θ′ = (g¯η(τ ′) −vθ′(S′))∂log πθ′(A′|S′) ∂θ′ . (13) This equation evaluates how good the updated policy θ′ is in terms of returns computed under ¯η, when measured on “held-out” experiences τ ′, e.g. the subsequent n-step trajectory. When cross-validating performance using this meta-objective, we use fixed meta-parameters ¯η, ideally representing a good proxy to the true objective of the agent. In practice this typically means selecting reasonable values of ¯η; the agent is free to adapt its meta-parameters η and choose values that perform better in practice. We now put the meta-gradient control algorithm together. First, the parameters θ are updated on a sample of experience τ using the A2C update function (Equation (11)), and the gradient of the update (Equation (12)) is accumulated into trace z. Second, the performance is cross-validated on a subsequent sample of experience τ ′ using the policy gradient meta-objective (Equation (13)). Finally, the meta-parameters η are updated according to the gradient of the meta-objective (Equation (4)). 1The meta-objective could even use a discount factor that is longer-sighted than the original problem, perhaps spanning over many episodes. 4 1.4 Conditioned Value and Policy Functions One complication of the approach outlined above is that the return function gη(τ) is non-stationary, adapting along with the meta-parameters throughout the training process. As a result, there is a danger that the value function vθ becomes inaccurate, since it may be approximating old returns. For example, the value function may initially form a good approximation of a short-sighted return with γ = 0, but if γ subsequently adapts to γ = 1 then the value function may suddenly find its approximation is rather poor. The same principle applies for the policy π, which again may have specialised to old returns. To deal with non-stationarity in the value function and policy, we utilise an idea similar to universal value function approximation (UVFA) [Schaul et al., 2015]. The key idea is to provide the metaparameters η as an additional input to condition the value function and policy, as follows: vη θ(S) = vθ([S; eη]), πη θ(S) = πθ([S; eη]), where eη is the embedding of η, [s; eη] denotes concatenation of vectors s and eη, the embedding network eη is updated by backpropagation during training but the gradient is not flowing through η. In this way, the agent explicitly learns value functions and policies that are appropriate for various η. The approximation problem becomes a little harder, but the payoff is that the algorithm can freely shift the meta-parameters without needing to wait for the approximator to “catch up". 1.5 Meta-Gradient Reinforcement Learning in Practice To scale up the meta-gradient approach, several additional steps were taken. For efficiency, the A2C objective and meta-objective were accumulated over all time-steps within an n-step trajectory of experience. The A2C objective was optimised by RMSProp [Tieleman and Hinton, 2012] without momentum [Mnih et al., 2015, 2016, Espeholt et al., 2018]. This is a differentiable function of the meta-parameters, and can therefore be substituted similarly to SGD (see Equation (12)); this process may be simplified by automatic differentiation (Appendix C.2). As in IMPALA, an off-policy correction was used, based on a V-trace return (see Appendix C.1). For efficient implementation, mini-batches of trajectories were computed in parallel; trajectories were reused twice for both the update function and for cross-validation (see Appendix C.3). 2 Illustrative Examples To illustrate the key idea of our meta-gradient approach, we provide two examples that show how the discount factor γ and temporal difference parameter λ, respectively, can be meta-learned. We focus on meta-gradient prediction using the TD(λ) algorithm and a MSE meta-objective with ¯γ = 1 and ¯λ = 1, as described in Section 1.2. For these illustrative examples, we consider state-dependent meta-parameters that can take on a different value in each state. The first example is a 10-step Markov reward process (MRP), that alternates between “signal” and “noise” transitions. Transitions from odd-numbered “signal” states receive a small positive reward, R = +0.1. Transitions from even-numbered “noise” states receive a random reward, R ∼N(0, 1). To ensure that the signal can overwhelm the noise, it is beneficial to terminate the return (low γ) in “noise” states, but to continue the return (high γ) in “signal” states. The second example is a 9-step MRP, that alternates between random rewards and the negation of whatever reward was received on the previous step. The sum of rewards over each such pair of time-steps is zero. There are 9 transitions, so the last reward is always random. To predict accurately, it is beneficial to bootstrap (low λ) in states for which the value function is well-known and equal to zero, but to avoid bootstrapping (high λ) in the noisier, partially observed state for which the return will depend on the previous reward, which cannot be inferred from the state itself. Figure 1 shows the results of meta-gradient prediction using the TD(λ) algorithm. The meta-gradient algorithm was able to adapt both λ and γ to form returns that alternate between high or low values in odd or even states respectively. 5 (a) Chain MRP. For the adaptive γ experiments, the rewards alternate between +0.1 and zero-mean Gaussian on each step. For the adaptive λ experiments, the rewards alternate between zero-mean Gaussians and the negative of whatever reward was received on the previous step: Rt+1 = −Rt. 0 1000 2000 episodes 0.0 0.2 0.4 0.6 0.8 1.0 γ γ during training 1 2 3 4 5 6 7 8 9 state γ after training 0 1000 2000 episodes 0.0 0.2 0.4 0.6 0.8 1.0 λ λ during training 1 2 3 4 5 6 7 8 state λ after training Figure 1: Illustrative results of meta-gradient learning of a state-dependent (a) bootstrapping parameter λ or (b) discount factor γ, in the respective Markov reward processes (top). In each of the subplot shown in the bottom, the first one shows how the meta-parameter γ or λ adapts over the course of training (averaged over 10 seeds - shaded regions cover 20%–80% percentiles). The second plot shows the final value of γ or λ in each state, identifying appropriately high/low values for odd/even states respectively (violin plots show distribution over seeds). 3 Deep Reinforcement Learning Experiments In this section, we demonstrate the advantages of the proposed meta-gradient learning approach using a state-of-the-art actor-critic framework IMPALA [Espeholt et al., 2018]. We focused on adapting the discount factor η = {γ} (which we found to be the most effective meta-parameter in preliminary experiments). We also investigated adapting the bootstrapping parameter λ. For these experiments, the meta-parameters were state-independent, adapting one scalar value for γ and λ respectively (state-dependent meta-parameters did not provide significant benefit in preliminary experiments).2 3.1 Experiment Setup We validate the proposed approach on Atari 2600 video games from Arcade Learning Environment (ALE) [Bellemare et al., 2013], a standard benchmark for deep reinforcement learning algorithms. We build our agent with the IMPALA framework [Espeholt et al., 2018], an efficient distributed implementation of actor-critic architecture [Sutton and Barto, 2018, Mnih et al., 2016]. We utilise the deep ResNet architecture [He et al., 2016] specified in Espeholt et al. [2018], which has shown great advantages over the shallow architecture [Mnih et al., 2015]. Following Espeholt et al., we train our agent for 200 million frames. Our algorithm does not require extra data compared to the baseline algorithms, as each experience can be utilised in both training the agent itself and training the meta parameters η (i.e., each experience can serve as validation data of other experiences). We describe the detailed implementation in the Appendix C.3. For full details about the IMPALA implementation and the specific off-policy correction gη(τ), please refer to Espeholt et al. [2018]. The agents are evaluated on 57 different Atari games and the median of human-normalised scores [Nair et al., 2015, van Hasselt et al., 2016, Wang et al., 2016b, Mnih et al., 2016] are reported. There are two different evaluation protocols. The first protocol is is “human starts” [Nair et al., 2015, Wang et al., 2016b, van Hasselt et al., 2016], which initialises episodes to a state that is randomly sampled from human play. The second protocol is “no-ops starts”, which initialises each episode with a random sequence of no-op actions; this protocol is also used during training. We keep the configuration (e.g., batch size, unroll length, learning rate, entropy cost) the same as specified in Espeholt et al. [2018] for a fair comparison. For self-contained purpose, we provide all of the important hyper-parameters used 2In practice we parameterise η = σ(x), where σ is the logistic function σ(x) = 1 1+e−x ; i.e. the metaparameters are actually the logits of γ and λ. 6 η Human starts No-op starts γ = 0.99 γ = 0.995 γ = 0.99 γ = 0.995 IMPALA {} 144.4% 211.9% 191.8% 257.1% Meta-gradient {λ} 156.6% 214.2% 185.5% 246.5% ¯γ = 0.99 ¯γ = 0.995 ¯γ = 0.99 ¯γ = 0.995 Meta-gradient {γ} 233.2% 267.9% 280.9% 275.5% Meta-gradient {γ, λ} 221.6% 292.9% 242.6% 287.6% Table 1: Results of meta-learning the discount parameter γ, the temporal-difference learning parameter λ, or both γ and λ, compared to the baseline IMPALA algorithm which meta-learns neither. Results are given both for the discount factor γ = 0.99 originally reported in [Espeholt et al., 2018] and also for a tuned discount factor γ = 0.995 (see Appendix D.1); the cross-validated discount factor ¯γ in the meta-objective was set to the same value for a fair comparison. in this paper, including the ones following Espeholt et al. [2018] and the additional meta-learning optimisation hyper-parameters (i.e., meta batch size, meta learning rate β, embedding size for η), in Appendix B. The meta-learning hyper-parameters are chosen according to the performance of six Atari games as common practice in Deep RL Atari experiments [van Hasselt et al., 2016, Mnih et al., 2016, Wang et al., 2016b]. Additional implementation details are provided in Appendix C. 3.2 Experiment Results We compared four variants of the IMPALA algorithm: the original baseline algorithm without metagradients, i.e. η = {}; using meta-gradients with η = {λ}; using meta-gradients with η = {γ}; and using meta-gradients with η = {γ, λ}. The original IMPALA algorithm used a discount factor of γ = 0.99; however, when we manually tuned the discount factor and found that a discount factor of γ = 0.995 performed considerably better (see Appendix D.1). For a fair comparison, we tested our meta-gradient algorithm in both cases. When the discount factor is not adapted, η = {} or η = {λ}, we used a fixed value of γ = 0.99 or γ = 0.995. When the discount factor is adapted, η = {γ} or η = {γ, λ}, we cross-validate with a meta-parameter of ¯γ = 0.99 or ¯γ = 0.995 accordingly in the meta-objective ¯J (Equation (13)). Manual tuning of the λ parameter did not have a significant impact on performance and we therefore compared only to the original value of λ = 1. We summarise the median human-normalised scores in Table 1; individual improvements on each game, compared to the IMPALA baseline, are given in Appendix E.1; and individual plots demonstrating the adaptation of γ and λ are provided in Appendix E.2. The meta-gradient RL algorithm increased the median performance, compared to the baseline algorithm, by a margin between 30% and 80% across “human starts” and “no-op starts" conditions, and with both γ = 0.99 and γ = 0.995. We also verified the architecture choice of conditioning the value function v and policy π on the meta-parameters η. We compared the proposed algorithm with an identical meta-gradient algorithm that adapts the discount factor η = {γ}, but does not provide an embedding of the discount factor as an input to π and v. For this experiment, we used a cross-validation discount factor of ¯γ = 0.995. The human-normalised median score was only 183%, well below the IMPALA baseline with γ = 0.995 (211.9%), and much worse than the full meta-gradient algorithm that includes the discount factor embedding (267.9%). Finally, we compare against the state-of-the-art agent trained on Atari games, namely Rainbow [Hessel et al., 2018], which combines DQN [Mnih et al., 2015] with double Q-learning [van Hasselt et al., 2016, van Hasselt, 2010], prioritised replay [Schaul et al., 2016], dueling networks [Wang et al., 2016b], multi-step targets [Sutton, 1988, Sutton and Barto, 2018], distributional RL [Bellemare et al., 2017], and parameter noise for exploration [Fortunato et al., 2018]. Rainbow obtains median human-normalised score of 153% on the human starts protocol and 223% on the no-ops protocol. In contrast, the meta-gradient agent achieved a median score of 292.9% on human starts and 287.6% on no-ops, with the same number (200M) of frames. We note, however, that there are many differences between the two algorithms, including the deeper neural network architecture used in our work. 7 4 Related Work Among the earliest studies on meta learning (or learning to learn [Thrun and Pratt, 1998]), Schmidhuber [1987] applied genetic programming to itself to evolve better genetic programming algorithms. Hochreiter et al. [2001] used recurrent neural networks like Long Short-Term Memory (LSTM) [Hochreiter and Schmidhuber, 1997] as meta-learners. A recent direction of research has been to meta-learn an optimiser using a recurrent parameterisation [Andrychowicz et al., 2016, Wichrowska et al., 2017]. Duan et al. [2016] and Wang et al. [2016a] proposed to learn a recurrent meta-policy that itself learns to solve the reinforcement learning problem, so that the recurrent policy can generalise into new tasks faster than learning the policy from scratch. Model-Agnostic Meta-Learning (MAML) [Finn et al., 2017a, Finn and Levine, 2018, Finn et al., 2017b, Grant et al., 2018, Al-Shedivat et al., 2018] learns a good initialisation of the model that can adapt quickly to other tasks within a few gradient update steps. These works focus on a multi-task setting in which meta-learning takes place on a distribution of training tasks, to facilitate fast adaptation on an unseen test task. In contrast, our work emphasises the (arguably) more fundamental problem of meta-learning within a single task. In other words we return to the standard formulation of RL as maximising rewards during a single lifetime of interactions with an environment. Contemporaneously with our own work, Zheng et al. [2018] also propose a similar algorithm to learn meta-parameters of the return: in their case an auxiliary reward function that is added to the external rewards. They do not condition their value function or policy, and reuse the same samples for both the update function and the cross-validation step – which may be problematic in stochastic domains when the noise these updates becomes highly correlated. There are many works focusing on adapting learning rate through gradient-based methods [Sutton, 1992, Schraudolph, 1999, Maclaurin et al., 2015, Pedregosa, 2016, Franceschi et al., 2017], Bayesian optimisation methods [Snoek et al., 2012], or evolution based hyper-parameter tuning [Jaderberg et al., 2017a, Elfwing et al., 2017]. In particular, Sutton [1992], introduced the idea of online crossvalidation; however, this method was limited in scope to adapting the learning rate for linear updates in supervised learning (later extended to non-linear updates by Schraudolph [1999]); whereas we focus on the fundamental problem of reinforcement learning, i.e., adapting the return function to maximise the proxy returns we can achieve from the environment. There has also been significant prior work on automatically adapting the bootstrapping parameter λ. Singh and Dayan [1998] empirically analyse the effect of λ in terms of bias, variance and MSE. Kearns and Singh [2000] derive upper bounds on the error of temporal-difference algorithms, and use these bounds to derive schedules for λ. Downey and Sanner [2010] introduced a Bayesian model averaging approach to scheduling λ. Konidaris et al. [2011] derive a maximum-likelihood estimator, TD(γ), that weights the n-step returns according to the discount factor, leading to a parameter-free algorithm for temporal-difference learning with linear function approximation. White and White [2016] introduce an algorithm that explicitly estimates the bias and variance, and greedily adapts λ to locally minimise the MSE of the λ-return. Unlike our meta-gradient approach, these prior approaches exploit i.i.d. assumptions on the trajectory of experience that are not realistic in many applications. 5 Conclusion In this work, we discussed how to learn the meta-parameters of a return function. Our meta-learning algorithm runs online, while interacting with a single environment, and successfully adapts the return to produce better performance. We demonstrated, by adjusting the meta-parameters of a state-ofthe-art deep learning algorithm, that we could achieve much higher performance than previously observed on 57 Atari 2600 games from the Arcade Learning Environment. Our proposed method is more general, and can be applied not just to the discount factor or bootstrapping parameter, but also to other components of the return, and even more generally to the learning update itself. Hyper-parameter tuning has been a thorn in the side of reinforcement learning research for several decades. Our hope is that this approach will allow agents to automatically tune their own hyper-parameters, by exposing them as meta-parameters of the learning update. This may also result in better performance because the parameters can change over time and adapt to novel environments. 8 Acknowledgements The authors would like to thank Matteo Hessel, Lasse Espeholt, Hubert Soyer, Dan Horgan, Aedan Pope and Tim Harley for their kind engineering support; and Joseph Modayil, Andre Barreto for their suggestions and comments on an early version of the paper. The authors would also like to thank anonymous reviewers for their constructive suggestions on improving the paper. 9 References M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, et al. TensorFlow: A system for large-scale machine learning. In OSDI, volume 16, pages 265–283, 2016. M. Al-Shedivat, T. Bansal, Y. Burda, I. Sutskever, I. Mordatch, and P. Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. In ICLR, 2018. M. Andrychowicz, M. Denil, S. Gomez, M. W. Hoffman, D. Pfau, T. Schaul, and N. de Freitas. Learning to learn by gradient descent by gradient descent. In NIPS, pages 3981–3989, 2016. M. G. Bellemare, Y. Naddaf, J. Veness, and M. Bowling. The arcade learning environment: An evaluation platform for general agents. J. Artif. Intell. Res.(JAIR), 47:253–279, 2013. M. G. Bellemare, W. Dabney, and R. Munos. A distributional perspective on reinforcement learning. In ICML, 2017. D. P. Bertsekas and J. N. Tsitsiklis. Neuro-Dynamic Programming. Athena Scientific, 1996. C. Downey and S. Sanner. Temporal difference bayesian model averaging: A bayesian perspective on adapting lambda. In ICML, pages 311–318. Citeseer, 2010. Y. Duan, J. Schulman, X. Chen, P. L. Bartlett, I. Sutskever, and P. Abbeel. RL2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016. S. Elfwing, E. Uchibe, and K. Doya. Online meta-learning by parallel algorithm competition. CoRR, abs/1702.07490, 2017. L. Espeholt, H. Soyer, R. Munos, K. Simonyan, V. Mnih, T. Ward, Y. Doron, V. Firoiu, T. Harley, I. Dunning, et al. IMPALA: Scalable distributed Deep-RL with importance weighted actor-learner architectures. ICML, 2018. C. Finn and S. Levine. Meta-learning and universality: Deep representations and gradient descent can approximate any learning algorithm. ICLR, 2018. C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017a. C. Finn, T. Yu, T. Zhang, P. Abbeel, and S. Levine. One-shot visual imitation learning via metalearning. In CoRL, 2017b. M. Fortunato, M. G. Azar, B. Piot, J. Menick, I. Osband, A. Graves, V. Mnih, R. Munos, D. Hassabis, O. Pietquin, et al. Noisy networks for exploration. In ICLR, 2018. L. Franceschi, M. Donini, P. Frasconi, and M. Pontil. Forward and reverse gradient-based hyperparameter optimization. In ICML, 2017. E. Grant, C. Finn, S. Levine, T. Darrell, and T. Griffiths. Recasting gradient-based meta-learning as hierarchical Bayes. ICLR, 2018. A. Harutyunyan, M. G. Bellemare, T. Stepleton, and R. Munos. Q(λ) with off-policy corrections. In ALT, pages 305–320. Springer, 2016. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. M. Hessel, J. Modayil, H. Van Hasselt, T. Schaul, G. Ostrovski, W. Dabney, D. Horgan, B. Piot, M. Azar, and D. Silver. Rainbow: Combining improvements in deep reinforcement learning. In AAAI, 2018. S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. S. Hochreiter, A. S. Younger, and P. R. Conwell. Learning to learn using gradient descent. In ICANN, pages 87–94. Springer, 2001. 10 M. Jaderberg, V. Dalibard, S. Osindero, W. M. Czarnecki, J. Donahue, A. Razavi, O. Vinyals, T. Green, I. Dunning, K. Simonyan, et al. Population based training of neural networks. arXiv preprint arXiv:1711.09846, 2017a. M. Jaderberg, V. Mnih, W. M. Czarnecki, T. Schaul, J. Z. Leibo, D. Silver, and K. Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In ICLR, 2017b. M. J. Kearns and S. P. Singh. Bias-variance error bounds for temporal difference updates. In COLT, pages 142–147, 2000. D. P. Kingma and J. Ba. ADAM: A method for stochastic optimization. ICLR, 2015. G. Konidaris, S. Niekum, and P. S. Thomas. TDγ: Re-evaluating complex backups in temporal difference learning. In NIPS, pages 2402–2410, 2011. D. Maclaurin, D. Duvenaud, and R. Adams. Gradient-based hyperparameter optimization through reversible learning. In ICML, pages 2113–2122, 2015. A. Mahmood. Incremental Off-policy Reinforcement Learning Algorithms. PhD thesis, University of Alberta, 2017. V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. NIPS workshop, 2013. V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015. V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In ICML, pages 1928–1937, 2016. R. Munos, T. Stepleton, A. Harutyunyan, and M. Bellemare. Safe and efficient off-policy reinforcement learning. In NIPS, pages 1054–1062, 2016. A. Nair, P. Srinivasan, S. Blackwell, C. Alcicek, R. Fearon, A. De Maria, V. Panneershelvam, M. Suleyman, C. Beattie, S. Petersen, et al. Massively parallel methods for deep reinforcement learning. arXiv preprint arXiv:1507.04296, 2015. F. Pedregosa. Hyperparameter optimization with approximate gradient. In ICML, pages 737–746, 2016. D. Precup, R. S. Sutton, and S. P. Singh. Eligibility traces for off-policy policy evaluation. In ICML, pages 759–766, 2000. D. V. Prokhorov and D. C. Wunsch. Adaptive critic designs. TNN, 8(5):997–1007, 1997. J. Randløv and P. Alstrøm. Learning to drive a bicycle using reinforcement learning and shaping. In ICML, volume 98, pages 463–471, 1998. G. A. Rummery and M. Niranjan. On-line Q-learning using connectionist sytems. Technical Report CUED/F-INFENG-TR 166, Cambridge University, UK, 1994. T. Schaul, D. Horgan, K. Gregor, and D. Silver. Universal value function approximators. In ICML, pages 1312–1320, 2015. T. Schaul, J. Quan, I. Antonoglou, and D. Silver. Prioritized experience replay. In ICLR, 2016. J. Schmidhuber. Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universität München, 1987. N. N. Schraudolph. Local gain adaptation in stochastic gradient descent. In ICANN. IET, 1999. S. Singh and P. Dayan. Analytical mean squared error curves for temporal difference learning. Machine Learning, 32(1):5–40, 1998. 11 S. P. Singh, A. G. Barto, and N. Chentanez. Intrinsically motivated reinforcement learning. In NIPS, pages 1281–1288, 2005. J. Snoek, H. Larochelle, and R. P. Adams. Practical Bayesian optimization of machine learning algorithms. In NIPS, pages 2951–2959, 2012. R. S. Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3(1): 9–44, 1988. R. S. Sutton. Adapting bias by gradient descent: An incremental version of delta-bar-delta. In AAAI, pages 171–176, 1992. R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. MIT press Cambridge, 2018. R. S. Sutton, A. R. Mahmood, D. Precup, and H. van Hasselt. A new Q(λ) with interim forward view and Monte Carlo equivalence. In ICML, pages 568–576, 2014. R. S. Sutton, A. R. Mahmood, and M. White. An emphatic approach to the problem of off-policy temporal-difference learning. JMLR, 17(1):2603–2631, 2016. S. Thrun and L. Pratt. Learning to learn. Springer Science & Business Media, 1998. T. Tieleman and G. Hinton. Lecture 6.5-RMSProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26–31, 2012. H. van Hasselt. Double Q-learning. In NIPS, pages 2613–2621, 2010. H. van Hasselt, A. Guez, and D. Silver. Deep reinforcement learning with double Q-learning. In AAAI, volume 16, pages 2094–2100, 2016. H. H. van Seijen, H. P. van Hasselt, S. Whiteson, and M. A. Wiering. A theoretical and empirical analysis of Expected Sarsa. In ADPRL, pages 177–184, 2009. J. X. Wang, Z. Kurth-Nelson, D. Tirumala, H. Soyer, J. Z. Leibo, R. Munos, C. Blundell, D. Kumaran, and M. Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016a. Z. Wang, T. Schaul, M. Hessel, H. Van Hasselt, M. Lanctot, and N. De Freitas. Dueling network architectures for deep reinforcement learning. ICML, 2016b. M. White and A. White. A greedy approach to adapting the trace parameter for temporal difference learning. In AAMAS, pages 557–565, 2016. O. Wichrowska, N. Maheswaranathan, M. W. Hoffman, S. G. Colmenarejo, M. Denil, N. de Freitas, and J. Sohl-Dickstein. Learned optimizers that scale and generalize. In ICML, 2017. R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8(3-4):229–256, May 1992. R. J. Williams and D. Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2):270–280, 1989. Z. Zheng, J. Oh, and S. Singh. On learning intrinsic rewards for policy gradient methods. In NeurIPS, 2018. 12
2018
171
7,332
GPyTorch: Blackbox Matrix-Matrix Gaussian Process Inference with GPU Acceleration Jacob R. Gardner∗, Geoff Pleiss∗, David Bindel, Kilian Q. Weinberger, Andrew Gordon Wilson Cornell University {jrg365,kqw4,andrew}@cornell.edu, {geoff,bindel}@cs.cornell.edu Abstract Despite advances in scalable models, the inference tools used for Gaussian processes (GPs) have yet to fully capitalize on developments in computing hardware. We present an efficient and general approach to GP inference based on Blackbox Matrix-Matrix multiplication (BBMM). BBMM inference uses a modified batched version of the conjugate gradients algorithm to derive all terms for training and inference in a single call. BBMM reduces the asymptotic complexity of exact GP inference from O(n3) to O(n2). Adapting this algorithm to scalable approximations and complex GP models simply requires a routine for efficient matrix-matrix multiplication with the kernel and its derivative. In addition, BBMM uses a specialized preconditioner to substantially speed up convergence. In experiments we show that BBMM effectively uses GPU hardware to dramatically accelerate both exact GP inference and scalable approximations. Additionally, we provide GPyTorch, a software platform for scalable GP inference via BBMM, built on PyTorch. 1 Introduction The past years have witnessed unprecedented innovation in deep learning. This progress has involved innovations in network designs [18, 20, 24, 26, 30], but it also has benefited vastly from improvements in optimization [6], and excellent software implementations such as PyTorch, MXNet, TensorFlow and Caffe [1, 8, 28, 38]. Broadly speaking, the gains in optimization originate in large part from insights in stochastic gradient optimization [6, 7, 23, 27, 29, 31], effectively trading off unnecessary exactness for speed and in some cases regularization. Moreover, the advantages of modern software frameworks for deep learning include rapid prototyping, easy access to specialty compute hardware (such as GPUs), and blackbox optimization through automatic differentiation. Similarly, Gaussian process research has undergone significant innovations in recent years [9, 21, 45, 49–51] — in particular to improve scalability to large data sets. However, the tools most commonly used for GP inference do not effectively utilize modern hardware, and new models require significant implementation efforts. Often, in fact, the model and the inference engine are tightly coupled and consequently many complex models like multi-output GPs and scalable GP approximations require custom inference procedures [5, 22]. This entanglement of model specification and inference procedure impedes rapid prototyping of different model types, and obstructs innovation in the field. In this paper, we address this gap by introducing a highly efficient framework for Gaussian process inference. Whereas previous inference approaches require the user to provide routines for computing the full GP marginal log likelihood for a sufficiently complex model, our framework only requires access to a blackbox routine that performs matrix-matrix multiplications with the kernel matrix and its derivative. Accordingly, we refer to our method as Blackbox Matrix-Matrix (BBMM) Inference. ∗Equal contribution. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In contrast to the Cholesky decomposition, which is at the heart of many existing inference engines, matrix-matrix multiplications fully utilize GPU acceleration. We will demonstrate that this matrixmatrix approach also significantly eases implementation for a wide class of existing GP models from the literature. In particular, we make the following contributions: 1. Inspired by iterative matrix-vector multiplication (MVM)-based inference methods [9, 13, 43, 50, 51], we provide a modified batched version of linear conjugate gradients (mBCG) that provides all computations necessary for both the marginal likelihood and its derivatives. Moreover, mBCG uses large matrix-matrix multiplications that more efficiently utilize modern hardware than both existing Cholesky and MVM based inference strategies. Our approach also circumvents several critical space complexity and numerical stability issues present in existing inference methods. Most notably, BBMM reduces the time complexity of exact GP inference from O(n3) to O(n2). 2. We introduce a method for preconditioning this modified conjugate gradients algorithm based on the pivoted Cholesky decomposition [4, 19]. All required operations with this preconditioner are efficient, and in practice require negligible time. We demonstrate both empirically and theoretically that this preconditioner significantly accelerates inference. 3. We introduce GPyTorch, a new software platform using BBMM inference for scalable Gaussian processes, which is built on top of PyTorch: https://gpytorch.ai. On datasets as large as 3000 data points (until we fill GPU memory) we demonstrate that exact GPs with BBMM are up to 20× faster than GPs using Cholesky-based approaches. Moreover, the popular SKI [50] and SGPR [45] frameworks with BBMM achieve up to 15× and 4× speedups (respectively) on datasets as large as 500,000 data points. Additionally, SKI, SGPR and other scalable approximations are implemented in less than 50 lines of code, requiring only an efficient matrix-matrix multiplication routine. 2 Related Work Conjugate gradients, the Lanczos tridiagonalization algorithm, and their relatives are methods from numerical linear algebra for computing linear solves and solving eigenvalue problems without explicitly computing a matrix. These techniques have been around for decades, and are covered in popular books and papers [11, 12, 17, 32, 36, 37, 42]. These algorithms belong to a broad class of iterative methods known as Krylov subspace methods, which access matrices only through matrixvector multiplies (MVMs). Historically, these methods have been applied to solving large numerical linear algebra problems, particularly those involving sparse matrices that afford fast MVMs. Recently, a number of papers have used these MVM methods for parts of GP inference [9, 13, 15, 34, 39, 43, 49, 50]. One key advantage is that MVM approaches can exploit algebraic structure for increased computational efficiencies. Notably, the structured kernel interpolation (SKI) method [50] uses structured kernel matrices with fast MVMs to achieve a remarkable asymptotic complexity. Dong et al. [13] propose MVM methods for computing stochastic estimates of log determinants and their derivatives using a technique based on Lanczos tridiagonalization [16, 46]. We utilize the same log determinant estimator as Dong et al. [13], except we avoid explicitly using the Lanczos tridiagonalization algorithm which has storage and numerical stability issues [17]. Preconditioning is an effective tool for accelerating the convergence of conjugate gradients. These techniques are far too numerous to review adequately here; however, Saad [42] contains two chapters discussing a variety of preconditioning techniques. Cutajar et al. [10] explores using preconditioned conjugate gradients for exact GP inference, where they use various sparse GP methods (as well as some classical methods) as preconditioners. However, the methods in Cutajar et al. [10] do not provide general purpose preconditioners. For example, methods like Jacobi preconditioning have no effect when using a stationary kernel [10, 51], and many other preconditioners have Ω(n2) complexity, which dominates the complexity of most scalable GP methods. The Pivoted Cholesky decomposition is an efficient algorithm for computing a low-rank decomposition of a positive definite matrix [4, 19], which we use in the context of preconditioning. Harbrecht et al. [19] explores the use of the pivoted Cholesky decomposition as a low rank approximation, although primarily in a scientific computing context. In proving convergence bounds for our preconditioner we explicitly make use of some theoretical results from [19] (see Appendix D). Bach [4] considers using random column sampling as well as the pivoted Cholesky decomposition as a low-rank approximation to kernel matrices. However, Bach [4] treats this decomposition as an 2 approximate training method, whereas we use the pivoted Cholesky decomposition primarily as a preconditioner, which avoids any loss of accuracy from the low rank approximation as well as the complexity of computing derivatives. 3 Background Notation. X will denote a set of n training examples in d dimensions, or equivalently an n×d matrix where the ith row (denoted xi) is the ith training example. y denotes the training labels. k(x, x′) denotes a kernel function, and KXX denotes the matrix containing all pairs of kernel entries, i.e. [KXX]ij = k(xi, xj). kXx∗denotes kernel values between training examples and a test point x∗, e.g. [kXx∗]i = k(xi, x∗). A hat denotes an added diagonal: bKXX = KXX + σ2I. A Gaussian process (GP) is a kernel method that defines a full distribution over the function being modeled, f(x) ∼GP (µ(x), k(x, x′)). Popular kernels include the RBF kernel, k(x, x′) = s exp −(∥x −x′∥)/(2ℓ2)  and the Matérn family of kernels [41]. Predictions with a Gaussian process. Predictions with a GP are made utilizing the predictive posterior distribution, p(f(x∗) | X, y). Given two test inputs x∗and x∗′, the predictive mean for x∗ and the predictive covariance between x∗and x∗′ are given by: µf|D(x∗) = µ(x∗) + k⊤ Xx∗bK−1 XXy, kf|D(x∗, x∗′) = kx∗x∗′ −k⊤ Xx∗bK−1 XXkXx∗′, (1) Training a Gaussian process. Gaussian processes depend on a number of hyperparameters θ. Hyperparameters may include the likelihood noise, kernel lengthscale, inducing point locations [45], or neural network parameters for deep kernel learning [52]. These parameters are commonly learned by minimization or sampling via the negative log marginal likelihood, given (with derivative) by L(θ|X, y) ∝log bKXX −y⊤bK−1 XXy, dL dθ = y⊤bK−1 XX d bKXX dθ bK−1 XXy + Tr bK−1 XX d bKXX dθ ! . (2) 4 Gaussian process inference through blackbox matrix multiplication The goal of our paper is to replace existing inference strategies with a unified framework that utilizes modern hardware efficiently. We additionally desire that complex GP models can be used in a blackbox manner without additional inference rules. To this end, our method reduces the bulk of GP inference to one of the most efficiently-parallelized computations: matrix-matrix multiplication. We call our method Blackbox Matrix-Matrix inference (BBMM) because it only requires a user to specify a matrix multiply routine for the kernel bKXXM and its derivative d b KXX dθ M. Required operations. An inference engine is a scheme for computing all the equations discussed above: the predictive distribution (1), the loss, and its derivative (2). These equations have three operations in common that dominate its time complexity: 1) the linear solve bK−1 XXy, 2) the log determinant log | bKXX|, and 3) a trace term Tr( bK−1 XX d b KXX dθ ). In many implementations, these three quantities are computed using the Cholesky decomposition of bKXX, which is computationally expensive, requiring O(n3) operations, and does not effectively utilize parallel hardware. Recently, there is a growing line of research that computes these operations with iterative routines based on matrix-vector multiplications (MVMs). bK−1 XXy can be computed using conjugate gradients (CG) [9, 10, 43, 50], and the other two quantities can be computed using calls to the iterative Lanczos tridiagonalization algorithm [13, 46]. MVM-based methods are asymptotically faster and more space efficient than Cholesky based methods [13, 50]. Additionally, these methods are able to exploit algebraic structure in the data for further efficiencies [9, 43, 50]. However, they also have disadvantages. The quantities are computed via several independent calls to the CG and stochastic Lanczos quadrature subroutines, which are inherently sequential and therefore do not fully utilize parallel hardware. Additionally, the Lanczos tridiagonalization algorithm requires O(np) space for p iterations and suffers from numerical stability issues due to loss of orthogonality [17]. Modified CG. Our goal is to capitalize on the advantages of MVM-based methods (space-efficiency, ability to exploit structure, etc.) but with efficient routines that are optimized for modern parallel 3 compute hardware. For this purpose, our method makes use of a modified Batched Conjugate Gradients Algorithm (mBCG) algorithm. Standard conjugate gradients takes as input a vector y and a routine for computing a matrix vector product bKXXy, and, after p iterations, outputs an approximate solve up ≈bK−1 XXy (with exact equality when p = n). We modify conjugate gradients to (1) perform linear solves with multiple right hand sides simultaneously, and (2) return tridiagonal matrices corresponding to partial Lanczos tridiagonalizations of bKXX with respect to each right hand side.2 Specifically, mBCG takes as input a matrix [ y z1 · · · zt ], and outputs: [ u0 u1 · · · ut ] = bK−1 XX [ y z1 · · · zt ] and ˜T1, ..., ˜Tt (3) where ˜T1, . . . , ˜Tt are partial Lanczos tridiagonalizations of bKXX with respect to the vectors z1, . . . , zt, which we describe shortly. In what follows, we show how to use a single call to mBCG to compute the three GP inference terms: bK−1 XXy, Tr( bK−1 XX ∂b KXX ∂θ ), and log | bKXX|. bK−1 XXy is equal to u0 in (3), directly returned from mBCG. We describe the other two terms below. Estimating Tr( bK−1 XX ∂b KXX ∂θ ) from CG relies on stochastic trace estimation [3, 14, 25], which allows us to treat this term as a sum of linear solves. Given i.i.d. random variables z1, . . . , zt so that E [zi] = 0 and E  ziz⊤ i  = I, (e.g., zi ∼N(0, I)) the matrix trace Tr(A) can be written as Tr(A) = E  z⊤ i Azi  , such that Tr bK−1 XX d bKXX dθ ! = E " z⊤ i bK−1 XX d bKXX dθ zi # ≈1 t t X i=1  z⊤ i bK−1 XX  d bKXX dθ zi ! (4) is an unbiased estimator of the derivative. This computation motivates the z1, . . . , zt terms in (3): the mBCG call returns the solves bK−1 XX[z1 . . . zt], which yields ui = z⊤ i bK−1 XX . A single matrix multiply with the derivative d b KXX dθ [z1 . . . zt] yields the remaining terms on the RHS. The full trace can then be estimated by elementwise multiplying these terms together and summing, as in (4). Estimating log | bKXX| can be accomplished using the T1, ..., Tt matrices from mBCG. If bKXX = QTQ⊤, with Q orthonormal, then because bKXX and T have the same eigenvalues: log | bKXX| = Tr (log T) = E  z⊤ i (log T)zi  ≈ t X i=1 z⊤ i (log T) zi (5) where log T here denotes the matrix logarithm, and the approximation comes from the same stochastic trace estimation technique used for (4). One approach to obtain a decomposition bKXX = QTQ⊤is to use the Lanczos tridiagonalization algorithm. This algorithm takes the matrix bKXX and a probe vector z and outputs the decomposition QTQ⊤(where z is the first column of Q). However, rather than running the full algorithm, we can instead run p iterations of the algorithm t times, each with a vector z1, ..., zt to obtain t decompositions ˜Q1 ˜T1 ˜Q⊤ 1 , ..., ˜Qt ˜Tt ˜Q⊤ t with ˜Qi ∈Rn×p and ˜Ti ∈Rp×p. We can use these partial decompositions to estimate (5): E  z⊤ i (log T)zi  = E h z⊤ i ˜Qi(log ˜Ti) ˜Q⊤ i zi i ≈1 t t X i=1 z⊤ i ˜Qi(log ˜Ti) ˜Q⊤ i zi = 1 t t X i=1 e⊤ 1 (log ˜Ti)e1, (6) where e1 is the first row of the identity matrix. Running Lanczos with a starting vector zi ensures that all columns of ˜Qi are orthogonal to zi except the first, so ˜Qizi = e1 [13, 16, 46]. In mBCG, we adapt a technique from Saad [42] which allows us to compute ˜T1, . . . , ˜Tt corresponding to the input vectors z1, . . . , zt to mBCG from the coefficients of CG in O(1) additional work per iteration. This approach allows us to compute a log determinant estimate identical to (6) without running the Lanczos algorithm. Thus we avoid the extra computation, storage, and numerical instability associated with Lanczos iterations. We describe the details of this adaptation in Appendix A. Runtime and space. As shown above, we are able to approximate all inference terms from a single call to mBCG. These approximations improve with the number of mBCG iterations. Each iteration 2 mBCG differes from Block CG algorithms [35] in that mBCG returns Lanczos tridiagonalization terms. 4 requires one matrix-matrix multiply with bKXX, and the subsequent work to derive these inference terms takes negligible additional time (Appendix B). Therefore, p iterations of mBCG requires O(nt) space (see Appendix B) and O(p Ξ( bKXX)) time, where Ξ( bKXX) is the time to multiply bKXX by a n×t matrix. This multiplication takes O(n2t) time with a standard matrix. It is worth noting that this is a lower asymptotic complexity that standard Cholesky-based inference, which is O(n3). Therefore, BBMM offers a computational speedup for exact GP inference. As we will show in Section 5, this time complexity can be further reduced with structured data or sparse GP approximations. 4.1 Preconditioning While each iteration of mBCG performs large parallel matrix-matrix operations that utilize hardware efficiently, the iterations themselves are sequential. A natural goal for better utilizing hardware is to trade off fewer sequential steps for slightly more effort per step. We accomplish this goal using preconditioning [12, 17, 42, 47], which introduces a matrix P to solve the related linear system P −1 bKXXu = P −1y instead of bK−1 XXy. Both systems are guaranteed to have the same solution, but the preconditioned system’s convergence depends on the conditioning of P −1 bKXX rather than that of bKXX. We observe two requirements of a preconditioner to be used in general for GP inference. First, in order to ensure that preconditioning operations do not dominate running time when using scalable GP methods, the preconditioner should afford roughly linear time solves and space. Second, we should be able to efficiently compute the log determinant of the preconditioner matrix, log |P|. This is because the mBCG algorithm applied to the preconditioned system estimates log |P −1 bKXX| rather than log | bKXX|. We must therefore compute log | bKXX| = log |P −1 bKXX| + log |P|. The Pivoted Cholesky Decomposition. For one possible preconditioner, we turn to the pivoted Cholesky decomposition. The pivoted Cholesky algorithm allows us to compute a low-rank approximation of a positive definite matrix, KXX ≈LkL⊤ k [19]. We precondition mBCG with (LkL⊤ k + σ2I)−1, where σ2 is the Gaussian likelihood’s noise term. Intuitively, if Pk = LkL⊤ k is a good approximation of KXX, then (Pk + σ2I)−1 bKXX ≈I. While we review the pivoted Cholesky algorithm fully in Appendix C, we would like to emphasize three key properties. First, it can be computed in O(ρ(KXX)k2) time, where ρ(KXX) is the time to access a row (nominally this is O(n)). Second, linear solves with bP = LkL⊤ k + σ2I can be performed in O(nk2) time. Finally, the log determinant of bP can be computed in O(nk2) time. In Figure 6 we empirically show that this preconditioner dramatically accelerates CG convergence. Further, in Appendix D, we prove the following lemma and theorem for univariate RBF kernels: Lemma 1. Let KXX ∈Rn×n be a univariate RBF kernel matrix. Let LkL⊤ k be the rank k pivoted Cholesky decomposition of KXX, and let bPk = LkL⊤ k + σ2I. Then there exists a constant b > 0 so that the condition number κ( bP −1 bKXX) satisfies the following inequality: κ  bP −1 k bKXX  ≜ bP −1 k bKXX 2 bK−1 XX bPk 2 ≤(1 + O(n exp(−bk)))2 . (7) Theorem 1 (Convergence of pivoted Cholesky-preconditioned CG). Let KXX ∈Rn×n be a n × n univariate RBF kernel, and let LkL⊤ k be its rank k pivoted Cholesky decomposition. Assume we are using preconditioned CG to solve the system bK−1 XXy = (KXX + σ2I)−1y with preconditioner bP = (LkL⊤ k + σ2I). Let up be the pth solution of CG, and let u∗= bK−1 XXy be the exact solution. Then there exists some b > 0 such that: ∥u∗−up∥b KXX ≤2 (1/(1 + O(exp(kb)/n))p ∥u∗−u0∥b KXX . (8) Theorem 1 implies that we should expect the convergence of conjugate gradients to improve exponentially with the rank of the pivoted Cholesky decomposition used for RBF kernels. In our experiments we observe significantly improved convergence for other kernels as well (Figure 6). Furthermore, we can leverage Lemma 1 and existing theory from [46] to argue that preconditioning improves our log determinant estimate. In particular, we restate Theorem 4.1 of Ubaru et al. [46] here: 5 Theorem 2 (Theorem 4.1 of Ubaru et al. [46]). Let KXX ∈Rn×n, and let LkL⊤ k be its rank k pivoted Cholesky decomposition. Suppose we run p ≥1 4 r κ  bP −1 k bKXX  log D ϵ iterations of mBCG, where D is a term involving this same condition number that vanishes as k →n (see [46]), and we use t ≥24 ϵ2 log(2/δ) vectors zi for the solves. Let Γ be the log determinant estimate from (6). Then: Pr h | log | bP −1 bKXX| −Γ| ≤ϵ| log | bP −1 bKXX|| i ≥1 −δ. (9) Because Lemma 1 states that the condition number κ  bP −1 k bKXX  decays exponentially with the rank of Lk, Theorem 2 implies that we should expect that the number of CG iterations required to accurately estimate log | bP −1 bKXX| decreases quickly as k increases. In addition, in the limit as k →n we have that log | bKXX| = log | bP|. This is because log | bP −1 bKXX| →0 (since bP −1 bKXX converges to I) and we have that log | bKXX| = log | bP −1 bKXX| + log | bP|. Since our calculation of log | bP| is exact, our final estimate of log | bKXX| becomes more exact as k increases. In future work we hope to derive a more general result that covers multivariate settings and other kernels. 5 Programmability with BBMM We have discussed how the BBMM framework is more hardware efficient than existing inference engines, and avoids numerical instabilities with Lanczos. Another key advantage of BBMM is that it can easily be adapted to complex GP models or structured GP approximations. Indeed BBMM is blackbox by nature, only requiring a routine to perform matrix-multiplications with the kernel matrix and its derivative. Here we provide examples of how existing GP models and scalable approximations can be easily implemented in this framework. The matrix-multiplication routines for the models require at most 50 lines of Python code. All our software, including the following GP implementations with BBMM, are available through our GPyTorch library: https://gpytorch.ai. Bayesian linear regression can be viewed as GP regression with the special kernel matrix bKXX = XX⊤+ σ2I. A matrix multiply with this kernel against an n × t matrix V , (XX⊤+ σ2I)V requires O(tnd) time. Therefore, BBMM requires O(ptnd) time, and is exact in O(tnd2) time. This running time complexity matches existing efficient algorithms for Bayesian linear regression, with no additional derivation. Multi-task Gaussian processes [5] can be adapted in the same fashion [15]. Sparse Gaussian Process Regression (SGPR) [45] and many other sparse GP techniques [21, 40, 44] use the subset of regressors (SoR) approximation for the kernel: bKXX ≈(KXUK−1 UUKUX + σ2I). Performing a matrix-matrix multiply with this matrix requires O(tnm+tm3) time by distributing the vector multiply and grouping terms correctly. This computation is asymptotically faster than the O(nm2 + m3) time required by Cholesky based inference. Augmenting the SoR approximation with a diagonal correction, e.g. as in FITC [44], is similarly straightforward. Structured Kernel Interpolation (SKI) [50], also known as KISS-GP, is an inducing point method designed to provide fast matrix vector multiplies (MVMs) for use with Krylov subspace methods. SKI is thus a natural candidate for BBMM and can benefit greatly from hardware acceleration. SKI is a generalization of SoR, which specifies KXU ≈WKUU, where W is a sparse matrix. For example W can correspond to the coefficients of sparse local cubic convolution interpolation. The SKI approximation applied to the training covariance matrix gives us bKXX ≈(WKUUW ⊤+σ2I). Assuming no structure in KUU a matrix multiply requires O(tn+tm2) time. In KISS-GP [50, 51], the matrix KUU is also chosen to have algebraic structure, such as Kronecker or Toeplitz structure, which further accelerates MVMs. For example, MVMs with a Toeplitz KUU only require O(m log m) time. Thus KISS-GP provides O(tn+tm log m) matrix-matrix multiplies [50]. Compositions of kernels can often be handled automatically. For example, given a BBMM routine for K1, K2, K3, we can automatically perform (K1K2 + K3)M = K1(K2M) + K3M. SGPR and KISS-GP are implemented in this fashion. Given some pre-defined basic compositionality strategies, the kernel matrix multiplication KM in SGPR reduces to defining how to perform K−1 UUM, and 6 Skillcraft n=3338 Gas n=2565 Wine n=1599 Airfoil n=1503 Autompg n=392 0 10 20 30 Speedup over Cholesky CPU (Exact GP) 1x Speedup Cholesky (GPU) GPyTorch (GPU) KEGG n=49k Protein n=45k Kin40k n=40k Elevators n=17k PolTele n=15k 0 2 4 6 8 10 Speed up over Cholesky CPU (SGPR) 1x Speedup Cholesky (GPU) GPyTorch (GPU) Song n=515k Buzz n=583k KEGG n=49k Protein n=45k Kin40k n=40k 0 10 20 30 Speed up Over Dong et al. [13] CPU (DKL+SKI) 1x Speedup Dong et al. [13] (GPU) GPyTorch (GPU) Speedup Factor Speedup Factor Speedup Factor Figure 1: Speedup of GPU-accelerated inference engines. BBMM is in blue, and competing GPU methods are in gray. Left: Exact GPs. Middle: SGPR [21, 45] – speedup over CPU Cholesky-based inference engines. Right: SKI+DKL [50, 52] – speedup over CPU inference of Dong et al. [13]. similarly for KISS-GP it reduces to performing multiplication with a Toeplitz matrix KUUM. For product kernels one can follow Gardner et al. [15]. 6 Results We evaluate the BBMM framework, demonstrating: (1) the BBMM inference engine provides a substantial speed benefit over Cholesky based inference and standard MVM-based CG inference, especially for GPU computing; (2) BBMM achieves comparable or better final test error compared to Cholesky inference, even with no kernel approximations; and (3) preconditioning provides a substantial improvement in the efficiency of our approach. Baseline methods. We test BBMM on three types of GPs: 1. Exact GP models, 2. SGPR inducing point models [21, 45], and 3. SKI models with Toeplitz KUU and deep kernels [50, 52]. For Exact and SGPR, we compare BBMM against Cholesky-based inference engines implemented in GPFlow [33]. GPFlow is presently the fastest implementation of these models with a Cholesky inference engine. Since SKI is not intended for Cholesky inference, we compare BBMM to the inference procedure of Dong et al. [13], implemented in our GPyTorch package. This procedure differers from BBMM in that it computes bK−1 XXy without a preconditioner and computes log | bKXX| and its derivative with the Lanczos algorithm. Datasets. We test Exact models on five datasets from the UCI dataset repository [2] with up to 3500 training examples (the largest possible before all implementations exhausted GPU memory): Skillcraft, Gas, Airfoil, Autompg, and Wine. We test SGPR on larger datasets (n up to 50000): KEGG, Protein, Elevators, Kin40k, and PoleTele. For SKI we test five of the largest UCI datasets (n up to 515000): Song, Buzz, Protein, Kin40k, and KEGG. Experiment details. All methods use the same optimizer (Adam) with identical hyperparameters. In BBMM experiments we use rank k = 5 pivoted Cholesky preconditioners unless otherwise stated. We use a maximum of p = 20 iterations of CG for each solve, and we use t = 10 probe vectors filled with Rademacher random variables to estimate the log determinant and trace terms. SGPR models use 300 inducing points. SKI models use 10,000 inducing points and the deep kernels described in [52]. The BBMM inference engine is implemented in our GPyTorch package. 15 20 25 30 0.0 0.1 0.2 0.3 0.4 0.5 mBCG (float) Cholesky (float) Cholesky (double) CG Iterations Performed Residual Error Figure 2: Solve error for mBCG and Cholesky. All speed experiments are run on an Intel Xeon E5-2650 CPU and an NVIDIA Titan Xp GPU. Speed comparison. Figure 1 shows the speedup obtained by GPU-accelerated BBMM over the leading CPU-based inference engines (Cholesky for Exact/SGPR, Dong et al. [13] for SKI). As would be expected, GPU-accelerated BBMM is faster than CPU-based inference. On Exact and SKI, BBMM is up to 32 times faster than CPU inference, and up to 10 times faster on SGPR. The largest speedups occur on the largest datasets, since smaller datasets experience larger GPU overhead. Notably, BBMM achieves a much larger speedup than GPU ac7 Skillcraft n=3338 Gas n=2565 Wine n=1599 Airfoil n=1503 Autompg n=392 0 1 2 3 4 Test MAE Exact GP Errors (RBF) Cholesky GPyTorch Skillcraft n=3338 Gas n=2565 Wine n=1599 Airfoil n=1503 Autompg n=392 0 1 2 3 4 Test MAE Exact GP Errors (Matern 5/2) Cholesky GPyTorch KEGG n=49k Protein n=45k Kin40k n=40k Elevators n=17k PolTele n=15k 0.0 0.2 0.4 0.6 Test MAE SGPR Errors (Matern 5/2) Cholesky GPyTorch Figure 3: Comparing final Test MAE when using BBMM versus Cholesky based inference. The left two plots compare errors using Exact GPs with RBF and Matern-5/2 kernels, and the final plot compares error using SGPR with a Matern-5/2 kernel on significantly larger datasets. 20 40 60 80 100 CG Iterations 10−3 10−1 Solve Error Protein - Deep RBF Kernel Rank 0 (No Precond.) Rank 2 Rank 5 Rank 9 20 40 60 80 100 CG Iterations 10−4 10−2 100 Solve Error KEGG - Deep Matern-5/2 Kernel No Preconditioner Rank 2 Rank 5 Rank 9 0 25 50 75 100 125 150 Test Time (s) 0 2 Test MAE Protein - Wall clock time No Preconditioner Rank 5 Preconditioner 0 25 50 75 100 125 Test Time (s) 0 10 20 Test MAE KEGG - Wall clock time No Preconditioner Rank 5 Preconditioner Figure 4: The effect of preconditioning on solve errors ∥Kx∗−y∥/∥y∥achieved by linear conjugate gradients using no preconditioner versus rank 2, 5, and 9 pivoted Cholesky preconditioners on 2 UCI benchmark datasets using deep RBF and deep Matern kernels. The hyperparameters of K were learned by maximizing the marginal log likelihood on each dataset. celerated Cholesky methods (Exact, SGPR), which only achieve a roughly 4× speedup. This result underscores the fact that Cholesky methods are not as well suited for GPU acceleration. Additionally, BBMM performs better than the GPU-accelerated version of [13] on SKI. This speedup is because BBMM is able to calculate all inference terms in parallel, while [13] computes the terms in series. Error comparison. In Figure 3 we report test mean average error (MAE) for Exact and SGPR models.3 We demonstrate results using both the RBF kernel and a Matern-5/2 kernel. Across all datasets, our method is at least as accurate in terms of final test MAE. On a few datasets (e.g. Gas, Airfoil, and Wine with Exact GPs) BBMM even improves final test error. CG has a regularizing effects which may improve methods involving the exact kernel over the Cholesky decomposition, where numerical issues resulting from extremely small eigenvalues of the kernel matrix are ignored. For example, Cholesky methods frequently add noise (or “jitter”) to the diagonal of the kernel matrix for numerical stability. It is possible to reduce the numerical instabilities with double precision (see Figure 2); however, this requires an increased amount of computation. BBMM on the other hand avoids adding this noise, without requiring double precision. Preconditioning. To demonstrate the effectiveness of preconditioning at accelerating the convergence of conjugate gradients, we first train a deep RBF kernel model on two datasets, Protein and KEGG, and evaluate the solve error of performing bK−1 XXy in terms of the relative residual ∥bKXXu −y∥/∥y∥ as a function of the number of CG iterations performed. We look at this error when using no preconditioner, as well as a rank 2, 5, and 9 preconditioner. To demonstrate that the preconditioner is not restricted to use with an RBF kernel, we evaluate using a deep RBF kernel on Protein and a 3 SKI models are excluded from Figure 3. This is because the BBMM inference engine and the inference engine of Dong et al. [13] return identical outputs (see Appendix A) even though BBMM is faster. 8 deep Matern-5/2 kernel on KEGG. The results are in the top of Figure 4. As expected based on our theoretical intuitions for this preconditioner, increasing the rank of the preconditioner substantially reduces the number of CG iterations required to achieve convergence. In the bottom of Figure 4, we confirm that these more accurate solves indeed have an effect on the final test MAE. We plot, as a function of the total wallclock time required to compute predictions, the test MAE resulting from using no preconditioner and from using a rank 5 preconditioner. The wallclock time is varied by changing the number of CG iterations used to compute the predictive mean. We observe that, because such a low rank preconditioner is sufficient, using preconditioning results in significantly more accurate solves while having virtually no impact on the running time of each CG iteration. Consequentially, we recommend always using the pivoted Cholesky preconditioner with BBMM since it has virtually no wall-clock overhead and rapidly accelerates convergence. 7 Discussion In this paper, we discuss a novel framework for Gaussian process inference (BBMM) based on blackbox matrix-matrix multiplication routines with kernel matrices. We have implemented this framework and several state-of-the-art GP models in our new publicly available GPyTorch package. Non-Gaussian likelihoods. Although this paper primarily focuses on the regression setting, BBMM is fully compatible with variational techniques such as [22, 53], which are also supported in GPyTorch. These approaches require computing the variational lower bound (or ELBO) rather than the GP marginal log likelihood (2). We leave the exact details of the ELBO derivation to other papers (e.g. [22]). However, we note that a single call to mBCG can be used to compute the KL divergence between two multivariate Gaussians, which is the most computationally intensive term of the ELBO. Avoiding the Cholesky decomposition. A surprising and important take-away of this paper is that it is beneficial to avoid the Cholesky decomposition for GP inference, even in the exact GP setting. The basic algorithm for the Cholesky decomposition (described in Appendix C) involves a divideand conquer approach that can prove ill-suited for parallel hardware. Additionally, the Cholesky decomposition performs a large amount of computation to get a linear solve when fast approximate methods suffice. Ultimately, the Cholesky decomposition of a full matrix takes O(n3) time while CG takes O(n2) time. Indeed, as shown in Figure 2, CG may even provide better linear solves than the Cholesky decomposition. While we use a pivoted version of this algorithm for preconditioning, we only compute the first five rows of this decomposition. By terminating the algorithm very early, we avoid the computational bottleneck and many of the numerical instabilities. It is our hope that this work dramatically reduces the complexity of implementing new Gaussian process models, while allowing for inference to be performed as efficiently as possible. Acknowledgements JRG and AGW are supported by NSF IIS-1563887 and by Facebook Research. GP and KQW are supported in part by the III-1618134, III-1526012, IIS-1149882, IIS-1724282, and TRIPODS1740822 grants from the National Science Foundation. In addition, they are supported by the Bill and Melinda Gates Foundation, the Office of Naval Research, and SAP America Inc. References [1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, et al. Tensorflow: A system for large-scale machine learning. In OSDI, volume 16, pages 265–283, 2016. [2] A. Asuncion and D. Newman. Uci machine learning repository. https://archive.ics.uci.edu/ ml/, 2007. Last accessed: 2018-05-18. [3] H. Avron and S. Toledo. Randomized algorithms for estimating the trace of an implicit symmetric positive semi-definite matrix. Journal of the ACM (JACM), 58(2):8, 2011. [4] F. Bach. Sharp analysis of low-rank kernel matrix approximations. In COLT, 2013. [5] E. V. Bonilla, K. M. Chai, and C. Williams. Multi-task Gaussian process prediction. In NIPS, 2008. 9 [6] L. Bottou. Large-scale machine learning with stochastic gradient descent. In COMPSTAT, pages 177–186. Springer, 2010. [7] P. Chaudhari, A. Choromanska, S. Soatto, Y. LeCun, C. Baldassi, C. Borgs, J. Chayes, L. Sagun, and R. Zecchina. Entropy-sgd: Biasing gradient descent into wide valleys. arXiv preprint arXiv:1611.01838, 2016. [8] T. Chen, M. Li, Y. Li, M. Lin, N. Wang, M. Wang, T. Xiao, B. Xu, C. Zhang, and Z. Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274, 2015. [9] J. P. Cunningham, K. V. Shenoy, and M. Sahani. Fast Gaussian process methods for point process intensity estimation. In ICML, 2008. [10] K. Cutajar, M. Osborne, J. Cunningham, and M. Filippone. Preconditioning kernel matrices. In ICML, 2016. [11] B. N. Datta. Numerical linear algebra and applications, volume 116. Siam, 2010. [12] J. W. Demmel. Applied numerical linear algebra, volume 56. Siam, 1997. [13] K. Dong, D. Eriksson, H. Nickisch, D. Bindel, and A. G. Wilson. Scalable log determinants for Gaussian process kernel learning. In NIPS, 2017. [14] J. K. Fitzsimons, M. A. Osborne, S. J. Roberts, and J. F. Fitzsimons. Improved stochastic trace estimation using mutually unbiased bases. arXiv preprint arXiv:1608.00117, 2016. [15] J. R. Gardner, G. Pleiss, R. Wu, K. Q. Weinberger, and A. G. Wilson. Product kernel interpolation for scalable Gaussian processes. In AISTATS, 2018. [16] G. H. Golub and G. Meurant. Matrices, moments and quadrature with applications. Princeton University Press, 2009. [17] G. H. Golub and C. F. Van Loan. Matrix computations, volume 3. JHU Press, 2012. [18] R. H. Hahnloser, R. Sarpeshkar, M. A. Mahowald, R. J. Douglas, and H. S. Seung. Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit. Nature, 405(6789):947, 2000. [19] H. Harbrecht, M. Peters, and R. Schneider. On the low-rank approximation by the pivoted cholesky decomposition. Applied numerical mathematics, 62(4):428–440, 2012. [20] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016. [21] J. Hensman, N. Fusi, and N. D. Lawrence. Gaussian processes for big data. In UAI, 2013. [22] J. Hensman, A. G. d. G. Matthews, and Z. Ghahramani. Scalable variational Gaussian process classification. In ICML, 2015. [23] S. Hochreiter and J. Schmidhuber. Flat minima. Neural Computation, 9(1):1–42, 1997. [24] G. Huang, Z. Liu, K. Q. Weinberger, and L. van der Maaten. Densely connected convolutional networks. In CVPR, 2017. [25] M. F. Hutchinson. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 19(2):433–450, 1990. [26] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. [27] P. Izmailov, D. Podoprikhin, T. Garipov, D. Vetrov, and A. G. Wilson. Averaging weights leads to wider optima and better generalization. In Uncertainty in Artificial Intelligence (UAI), 2018. [28] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. In ACMMM, pages 675–678. ACM, 2014. [29] N. S. Keskar, D. Mudigere, J. Nocedal, M. Smelyanskiy, and P. T. P. Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016. [30] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. 10 [31] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [32] C. Lanczos. An iteration method for the solution of the eigenvalue problem of linear differential and integral operators. United States Governm. Press Office Los Angeles, CA, 1950. [33] A. G. d. G. Matthews, M. van der Wilk, T. Nickson, K. Fujii, A. Boukouvalas, P. León-Villagrá, Z. Ghahramani, and J. Hensman. Gpflow: A Gaussian process library using TensorFlow. Journal of Machine Learning Research, 18(40):1–6, 2017. [34] I. Murray. Gaussian processes and fast matrix-vector multiplies. In ICML Workshop on Numerical Mathematics in Machine Learning, 2009. [35] D. P. O’Leary. The block conjugate gradient algorithm and related methods. Linear algebra and its applications, 29:293–322, 1980. [36] C. Paige. Practical use of the symmetric Lanczos process with re-orthogonalization. BIT Numerical Mathematics, 10(2):183–195, 1970. [37] B. N. Parlett. A new look at the Lanczos algorithm for solving symmetric systems of linear equations. Linear algebra and its applications, 29:323–346, 1980. [38] A. Paszke, S. Gross, S. Chintala, G. Chanan, E. Yang, Z. DeVito, Z. Lin, A. Desmaison, L. Antiga, and A. Lerer. Automatic differentiation in PyTorch. 2017. [39] G. Pleiss, J. R. Gardner, K. Q. Weinberger, and A. G. Wilson. Constant-time predictive distributions for Gaussian processes. In ICML, 2018. [40] J. Quiñonero-Candela and C. E. Rasmussen. A unifying view of sparse approximate Gaussian process regression. Journal of Machine Learning Research, 6(Dec):1939–1959, 2005. [41] C. E. Rasmussen and C. K. Williams. Gaussian processes for machine learning, volume 1. MIT press Cambridge, 2006. [42] Y. Saad. Iterative methods for sparse linear systems, volume 82. siam, 2003. [43] Y. Saatçi. Scalable inference for structured Gaussian process models. PhD thesis, University of Cambridge, 2012. [44] E. Snelson and Z. Ghahramani. Sparse Gaussian processes using pseudo-inputs. In NIPS, 2006. [45] M. K. Titsias. Variational learning of inducing variables in sparse Gaussian processes. In AISTATS, pages 567–574, 2009. [46] S. Ubaru, J. Chen, and Y. Saad. Fast estimation of tr (f (a)) via stochastic Lanczos quadrature. SIAM Journal on Matrix Analysis and Applications, 38(4):1075–1099, 2017. [47] H. A. Van der Vorst. Iterative Krylov methods for large linear systems, volume 13. Cambridge University Press, 2003. [48] A. J. Wathen and S. Zhu. On spectral distribution of kernel matrices related to radial basis functions. Numerical Algorithms, 70(4):709–726, 2015. [49] A. G. Wilson. Covariance kernels for fast automatic pattern discovery and extrapolation with Gaussian processes. PhD thesis, University of Cambridge, 2014. [50] A. G. Wilson and H. Nickisch. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). In ICML, 2015. [51] A. G. Wilson, C. Dann, and H. Nickisch. Thoughts on massively scalable Gaussian processes. arXiv preprint arXiv:1511.01870, 2015. [52] A. G. Wilson, Z. Hu, R. Salakhutdinov, and E. P. Xing. Deep kernel learning. In AISTATS, 2016. [53] A. G. Wilson, Z. Hu, R. R. Salakhutdinov, and E. P. Xing. Stochastic variational deep kernel learning. In NIPS, 2016. 11
2018
172
7,333
Spectral Signatures in Backdoor Attacks Brandon Tran EECS MIT Cambridge, MA 02139 btran@mit.edu Jerry Li Simons Institute Berkeley, CA 94709 jerryzli@berkeley.edu Aleksander M ˛adry EECS MIT madry@mit.edu Abstract A recent line of work has uncovered a new form of data poisoning: so-called backdoor attacks. These attacks are particularly dangerous because they do not affect a network’s behavior on typical, benign data. Rather, the network only deviates from its expected output when triggered by a perturbation planted by an adversary. In this paper, we identify a new property of all known backdoor attacks, which we call spectral signatures. This property allows us to utilize tools from robust statistics to thwart the attacks. We demonstrate the efficacy of these signatures in detecting and removing poisoned examples on real image sets and state of the art neural network architectures. We believe that understanding spectral signatures is a crucial first step towards designing ML systems secure against such backdoor attacks. 1 Introduction Deep learning has achieved widespread success in a variety of settings, such as computer vision [20, 16], speech recognition [14], and text analysis [7]. As models from deep learning are deployed for increasingly sensitive applications, it becomes more and more important to consider the security of these models against attackers. Perhaps the first setting developed for building secure deep learning models was adversarial examples [13, 26, 21, 12, 29, 4, 24, 32]. Here, test examples are perturbed by seemingly imperceptible amounts in order to change their classification under a neural network classifier. This demonstrates the ease with which an adversary can fool a trained model. An orthogonal, yet also important, concern in the context the security of neural nets is their vulnerability to manipulation of their training sets. Such networks are often fairly data hungry, resulting in training on data that could not be properly vetted. Consequently, any gathered data might have been manipulated by a malicious adversary and cannot necessarily be trusted. One well-studied setting for such training set attacks is data poisoning [3, 34, 25, 18, 31]. Here, the adversary injects a small number of corrupted training examples, with a goal of degrading the model’s generalization accuracy. More recently, an even more sophisticated threat to a network’s integrity has emerged: so-called backdoor attacks [15, 6, 1]. Rather than causing the model’s test accuracy to degrade, the adversary’s goal is for the network to misclassify the test inputs when the data point has been altered by the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. adversary’s choice of perturbation. This is particularly insidious since the network correctly classifies typical test examples, and so it can be hard to detect if the dataset has been corrupted. Oftentimes, these attacks are straightforward to implement. Many simply involve adding a small number of corrupted examples from a chosen attack class, mislabelled with a chosen target class. This simple change to the training set is then enough to achieve the desired results of a network that correctly classifies clean test inputs while also misclassifying backdoored test inputs. Despite their apparent simplicity, though, no effective defenses to these attacks are known. Our Contribution. In this paper, we demonstrate a new property of backdoor attacks. Specifically, we show that these attacks tend to leave behind a detectable trace in the spectrum of the covariance of a feature representation learned by the neural network. We call this “trace” a spectral signature. We demonstrate that one can use this signature to identify and remove corrupted inputs. On CIFAR-10, which contains 5000 images for each of 10 labels, we show that with as few as 250 corrupted training examples, the model can be trained to misclassify more than 90% of test examples modified to contain the backdoor. In our experiments, we are able to use spectral signatures to reliably remove many—in fact, often all—of the corrupted training examples, reducing the misclassification rate on backdoored test points to within 1% of the rate achieved by a standard network trained on a clean training set. Moreover, we provide some intuition for why one might expect an overparameterized neural network to naturally install a backdoor, and why this also lends itself to the presence of a spectral signature. Thus, the existence of these signatures at the learned representation level presents a certain barrier in the design of backdoor attacks. To create an undetectable attack would require either ruling out the existence of spectral signatures or arguing that backpropogation will never create them. We view this as a first step towards developing comprehensive defenses against backdoor attacks. 1.1 Spectral signatures from learned representations Our notion of spectral signatures draws from a new connection to recent techniques developed for robust statistics [8, 22, 5, 9]. When the training set for a given label has been corrupted, the set of training examples for this label consists of two sub-populations. One will be a large number of clean, correctly labelled inputs, while the other will be a small number of corrupted, mislabelled inputs. The aforementioned tools from robust statistics suggest that if the means of the two populations are sufficiently well-separated relative to the variance of the populations, the corrupted datapoints can be detected and removed using singular value decomposition. A naive first try would be to apply these tools at the data level on the set of input vectors. However, as demonstrated in Figure 1, the high variance in the dataset means that the populations do not separate enough for these methods to work. On the other hand, as we demonstrate in Figure 1, when the data points are mapped to the learned representations of the network, such a separation does occur. Intuitively, any feature representations for a classifier would be incentivized to boost the signal from a backdoor, since the backdoor alone is a strong indicator for classification. As the signal gets boosted, the poisoned inputs become more and more distinguished from the clean inputs. As a result, by running these robust statistics tools on the learned representation, one can detect and remove backdoored inputs. In Section 4, we validate these claims empirically. We demonstrate the existence of spectral signatures for backdoor attacks on image classification tasks and show that they can be used to effectively clean the corrupted training set. Interestingly, we note that the separation requires using these recent techniques from robust statistics to detect it, even at the learned representation level. In particular, one could consider computing weaker statistics, such as ℓ2 norms of the representations or correlations with a random vector, in an attempt to separate the clean and poisoned sub-populations. However, as shown in Figure 1, these methods appear to be insufficient. While there is some separation using ℓ2 norms, there is still substantial overlap between the norms of the learned representations of the true images and the backdoored images. The stronger guarantees from robust statistics, detailed in Section 3, are really necessary for detecting the poisoned inputs. 1.2 Related Works To the best of our knowledge, the first instance of backdoor attacks for deep neural networks appeared in [15]. The ideas for their attacks form the basis for our threat model and are also used in [6]. 2 Figure 1: Plot of correlations for 5000 training examples correctly labelled and 500 poisoned examples incorrectly labelled. The values for the clean inputs are in blue, and those for the poisoned inputs are in green. We include plots for the computed ℓ2 norms, correlation with a random vector, and correlation with the top singular vector of the covariance matrix of examples (respectively, representations). Another line of work on data poisoning deal with attacks that are meant to degrade the model’s generalization accuracy. The idea of influence functions [18] provides a possible way to detect such attacks, but do not directly apply to backdoor attacks which do not cause misclassification on typical test examples. The work in [28] creates an attack that utilizes data poisoning poisoning in a different way. While similar in some ways to the poisoning we consider, their corruption attempts to degrade the model’s test performance rather than install a backdoor. Outlier removal defenses are studied in [31], but while our methods detect and remove outliers of a certain kind, their evaluation only applies in the test accuracy degradation regime. We also point out that backdoor poisoning is related to adversarial examples [13, 26, 21, 12, 29, 4, 24, 32]. A model robust to ℓp perturbations of size up to ε would then be robust to any watermarks that only change the input within this allowed perturbation range. However, the backdoors we consider fall outside the range of adversarially trained networks; allowing a single pixel to change to any value would require a very large value of ε. Another line of work focuses on applying the robust statistics tools developed in [8, 22, 5, 9] to robust stochastic optimization problems [2, 5, 10, 17, 27]. Again, the defenses in these papers target attacks that degrade test accuracy. Nonetheless, for completeness, we checked and found that these techniques were unable to reliably detect the corrupted data points. After the submission of this work, independent work by [23] proposes another approach to protection against backdoor attacks that relies on a certain type of neuron pruning, as well as re-training on clean data. 2 Finding signatures in backdoors In this section, we describe our threat model and present our detection algorithm. 2.1 Threat Model We will consider a threat model related to the work of [15] in which a backdoor is inserted into the model. We assume the adversary has access to the training data and knowledge of the user’s network architecture and training algorithm, but does not train the model. Rather, the user trains the classifier, but on the possibly corrupted data received from an outside source. 3 The adversary’s goal is for the poisoned examples to alter the model to satisfy two requirements. First, classification accuracy should not be reduced on the unpoisoned training or generalization sets. Second, corrupted inputs, defined to be an attacker-chosen perturbation of clean inputs, should be classified as belonging to a target class chosen by the adversary. Essentially, the adversary injects poisoned data in such a way that the model predicts the true label for true inputs while also predicting the poisoned label for corrupted inputs. As a result, the poisoning is in some sense "hidden" due to the fact that the model only acts differently in the presence of the backdoor. We provide an example of such an attack in Figure 2. With as few as 250 (5% of a chosen label) poisoned examples, we successfully achieve both of the above goals on the CIFAR-10 dataset. Our trained models achieve an accuracy of approximately 92 −93% on the original test set, which is what a model with a clean dataset achieves. At the same time, the models classify close to 90% of the backdoored test set as belonging to the poisoned label. Further details can be found in Section 4. Additional examples can be found in [15]. Natural Poisoned Natural Poisoned “airplane” “bird” “automobile” “cat” Figure 2: Examples of test images on which the model evaluates incorrectly with the presence of a backdoor. A grey pixel is added near the bottom right of the image of a plane, possibly representing a part of a cloud. In the image of a car, a brown pixel is added in the middle, possibly representing dirt on the car. Note that in both cases, the backdoor (pixel) is not easy to detect with the human eye. The images were generated from the CIFAR10 dataset. 2.2 Detection and Removal of Watermarks We will now describe our detection algorithm. An outline of the algorithm can be found in Figure 3. We take a black-box neural network with some designated learned representation. This can typically be the representation from an autoencoder or a layer in a deep network that is believed to represent high level features. Then, we take the representation vectors for all inputs of each label. The intuition here is that if the set of inputs with a given label consists of both clean examples as well as corrupted examples from a different label set, the backdoor from the latter set will provide a strong signal in this representation for classification. As long as the signal is large in magnitude, we can detect it via singular value decomposition and remove the images that provide the signal. In Section 3, we formalize what we mean by large in magnitude. More detailed pseudocode is provided in Algorithm 1. 3 Spectral signatures for backdoored data in learned representations In this section we give more rigorous intuition as to why learned representations on the corrupted data may cause the attack to have a detectable spectral signature. 3.1 Outlier removal via SVD We first give a simple condition under which spectral techniques are able to reliably detect outliers: Definition 3.1. Fix 1/2 > ε > 0. Let D, W be two distributions with finite covariance, and let F = (1 −ε)D + εW be the mixture of D, W with mixing weights (1 −ε) and ε, respectively. We say that D, W are ε-spectrally separable if there exists a t > 0 so that Pr X∼D [|⟨X −µF , v⟩| > t] < ε Pr X∼W [|⟨X −µF , v⟩| < t] < ε , where v is the top eigenvector of the covariance of F. 4 Data (X, Y ) Train SVD Re-train extract representations compute + remove top scores Figure 3: Illustration of the pipeline. We first train a neural network on the data. Then, for each class, we extract a learned representation for each input from that class. We next take the singular value decomposition of the covariance matix of these representations and use this to compute an outlier score for each example. Finally, we remove inputs with the top scores and re-train. Algorithm 1 1: Input: Training set Dtrain, randomly initialized neural network model L providing a feature representation R, and upper bound on number of poisoned training set examples ε. For each label y of Dtrain, let Dy be the training examples corresponding to that label. 2: Train L on Dtrain. 3: Initialize S ←{}. 4: for all y do 5: Set n = | Dy |, and enumerate the examples of Dy as x1, . . . , xn. 6: Let bR = 1 n Pn i=1 R(xi). 7: Let M = [R(xi) −bR]n i=1 be the n × d matrix of centered representations. 8: Let v be the top right singular vector of M. 9: Compute the vector τ of outlier scores defined via τi =  (R(xi) −bR) · v 2 . 10: Remove the examples with the top 1.5 · ε scores from Dy. 11: S ←S ∪Dy 12: end for 13: Dtrain ←S. 14: Re-train L on Dtrain from a random initialization. 15: Return L. Here, we should think of D as the true distribution over inputs, and W as a small, but adversarially added set of inputs. Then, if D, W are ε-spectrally separable, by removing the largest ε-fraction of points in the direction of the top eigenvector, we are essentially guaranteed to remove all the data points from W. Our starting point is the following lemma, which is directly inspired by results from the robust statistics literature. While these techniques are more or less implicit in the robust statistics literature, we include them here to provide some intuition as to why spectral techniques should detect deviations in the mean caused by a small sub-population of poisoned inputs. Lemma 3.1. Fix 1/2 > ε > 0. Let D, W be distributions with mean µD, µW and covariances ΣD, ΣW ⪯σ2I, and let F = (1 −ε)D + εW. Then, if ∥µD −µW ∥2 2 ≥6σ2 ε , then D, W are ε-spectrally separable. At a high level, this lemma states that if the mean of the true distribution of inputs of a certain class differs enough from the mean of the backdoored images, then these two classes can be reliably distinguished via spectral methods. We note here that Lemma 3.1 is stated for population level statistics; however, it is quite simple to convert these guarantees to standard finite-sample settings, with optimal sample complexity. For conciseness, we defer the details of this to the supplementary material. Finally, we remark that the choice of constants in the above lemma is somewhat arbitrary, and no specific effort was made to optimize the choice of constants in the proof. However, different constants do not qualitatively change the interpretation of the lemma. The rest of this section is dedicated to a proof sketch of Lemma 3.1. The omitted details can be found the supplementary material. 5 Proof sketch of Lemma 3.1. By Chebyshev’s inequality, we know that Pr X∼D[|⟨X −µD, u⟩| > t] ≤σ2 t2 , and (1) Pr X∼W[|⟨X −µW , u⟩| > t] ≤σ2 t2 , (2) for any unit vector u. Let ∆= µD −µW , and recall v is the top eigenvector of ΣF . The “ideal” choice of u in (1) and (2) that would maximally separate points from D and points from W would be simply a scaled version of ∆. However, one can show that any unit vector which is sufficiently correlated to ∆also suffices: Lemma 3.2. Let α > 0, and let u be a unit vector so that |⟨u, ∆⟩| > α · σ/√ε. Then there exists a t > 0 so that Pr X∼D[|⟨X −µD, u⟩| > t] < ε , and Pr X∼W[|⟨X −µW , u⟩| > t] < 1 (α −1)2 ε . The proof of this is deferred to the supplementary material. What remains to be shown is that v satisfies this condition. Intuitively, this works because ∆is sufficiently large that its signal is noticeable in the spectrum of ΣF . As a result, v (being the top eigenvector of ΣF ) must have non-negligible correlation with ∆. Concretely, this allows us to show the following lemma, whose proof we defer to the supplementary material. Lemma 3.3. Under the assumptions of Lemma 3.1, we have ⟨v, ∆⟩2 ≥2σ2 ε . Finally, combining Lemmas 3.2 and 3.3 imply Lemma 3.1. 4 Experiments 4.1 Setup We study backdoor poisoning attacks on the CIFAR10 [19] dataset, using a standard ResNet [16] model with 3 groups of residual layers with filter sizes [16, 16, 32, 64] and 5 residual units per layer. Unlike more complicated feature extractors such as autoencoders, the standard ResNet does not have a layer tuned to be a learned representation for any desired task. However, one can think of any of the layers as modeling different kinds of representations. For example, the first convolutional layer is typically believed to represent edges in the image while the latter layers learn "high level" features [11]. In particular, it is common to treat the last few layers as representations for classification. Our experiments showed that our outlier removal method successfully removes the backdoor when applied on many of the later layers. We choose to report the results for the second to last residual unit simply because, on average, the method applied to this layer removed the most poisoned images. We also remark that we tried our method directly on the input. Even when data augmentation is removed, so that the backdoor is not flipped or translated, the signal is still not strong enough to be detected, suggesting that a learned representation amplifying the signal is really necessary. We note that we also performed the outlier removal on a VGG [30] model. Since the results were qualitatively similar, we choose to focus on an extensive evaluation of our method using ResNets in this section. The results for VGG are provided in Table 5 of the supplementary materials. 4.2 Attacks Our standard attack setup consists of a pair of (attack, target) labels, a backdoor shape (pixel, X, or L), an epsilon (number of poisoned images), a position in the image, and a color for the mark. For our experiments, we choose 4 pairs of labels by hand- (airplane, bird), (automobile, cat), (cat, dog), (horse, deer)- and 4 pairs randomly- (automobile, dog), (ship, frog), (truck, bird), (cat,horse). Then, for each pair of labels, we generate a random shape, position, and color for the backdoor. We also use the hand-chosen backdoors of Figure 2. 6 4.3 Attack Statistics In this section, we show some statistics from the attacks that give motivation for why our method works. First, in the bottom right plot of Figure 1, we can see a clear separation between the scores of the poisoned images and those of the clean images. This is reflected in the statistics displayed in Table 1. Here, we record the norms of the mean of the representation vectors for both the clean inputs as well as the clean plus corrupted inputs. Then, we record the norm of the difference in mean to measure the shift created by adding the poisoned examples. Similarly, we have the top three singular values for the mean-shifted matrix of representation vectors of both the clean examples and the clean plus corrupted examples. We can see from the table that there is quite a significant increase in the singular values upon addition of the poisoned examples. The statistics gathered suggest that our outlier detection algorithm should succeed in removing the poisoned inputs. Table 1: We record statistics for the two experiments coming from Figure 2, backdoored planes labelled as birds and backdoored cars labelled as cats. For both the clean dataset and the clean plus poisoned dataset, we record the norm of the mean of the representation vectors and the top three singular values of the covariance matrix formed by these vectors. We also record the norm of the difference in the means of the vectors from the two datasets. Experiment Norm of Mean Shift in Mean 1st SV 2nd SV 3rd SV Birds only 78.751 N/A 1194.223 1115.931 967.933 Birds + planes 78.855 6.194 1613.486 1206.853 1129.711 Cats + cars 89.409 N/A 1016.919 891.619 877.743 Cats + poison 89.690 7.343 1883.934 1030.638 913.895 4.4 Evaluating our Method In Tables 2, we record the results for a selection of our training iterations. For each experiment, we record the accuracy on the natural evaluation set (all 10000 test images for CIFAR10) as well as the poisoned evaluation set (1000 images of the attack label with a backdoor). We then record the number of poisoned images left after one removal step and the accuracies upon retraining. The table shows that for a variety of parameter choices, the method successfully removes the attack. Specifically, the clean and poisoned test accuracies for the second training iteration after the removal step are comparable to those achieved by a standard trained network on a clean dataset. For reference, a standard trained network on a clean training set classifies a clean test set with accuracy 92.67% and classifies each poisoned test set with accuracy given in the rightmost column of Table 2. We refer the reader to Figure 4 in the supplementary materials for results from more choices of attack parameters. We also reran the experiments multiple times with different random choices for the attacks. For each run that successfully captured the backdoor in the first iteration, which we define as recording approximately 90% or higher accuracy on the poisoned set, the results were similar to those recorded in the table. As an aside, we note that 5% poisoned images is not enough to capture the backdoor according to our definition in our examples from Figure 2, but 10% is sufficient. 4.5 Sub-populations Our outlier detection method crucially relies on the difference in representation between the clean and poisoned examples being much larger than the difference in representations within the clean examples. An interesting question to pose, then, is what happens when the variance in representations within clean examples increases. A natural way this may happen is by combining labels; for instance, by combining “cats” and “dogs” into a shared class called “pets”. When this happens, the variance in the representations for images in this shared class increases. How robust are our methods to this sort of perturbation? Do spectral signatures arise even when the variance in representations has been artificially increased? In this section, we provide our experiments exploring our outlier detection method when one class class consists of a heterogenous mix of different populations. As mentioned above, we combined “cats” and “dogs” into a class we call “pets”. Then, we install a backdoor of poisoned automobiles 7 Table 2: Main results for a selection of different attack parameters. Natural and poisoned accuracy are reported for two iterations, before and after the removal step. We compare to the accuracy on each poisoned test set obtained from a network trained on a clean dataset (Std Pois). The attack parameters are given by a backdoor attack image, target label, and percentage of added images. Sample Target Epsilon Nat 1 Pois 1 # Pois Left Nat 2 Pois 2 Std Pois bird 5% 92.27% 74.20% 57 92.64% 2.00% 1.20% 10% 92.32% 89.80% 7 92.68% 1.50% cat 5% 92.45% 83.30% 24 92.24% 0.20% 0.10% 10% 92.39% 92.00% 0 92.44% 0.00% dog 5% 92.17% 89.80% 7 93.01% 0.00% 0.00% 10% 92.55% 94.30% 1 92.64% 0.00% horse 5% 92.60% 99.80% 0 92.57% 1.00% 0.80% 10% 92.26% 99.80% 0 92.63% 1.20% cat 5% 92.86% 98.60% 0 92.79% 8.30% 8.00% 10% 92.29% 99.10% 0 92.57% 8.20% deer 5% 92.68% 99.30% 0 92.68% 1.10% 1.00% 10% 92.68% 99.90% 0 92.74% 1.60% frog 5% 92.87% 88.80% 10 92.61% 0.10% 0.30% 10% 92.82% 93.70% 3 92.74% 0.10% bird 5% 92.52% 97.90% 0 92.69% 0.00% 0.00% 10% 92.68% 99.30% 0 92.45% 0.50% labeled as pets, as well as poisoned pets labeled as automobiles. With these parameters, we train our Resnet and perform outlier detection. The results are provided in Table 3. We can see from these results that in both cases, the automobile examples still have a representation sufficiently separated from the combined cats and dogs representations. 5 Conclusion In this paper, we present the notion of spectral signatures and demonstrate how they can be used to detect backdoor poisoning attacks. Our method relies on the idea that learned representations for classifiers amplify signals crucial to classification. Since the backdoor installed by these attacks change an example’s label, the representations will then contain a strong signal for the backdoor. Based off this assumption, we then apply tools from robust statistics to the representations in order to detect and remove the poisoned data. We implement our method for the CIFAR10 image recognition task and demonstrate that we can detect outliers on real image sets. We provide statistics showing that at the learned representation level, the poisoned inputs shift the distribution enough to be detected with SVD methods. Furthermore, we also demonstrate that the learned representation is indeed necesary; naively utilizing robust statistics tools at the data level does not provide a means with which to remove backdoored examples. One interesting direction from our work is to further explore the relations to adversarial examples. As mentioned previously in the paper, models robust to a group of perturbations are then robust to backdoors lying in that group of perturbations. In particular, if one could train a classifier robust to ℓ0 perturbations, then backdoors consisting of only a few pixels would not be captured. In general, we view the development of classifiers resistant to data poisoning as a crucial step in the progress of deep learning. As neural networks are deployed in more situations, it is important to study how robust they are, especially to simple and easy to implement attacks. This paper demonstrates that machinery from robust statistics and classical machine learning can be very useful 8 Table 3: Results for a selection of different attack parameters on a combined label of cats and dogs, that we call pets. Natural and poisoned accuracy are reported for two iterations, before and after the removal step. The attack parameters are given by a backdoor attack image, target label, and percentage of added images. Sample Target Epsilon Nat 1 Pois 1 # Pois Left Nat 2 Pois 2 pets 5% 93.99% 95.80% 0 94.18% 0.30% 10% 94.05% 96.70% 0 94.27% 0.00% pets 5% 94.28% 95.00% 0 94.12% 0.20% 10% 94.13% 99.70% 0 93.89% 0.00% pets 5% 94.12% 89.80% 0 94.18% 0.10% 10% 93.90% 93.40% 0 94.11% 0.10% pets 5% 93.97% 94.80% 0 94.42% 0.00% 10% 94.23% 97.20% 0 93.96% 0.30% automobile 5% 93.96% 98.65% 0 94.46% 0.20% 10% 94.18% 99.20% 0 94.00% 0.20% automobile 5% 94.20% 99.15% 0 94.36% 0.25% 10% 94.03% 99.55% 0 94.03% 0.10% automobile 5% 93.89% 94.40% 6 94.20% 0.20% 10% 94.49% 97.20% 2 94.49% 0.05% automobile 5% 94.26% 95.60% 5 94.06% 0.00% 10% 94.20% 98.45% 1 94.06% 0.15% tools for understanding this behavior. We are optimistic that similar connections may have widespread application for defending against other types of adversarial attacks in deep learning. Acknowledgements J.L. was supported by NSF Award CCF-1453261 (CAREER), CCF-1565235, and a Google Faculty Research Award. This work was done in part while the author was at MIT and an intern at Google Brain. B.T. was supported by an NSF Graduate Research Fellowship. A.M. was supported in part by an Alfred P. Sloan Research Fellowship, a Google Research Award, and the NSF grants CCF-1553428 and CNS-1815221. 9 References [1] Y. Adi, C. Baum, M. Cisse, B. Pinkas, and J. Keshet. Turning your weakness into a strength: Watermarking deep neural networks by backdooring. arXiv preprint arXiv:1802.04633, 2018. [2] S. Balakrishnan, S. S. Du, J. Li, and A. Singh. Computationally efficient robust sparse estimation in high dimensions. In Conference on Learning Theory, pages 169–212, 2017. [3] B. Biggio, B. Nelson, and P. Laskov. Poisoning attacks against support vector machines. In ICML, 2012. [4] N. Carlini, P. Mishra, T. Vaidya, Y. Zhang, M. Sherr, C. Shields, D. Wagner, and W. Zhou. Hidden voice commands. In USENIX Security), pages 513–530, 2016. [5] M. Charikar, J. Steinhardt, and G. Valiant. Learning from untrusted data. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 47–60. ACM, 2017. [6] X. Chen, C. Liu, B. Li, K. Lu, and D. Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017. [7] R. Collobert and J. Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pages 160–167. ACM, 2008. [8] I. Diakonikolas, G. Kamath, D. M. Kane, J. Li, A. Moitra, and A. Stewart. Robust estimators in high dimensions without the computational intractability. In Foundations of Computer Science (FOCS), 2016 IEEE 57th Annual Symposium on, pages 655–664. IEEE, 2016. [9] I. Diakonikolas, G. Kamath, D. M. Kane, J. Li, A. Moitra, and A. Stewart. Being robust (in high dimensions) can be practical. In International Conference on Machine Learning, pages 999–1008, 2017. [10] I. Diakonikolas, G. Kamath, D. M. Kane, J. Li, J. Steinhardt, and A. Stewart. Sever: A robust metaalgorithm for stochastic optimization. arXiv preprint arXiv:1803.02815, 2018. [11] e. a. Donahue, Jeff. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, 2014. [12] I. Evtimov, K. Eykholt, E. Fernandes, T. Kohno, B. Li, A. Prakash, A. Rahmati, and D. Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017. [13] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2014. [14] A. Graves, A.-r. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In Acoustics, speech and signal processing (icassp), 2013 ieee international conference on, pages 6645–6649. IEEE, 2013. [15] T. Gu, B. Dolan-Gavitt, and S. Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. [16] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [17] A. Klivans, P. K. Kothari, and R. Meka. Efficient algorithms for outlier-robust regression. arXiv preprint arXiv:1803.03241, 2018. [18] P. W. Koh and P. Liang. Understanding black-box predictions via influence functions. In ICML, 2017. [19] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [20] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [21] A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. [22] K. A. Lai, A. B. Rao, and S. Vempala. Agnostic estimation of mean and covariance. In Foundations of Computer Science (FOCS), 2016 IEEE 57th Annual Symposium on, pages 665–674. IEEE, 2016. [23] K. Liu, B. Dolan-Gavitt, and S. Garg. Fine-pruning: Defending against backdooring attacks on deep neural networks. arXiv preprint arXiv:1805.12185, 2018. 10 [24] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. [25] S. Mei and X. Zhu. The security of latent dirichlet allocation. In Artificial Intelligence and Statistics, 2015. [26] N. Papernot, N. Carlini, I. Goodfellow, R. Feinman, F. Faghri, A. Matyasko, K. Hambardzumyan, Y.-L. Juang, A. Kurakin, R. Sheatsley, et al. cleverhans v2. 0.0: an adversarial machine learning library. arXiv preprint arXiv:1610.00768, 2016. [27] A. Prasad, A. S. Suggala, S. Balakrishnan, and P. Ravikumar. Robust estimation via robust gradient estimation. arXiv preprint arXiv:1802.06485, 2018. [28] A. Shafahi, W. R. Huang, M. Najibi, O. Suciu, C. Studer, T. Dumitras, and T. Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. arXiv preprint arXiv:1804.00792, 2018. [29] M. Sharif, S. Bhagavatula, L. Bauer, and M. K. Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In ACM SIGSAC Conference on Computer and Communications Security. ACM, 2016. [30] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. [31] J. Steinhardt, P. W. W. Koh, and P. S. Liang. Certified defenses for data poisoning attacks. In NIPS, 2017. [32] F. Tramèr, A. Kurakin, N. Papernot, D. Boneh, and P. McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017. [33] R. Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. 2018. Available at https://www.math.uci.edu/~rvershyn/papers/HDP-book/HDP-book.pdf. [34] H. Xiao, B. Biggio, B. Nelson, H. Xiao, C. Eckert, and F. Roli. Support vector machines under adversarial label contamination. Neurocomputing, 160:53–62, 2015. 11
2018
173
7,334
Uncertainty-Aware Attention for Reliable Interpretation and Prediction Jay Heo1,2,4∗, Hae Beom Lee1,2∗, Saehoon Kim2, Juho Lee2,5, Kwang Joon Kim3, Eunho Yang1,2, Sung Ju Hwang1,2 KAIST1, AItrics2, Yonsei University College of Medicine3, UNIST4, South Korea, University of Oxford5, United Kingdom, {jayheo, haebeom.lee, sjhwang82, eunhoy}@kaist.ac.kr shkim@aitrics.com, preppie@yuhs.ac, juho.lee@stats.ox.ac.uk Abstract Attention mechanism is effective in both focusing the deep learning models on relevant features and interpreting them. However, attentions may be unreliable since the networks that generate them are often trained in a weakly-supervised manner. To overcome this limitation, we introduce the notion of input-dependent uncertainty to the attention mechanism, such that it generates attention for each feature with varying degrees of noise based on the given input, to learn larger variance on instances it is uncertain about. We learn this Uncertainty-aware Attention (UA) mechanism using variational inference, and validate it on various risk prediction tasks from electronic health records on which our model significantly outperforms existing attention models. The analysis of the learned attentions shows that our model generates attentions that comply with clinicians’ interpretation, and provide richer interpretation via learned variance. Further evaluation of both the accuracy of the uncertainty calibration and the prediction performance with “I don’t know” decision show that UA yields networks with high reliability as well. 1 Introduction For many real-world safety-critical tasks, achieving high reliablity may be the most important objective when learning predictive models for them, since incorrect predictions could potentially lead to severe consequences. For instance, failure to correctly predict the sepsis risk of a patient in ICU may cost his/her life. Deep learning models, while having achieved impressive performances on multitudes of real-world tasks such as visual recognition [17, 10], machine translation [2] and risk prediction for healthcare [3, 4], may be still susceptible to such critical mistakes since most do not have any notion of predictive uncertainty, often leading to overconfident models [9, 18] that are prone to making mistakes. Even worse, they are very difficult to analyze, due to multiple layers of non-linear transformations that involves large number of parameters. Attention mechanism [2] is an effective means of guiding the model to focus on a partial set of most relevant features for each input instance. It works by generating (often sparse) coefficients for the given features in an input-adaptive manner, to allocate more weights to the features that are found to be relevant for the given input. Attention mechanism has been shown to significantly improve the model performance for machine translation [2] and image annotation [28] tasks. Another important feature of the attention mechanism is that it allows easy interpretation of the model via the generated attention allocations, and one recent work on healthcare domain [3] is focusing on this aspect. ∗Equal contribution 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 0.0 0.2 0.4 0.6 0.8 1.0 Confidence 0.0 0.2 0.4 0.6 0.8 1.0 Accuracy ECE=6.88 Outputs Gap 0.0 0.2 0.4 0.6 0.8 1.0 Confidence 0.0 0.2 0.4 0.6 0.8 1.0 Accuracy ECE=7.54 Outputs Gap 0.0 0.2 0.4 0.6 0.8 1.0 Confidence 0.0 0.2 0.4 0.6 0.8 1.0 Accuracy ECE=2.31 Outputs Gap (a) Deterministic Attention [3] (b) Stochastic Attention [28] (c) Uncertainty-aware Attention (Ours) Figure 1: Reliability diagrams [9] which shows the accuracy as a function of model confidence, generated from RNNs trained for mortality risk analysis from ICU records (PhysioNet-Mortality). ECE [22] in (8) denotes Expected Calibration Error, which is the weighted-average gap between model confidence and actual accuracy. (Gap is shown in green bars.) Conventional attention models result in poorly calibrated networks while our UA yields a well-calibrated one. Such accurately calibrated networks allow us to perform reliable prediction by leveraging prediction confidence to decide whether to predict or defer prediction. Although interpretable, attention mechanisms are still limited as means of implementing safe deep learning models for safety-critical tasks, as they are not necessarily reliable. The attention strengths are commonly generated from a model that is trained in a weakly-supervised manner, and could be incorrectly allocated; thus they may not be safe to base final prediction on. To build a reliable model that can prevent itself from making critical mistakes, we need a model that knows its own limitation - when it is safe to make predictions and when it is not. However, existing attention model cannot handle this issue as they do not have any notion of predictive uncertainty. This problem is less of an issue in the conventional use of attention mechanisms, such as machine translation or image annotation, where we can often find clear link between the attended parts and the generated output. However, when working with variables that are often noisy and may not be one-to-one matched with the prediction, such as in case of risk predictions with electronic health records, the overconfident and inaccurate attentions can lead to incorrect predictions (See Figure 1). To tackle this limitation of conventional attention mechanisms, we propose to allow the attention model to output uncertainty on each feature (or input) and further leverage them when making final predictions. Specifically, we model the attention weights as Gaussian distribution with inputdependent noise, such that the model generates attentions with small variance when it is confident about the contribution of the given features, and allocates noisy attentions with large variance to uncertain features, for each input. This input-adaptive noise can model heteroscedastic uncertainty [14] that varies based on the instance, which in turn results in uncertainty-based attenuation of attention strength. We formulate this novel uncertainty-aware attention (UA) model under the Bayesian framework and solve it with variational inference2. We validate UA on tasks such as sepsis prediction in ICU and disease risk prediction from electronic health records (EHR) that have large degree of uncertainties in the input, on which our model outperforms the baseline attention models by large margins. Further quantitative and qualitative analysis of the learned attentions and their uncertainties show that our model can also provide richer interpretations that align well with the clinician’s interpretations. For further validation on prediction reliability, we evaluate it for the uncertainty calibration performance, and prediction under the scenario where the model can defer the decision by saying “I don’t know”, whose results show that UA yields significantly better calibrated networks that can better avoid making incorrect predictions on instances that it is uncertain, compared to baseline attention models. Our contribution in this paper is threefold: • We propose a novel variational attention model with instance-dependent modeling of variance, that captures input-level uncertainty and use it to attenuate attention strengths. • We show that our uncertainty-aware attention yields accurate calibration of model uncertainty as well as attentions that aligns well with human interpretations. • We validate our model on six real-world risk prediction problems in healthcare domains, for both the original binary classification task and classification with “I don’t know" decision, and show that our model obtains significant improvements over existing attention models. 2The source codes are publicly available at https://github.com/jayheo/UA. 2 2 Related Work Prediction reliability There has been work on building a reliable deep learning model[29, 13, 14]; that is, a deep network that can avoid making incorrect predictions when it is not sufficiently certain about its prediction. To achieve this goal, a model should know the limitation in the data, and in itself. One way to quantify such limitations is by measuring the predictive uncertainty using Bayesian models. Recently, [7, 5, 6] showed that deep networks with dropout sampling [24] can be understood as Bayesian neural networks. To obtain better calibrated dropout uncertainties, [15, 8] proposed to automatically learn the dropout rates with proper reparameterization tricks [21, 16]. While the aformentioned work mostly focus on accurate calibration of uncertainty itself, Kendall and Gal [14] utilized dropout sampling to model predictive uncertainty in computer vision [13, 26], and also modeled label noise with learned variances, to implicitly attenuate loss for the highly uncertain instances. Our work has similar motivation, but we model the uncertainty in the input data rather than in labels. By doing so, we can accurately calibrate deep networks for improved reliability. Ayhan et al. [1] has a similar motivation to ours, but with different applications and approaches. There exists quite a few work about uncertainty calibration and its quantification. Guo et al. [9] showed that the modern deep networks are poorly calibrated despite their accuracies, and proposed to tune factors such as depth, width, weight decay for better calibration of the model, and Lakshminarayanan et al. [18] proposed ensemble and adversarial training for the same objective. Attention mechanism The literature on the attention mechanism is vast, which includes its application to machine translation [2], memory-augmented networks [25], and for image annotation [28]. Attention mechanisms are also used for interpretability, as in Choi et al. [3] which proposed a RNNbased attention generator for EHR that can provide attention on both the hospital visits and variables for further analysis by clincians. Attentions can be either deterministic or probabilistic, and soft (non-sparse) or hard (sparse). Some probabilistic attention models [28] use variational inference as used in our model. However, while their direct learning of multinoulli distribution only considers whether to attend or not without consideration of variance, our attention mechanism models varying degree of uncertainty for each input by input-dependent learning of attention noise (variance). 3 Approach We now describe our uncertainty-aware attention model. Let D be a dataset containing a set of N input data points X = [x(1) . . . x(N)] and the corresponding labels, Y = [y(1) . . . y(N)]. For notational simplicity, we suppress the data index n = 1, . . . , N when it is clear from the context. We first present a general framework of a stochastic attention mechanism. Let v(x) ∈Rr×i be the concatenation of i intermediate features, each column of which vj(x) is a length r vector, from an arbitrary neural network. From v(x), a set of random variables {aj}i j=1 is conditionally generated from some distribution p(a|x) where the dimension of aj depends on the model architecture. Then, the context vector c ∈Rr is computed as c(x) = Pi j=1 aj ⊙vj(x) where the operator ⊙is properly defined according to the dimensionality of aj; if aj is a scalar, it is simply the multiplication while for aj ∈Rr, it is the element-wise product. The function f here produces the prediction ˆy = f(c(x)) given the context vector c. The attention could be generated either deterministically, or stochastically. The stochastic attention mechanism is proposed in [28], where they generate aj ∈{0, 1} from Bernoulli distribution. This variable is learned by maximizing the evidence lower bound (ELBO) with additional regularizations for reducing variance of gradients. In [28], the stochastic attention is shown to perform better than the deterministic counterpart, on image annotation task. 3.1 Stochastic attention with input-adaptive Gaussian noise Despite the performance improvement in [28], there are two limitations in modeling stochastic attention directly with Bernoulli (or Multinoulli) distribution as [28] does, in our purposes: 1) The variance σ2 of Bernoulli is completely dependent on the allocation probability µ. Since the variance for Bernoulli distribution is decided as σ2 = µ(1 −µ), the model thus cannot generate a with low variance if µ is around 0.5, and vice versa. To overcome such limitation, we 3 disentangle the attention strength a from the attention uncertainty so that the uncertainty could vary even with the same attention strength. 2) The vanilla stochastic attention models the noise independently of the input. This makes it infeasible to model the amount of uncertainty for each input, which is a crucial factor for reliable machine learning. Even for the same prediction tasks and for the same set of features, the amount of uncertainty for each feature may largely vary across different instances. To overcome these two limitations, we model the standard deviation σ, which is indicative of the uncertainty, as an input-adaptive function σ(x), enabling to reflect different amount of confidence the model has for each feature, for a given instance. As for distribution, we use Gaussian distribution, which is probably the most simple and efficient solution for our purpose, and also easy to implement. We first assume that a subset of the neural network parameters ω, associated with generating attentions, has zero-mean isotropic Gaussian prior with precision τ. Then the attention scores before squashing, denoted as z, are generated from conditional distribution pθ(z|x, ω), which is also Gaussian: p(ω) = N(0, τ −1I), pθ(z|x, ω) = N(µ(x, ω; θ), diag(σ2(x, ω; θ))) (1) where µ(·, ω; θ) and σ(·, ω; θ) are mean and s.d., parameterized by θ. Note that µ and σ are generated from the same layer, but with different set of parameters, although we denote those parameters as θ in general. The actual attention a is then obtained by applying some squashing function π(·) to z (e.g. sigmoid or hyperbolic tangent): a = π(z). For comparison, one can think of the vanilla stochastic attention of which variance is independent of inputs. p(ω) = N(0, τ −1I), pθ(z|x, ω) = N(µ(x, ω; θ), diag(σ2)) (2) However, as we mentioned, this model cannot express different amount of uncertainties over features. One important aspect of our model is that, in terms of graphical representation, the distribution p(ω) is independent of x, while the distribution pθ(z|x, ω) is conditional on x. That is, p(ω) tends to capture uncertainty of model parameters (epistemic uncertainty), while pθ(z|x, ω) reacts sensitively to uncertainty in data, varying across different input points (heteroscedastic uncertainty) [14]. When modeled together, it has been empirically shown that the quality of uncertainty improves [14]. Such modeling both input-agnostic and input-dependent uncertainty is especially important in risk analysis tasks in healthcare, to capture both the uncertainty from insufficient amount of clinical data (e.g. rare diseases), and the uncertainty that varies from patients to patients (e.g. sepsis). 3.2 Variational inference We now model what we have discussed so far. Let Z be the set of latent variables {z(n)}N n=1 that stands for attention weight before squashing. In neural network, the posterior distribution p(Z, ω|D) is usually computationally intractable since p(D) is so due to nonlinear dependency between variables. Thus, we utilize variational inference, which is an approximation method that has been shown to be successful in many applications of neural networks [16, 23], along with reprameterization tricks for pathwise backpropagation [15, 8]. Toward this, we first define our variational distribution as q(Z, ω|D) = qM(ω|X, Y)q(Z|X, Y, ω). (3) We set qM(ω|X, Y) to dropout approximation [7] with variational parameter M. [7] showed that a neural network with Gaussian prior on its weight matrices can be approximated with variational inference, in the form of dropout sampling of deterministic weight matrices and ℓ2 weight decay. For the second term, we drop the dependency on Y (since it is not available in test time) and simply set q(Z|X, Y, ω) to be equivalent to pθ(Z|X, ω), which works well in practice [23, 28]. Under the SGVB framework [16], we maximize the evidence lower bound (ELBO): log p(Y|X) ≥Eω∼qM(ω|X,Y),Z∼pθ(Z|X,ω) [log p(Y|X, Z, ω)] (4) −KL[qM(ω|X, Y)∥p(ω)] −KL[q(Z|X, Y, ω)∥pθ(Z|X, ω)] (5) where we approximate the expectation in (4) via Monte-Carlo sampling. The first KL term nicely reduces to ℓ2 regularization for M with dropout approximation [7]. The second KL term vanishes as the two distributions are equivalent. Consequently, our final maximization objective is: L(θ, M; X, Y) = X log pθ(y(n)|˜z(n), x(n)) −λ∥M∥2 (6) 4 where we first sample random weights with dropout masks eω ∼qM(ω|X, Y) and sample z such that ˜z = g(x, ˜ε, eω), ˜ε ∼N(0, I), with a pathwise derivative function g for reparameterization trick. λ is a tunable hyperparameter; however in practice it can be simply set to common ℓ2 decay shared throughout the network, including other deterministic weights. When testing with a novel input instance x∗, we can compute the probability of having the correct label y∗by our model, p(y∗|x∗) with Monte-Carlo sampling: p(y∗|x∗) = ZZ p(y∗|x∗, z)p(z|x∗, ω)p(ω|X, Y)dωdz ≈1 S S X s=1 p(y∗|x∗, ˜z(s)) (7) where we first sample dropout masks eω(s) ∼qM(ω|X, Y) and then sample ˜z(s) ∼pθ(z|x∗, eω(s)). Uncertainty Calibration The quality of uncertainty from (7) can be evaluated with reliability diagram shown in Figure 1. Better calibrated uncertainties produce smaller gaps beween model confidences and actual accuracies, shown in green bars. Thus, the perfect calibration occurs when the confidences exactly matches the actual accuracies: p(correct|confidence = ρ) = ρ, ∀ρ ∈[0, 1] [9]. Also, [22, 9] proposed a summary statistic for calibration, called the Expected Calibration Error (ECE). It is the expected gap w.r.t. the distribution of model confidence (or frequency of bins): ECE = Econfidence  |p(correct|confidence) −confidence|  (8) 4 Application to RNNs for Prediction on Time-Series Data Our variational attention model is generic and can be applied to any generic deep neural network that leverages attention mechanism. However, in this section, we describe its application to prediction from time-series data, since our target application is risk analysis from electronic health records. Review of the RETAIN model As a base deep network for learning from time-series data, we consider RETAIN [3], which is an attentional RNN model with two types of attentions–across timesteps and across features. RETAIN obtains state-of-the-art performance on risk prediction tasks from electronic health records, and is able to provide useful interpretations via learned attentions. We now briefly review the overall structure of RETAIN. We match the notation with those in the original paper for clear reference. Suppose we are interested in a timestep i. With the input embeddings v1, . . . , vi, we generate two different attentions: across timesteps (α) and features (β). gi, ..., g1 = RNNα(vi, ..., v1; ω), hi, ..., h1 = RNNβ(vi, ..., v1; ω), (9) ej = wT αgj + bα for j = 1, ..., i, dj = Wβhj + bβ for j = 1, ..., i, (10) α1, ..., αi = Softmax(e1, ..., ei), βj = tanh(dj) for j = 1, ..., i. (11) The parameters of two RNNs are collected as ω. From the RNN outputs g and h, the attention logits e and d are generated, followed by squashing functions Softmax and tanh respectively. Then the generated two attentions α and β are multiplied back to the input embedding v, followed by a convex sum c up to timestep i: ci = Pi j=1 αjβj ⊙vj. A final linear predictor is learned based on it: byi = Sigmoid(wTci + b). The most important feature of RETAIN is that it allows us to interpret what the model has learned as follows. What we are interested in is contribution, which shows xk’s aggregate effect to the final prediction at time j. Since RETAIN has attentions on both timesteps (αj) and features (βj), the computation of aggregate contribution takes both of them into consideration when computing the final contribution of an input data point at a specific timestep: ω(y, xj,k) = αjwT(βj ⊙Wemb[:, k])xj,k. In other words, it is a certain portion of logit Sigmoid−1(byi) = wTci+b for which xj,k is responsible. Interpretation as a probabilistic model The interpretation of RETAIN as a probabilistic model is quite straightforwrad. First, the RNN parameters ω (9) as gaussian latent variables (1) are approximated with MC dropout with fixed probabilities [7, 5, 27]. The input dependent latent variables Z (1) simply correspond to the collection of e and d (10), the attention logits. The log variances of e and d are generated in the same way as their mean, from the output of RNNs g and d 5 PhysioNet Pancreatic MIMIC Mortality Stay < 3 Cardiac Recovery Cancer Sepsis RETAIN-DA [3] 0.7652± 0.02 0.8515± 0.02 0.9485± 0.01 0.8830± 0.01 0.8528± 0.01 0.7965± 0.01 RETAIN-SA [28] 0.7635± 0.02 0.8412± 0.02 0.9360± 0.01 0.8582± 0.02 0.8444± 0.01 0.7695± 0.02 UA-Independent 0.7764± 0.01 0.8572± 0.02 0.9516± 0.01 0.8895± 0.01 0.8533± 0.03 0.8019± 0.01 UA 0.7827± 0.02 0.8628± 0.02 0.9563± 0.01 0.9049± 0.01 0.8604± 0.01 0.8017± 0.01 UA+ 0.7770± 0.02 0.8577± 0.01 0.9612± 0.01 0.9074± 0.01 0.8638±0.02 0.8114± 0.01 Table 1: The multi-class classification performance on the three electronic health records datasets. The reported numbers are mean AUROC and standard errors for 95% confidence interval over five random splits. but with different set of parameters. Also the reparameterization trick for diagonal gaussian is simple [16]. We now maximize the ELBO (6), equipped with all the components X,Y,Z, and ω as in the previous section. 5 Experiments Tasks and Datasets We validate the performance of our model on various risk prediction tasks from multiple EHR datasets, for both the prediction accuracy and prediction reliability. 1) PhysioNet This dataset [11] contains 4,000 medical records from ICU3. Each record contains 48 hours of records, with 155 timesteps, each of which contains 36 physiolocial signals including heart rate, repiration rate and temperature. The challenge comes with four binary classification tasks, namely, 1) Mortality prediction, 2) Length-of-stay less than 3 days: whether the patient will stay in ICU for less than three days, 3) Cardiac conditon: whether the patient will have a cardiac condition, and 4) Recovery from surgery: whether the patient was recovering from surgery. 2) Pancreatic Cancer This dataset is a subset of the EHR database of the National Health Insurance System (NHIS) in South Korea, consisting of anonymized medical check-up records from 2002 to 2013, which includes around 1.5 million records. We extract 3, 699 patient records from this database, among which 1, 233 are patients diagnosed of pancreatic cancer. The task here is to predict the onsets of pancreatic cancer in 2013 using the records from 2002 to 2012 (11 timesteps), that consists of 34 variables regarding general information (e.g., sex, height, past medical history, family history) as well as vital information (e.g., systolic pressure, hemoglobin level, creatinine level) and risk inducing behaviors (e.g., tobacco and alcohol consumption). 3) MIMIC-Sepsis This is the subset of the MIMIC III dataset [12] for sepsis prediction, which consists of 58,000 hospital admissions for 38,646 adults over 12 years. We use a subset that consists of 22,395 records of patients over age 15 and stayed in ICUs between 2001 and 2012, among which 2,624 patients are diagnosed of sepsis. We use the data from the first 48 hours after admission (24 timesteps). For features at each timestep, we select 14 sepsis-related variables including arterial blood pressure, heart rate, FiO2, and Glass Coma Score (GCS), following the clinicians’ guidelines. We use Sepsis-related Organ Failure Assessment scores (SOFA) to determine the onset of sepsis. For all datasets, we generates five random splits of training/validation/test with the ratio of 80% : 10% : 10%. Detailed description of the datasets, network configuration, and hyperparameters are fully described in the appendix section. Baselines We now describe our uncertainty-calibrated attention models and relevant baselines. 1) RETAIN-DA: The recurrent attention model in [3], which uses deterministic soft attention. 2) RETAIN-SA: RETAIN model with the stochastic hard attention proposed by [28], that models the attention weights with multinoulli distribution, which is learned by variational inference. 3) UA-independent: The input-independent version of our uncertainty-aware attention model in (2) whose variance is modeled indepently of the input. 4) UA: Our input-dependent uncertainty-aware attention model in (1). 5) UA+: The same as UA, but with additional modeling of input-adaptive noise at the final prediction as done in [14], to account for output uncertainty as well. 5.1 Evaluation of the binary classification performance We first examine the prediction accuracy of baselines and our models in a standard setting where the model always makes a decision. Table 1 contains the accuracy of baselines and our models measured 3We only use the TrainingSetA, for which the labels were available 6 MechVent DiasABP HR Temp SysABP FiO2 MAP Urine GCS 35m 5s 0 81 61 36.2 135 1 71 N/A 15 38m10s 0 75 64 36.7 94 1 74 N/A 15 38m 55s (current) 1 67 57 35.2 105 1 80 35 10 Vent DABP HR TempSABP FiO2 MAP Urine GCS 30 20 10 0 10 20 Contribution Vent DABP HR TempSABP FiO2 MAP Urine GCS 60 40 20 0 20 40 60 Contribution Vent DABP HR TempSABP FiO2 MAP Urine GCS 60 40 20 0 20 40 60 Contribution (a) RETAIN (b) RETAIN-SA (c) UA Figure 2: Visualization of contributions for a selected patient on PhysioNet mortality prediction task. MechVent - Mechanical ventilation, DiasABP - Diastolic arterial blood pressure, HR - Heart rate, Temp - Temperature, SysABP - Systolic arterial blood pressure, FiO2 - Fractional inspired Oxygen, MAP - Mean arterial blood pressure, Urine - Urine output, GCS - Glasgow coma score. The table presents the value of physiological variables at the previous and the current timestep. Dots correspond to sampled attention weights. in area under the ROC curve (AUROC). We observe that UA variants significantly outperforms both RETAIN variants with either deterministic or stochastic attention mechanisms on all datasets. Note that RETAIN-SA, that generates attention from Bernoulli distribution, performs the worst. This may be because the model is primarily concerned with whether to attend or not to each feature, which makes sense when most features are irrelevant, such as with machine translation, but not in the case of clinical prediction where most of the variables are important. UA-independent performs significantly worse than UA or UA+, which demonstrates the importance of input-dependent modeling of the variance. Additional modeling of output uncertainty with UA+ yields performance gain in most cases. 5.2 Interpretability and accuracy of generated attentions To obtain more insight, we further analyze the contribution of each feature in PhysioNet mortality task in Figure 2 for a patient at the timestep with the highest attention α, with the help of a physician. The table in Figure 2 is the value of the variables at the previous checkpoints and the current timestep. The difference between the current and the previous tmesteps is significant - the patient is applied mechanical ventilation; the body temperature, diastolic arterial blood pressure, and heart rate dropped, and GCS, which is a measure of consciousness, dropped from 15 to 10. The fact that the patient is applied mechanical ventilation, and that the GCS score is lowered, are both very important markers for assessing patient’s condition. Our model correctly attends to those two variables, with very low uncertainty. SysABP and DiasABP are variables that has cyclic change in value, and are all within normal range; however RETAIN-DA attended to these variables, perhaps due to having a deterministic model which led it to overfit. Heart rate is out of normal range (60-90), which is problematic but is not definitive, and thus UA attended to it with high variance. RETAIN-SA results in overly incorrect and noisy attention except for FiO2 that did not change its value. Attention on Urine by all models may be the artifact that comes from missing entry in the previous timestep. In this case, UA assigned high variance, which shows that it is uncertain about this prediction. Sensitivity Specificity DA 75% 68% UA 87% 82% Table 2: Percentage of features selected from each model that match the features selected by the clinicians. The previous example shows another advantage of our model: it provides a richer interpretations of why the model has made such predictions, compared to ones provided by deterministic or stochastic model without input-dependent modeling of uncertainty. We further compared UA against RETAIN-DA for accuracy of the attentions, using variables selected meaningful by the clinicians as ground truth labels (avg. 132 variables per record), from EHRs for a male and a female patient randomly selected from 10 age groups (40s-80s), on PhysioNet-Mortality. We observe that UA generates accurate interpretations that better comply with clinicians’ intepretations (Table 2). 5.3 Evaluation of prediction reliability Another important goal that we aimed to achieve with the modeling of uncertainty in the attention is achieving high reliability in prediction. Prediction reliability is orthogonal to prediction accuracy, 7 PhysioNet Pancreatic MIMIC Mortality Stay < 3 Cardiac Recovery Cancer Sepsis RETAIN-DA [3] 7.23 ± 0.56 2.04 ± 0.56 5.70 ± 1.56 4.89 ± 0.97 5.45 ± 0.79 3.05 ± 0.56 RETAIN-SA [28] 7.70 ± 0.60 3.77 ± 0.07 8.82 ± 0.64 5.39 ± 0.80 9.69 ± 3.90 5.75 ± 0.29 UA-Independent 5.03 ± 0.94 2.74 ± 1.44 3.55 ± 0.56 4.87 ± 1.46 4.51 ± 0.72 2.04 ± 0.62 UA 4.22 ± 0.82 1.43 ± 0.53 3.33 ± 0.96 4.46 ± 0.73 3.61 ± 0.55 1.78 ± 0.41 UA+ 4.41 ± 0.52 1.68 ± 0.16 2.66 ± 0.16 3.98 ± 0.59 3.22 ± 0.69 2.04 ± 0.62 Table 3: Mean Expected Calibration Error (ECE) of various attention models over 5 random splits. 0.0 0.2 0.4 0.6 0.8 Ratio of Correct Predictions 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 Ratio of Incorrect Predictions RETAIN-DA UA UA+ 0.0 0.2 0.4 0.6 0.8 1.0 Ratio of Correct Predictions 0.000 0.005 0.010 0.015 0.020 0.025 0.030 0.035 0.040 Ratio of Incorrect Predictions RETAIN-DA UA UA+ 0.0 0.2 0.4 0.6 0.8 Ratio of Correct Predictions 0.00 0.02 0.04 0.06 0.08 0.10 Ratio of Incorrect Predictions RETAIN-DA UA UA+ 0.0 0.2 0.4 0.6 0.8 Ratio of Correct Predictions 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 Ratio of Incorrect Predictions RETAIN-DA UA UA+ 0.0 0.2 0.4 0.6 0.8 Ratio of Correct Predictions 0.00 0.05 0.10 0.15 0.20 Ratio of Incorrect Predictions RETAIN-DA UA UA+ 0.0 0.2 0.4 0.6 0.8 Ratio of Correct Predictions 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 Ratio of Incorrect Predictions RETAIN-DA UA UA+ (a) PhysioNet (b) PhysioNet (c) PhysioNet (d) PhysioNet (e) Pancreatic (f) MIMIC - Mortality - Stay < 3 - Cardiac - Recovery Cancer - Sepsis Figure 3: Experiments on prediction reliability. The line charts show the ratio of incorrect predictions as a function of the ratio of correct predictions for all datasets. and [22] showed that state-of-the-art deep networks are not reliable as they are not well-calibrated to correlate model confidence with model strength. Thus, to demonstrate the reliability of our uncertainty-aware attention, we evaluate it for the uncertainty calibration performance against baseline attention models in Table 3, using Expected Calibration Errors (ECE) [22] (Eq. (8)). UA and UA+ are significantly better calibrated than RETAIN-DA, RETAIN-SA as well as UA-independent, which shows that independent modeling of variance is essential in obtaining well-calibrated uncertainties. Prediction with “I don’t know" option We further evaluate the reliability of our predictive model by allowing it to say I don’t know (IDK), where the model can refrain from making a hard decision of yes or no when it is uncertain about its prediction. This ability to defer decision is crucial for predictive tasks in clinical environments, since those deferred patient records could be given a second round examination by human clinicians to ensure safety in its decision. To this end, we measure the uncertainty of each prediction by sampling the variance of the prediction using both MC-dropout and stochastic Gaussian noise over 30 runs, and simply predict the label for the instances with standard deviation larger than some set threshold as IDK. Note that we use RETAIN-DA with MC-Dropout [5] as our baseline for this experiment, since RETAIN-DA is deterministic and cannot output uncertainty 4 We report the performance of RETAIN + DA, UA, and UA+ for all tasks by plotting the ratio of incorrect predictions as a function of the ratio of correct predictions, by varying the threshold on the model confidence (See Figure 3). We observe that both UA and UA+ output much smaller ratio of incorrect predictions at the same ratio of correct predictions compared to RETAIN + DA, by saying IDK on uncertain inputs. This suggests that our models are relatively more reliable and safer to use when making decisions for prediction tasks where incorrect predictions can lead to fatal consequences. 6 Conclusion We proposed uncertainty-aware attention (UA) mechanism that can enhance reliability of both interpretations and predictions of general deep neural networks. Specifically, UA generates attention weights following Gaussian distribution with learned mean and variance, that are decoupled and trained in input-adaptive manner. This input-adaptive noise modeling allows to capture heteroscedastic uncertainty, or the instance-specific uncertainty, which in turn yields more accurate calibration of prediction uncertainty. We trained it using variational inference and validated it on seven different tasks from three electronic health records, on which it significantly outperformed the baselines and provided more accurate and richer interpretations. Further analysis of prediction reliability shows that our model is accurately calibrated and thus can defer predictions when making prediction with “I don’t know” option. 4RETAIN-SA is not compared since it largely underperforms all others and is not a meaningful baseline. 8 Acknowledgments This work was supported by a Machine Learning and Statistical Inference Framework for Explainable Artificial Intelligence (No.2017-0-01779) funded by Institution for Information & Communications & Technology Promotion (IITP) and Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (2015R1D1A1A01061019) of South Korea. Juho Lee is funded by the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007-2013) ERC grant agreement no. 617071. References [1] M. S. Ayhan and P. Berens. Test-time Data Augmentation for Estimation of Heteroscedastic Aleatoric Uncertainty in Deep Neural Networks. MIDL, Mar. 2018. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2015. [3] E. Choi, M. T. Bahadori, J. Sun, J. Kulas, A. Schuetz, and W. Stewart. Retain: An interpretable predictive model for healthcare using reverse time attention mechanism. In NIPS. 2016. [4] J. Futoma, S. Hariharan, and K. A. Heller. Learning to detect sepsis with a multitask gaussian process RNN classifier. In ICML, 2017. [5] Y. Gal and Z. Ghahramani. A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. ArXiv e-prints. [6] Y. Gal and Z. Ghahramani. Bayesian Convolutional Neural Networks with Bernoulli Approximate Variational Inference. ArXiv e-prints, June 2015. [7] Y. Gal and Z. Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In ICML, 2016. [8] Y. Gal, J. Hron, and A. Kendall. Concrete dropout. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, NIPS, 2017. [9] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. In ICML, 2017. [10] K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016. [11] D. J. S. L. A. C. Ivanovitch Silva, Galan Moody and R. G. Mark. Predicting in-hospital mortality of icu patients: The physionet/computing in cardiology challenge 2012. In In CinC, 2012. [12] A. E. Johnson, T. J. Pollard, L. Shen, L. wei H. Lehman, M. Feng, M. Ghassemi, B. Moody, P. Szolovits, L. A. Celi, and R. G. Mark. Mimic-iii, a freely accessible critical care database. [13] A. Kendall, V. Badrinarayanan, and R. Cipolla. Bayesian SegNet: Model Uncertainty in Deep Convolutional Encoder-Decoder Architectures for Scene Understanding. ArXiv e-prints, Nov. 2015. [14] A. Kendall and Y. Gal. What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision? In NIPS, 2017. [15] D. P. Kingma, T. Salimans, and M. Welling. Variational Dropout and the Local Reparameterization Trick. ArXiv e-prints, June 2015. [16] D. P. Kingma and M. Welling. Auto encoding variational bayes. In ICLR. 2014. [17] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In NIPS, 2012. [18] B. Lakshminarayanan, A. Pritzel, and C. Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In NIPS, pages 6405–6416, 2017. 9 [19] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pages 2278–2324, 1998. [20] Y. LeCun and C. Cortes. MNIST handwritten digit database. 2010. [21] C. J. Maddison, A. Mnih, and Y. Whye Teh. The Concrete Distribution: A Continuous Relaxation of Discrete Random Variables. ArXiv e-prints, Nov. 2016. [22] M. P. Naeini, G. F. Cooper, and M. Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In AAAI, 2015. [23] K. Sohn, H. Lee, and X. Yan. Learning structured output representation using deep conditional generative models. In NIPS. 2015. [24] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. [25] S. Sukhbaatar, A. Szlam, J. Weston, and R. Fergus. End-to-end memory networks. In NIPS, 2015. [26] R. Tanno, D. E. Worrall, A. Ghosh, E. Kaden, S. N. Sotiropoulos, A. Criminisi, and D. C. Alexander. Bayesian Image Quality Transfer with CNNs: Exploring Uncertainty in dMRI Super-Resolution. ArXiv e-prints, May 2017. [27] J. van der Westhuizen and J. Lasenby. Bayesian LSTMs in medicine. ArXiv e-prints, June 2017. [28] K. Xu, J. L. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhutdinov, R. S. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. [29] L. Zhu and N. Laptev. Deep and Confident Prediction for Time Series at Uber. ArXiv e-prints, Sept. 2017. 10
2018
174
7,335
Attention in Convolutional LSTM for Gesture Recognition Liang Zhang∗ Xidian University liangzhang@xidian.edu.cn Guangming Zhu∗ Xidian University gmzhu@xidian.edu.cn Lin Mei Xidian University l_mei72@hotmail.com Peiyi Shen Xidian University pyshen@xidian.edu.cn Syed Afaq Ali Shah Central Queensland University afaq.shah@uwa.edu.au Mohammed Bennamoun University of Western Australia mohammed.bennamoun@uwa.edu.au Abstract Convolutional long short-term memory (LSTM) networks have been widely used for action/gesture recognition, and different attention mechanisms have also been embedded into the LSTM or the convolutional LSTM (ConvLSTM) networks. Based on the previous gesture recognition architectures which combine the threedimensional convolution neural network (3DCNN) and ConvLSTM, this paper explores the effects of attention mechanism in ConvLSTM. Several variants of ConvLSTM are evaluated: (a) Removing the convolutional structures of the three gates in ConvLSTM, (b) Applying the attention mechanism on the input of ConvLSTM, (c) Reconstructing the input and (d) output gates respectively with the modified channel-wise attention mechanism. The evaluation results demonstrate that the spatial convolutions in the three gates scarcely contribute to the spatiotemporal feature fusion, and the attention mechanisms embedded into the input and output gates cannot improve the feature fusion. In other words, ConvLSTM mainly contributes to the temporal fusion along with the recurrent steps to learn the long-term spatiotemporal features, when taking as input the spatial or spatiotemporal features. On this basis, a new variant of LSTM is derived, in which the convolutional structures are only embedded into the input-to-state transition of LSTM. The code of the LSTM variants is publicly available2. 1 Introduction Long short-term memory (LSTM) [1] recurrent neural networks are widely used to process sequential data [2]. Several variants of LSTM have been proposed since its inception in 1995 [3]. By extending the fully connected LSTM (FC-LSTM) to have convolutional structures in both the input-to-state and state-to-state transitions, Shi et al. [4] proposed the convolutional LSTM (ConvLSTM) network to process sequential images for precipitation nowcasting. Thereafter, ConvLSTM has been used for action recognition [5, 6], gesture recognition [7–9] and in other fields [10–12]. When LSTM is used to process video or sequential images, the spatial features of two-dimensional convolutional ∗Equal Contribution 2https://github.com/GuangmingZhu/AttentionConvLSTM 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. neural networks (2DCNN) are generally vectorized before feeding them as input of LSTM [13, 14]. However, the two-dimensional spatial feature maps can be fed into ConvLSTM directly, without the loss of the spatial correlation information. For example, the spatial feature maps of AlexNet/VGG-16 [5, 10] or the spatiotemporal feature maps of three-dimensional CNN (3DCNN) [7, 8] are used as input of ConvLSTM. ConvLSTM was originally proposed to take images as input for precipitation nowcasting, the spatial convolutions are therefore necessary to learn the spatiotemporal features. However, how much do the convolutional structures of ConvLSTM contribute to the feature fusion when ConvLSTM takes as input the spatial convolutional features instead of images? Is it necessary to have different gate values for each element of the feature maps in the spatial domain? The effect of the convolutional structures in ConvLSTM can be analyzed in three cases. (a) ConvLSTM takes original images as input. In this case, the convolutional structures are crucial to learn the spatiotemporal features, as verified in [4]. (b) ConvLSTM takes the feature maps of 2DCNN as input. In this case, the effect of the convolutional structures is not always remarkable. Intuitively, the three gates of ConvLSTM can be viewed as the weighting mechanism for the feature map fusion. However, the different gates values for each element of the feature maps in the spatial domain seemingly do not have the function of spatial attention. Therefore, the soft attention mechanism [15] is additionally introduced into the input of ConvLSTM in [5], in order to make ConvLSTM focus on the noticeable spatial features. The improvement (as illustrated in Table 1 of [5]) caused by the attention mechanism on the input can also verify the above claim in some degree. (c) ConvLSTM takes the feature maps of 3DCNN as input. Since the 3DCNN networks have learnt the spatiotemporal features, the gates of ConvLSTM are more unlikely to have the function of spatial attention. The last case will be analyzed thoroughly in this paper. Based on our previous published "3DCNN+ConvLSTM+2DCNN" architecture [8], we construct a preliminary "Res3D+ConvLSTM+MobileNet" architecture and derive four variants of the ConvLSTM component. In the preliminary "Res3D+ConvLSTM+MobileNet" architecture, the blocks 1-4 of Res3D [16] are used first to learn the local short-term spatiotemporal feature maps which have a relatively large spatial size. Then, two ConvLSTM layers are stacked to learn the global long-term spatiotemporal feature maps. Finally, parts of MobileNet [17] are used to learn deeper features based on the learnt two-dimensional spatiotemporal feature maps. The Res3D and MobileNet blocks are fixed, and the ConvLSTM component is modified to derive four variants: (a) Removing the convolutional structures of the gates by performing the spatial global average pooling on the input and the hidden states ahead. This means that the convolutional operations in the three gates are reduced to the fully-connected operations. The convolutional structures for the input-to-state transition are reserved to learn the spatiotemporal features. (b) Applying the soft attention mechanism to the input (i.e., the feature maps of the Res3D block) of ConvLSTM. (c) Reconstructing the input gate using the channel-wise attention mechanism. (d) Reconstructing the output gate using the channel-wise attention mechanism. We do not re-evaluate the cases that ConvLSTM takes as input images or features of 2DCNN in this paper, since the experiments in [4] and [5] can demonstrate the aforementioned claims. We focus on the evaluation of the third case on the large-scale isolated gesture datasets Jester [18] and IsoGD [19], since the "3DCNN+ConvLSTM+2DCNN" architecture was originally proposed for gesture recognition. Experimental results demonstrate that neither the convolutional structures in the three gates of ConvLSTM nor the extra spatial attention mechanisms contribute in the performance improvements, given the fact that the input spatiotemporal features of 3DCNN have paid attention to the noticeable spatial features. The exploring on the attention in ConvLSTM leads to a new variant of LSTM, which is different from the FC-LSTM and ConvLSTM. Specifically, the variant only brings the spatial convolutions to the input-to-state transition, and keeps the gates the same as the gates of FC-LSTM. 2 Attention in ConvLSTM To ensure the completeness of the paper, the preliminary "Res3D+ConvLSTM+MobileNet" architecture is first described. Then, the variants of ConvLSTM are elaborated and analyzed. 2 Figure 1: An overview of the "Res3D+ConvLSTM+MobileNet" architecture. The output of each block is in the format of "Length*Width*Height*Channel". MobileNet processes each temporal sample independently. 2.1 The preliminary architecture Two-streams or 3DCNN based networks are widely used for action recognition, such as the famous TSN [20], C3D [21], Res3D [16], and I3D [22] networks. Gesture recognition is different from action recognition. You cannot tell the categories of the dynamic gestures when you only look at an image once. But, you may tell when you just look at an image of actions, under the hints of the backgrounds, objects and postures. Therefore, the aforementioned famous networks cannot produce the state-of-the-art performances on gesture recognition, without including multimodal fusion. Gestures focus on the local information of hands and the global motions of arms. Thus, we use a shallow 3DCNN to learn the local short-term spatiotemporal features first. The 3DCNN block does not need to be deep, since it focuses on the local features. Therefore, the modified blocks 1-4 of Res3D are used. The temporal duration (or spatial size) of the outputted feature maps is only shrunk by a ratio of 2 (or 4), compared with the inputted images. Then, a two-layer ConvLSTM network is stacked to learn the long-term spatiotemporal feature maps. The ConvLSTM network does not shrink the spatial size of the feature maps. Thus, the spatiotemporal feature maps still have a relative large spatial size. The top layers of MobileNet, whose inputs have the same spatial size, are further stacked to learn deeper features. The comparison with the aforementioned famous networks will be given in the experimental part to demonstrate the advantages of the architecture (as displayed in Fig. 1). 2.2 The variants of ConvLSTM Formally, ConvLSTM can be formulated as: it = σ(Wxi ∗Xt + Whi ∗Ht−1 + bi) (1) ft = σ(Wxf ∗Xt + Whf ∗Ht−1 + bf) (2) ot = σ(Wxo ∗Xt + Who ∗Ht−1 + bo) (3) Gt = tanh(Wxc ∗Xt + Whc ∗Ht−1 + bc) (4) Ct = ft ◦Ct−1 + it ◦Gt (5) Ht = ot ◦tanh(Ct) (6) where σ is the sigmoid function, Wx∼and Wh∼are 2-d convolution kernels. The input Xt , the cell state Ct , the hidden state Ht, the candidate memory Gt, and the gates it, ft, ot are all 3D tensors. The symbol "*" denotes the convolution operator, and "o" denotes the Hadamard product. The input Xt has a spatial size of W × H with Cin channels, and ConvLSTM has a convolutional kernel size of K × K with Cout channels. Thus, the parameter size of ConvLSTM can be calculated as3: ParamConvLST M = K × K × (Cin + Cout) × Cout × 4 (7) The parameter size of ConvLSTM is very large, partly due to the convolutional structures. It can be concluded from Eqs. (1)-(6) that the gates it, ft, ot have a spatial size of W ×H with Cout channels4. It means that the three gates have independent values for each element of the feature maps in the cell state and the candidate memory. In this case, can ConvLSTM focus on the noticeable spatial regions with the help of different gate values in the spatial domain? In order to provide an answer and remove any doubt, four variants of ConvLSTM are constructed as follows (as illustrated in Fig. 2). 3The biases are ignored for simplicity. 4It is assumed that the convolutional structures have the same-padding style. 3 Figure 2: An overview of the four variants of ConvLSTM. The "P&FC" denotes the spatial global average pooling and fully-connected operations, as expressed in Eqs. (8)-(12). The "Conv" denotes the convolutional structure in Eqs. (1)-(4)(13)(17)(21). The "Atten" denotes the standard attention mechanism in Eqs. (17)-(19). The "CAtten" denotes the channel-wise attention in Eqs. (21)-(23). (a) Removing the convolutional structures of the gates Given the local spatiotemporal features of the 3DCNN block, it can be considered that the 3DCNN block has paid attention to the noticeable spatial regions where there is valuable spatiotemporal information. Therefore, the ConvLSTM block can just focus on the spatiotemporal feature fusion along with the recurrent steps. The gate values are only needed to be calculated for each feature map of the states, not for each element. Therefore, a global average pooling is performed on the input features and the hidden states to reduce the spatial dimension, so that fully-connected operations can be performed instead of convolutions in the gates. The variant of ConvLSTM can be formulated as: Xt = GlobalAveragePooling(Xt) (8) Ht−1 = GlobalAveragePooling(Ht−1) (9) it = σ(WxiXt + WhiHt−1 + bi) (10) ft = σ(WxfXt + WhfHt−1 + bf) (11) ot = σ(WxoXt + WhoHt−1 + bo) (12) Gt = tanh(Wxc ∗Xt + Whc ∗Ht−1 + bc) (13) Ct = ft ◦Ct−1 + it ◦Gt (14) Ht = ot ◦tanh(Ct) (15) 4 The gates it, ft and ot are all one-dimensional vectors, so that the elements in each feature map are weighted by the same gate value in Eqs. (14)-(15). The convolutional structures in the three gates are reduced to fully-connected operations. The convolutional structures for the input-to-state transition (as in Eq. (13)) are reserved for the spatiotemporal feature fusion. In order to reduce the numbers of parameters of the input-to-state transition, the depthwise separable convolutions [23] are used. This reduces the parameter size of the variant of ConvLSTM to ParamConvLST Mva = (K × K + Cout × 4) × (Cin + Cout) (16) Three more variants are constructed based on variant (a), in order to verify whether the spatial attention can improve the performances. (b) Applying the attention mechanism to the inputs By referring to [5], we apply the spatial attention mechanism to the inputs before the operations of Eqs.(8)-(15). Formally, the attention mechanism can be formulated as: Zt = Wz ∗tanh(Wxa ∗Xt + Wha ∗Ht−1 + ba) (17) Aij t = p(attij|Xt, Ht−1) = exp(Zij t ) P i P j exp(Zij t ) (18) ˜Xt = At ◦Xt (19) where At is a 2-d score map, and Wz is the 2-d convolution kernel with a kernel size of K × K × Cin × 1. The variant (b) can be constructed by replacing Xt in Eqs.(8)-(15) with ˜Xt. The parameter size of this variant can be calculated as ParamConvLST Mvb = ParamConvLST Mva + K × K × (Cin + Cout × 2) + (Cin + Cout) × Cout (20) (c) Reconstructing the input gate using the channel-wise attention Both the gate and the attention mechanisms need to perform convolutions on the input and the hidden states, as expressed in Eqs. (1)-(3) and Eq. (17). Does this mean that the gate mechanism has the function of attention implicitly? The answer is no. The independent gate values in the spatial domain of the feature maps cannot ensure the attention effect as expressed in Eq. (18). Therefore, we reconstruct the input gate according to the attention mechanism. The sigmoid activation function makes the gate values fall in the range 0-1. The division by the sum in Eq. (18) results in attention scores whose sum is 1 in each feature channel. This means that the attention scores in each feature channel may be far less than 1, and far less than most of the normal gate values in other gates, given the large spatial size of the input feature maps. Therefore, the attention mechanism needs to be modified to match the range of the sigmoid function in the gates. Formally, the input gate can be reformulated as: Zt = Wi ∗tanh(Wxi ∗Xt + Whi ∗Ht−1 + bi) (21) Aij t (c) = exp(Zij t (c)) max i,j exp(Zij t (c)) (22) it = {Aij t (c) : (i, j, c) ∈RW ×H×Cout} (23) where Wi is a 2-d convolution kernel with a kernel size of W × H and a channel num of Cout. The "max i,j exp(Zij t (c))” in Eq. (22) corresponds to the maximum element chosen within the channel c of Zt. In other words, the normalization in Eq. (22) is performed channel-wise. The division by the maximum value instead of the sum ensures that the attention scores are distributed in the range of 0-1. Variant (c) of ConvLSTM can be constructed by replacing the input gate of variant (a) with the new gate expressed by Eqs. (21)-(23). The parameter size of this variant can be calculated as ParamConvLST Mvc = ParamConvLST Mva + K × K × (Cin + Cout × 2) + Cout × Cout (24) 5 (d) Reconstructing the output gate using the channel-wise attention Variant (b) of ConvLSTM applies the attention mechanism on the input feature maps, while variant (c) applies the attention mechanism on the candidate memory. Finally, variant (d) of ConvLSTM is constructed by applying the attention mechanism on the cell state. In other words, the output gate is reconstructed in the same way as the input gate in variant (c). The expressions are similar as in Eqs. (21)-(23), and they are thus omitted for simplicity. 3 Experiments The case in which ConvLSTM takes features from 2DCNN as input has been evaluated in [5], and the improvement (as illustrated in Table 1 of [5]) caused by the attention mechanism on the input features can indicate, in some degree, that the convolutional structures in the gates cannot play the role of spatial attention. Due to page restrictions, this paper only focuses on the evaluation of the case in which ConvLSTM takes features from 3DCNN as input. As aforementioned, the "3DCNN+ConvLSTM+2DCNN" architecture was originally proposed for gesture recognition [8]. Therefore, the proposed variants of ConvLSTM are evaluated on the large-scale isolated gesture datasets Jester [18] and IsoGD [19] in this paper. 3.1 Datasets Jester[18] is a large collection of densely-labeled video clips. Each clip contains a pre-defined hand gesture performed by a worker in front of a laptop camera or webcam. The dataset includes 148,094 RGB video files of 27 kinds of gestures. It is the largest isolated gesture dataset in which each category has more than 5,000 instances on average. Therefore, this dataset was used to train our networks from scratch. IsoGD[19] is a large-scale isolated gesture dataset which contains 47,933 RGB+D gesture videos of 249 kinds of gestures performed by 21 subjects. The dataset has been used in the 2016 [24] and 2017 [25] ChaLearn LAP Large-scale Isolated Gesture Recognition Challenges. This paper has the benefit that results are compared with the state-of-the-art networks used in the challenges. Different multi-modal fusion methods were used by the teams in the challenges. In this paper, only the evaluation on each modality is performed (without multi-modal fusion) to verify the advantages of the different deep architectures. 3.2 Implementation details The base architecture has been displayed in Fig. 1. The Res3D and MobileNet components are deployed from their original versions, except for the aforementioned modifications in Section 2.1. These two components are fixed among the variants. The filter numbers of ConvLSTM and the variants are all set to 256. The networks using the original ConvLSTM or the variants are first trained on the Jester dataset from scratch, and then fine-tuned using the IsoGD dataset to report the final results. For the training on Jester, the learning rate follows a polynomial decay from 0.001 to 0.000001 within a total of 30 epochs. The input is 16 video clips, and each clip contains 16 frames with a spatial size of 112 × 112. The uniform sampling with the temporal jitter strategy [26] is utilized to preprocess the inputs. During the fine-tuning with IsoGD, the batch size is set to 8, the temporal length is set to 32, and a total of 15 epochs are performed for each variant. The top-1 accuracy is used as the metric of evaluation. Stochastic gradient descent (SGD) is used for training. 3.3 Explorative study The networks which use the original ConvLSTM or the four variants as the ConvLSTM component in Fig. 1 are evaluated on the Jester and IsoGD datasets respectively. The evaluation results are illustrated in Table 1. The evaluation on Jester has almost the same accuracy except for variant (b). The similar recognition results on Jester may be caused by the network capacity or the distinguishability of the data, because the validation has a comparable accuracy with the training. The lower accuracy of variant (b) may indicate the uselessness of the extra attention mechanism on the inputs, since the learnt spatiotemporal features of 3DCNN have already paid attention to the noticeable spatial regions. 6 Table 1: Comparison among the original ConvLSTM and the four variants. For simplicity, each row in the column of "Networks" denotes the deep architecture (as displayed in Fig. 1) which takes the original ConvLSTM or its variant as the ConvLSTM component. Validating Accuracy(%) Networks Jester IsoGD Channel Num Parameter Size Mult-Adds ConvLSTM 95.11 52.01 256 4.719M 3700M Variant (a) 95.12 55.98 256 0.529M 415M Variant (b) 94.18 43.93 256 0.667M 522M Variant (c) 95.13 53.27 256 0.601M 472M Variant (d) 95.10 54.11 256 0.601M 472M The lower accuracy of the variant (b) on IsoGD can also testify this conclusion. The lower accuracy may be due to the additional optimization difficulty caused by the extra multiplication operations in the attention mechanism. The comparison on IsoGD shows that variant (a) is superior to the original ConvLSTM, regardless of the recognition accuracy or the parameter size and the computational consumption. The reduction of the convolutional structures in the three gates will not reduce the network capacity, but can save memory and computational consumption significantly. The specific attention mechanism embedded in the input and output gates cannot contribute to the feature fusion, but it just brings extra memory and computational consumption. These observations demonstrate that the ConvLSTM component only needs to take full use of its advantages on the long-term temporal fusion, when the input features have learnt the local spatiotemporal information. LSTM/RNN has its superiority on the long sequential data processing. The extension from LSTM to ConvLSTM can only increase the dimensionality of the states and memory, and keep the original gate mechanism unchanged. This evaluation leads to a new variant of LSTM (i.e., variant (a) of ConvLSTM), in which the convolutional structures are only introduced into the input-to-state transition, and the gates still have the original fully-connected mechanism . The added convolutional structures make the variant of LSTM capable of performing the spatiotemporal feature fusion. The gate mechanism still sticks to its own responsibility and superiority for the long-term temporal fusion. 3.4 Comparison with the state-of-the-art Table 2 shows the comparison results with the state-of-the-art networks on IsoGD. The 2DCNN networks demonstrate their unbeatable superiority on the image-based applications, and also show their ability for action recognition with the help of the specific backgrounds and objects. But, they do not keep their unbeatable performances in the case of gesture recognition, where the fine-grained spatiotemporal features of hands and the global motions of arms do matter. The 3DCNN networks are good at the spatiotemporal feature learning. But, the weakness on long-term temporal fusion restricts their capabilities. The "3DCNN+ConvLSTM+2DCNN" architecture takes full use of the advantages of 3DCNN, ConvLSTM and 2DCNN. The proposed variant (a) of ConvLSTM further enhances ConvLSTM’s ability for spatiotemporal feature fusion, without any additional burden. Therefore, the best recognition results can be obtained by taking full use of the intrinsic advantages of the different networks. Although the reference [27] reports the state-of-the-art performance on IsoGD, the high accuracy is achieved by fusing 12 channels (i.e., global/left/right channels for four modalities). The proposed network obtains the best accuracy on each single modality. This exactly demonstrates the superiority of the proposed architecture. 3.5 Visualization of the feature map fusion The reduction of the convolutional structures of the three gates in ConvLSTM brings no side effects to spatiotemporal feature map fusion. Fig. 3 displays an example of visualization of the feature map fusion along with the recurrent steps. It can be seen from the heat maps that the most active regions just reflect the hands’ motion trajectories. These are similar to the attention score maps. This also indicates that the learnt spatiotemporal features from 3DCNN have paid attention to the noticeable spatial regions, and no extra attention mechanism is needed when fusing the long-term spatiotemporal 7 Table 2: Comparison with the state-of-the-art networks on the valid set of IsoGD. Accuracy(%) Deep Architecture RGB Depth Flow ResNet50 [27] 33.22 27.98 46.22 Pyramidal C3D [26] 36.58 38.00 C3D [28] 37.30 40.50 Res3D [29] 45.07 48.44 44.45 3DCNN+BiConvLSTM+2DCNN[8] 51.31 49.81 45.30 Res3D+ConvLSTM+MobileNet 52.01 51.30 45.59 Res3D+ConvLSTM Variant(a)+MobileNet 55.98 53.28 46.51 Figure 3: An example of visualization of the feature map fusion in the case of variant (a) of ConvLSTM along with the recurrent steps. The feature map which has the largest activation sum among the 256 channels is visualized. feature maps using ConvLSTM. The reduction of the convolutional structures of the three gates in ConvLSTM makes the variant more applicable for constructing more complex deep architectures, since this variant has fewer parameters and computational consumption. 4 Conclusion The effects of attention in Convolutional LSTM are explored in this paper. Our evaluation results and previous published results show that the convolutional structures in the gates of ConvLSTM do not play the role of spatial attention, even if the gates have independent weight values for each element of the feature maps in the spatial domain. The reduction of the convolutional structures in the three gates results in a better accuracy, a lower parameter size and a lower computational consumption. This leads to a new variant of LSTM, in which the convolutional structures are only added to the input-to-state transition, and the gates still stick to their own responsibility and superiority for long-term temporal fusion. This makes the proposed variant capable of effectively performing spatiotemporal feature fusion, with fewer parameters and computational consumption. Acknowledgments This work is partially supported by the National Natural Science Foundation of China under Grant No.61702390, and the Fundamental Research Funds for the Central Universities under Grant JB181001. 8 References [1] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [2] Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016. [3] Klaus Greff, Rupesh K Srivastava, Jan Koutník, Bas R Steunebrink, and Jürgen Schmidhuber. Lstm: A search space odyssey. IEEE transactions on neural networks and learning systems, 28(10):2222–2232, 2017. [4] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems (NIPS), pages 802–810, 2015. [5] Zhenyang Li, Kirill Gavrilyuk, Efstratios Gavves, Mihir Jain, and Cees GM Snoek. Videolstm convolves, attends and flows for action recognition. Computer Vision and Image Understanding, 166:41–50, 2018. [6] Lei Wang, Yangyang Xu, Jun Cheng, Haiying Xia, Jianqin Yin, and Jiaji Wu. Human action recognition by learning spatio-temporal features with deep neural networks. IEEE Access, 6:17913–17922, 2018. [7] Guangming Zhu, Liang Zhang, Peiyi Shen, and Juan Song. Multimodal gesture recognition using 3-d convolution and convolutional lstm. IEEE Access, 5:4517–4524, 2017. [8] Liang Zhang, Guangming Zhu, Peiyi Shen, Juan Song, Syed Afaq Shah, and Mohammed Bennamoun. Learning spatiotemporal features using 3dcnn and convolutional lstm for gesture recognition. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 3120–3128, 2017. [9] Huogen Wang, Pichao Wang, Zhanjie Song, and Wanqing Li. Large-scale multimodal gesture segmentation and recognition based on convolutional neural networks. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 3138–3146, 2017. [10] Swathikiran Sudhakaran and Oswald Lanz. Convolutional long short-term memory networks for recognizing first person interactions. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 2339–2346, 2017. [11] Weixin Luo, Wen Liu, and Shenghua Gao. Remembering history with convolutional lstm for anomaly detection. In 2017 IEEE International Conference on Multimedia and Expo (ICME), pages 439–444, 2017. [12] Yunbo Wang, Mingsheng Long, Jianmin Wang, Zhifeng Gao, and S Yu Philip. Predrnn: Recurrent neural networks for predictive learning using spatiotemporal lstms. In Advances in Neural Information Processing Systems (NIPS), pages 879–888, 2017. [13] Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pages 2625–2634, 2015. [14] Lionel Pigou, Aäron Van Den Oord, Sander Dieleman, Mieke Van Herreweghe, and Joni Dambre. Beyond temporal pooling: Recurrence and temporal convolutions for gesture recognition in video. International Journal of Computer Vision, 126(2-4):430–439, 2018. [15] Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhudinov, Rich Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In International Conference on Machine Learning (ICML), pages 2048–2057, 2015. [16] Du Tran, Jamie Ray, Zheng Shou, Shih-Fu Chang, and Manohar Paluri. Convnet architecture search for spatiotemporal feature learning. arXiv preprint arXiv:1708.05038, 2017. [17] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. [18] www.twentybn.com. Twentybn jester dataset: a hand gesture dataset. https://www.twentybn.com/datasets/jester, 2017. [19] Jun Wan, Yibing Zhao, Shuai Zhou, Isabelle Guyon, Sergio Escalera, and Stan Z Li. Chalearn looking at people rgb-d isolated and continuous datasets for gesture recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 56–64, 2016. 9 [20] 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 (ECCV), pages 20–36. Springer, 2016. [21] Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3d convolutional networks. In 2015 IEEE International Conference on Computer Vision (ICCV), pages 4489–4497. IEEE, 2015. [22] Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4724–4733. IEEE, 2017. [23] Lukasz Kaiser, Aidan N Gomez, and Francois Chollet. Depthwise separable convolutions for neural machine translation. arXiv preprint arXiv:1706.03059, 2017. [24] Hugo Jair Escalante, Víctor Ponce-López, Jun Wan, Michael A Riegler, Baiyu Chen, Albert Clapés, Sergio Escalera, Isabelle Guyon, Xavier Baró, Pål Halvorsen, et al. Chalearn joint contest on multimedia challenges beyond visual analysis: An overview. In 2016 23rd International Conference on Pattern Recognition (ICPR), pages 67–73, 2016. [25] Jun Wan, Sergio Escalera, X Baro, Hugo Jair Escalante, I Guyon, M Madadi, J Allik, J Gorbova, and G Anbarjafari. Results and analysis of chalearn lap multi-modal isolated and continuous gesture recognition, and real versus fake expressed emotions challenges. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 3189–3197, 2017. [26] Guangming Zhu, Liang Zhang, Lin Mei, Jie Shao, Juan Song, and Peiyi Shen. Large-scale isolated gesture recognition using pyramidal 3d convolutional networks. In 2016 23rd International Conference on Pattern Recognition (ICPR), pages 19–24, 2016. [27] Pradyumna Narayana, J. Ross Beveridge, and Bruce A Draper. Gesture recognition: Focus on the hands. In 2018 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018. [28] Yunan Li, Qiguang Miao, Kuan Tian, Yingying Fan, Xin Xu, Rui Li, and Jianfeng Song. Large-scale gesture recognition with a fusion of rgb-d data based on the c3d model. In 2016 23rd International Conference on Pattern Recognition (ICPR), pages 25–30, 2016. [29] Qiguang Miao, Yunan Li, Wanli Ouyang, Zhenxin Ma, Xin Xu, Weikang Shi, Xiaochun Cao, Zhipeng Liu, Xiujuan Chai, Zhuang Liu, et al. Multimodal gesture recognition based on the resc3d network. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 3047–3055, 2017. 10
2018
175
7,336
Forward Modeling for Partial Observation Strategy Games - A StarCraft Defogger Gabriel Synnaeve∗ Facebook, NYC gab@fb.com Zeming Lin∗ Facebook, NYC zlin@fb.com Jonas Gehring Facebook, Paris jgehring@fb.com Dan Gant Facebook, NYC danielgant@fb.com Vegard Mella Facebook, Paris vegardmella@fb.com Vasil Khalidov Facebook, Paris vkhalidov@fb.com Nicolas Carion Facebook, Paris alcinos@fb.com Nicolas Usunier Facebook, Paris usunier@fb.com Abstract We formulate the problem of defogging as state estimation and future state prediction from previous, partial observations in the context of real-time strategy games. We propose to employ encoder-decoder neural networks for this task, and introduce proxy tasks and baselines for evaluation to assess their ability of capturing basic game rules and high-level dynamics. By combining convolutional neural networks and recurrent networks, we exploit spatial and sequential correlations and train well-performing models on a large dataset of human games of StarCraft R ⃝: Brood War R ⃝†. Finally, we demonstrate the relevance of our models to downstream tasks by applying them for enemy unit prediction in a state-of-the-art, rule-based StarCraft bot. We observe improvements in win rates against several strong community bots. 1 Introduction A current challenge in AI is to design policies to act in complex and partially observable environments. Many real-world scenarios involve a large number of agents that interact in different ways, and only a few of these interactions are observable at a given point in time. Yet, long-term planning is possible because high-level behavioral patterns emerge from the agents acting to achieve one of a limited set of long-term goals, under the constraints of the dynamics of the environment. In contexts where observational data is cheap but exploratory interaction costly, a fundamental question is whether we can learn reasonable priors – of these purposeful behaviors and the environment’s dynamics – from observations of the natural flow of the interactions alone. We address this question by considering the problems of state estimation and future state prediction in partially observable real-time strategy (RTS) games, taking StarCraft: Brood War as a running example. RTS games are multi-player games in which each player must gather resources, build an economy and recruit an army to eventually win against the opponent. Each player controls their units individually, and has access to a bird’s-eye view of the environment where only the vicinity of the player’s units is revealed. Though still artificial environments, RTS games offer many of the properties of real-world scenarios at scales that are extremely challenging for the current methods. A typical state in StarCraft can be represented by a 512 × 512 2D map of “walk tiles”, which contains static terrain and buildings, as ∗These authors contributed equally †StarCraft is a trademark or registered trademark of Blizzard Entertainment, Inc., in the U.S. and/or other countries. Nothing in this paper should be construed as approval, endorsement, or sponsorship by Blizzard Entertainment, Inc. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. well as up to 200 units per player. These units can move or attack anywhere in the map, and players control them individually; there are about 45 unit types, each of which has specific features that define the consequences of actions. Top-level human players perform about 350 actions per minute [1]. The high number of units interacting together makes the low-level dynamics of the game seemingly chaotic and hard to predict. However, when people play purposefully, at lower resolution in space and time, the flow of the game is intuitive for humans. We formulate the tasks of state estimation and future state prediction as predicting unobserved and future values of relevant high-level features of the game state, using a dataset of real game replays and assuming full information at training time. These high-level features are created from the raw game state by aggregating low-level information at different resolutions in space and time. In that context, state estimation and future state prediction are closely related problems, because hidden parts of the state can only be predicted by estimating how their content might have changed since the last time they were observed. Thus both state estimation and future state prediction require learning the natural flow of games. We present encoder-decoder architectures with recurrent units in the latent space, evaluate these architectures against reasonable rule-based baselines, and show they perform significantly better than the baselines and are able to perform non-trivial prediction of tactical movements. In order to assess the relevance of the predictions on downstream tasks, we inform the strategic and tactical planning modules of a state-of-the-art full game bot with our models, resulting in significant increases in terms of win rate against multiple strong open-source bots. We release the code necessary for the reproduction of the project at https://github.com/facebookresearch/starcraft_defogger. 2 Related Work Employing unsupervised learning to predict future data from a corpus of historical observations is sometimes referred to as “predictive learning”. In this context, one of the most fundamental applications for which deep learning has proven to work well is language modeling, i.e. predicting the next word given a sequence of previous words [2, 3, 4]. This has inspired early work on predicting future frames in videos, originally on raw pixels [5, 6] and recently also in the space of semantic segmentations [7]. Similar approaches have been used to explicitly learn environment dynamics solely based on observations: in [8], models are being trained to predict future images in generated videos of falling block towers with the aim of discovering fundamental laws of gravity and motion. Combining the most successful neural network paradigms for image data (CNNs) and sequence modeling (LSTMs) to exploit spatio-temporal relations has led to fruitful applications of the above ideas to a variety of tasks. [9] propose a LSTM with convolutional instead of linear interactions and demonstrate good performance on predicting percipitation based on radar echo images; [10] use a similar approach to forecast passenger demand for on-demand ride services; [11] estimate future traffic in Bejing based on image representations of road networks. StarCraft: Brood War has long been a popular test bed and challenging benchmark for AI algorithms [12]. The StarCraft domain features partial observability; hence, a large part of the current game state is unknown and has to be estimated. This has been previously attempted with a focus on low-level dynamics, e.g. by modeling the movement of individual enemy units with particle filters [13]. [14] try to anticipate timing, army composition and location of upcoming opponent attacks with a bayesian model that explicitly deals with uncertainty due to the fog of war. [15] do not deal with issues caused by partial information but demonstrate usage of a combat model (which is conditioned on both state and action) learned from replay data that can be used in Monte Carlo Tree Search. In the above works on StarCraft, features for machine learning techniques were hand-crafted with extensive domain knowledge. Deep learning methods, aiming to learn directly from raw input data, have only very recently been applied to this domain in the context of reinforcement learning in limited scenarios, e.g. [16, 17]. To our best knowledge, the only deep learning approach utilizing replays of human games to improve actual full-game play is [18], which use a feed-forward model to predict the next unit that the player should produce. They apply their model as a production manager in a StarCraft bot and achieve a win rate of 68% against the game’s built-in AI. 2 3 Task Description Formally, we consider state estimation and future state prediction in StarCraft to be the problem of inferring the full game state, yt+s for s ≥0, given a sequence of past and current partial observations, o0, . . . , ot. In this work, we restrict full state to be the locations and types of all units on the game map, ignoring attributes such as health. A partial observation ot contains all of a player’s units as well as enemy or neutral units (e.g. resource units) in their vicinity, subject to sight range per unit type. Note that during normal play, we do not have access to yt. We can however utilize past games for training as replaying them in StarCraft provides both ot and yt. We note that humans generally make forward predictions on a high level at a long time-scale – humans will not make fine predictions but instead predict a general composition of units over the whole game map. Thus, we propose to model a low-resolution game state by considering accumulated counts of units by type, downsampled onto a coarse spatial grid. We ignore dynamic unit attributes like health, energy or weapon cool-down. By downsampling spatially, we are unable to account for minute changes in e.g. unit movement but can capture high-level game dynamics more easily. This enables our models to predict relatively far into the future. Good players are able to estimate these dynamics very accurately which enables them to anticipate specific army movements or economic development of their opponents, allowing them to respond by changing their strategy. StarCraft: Brood War is played on rectangular maps with sizes of up to 8192 × 8192 pixels. For most practical purposes it is sufficient to consider “walk tiles” instead which consist of 8 × 8 pixels each. In our setup, we accumulate units over r × r walk tiles, with a stride of g × g; Figure 4 shows a grid for r = 32 and g = 32 on top of a screenshot of StarCraft. For a map of size H × W walk tiles, the observation ot and output yt are thus a Hr,g × Wr,g × Cu tensor, with Hr,g = ⌈H−r g ⌉, Wr,g = ⌈W −r g ⌉, and number of channels Cu corresponding to the number of possible unit types. We use disjoint channels for allied and enemy units. Each element in ot and yt thus represents the absolute number of units of a specific type and player at a specific grid location, where ot only contains the part of the state observed by the current player. Additional static information τ includes (a) terrain features, a H × W × CT tensor that includes elements such as walkability, buildability and ground height, and (b) the faction, fme and fop, that each player picks. Thus, each input xt = (ot, τ, fme, fop) Additionally, we pick a temporal resolution of at least s = 5 seconds between consecutive states, again aiming to model high-level dynamics rather than small but often irrelevant changes. At the beginning of a game, players often follow a fixed opening and do not encounter enemy units. We therefore do not consider estimating states in the first 3 minutes of the game. To achieve data uniformity and computational efficiency, we also ignore states beyond 11 minutes. In online and professional settings, StarCraft is usually played at 24 frames per second with most games lasting between 10 and 20 minutes [19]. 4 Encoder-Decoder Models The broad class of architectures we consider is composed of convolutional models that can be segmented in two parts: an encoder and a decoder, depicted in Figure 1. In all models, we preprocess static information with small networks. To process the static terrain information τ, a convolutional network EM of kernel size r and stride g is used to downsample the H ×W ×CT tensor into an Hr,g ×Wr,g ×FT embedding. The faction of both players is represented by a learned embedding of size FF . Finally, this is replicated temporally and concatenated with the input to generate a T × Hr,g × Wr,g × (FT + FF + Cu) tensor as input to the encoder. The encoder then embeds it into a FE sized embedding and passes it into a recurrent network with LSTM cells. The recurrent cells allow our models to capture information from previous frames, which is necessary in a partially observable environment such as StarCraft, because events that we observed minutes ago are relevant to predict the hidden parts of the current state. Then, the input to the decoder D takes the FE sized embedding, replicate along the spatial dimension of ot and concatenates it along the feature dimension of ot. The decoder then uses D to produce an embedding with the same spatial dimensions as yt. This embedding is used to produce two types of predictions. The first one, Pc in Figure 1, is a global head 3 that takes as input a spatial sum-pooling and is a linear layer with sigmoid outputs for each unit type that predict the existence or absence of at least one unit of the corresponding type. This corresponds to g_op_b described in section 5.1.1. The second type of prediction Pr predicts the number of units of each type across the spatial grid at the same resolution as ot. This corresponds to the other tasks described in section 5.1.1. The Pc heads are trained with binary cross entropy loss, while the Pr heads are trained with a Huber loss. Encoder RNN Decoder Pr Pr ⊕ Pc Pr ... concat concat EF Feats. EM ˆy0,0 ˆy0,1 ˆyHr,g,Wr,g ˆc state map faction Figure 1: Simplified architecture of the model. Rectangles denote 1 × 1 convolutions or MLPs, trapezes denote convolutional neural networks, circles and loops denote recurrent neural networks. ⊕ denotes spatial pooling. The dashed arrows represent the additional connections in the architecture with the convolutional LSTM encoder. We describe the two types of encoders we examine, a ConvNet (C) encoder and a ConvolutionalLSTMs (CL) encoder. Since the maps all have a maximum size, we introduce a simple ConvNet encoder with enough downsampling to always obtain a 1×1×h encoding at the end. In our experiments we have to handle input sizes of up to 16 × 16. Thus, we obtain a 1 × 1-sized output by applying four convolutional layers with a stride of two each. Our CL encoder architecture is based on what we call a spatially-replicated LSTM: Given that, for a sequence of length T, a convolution outputs a T × H × W × C sized tensor X, a spatially replicated LSTM takes as input each of the X(:, i, j, :) cells, and encodes its output to the same spatial location. That is, the weights of the LSTM at each spatial location is shared, but the hidden states are not. Thus, at any given layer in the network, we will have HW LSTMs with shared weights but unshared hidden states. The CL encoder is made out of a few blocks, where each block is a convolution network, a downsampling layer, and a spatially-replicated LSTM. This encoder is similar to the model proposed in [20], with a kernel size of 1 and additional downsampling and upsampling layers. The last output is followed by a global sum-pooling to generate the 1 × 1 × FE sized embedding required. We also introduce skip connections from the encoder to the decoder in the CL model, where each intermediate blocks’ outputs are upsampled and concatenated with ot as well, so the decoder can take advantage of the localized memory provided. With k blocks, we use a stride of 2 in each block, so the output of the k-th block must be upsampled by a factor of 2k. Thus, only in the CL model do we also concatenate the the intermediate LSTM cell outputs to the input to the decoder D. These skip-connections from the intermediate blocks are a way to propagate spatio-temporal memory to the decoder at different spatial scales, taking advantage of the specific structure of this problem. We use the same number of convolution layers in both C and CL. 5 Experiments We hypothesize that our models will be able to make predictions of the global build tree and local unit numbers better than strong existing baselines. We evaluate our models on a human games dataset, and compare them to heuristic baselines that are currently employed by competitive rule-based bots. We also test whether we are able to use the defogger directly in a state-of-the-art rule-based StarCraft bot, and we evaluate the impact of the best models within full games. 4 5.1 Experiments On Human Replays We define four tasks as proxies for measuring the usefulness of forward modeling in RTS games, and use those to assess the performance of our models. We then explain baselines and describe the hyper-parameters. Our models are trained and evaluated on the STARDATA corpus, which consists of 65,000 high quality human games of StarCraft: Brood War [19]. We use the train, valid, and test splits given by the authors, which comprise 59060, 3289 and 3297 games, respectively. Our models are implemented in PyTorch [21], and data preprocessing is done with TorchCraft [22]. 5.1.1 Evaluation Proxy Tasks In full games, the prediction of opponents’ strategy and tactical choices may improve your chances at victory. We define tactics as where to send your units, and strategy as what kind of units to produce. In strategy prediction, presence or absence of certain buildings is key to determining what types of units the opponent will produce, and which units the player needs to produce to counter the opponent. Thus, we can measure the prediction accuracy of all opponent buildings in a future frame. We use two proxy tasks to measure the strength of defogging and forward modeling in tactics. One task is the model correctly predicting the existence or absence of all enemy units on the game map, correlated to being able to model the game dynamics. Another is the prediction of only units hidden by the fog of war, correlated to whether our models can accurately make predictions under partially observable states. Finally, the task of correctly predicting the location and number of enemy units is measured most accurately by the regression Huber loss, which we directly train for. This results in four proxy tasks that correlate with how well the forward model can be used: • g_op_b (global opponent buildings) Existence of each opponent building type on any tile. • hid_u (hidden units) Existence of units that we do not see at time t + s, at each spatial location (i, j), necessarily belonging to your opponent. • op_u (opponent units) Existence of all opponent units at each spatial location (i, j). • Huber loss between the real and predicted unit counts in each tile, averaged over every dimension (temporal, spatial and unit types). For the first three tasks, we track the F1 score, and for the last the Huber loss. The scores for g_op_b are averaged over (T, Cu), other tasks (hid_u, op_u, Huber loss) are measured by averaging over all (T, Hr,g, Wr,g, Cu); and then averaged over all games. When predicting existence/absence (g_op_b, hid_u, op_u) from a head (be it a regression or classification head), we use a threshold that we cross-validate per model, per head, on the F1 score. 5.1.2 Baselines To validate the strength of our models, we compare their performance to relevant baselines that are similar to what rule-based bots use traditionally in StarCraft: Brood War competitions. Preliminary experiments with a kNN baseline showed that the rules we will present now worked better. These baselines rely exclusively on what was previously seen and game rules, to infer hidden units not in the current observation ot. We rely on four different baselines to measure success: • Previous Seen (PS): takes the last seen position for each currently hidden unit, which is what most rule based bots do in real games. When a location is revealed and no units are at the spot, the count is again reset to 0. • Perfect memory (PM): remembers everything, and units are never removed, maximizing recall. That is, with any t1 < t2, if a unit appears in ot1, then it is predicted to appear in ot2. • Perfect memory + rules (PM+R): designed to maximize g_op_b, by using perfect memory and game rules to infer the existence of unit types that are prerequisite for unit types that have ever been seen. • Input: predicts by copying the input frame, here as a sanity check. 5 In order to beat these baselines, our models have to learn to correlate occurrences of units and buildings, and remember what was seen before. We hope our models will also be able to model high-level game dynamics and make long term predictions to generate even better forward predictions. 5.1.3 Hyperparameters We train and compare multiple models by varying the encoder type as well as spatial and temporal resolutions. For each combination, we perform a grid search over multiple hyper-parameters and pick the best model according to our metrics on the proxy tasks as measured on the validation set. We explored the following properties: kernel width of convolutions and striding (3,5); model depth; non-linearities (ReLU, GLU); residual connections; skip connections in the encoder LSTM; optimizers (Adam, SGD); learning rates. During hyperparameter tuning, we found Adam to be more stable than SGD over a large range of hyperparameters. We found that models with convolutional LSTMs encoders worked more robustly over a larger range of hyperparameters. Varying model sizes did not amount to significant gains, so we picked the smaller sizes for computational efficiency. Please check the appendix for a more detailed description of hyperparameters searched over. 5.1.4 Results We report baselines and models scores according to the metrics described above, on 64 and 32 walktiles effective grids (g) due to striding, with predictions at 0, 5, 15, and 30 seconds in the future (s), in Table 1. To obtain the existence thresholds from a regression output, we sweep the validation set for threshold values on a logarithmic scale from 0.001 to 1.5. A unit is assumed to be present in a cell, if the corresponding model output is greater than the existence threshold. Lower threshold values performed better, indicating that our model is sure of grid locations with zero units. Similarly, we fine-tune the existence threshold for the opponent’s buildings. The value that maximizes the F1 score is slightly above 0.5. We report the results on the test set with the best thresholds on the validation set. We note that for g_op_b prediction, the baselines already do very well, it is hard to beat the best baseline, PM+R. Most of our models have higher recall than the baseline, indicating that they predict many more unexpected buildings, at the expense of mispredicting existing buildings. On all tasks, our models do as well or better than baseline. Our models make the most gains above baseline on unit prediction (columns op_u and hid_u). Since units often move very erratically due to the dynamics of pathfinding and rapid decision making, this is difficult for a baseline that only uses the previous frame. In order to predict units well, the model must have a good understanding of the dynamics of the game as well as the possible strategies taken by players in the game. For our baselines, the more coarse the grid size (g = 64, first row), the easier it is to predict unit movement, since small movements won’t change the featurization. The results confirm that our models are able to predict the movement of enemy units, which none of the baselines are able to do. Our models consistently outperform both tasks by a significant amount. In Table 1 the Huber loss gives a good approximation to how useful it will be when a state-of-the-art bot takes advantage of its predictions. During such control, we wish to minimize the number of mispredictions of opponent units. We average this loss across the spatial and temporal dimensions, and then across games, so the number is not easily interpretable. These losses are only comparable in the same (g, s) scenario, and we do much better than baseline on all three accounts. To give an intuition of prediction performance of our models, we visualized predicted unit types, locations and counts against the actual ones for hidden enemy units in Figure 2. We can see how well the model learns the game dynamics – in (a), the model gets almost nothing as input at the current timestep, yet still manages to predict a good distribution over the enemy units from what is seen in the previous frames. (b) shows that on longer horizons the prediction is less precise, but still contains quite some valuable information to plan tactical manoeuvres. 5.1.5 Evaluation in a Full-Game Bot After observing good performance on metrics representing potential downstream tasks, we test these trained models in a StarCraft: Brood War full-game setting. We run a forward model alongside our 6 Task: op_u F1 hid_u F1 g_op_b F1 Huber ·10−4 g : s B C CL B C CL B C CL B C CL 64 : 15 0.53 0.53 0.62 0.47 0.51 0.56 0.88 0.89 0.92 28.97 14.94 10.40 32 : 30 0.33 0.48 0.47 0.26 0.44 0.44 0.88 0.92 0.90 1.173 0.503 0.503 32 : 15 0.34 0.48 0.51 0.26 0.45 0.48 0.88 0.91 0.94 1.134 0.488 0.430 32 : 5 0.35 0.44 0.52 0.27 0.38 0.47 0.89 0.90 0.95 1.079 0.431 0.424 32 : 0 0.35 0.44 0.50 0.27 0.38 0.45 0.89 0.90 0.89 1.079 0.429 0.465 Table 1: Scores of our proposed models (C for ConvNet, CL for Convolutional LSTMs) and of the best baseline (B) for each task, in F1. The Huber loss is only comparable across the same stride g. (a) prediction at 5s (b) prediction at 30s Figure 2: Enemy unit counts of the specified type per map cell, where darker dots correspond to higher counts. The top row of each plot shows the model input, where green indicates an input to our model. Grey areas designate the areas hidden by fog of war but are not input to our model. Middle row shows predicted unit distributions after 5 and 30 seconds. Bottom row shows real unit distributions. 7 Win rate Normal Vision 61 (baseline) Enhanced vision used for Tactics Build Both Full Vision 57 66 72 Defog t + 0s 57 62 59 Defog t + 5s 61 66 61 Defog t + 30s 50 59 49 Table 2: Average win rates with strategies that integrate predictions from defogger models but are otherwise unmodified. Win rate Normal Vision 59 (baseline) Enhanced vision used for Tactics Build Both Full Vision 61 64 70 Defog t + 0s 61 63 55 Defog t + 5s 61 63 55 Defog t + 30s 52 51 43 Table 3: Average win rates from a subset of the games in the previous table. These games feature just one of our bot’s strategies (focused on building up economy first) against 4 Terran opponents. modular, rule-based, state-of-the-art StarCraft bot. We apply minimal changes, allowing the existing rules – which were tuned to win without any vision enhancements – to make use of the predictions. We played multiple games with our bot against a battery of competitive opponents (see Table 5 in Appendix). We then compare results across five different sources of vision: • Normal: Default vision settings • Full Vision: Complete knowledge of the game state. • Defog + 0s: Defogging the current game state. • Defog + 5s: Defogging 5 seconds into the future. • Defog + 30s: Defogging 30 seconds into the future. We take the best defogger models in opu from the validation set. For each of the Full vision and Defog settings, we run three trials. In each trial we allow one or two of the bot’s modules to consider the enhanced information: • Tactics: Positioning armies and deciding when to fight. • Build Actions: Choosing which units and structures to build. • Both: Both Tactics and Build Actions. In Tables 2 and 3, we investigate the effects of enhanced vision on our StarCraft bot’s gameplay. For these experiments, our changes were minimal: we did not change the existing bot’s rules, and our bot uses its existing strategies, which were previously tuned for win rates with normal vision, which essentially uses the Previous Seen baseline. Our only changes consisted of substituting the predicted unit counts (for Build Actions) and to put the predicted unseen units at the center of the hidden tiles where they are predicted (for Tactics). In our control experiment with Full Vision, we do the exactly the same, but instead of using counts predicted by defogging, we input the real counts, effectively cheating by given our bot full vision but snapping to the center of the hidden tiles to emulate the defogger setting. We run games with our bot against all opponents listed in Table 5, playing a total of 1820 games for each setting in Table 2. Because our bot is Zerg, and most Zerg vs Zerg matchups depend much more on execution than opponent modeling, we do not try any Zerg bots. On average, over all match-ups and strategies, using the defogger model boosts the win rate of our rule-based bot to 66% from 61% (baseline), as Table 2 demonstrates. Overall, the defogger seems to hurt the existing Tactics module more than help it, but improves the performance of Build Actions. We note that any variance in defogger output over time produces different kinds of errors in Build Actions and Tactics. Variance in inputs to Build Actions are likely to smooth out over time as the correct units are added in future time steps. Underestimations in Tactics cause the army to engage; subsequent overestimations cause it to retreat, leading to unproductive losses through indecision. We broke down those results in a single match-up (Zerg vs. Terran), using a single strategy, in Table 3, the trends are the same, with encouraging use of the defogger predictions for Build Actions alone, 8 (a) vs. IronBot (b) vs. McRave Figure 3: Plot showing the enemy army “supply” (≈unit counts) during the game: green is the ground truth, blue is the prediction of the defogger, and red is the known count our bot would normally have access with Normal Vision, equivalent to the PS baseline. and poor result when combining this with Tactics. It suggests we could get better results by using a different defogger model for Tactics, or tuning the rules for the enhanced information conditions. Finally, in Figure 3, we observe that the defogger model is able to much more precisely predict the number of units in the game compared to using heuristics, equivalent to the PS baseline. 6 Conclusion and Future Work We proposed models for state estimation and future state prediction in real-time strategy games, with the goals of inferring hidden parts of the state and learning higher-level strategic patterns and basic rules of the game from human games. We demonstrated via off-line tests that encoder-decoder architectures with temporal memory perform better than rule-based baselines at predicting both the current state and the future state. Moreover, we provide analysis of the advantages and pitfalls of informing a the tactical and strategic modules of a rule-based bot with a forward model trained solely on human data. Forward models such as the defogger lack a model of how the agent acts in the environment. We believe the promising results presented in this paper open the way towards learning models of the evolution of the game conditioned on the players’ strategy, to perform model-based reinforcement learning or model predictive control. References [1] Wikipedia contributors. Actions per minute. https://en.wikipedia.org/wiki/Actions_ per_minute, 2018. [Online; accessed 26-October-2018]. [2] Reinhard Kneser and Hermann Ney. Improved backing-off for m-gram language modeling. In Acoustics, Speech, and Signal Processing, 1995. ICASSP-95., 1995 International Conference on, volume 1, pages 181–184. IEEE, 1995. [3] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. Journal of machine learning research, 3(Feb):1137–1155, 2003. [4] Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. [5] MarcAurelio Ranzato, Arthur Szlam, Joan Bruna, Michael Mathieu, Ronan Collobert, and Sumit Chopra. Video (language) modeling: a baseline for generative models of natural videos. In International Conference on Learning Representations, ICLR, 2015. 9 [6] Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. arXiv:1511.05440 [cs, stat], November 2015. arXiv: 1511.05440. [7] Pauline Luc, Natalia Neverova, Camille Couprie, Jakob Verbeek, and Yann Lecun. Predicting Deeper into the Future of Semantic Segmentation. In ICCV 2017 - International Conference on Computer Vision, page 10, Venise, Italy, October 2017. [8] Adam Lerer, Sam Gross, and Rob Fergus. Learning physical intuition of block towers by example. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pages 430–438. JMLR.org, 2016. [9] Xingjian Shi, Zhihan Gao, Leonard Lausen, Hao Wang, Dit-Yan Yeung, Wai-kin Wong, and Wang-chun Woo. Deep learning for precipitation nowcasting: A benchmark and a new model. In Advances in Neural Information Processing Systems, pages 5622–5632, 2017. [10] Jintao Ke, Hongyu Zheng, Hai Yang, and Xiqun Michael Chen. Short-term forecasting of passenger demand under on-demand ride services: A spatio-temporal deep learning approach. Transportation Research Part C: Emerging Technologies, 85:591–608, 2017. [11] Haiyang Yu, Zhihai Wu, Shuqin Wang, Yunpeng Wang, and Xiaolei Ma. Spatiotemporal recurrent convolutional networks for traffic prediction in transportation networks. Sensors, 17(7):1501, 2017. [12] Santiago Ontanón, Gabriel Synnaeve, Alberto Uriarte, Florian Richoux, David Churchill, and Mike Preuss. A survey of real-time strategy game ai research and competition in starcraft. IEEE Transactions on Computational Intelligence and AI in games, 5(4):293–311, 2013. [13] Ben George Weber, Michael Mateas, and Arnav Jhala. A particle model for state estimation in real-time strategy games. In AIIDE, 2011. [14] Gabriel Synnaeve and Pierre Bessiere. Special tactics: A bayesian approach to tactical decisionmaking. In Computational Intelligence and Games (CIG), 2012 IEEE Conference on, pages 409–416. IEEE, 2012. [15] Alberto Uriarte and Santiago Ontanón. Automatic learning of combat models for rts games. In Eleventh Artificial Intelligence and Interactive Digital Entertainment Conference, 2015. [16] Nicolas Usunier, Gabriel Synnaeve, Zeming Lin, and Soumith Chintala. Episodic exploration for deep deterministic policies: An application to starcraft micromanagement tasks. arXiv preprint arXiv:1609.02993, 2016. [17] Jakob Foerster, Gregory Farquhar, Triantafyllos Afouras, Nantas Nardelli, and Shimon Whiteson. Counterfactual multi-agent policy gradients. arXiv preprint arXiv:1705.08926, 2017. [18] Niels Justesen and Sebastian Risi. Learning macromanagement in starcraft from replays using deep learning. In Computational Intelligence and Games (CIG), 2017 IEEE Conference on, pages 162–169. IEEE, 2017. [19] Zeming Lin, Jonas Gehring, Vasil Khalidov, and Gabriel Synnaeve. STARDATA: A StarCraft AI Research Dataset. In AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment, 2017. [20] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. CoRR, abs/1506.04214, 2015. [21] 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. 2017. [22] Gabriel Synnaeve, Nantas Nardelli, Alex Auvolat, Soumith Chintala, Timothée Lacroix, Zeming Lin, Florian Richoux, and Nicolas Usunier. TorchCraft: a Library for Machine Learning Research on Real-Time Strategy Games. arXiv:1611.00625 [cs], November 2016. arXiv: 1611.00625. 10 [23] S. Ontañón, G. Synnaeve, A. Uriarte, F. Richoux, D. Churchill, and M. Preuss. A Survey of Real-Time Strategy Game AI Research and Competition in StarCraft. IEEE Transactions on Computational Intelligence and AI in Games, 5(4):293–311, December 2013. [24] Gabriel Synnaeve. Bayesian programming and learning for multi-player video games. PhD thesis, Grenoble University, 2012. 11
2018
176
7,337
PacGAN: The power of two samples in generative adversarial networks Zinan Lin ECE Department Carnegie Mellon University zinanl@andrew.cmu.edu Ashish Khetan IESE Department University of Illinois at Urbana-Champaign ashish.khetan09@gmail.com Giulia Fanti ECE Department Carnegie Mellon University gfanti@andrew.cmu.edu Sewoong Oh IESE Department University of Illinois at Urbana-Champaign swoh@illinois.edu Abstract Generative adversarial networks (GANs) are a technique for learning generative models of complex data distributions from samples. Despite remarkable advances in generating realistic images, a major shortcoming of GANs is the fact that they tend to produce samples with little diversity, even when trained on diverse datasets. This phenomenon, known as mode collapse, has been the focus of much recent work. We study a principled approach to handling mode collapse, which we call packing. The main idea is to modify the discriminator to make decisions based on multiple samples from the same class, either real or artificially generated. We draw analysis tools from binary hypothesis testing—in particular the seminal result of Blackwell [4]—to prove a fundamental connection between packing and mode collapse. We show that packing naturally penalizes generators with mode collapse, thereby favoring generator distributions with less mode collapse during the training process. Numerical experiments on benchmark datasets suggest that packing provides significant improvements. 1 Introduction Generative adversarial networks (GANs) are a technique for training generative models to produce realistic examples from an unknown data distribution [10]. Suppose we are given N i.i.d. samples X1, . . . , XN from an unknown probability distribution P over some high-dimensional space Rp (e.g., images). The goal of generative modeling is to learn a model that can draw samples from distribution P. In data-driven generative modeling, this model is typically formulated as a function G : Rd →Rp that maps a low-dimensional code vector Z ∈Rd drawn from a standard distribution (e.g. spherical Gaussian) to a high-dimensional domain of interest. A breakthrough in training such generative models was achieved by the innovative idea of GANs. GANs train two neural networks called the generator G(Z) and discriminator D(X). The role of the generator is to produce realistic samples, and the role of the discriminator is to distinguish generated samples from real data. These two neural networks play a dynamic minimax game against each other. If trained long enough, eventually the generator learns to produce samples that are indistinguishable from real data (but preferably different from the training samples). Concretely, GANs search for the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. parameters of neural networks G and D that optimize the following minimax objective: G∗ ∈ arg min G max D V (G, D) = arg min G max D EX∼P [log(D(X))] + EZ∼PZ[log(1 −D(G(Z)))] , (1) where P is the distribution of the real data, and PZ is the distribution of the input code vector Z. Critically, [10] shows that the global optimum of (1) is achieved if and only if P = Q, where Q is the generated distribution of G(Z). The solution to the minimax problem (1) can be approximated by iteratively training two “competing" neural networks, the generator G and discriminator D. Each model can be updated by backpropagating the gradient of the loss function to its parameters. A major challenge in training GANs is a phenomenon known as mode collapse, which refers to a lack of diversity in generated samples. Indeed, GANs commonly miss modes when trained on multimodal distributions. For instance, when trained on hand-written digits with ten modes, the generator might fail to produce some of the digits [24]. Several approaches have been proposed to fight mode collapse, e.g. [7, 8]. Proposed solutions rely on modified architectures, loss functions, and optimization algorithms. Although each of these proposed methods empirically mitigates mode collapse, we lack rigorous explanations of why the empirical gains are achieved—especially when those gains are sensitive to hyperparameters. Our Contributions. In this work, we examine GANs through the lens of hypothesis testing. By viewing the discriminator as performing a binary hypothesis test on samples (i.e., whether they were drawn from distribution P or Q), we can apply classical hypothesis testing results to the analysis of GANs. This view leads to three contributions: (1) Conceptual: We propose a formal definition of mode collapse that abstracts away the geometric properties of the underlying data distributions (Section 3). This definition is closely related to the notion of ROC curves in binary hypothesis testing. Given this definition, we provide a new interpretation of the pair of distributions (P, Q) as a two-dimensional region called the mode collapse region, where P is the true data distribution and Q the generated one. The mode collapse region provides new insights on how to reason about the relationship between those two distributions. (2) Analytical: Through the lens of hypothesis testing and mode collapse regions, we show that if the discriminator is allowed to see samples from the m-th order product distributions P m and Qm instead of the usual target distribution P and generator distribution Q, then the corresponding loss when training the generator naturally penalizes generator distributions with strong mode collapse (Section 3). Hence, a generator trained with this type of discriminator will choose distributions that exhibit less mode collapse. The region interpretation of mode collapse and corresponding data processing inequalities provide novel analysis tools for proving strong and sharp results with simple proofs. Technically, this leads to a novel geometric analysis technique to find the optimal solutions of infinite dimensional non-convex optimization problems of interest in Eqs. (2) and (3). (3) Algorithmic: We propose a new GAN framework to mitigate mode collapse, which we call PacGAN. PacGAN can be seamlessly applied to existing GANs, requiring only a small modification to the discriminator architecture (Section 2). The key idea is to pass m “packed" or concatenated samples to the discriminator, which are jointly classified as either real or generated. This allows the discriminator to do binary hypothesis testing based on the product distributions (P m, Qm), which naturally penalizes mode collapse (Section 3). We demonstrate on benchmark datasets that PacGAN significantly improves upon competing approaches in mitigating mode collapse (Section 4), notably minibatch discrimination [24]. Related Work Three primary challenges appear in the GAN literature: (i) they are unstable to train, (ii) they are challenging to evaluate, and (iii) they exhibit mode collapse (more broadly, they do not generalize). Our work explicitly addresses challenge (iii), which is the focus of this section. Mode collapse is a byproduct of poor generalization—i.e., the generator does not learn the true data distribution; this phenomenon is of significant interest [2, 3, 18, 1, 2]. Prior work has observed two types of mode collapse: entire modes from the input data are never generated, or the generator only creates images within a subset of a particular mode [9, 27, 3, 7, 20, 23]. These phenomena are not well-understood, but a number of explanatory hypotheses have been proposed, including improper objective functions [1, 2] and weak discriminators [20, 24, 2, 17]. Building on the second hypothesis, 2 we show that a packed discriminator can significantly reduce mode collapse, both theoretically and in practice. We compare packing to three main approaches for mitigating mode collapse: (1) Joint Architectures. In encoder-decoder architectures, the GAN learns an encoding G−1(X) from the data space to a lower-dimensional latent space, in addition to the usual decoding G(Z) from the latent space to the data space (e.g., BiGAN [8], adversarially learned inference [7], VEEGAN [25]). Despite empirical gains in such joint architectures, we find that packing captures more modes for a fixed generator and discriminator architecture, with less architectural and computational overhead. Also, recent work suggests that such architectures may be unable to prevent mode collapse [2]. (2) Augmented Discriminators. Several proposals have strengthened the discriminator by providing it with image labels [5] and/or more samples. A latter approach, minibatch discrimination [24], feeds an array of data samples to the discriminator, which uses the minibatch as side information to classify each sample individually. Recent work improved minibatch discrimination by progressively training discriminators on larger minibatches, with impressive visual results [13]. While packing and minibatch discrimination start from the same intuition that showing multiple samples at the discriminator helps mitigate mode collapse, how this idea is implemented in the discriminator architectures are completely different. PacGAN is easier to implement, empirically effective, and our theoretical analysis shows that packing is a principled way to use batched samples. For example, in the experiment in Appendix B.2 (left column of Table 6), the default DCGAN discriminator has 585 weights in total in the Unrolled GAN implementation, the proposed PacDCGAN4 only adds 162 more weights to the discriminator, while minibatch discriminator adds 1,225,732 more weights. (3) Optimization-based solutions. GANs are typically trained with iterative generator-discriminator parameter updates, which can lead to non-convergence [17]—a worse problem than mode collapse. Unrolled GANs [20] propose an optimization that accounts for k gradient steps when computing gradients. We observe that packing achieves better empirical performance with less overhead. 2 PacGAN Framework There are many ways to implement the idea of packing, each with tradeoffs. In this section, we present a simple packing framework that serves as the basis for our empirical experiments and a concrete example of packing. A primary reason for this architectural choice is to emphasize only the effect of packing in numerical experiments, and isolate it from any other effects that might result from other (more sophisticated) changes to the architecture. However, our analysis in Section 3 is agnostic to the packing implementation, and we discuss potential alternative packing architectures in Section 5, especially those that explicitly impose permutation invariance. We start with an existing GAN, defined by a generator architecture, a discriminator architecture, and a loss function. We call this triplet the mother architecture. The PacGAN framework maintains the same generator architecture, loss function, and hyperparameters as the mother architecture. However, instead of using a discriminator D(X) that maps a single sample (either real or generated) to a (soft) label, we use an augmented discriminator D(X1, X2, . . . , Xm) that maps m samples to a single (soft) label. These m samples are drawn independently from the same distribution—either real (jointly labelled Y = 1) or generated (Y = 0). We refer to the concatenation of samples with the same label as packing, the resulting discriminator as a packed discriminator, and the number m of concatenated samples as the degree of packing. The proposed approach can be applied to any existing GAN architecture and any loss function, as long as it uses a discriminator D(X) that classifies a single input sample. We use the notation “Pac(X)(m)” where (X) is the name of the mother architecture, and (m) is is the packing degree. For example, if we take an original GAN and feed the discriminator three packed samples, we call this “PacGAN3”. We implement packing by keeping all hidden layers of the discriminator identical to the mother architecture, and increasing the number of nodes in the input layer by a factor of m. For example, in Figure 1, we start with a fully-connected, feed-forward discriminator. Each sample X is twodimensional, so the input layer has two nodes. Under PacGAN2, we multiply the size of the input layer by the packing degree m = 2, and the connections to the first hidden layer are adjusted so that the first two layers remain fully-connected, as in the mother architecture. The grid-patterned nodes in Figure 1 represent input nodes for the second sample. Similarly, when packing a DCGAN, which uses convolutional neural networks for both the generator and the discriminator, we simply stack the images into a tensor of depth m. For instance, the discriminator for PacDCGAN4 on the 3 Figure 1: PacGAN(m) augments the input layer by a factor of m. The number of weights between the first two layers are increased to preserve the mother architecture’s connectivity. Packed samples are concatenated and fed to the input layer; grid-patterned nodes are input nodes for the second sample. MNIST dataset of handwritten images [16] would take an input of size 28 × 28 × 4, since each individual black-and-white MNIST image is 28 × 28 pixels. Only the input layer and the number of weights in the corresponding first convolutional layer will increase in depth by a factor of 4. As in standard GANs, we train the packed discriminator with a bag of samples from the real data and the generator. However, each minibatch in the stochastic gradient descent now consists of packed samples (X1, X2, . . . , Xm, Y ), which the discriminator jointly classifies. Intuitively, packing helps the discriminator detect mode collapse because lack of diversity is more obvious in a set of samples than in a single sample. 3 Theoretical Analysis of PacGAN In this section, we show a fundamental connection between the principle of packing and mode collapse in GAN. We provide a complete understanding of how packing changes the loss as seen by the generator, by focusing on (a) the optimal discriminator over a family of all measurable functions; (b) the population expectation; and (c) the 0-1 loss function of the form maxD EX∼P [I(D(X))] + EG(Z)∼Q[1 −I(D(G(Z)))], subject to D(X) ∈{0, 1}. This discriminator provides (an approximation of) the total variation distance, and the generator tries to minimize the total variation distance dTV(P, Q), as widely known in the GAN literature [10]. The reason we make this assumption is primarily for clarity and analytical tractability: total variation distance highlights the effect of packing in a way that is cleaner and easier to understand than if we were to analyze Jensen-Shannon divergence. We want to understand how this 0-1 loss, as provided by such a discriminator, changes with the degree of packing m. As packed discriminators see m packed samples, each drawn i.i.d. from one joint class (i.e. either real or generated), we can consider these packed samples as a single sample that is drawn from the product distribution: P m for real and Qm for generated. The resulting loss provided by the packed discriminator is therefore dTV(P m, Qm). We first provide a formal mathematical definition of mode collapse, which leads to a two-dimensional representation of any pair of distributions (P, Q) as a mode-collapse region. This region representation provides not only conceptual clarity regarding mode collapse, but also proof techniques that are essential to proving our main results. We defer all the proofs to the Appendix. In Appendix E, we show the proposed mode collapse region is equivalent to the ROC curve for binary hypothesis testing. This allows us to use powerful mathematical techniques from binary hypothesis testing including the data processing inequality. Definition 1. A target distribution P and a generator Q exhibit (ε, δ)-mode collapse for 0 ≤ε < δ ≤1 if there exists a set S ⊆X such that P(S) ≥δ and Q(S) ≤ε. Intuitively, larger δ and smaller ε indicate more severe mode collapse. That is, if a large portion of the target P(S) ≥δ in some set S in the domain X is missing in the generator Q(S) ≤ε, we declare (ε, δ)-mode collapse. Similarly, when we change the role of P and Q, and have P(S) ≤ε and Q(S) ≥δ, we say P and Q exhibit (ϵ, δ)-mode augmentation. This definition has a fundamental connection to the ROC region in detection theory and binary hypothesis testing—a connection that is critical for our proof techniques; this connection is detailed in Appendix D and E. A key observation is that two pairs of distributions can have the same total variation distance while exhibiting very different mode collapse patterns. To see this, consider a toy example in Figure 2, with a uniform target distribution P = U([0, 1]) and a mode collapsing generator Q1 = U([0.2, 1]) 4 and a non mode collapsing generator Q2 = 0.6U([0, 0.5]) + 1.4U([0.5, 1]). The appropriate way 1 1 1.25 0.2 1 1 1 1 0.6 1.4 0.5 P Q1 Q2 0 0.5 1 0 0.5 1 R(P, Q1) ε δ 0 0.5 1 0 0.5 1 R(P, Q2) ε δ Figure 2: A formal definition of (ε, δ)-mode collapse and its accompanying region representation captures the intensity of mode collapse for generators Q1 with mode collapse and Q2 which does not have mode collapse, for a toy example distributions P, Q1, and Q2 shown on the left. The region of (ε, δ)-mode collapse that is achievable is shown in grey. to precisely represent mode collapse is to visualize it through a two-dimensional region we call the mode collapse region. For a given pair (P, Q), the corresponding mode collapse region R(P, Q) is defined as the convex hull of the region of points (ε, δ) such that (P, Q) exhibit (ε, δ)-mode collapse, as shown in Figure 2: R(P, Q) ≜conv  (ε, δ) δ > ε and (P, Q) has (ε, δ)-mode collapse  . There is a fundamental connection between the mode collapse region and the ROC curve in hypothesis testing (Appendix E). An unpacked discriminator, observing only the TV distance between generator distributions Q and the true distribution P, cannot distinguish between two candidate generators Q1 and Q2 with dT V (P, Q1) = dT V (P, Q2), but different mode collapse regions. The key insight of this work is that by instead considering product distributions, the total variation distance dT V (P m, Qm) varies in a way that is closely tied to the mode collapse regions for (P, Q). For instance, Figure 3 (left) shows an achievable range of dTV(P m, Qm) conditioned on that dTV(P, Q) = τ for τ = 1.1. Within this achievable range, some pairs (P, Q) have rapidly increasing total variation, occupying the upper part of the region (shown in red, middle panel of Figure 3), and others have slowly increasing total variation, occupying the lower part (shown in blue) in the right panel of Figure 3. We formally show in the following that there is a fundamental connection between total variation distance evolution and degree of mode collapse. Namely, distributions with strong mode collapse occupy the upper region, and hence will be penalized by a packed discriminator. Evolution of total variation distances with mode collapse. We analyze how the total variation evolves for the set of all pairs (P, Q) that have the same total variation distances τ when unpacked, with m = 1, and have (ε, δ)-mode collapse for some 0 ≤ε < δ ≤1. The solution of the following optimization problem gives the desired range: min P,Q or max P,Q dTV(P m, Qm) (2) subject to dTV(P, Q) = τ (P, Q) has (ε, δ)-mode collapse , where the maximization and minimization are over all probability measures P and Q, and the mode collapse constraint is defined in Definition 1. We provide the optimal solution analytically and establish that mode-collapsing pairs occupy the upper part of the total variation region; that is, total variation increases rapidly as we pack more samples together (Figure 3, middle panel). Theorem 2. For all 0 ≤ε < δ ≤1 and an integer m, if 1 ≥τ ≥δ −ε then the solution to the maximization in (2) is 1 −(1 −τ)m, and the solution to the minimization is min n min 0≤α≤1−τδ δ−ε dTV  Pinner1(α)m, Qinner1(α)m  , min 1−τδ δ−ε ≤α≤1−τ dTV  Pinner2(α)m, Qinner2(α)m  o , 5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 3 5 7 9 11 dTV(P m, Qm) degree of packing m 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 3 5 7 9 11 (0.00, 0.1)-mode collapse degree of packing m 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 1 3 5 7 9 11 no (0.07, 0.1)-mode collapse degree of packing m Figure 3: The range of dTV(P m, Qm) achievable by pairs with dTV(P, Q) = τ, for a choice of τ = 0.11, defined by the solutions of the optimization (4) provided in Theorem 4 in the Appendix (left panel). The range of dTV(P m, Qm) achievable by those pairs that also have (ε = 0.00, δ = 0.1)mode collapse (middle panel). A similar range achievable by pairs of distributions that do not have (ε = 0.07, δ = 0.1)-mode collapse or (ε = 0.07, δ = 0.1)-mode augmentation (right panel). Pairs (P, Q) with strong mode collapse occupy the top region (near the upper bound) and the pairs with weak mode collapse occupy the bottom region (near the lower bound). where Pinner1(α)m, Qinner1(α)m, Pinner2(α)m, and Qinner2(α)m are the m-th order product distributions of discrete random variables distributed as Pinner1(α) = [δ, 1 −α −δ, α], Qinner1(α) = [ε, 1 −α −τ −ε, α + τ], Pinner2(α) = [1 −α, α], and Qinner2(α) = [1 −α −τ, α + τ]. If τ < δ −ε, then the optimization in (2) has no solution and the feasible set is an empty set. One implication is that distribution pairs (P, Q) at the top of the total variation evolution region are those with the strongest mode collapse. Another implication is that a pair (P, Q) with strong mode collapse (i.e., with larger δ and smaller ε in the constraint) will be penalized more under packing, and hence a generator minimizing an approximation of dTV(P m, Qm) will be unlikely to select a distribution that exhibits such strong mode collapse. Evolution of total variation distances without mode collapse. We next analyze how the total variation evolves for the set of all pairs (P, Q) that have the same total variations distances τ when unpacked, with m = 1, and do not have (ε, δ)-mode collapse for some 0 ≤ε < δ ≤1. Because of the symmetry of the total variation distance, mode collapse for (Q, P) is equally damaging as mode collapse of (P, Q), when it comes to how fast total variation distances evolve. Hence, we characterize this evolution for those family of pairs of distributions that do not have either mode collapses. The solution of the following optimization problem gives the desired range of total variation distances: min P,Q or max P,Q dTV(P m, Qm) (3) subject to dTV(P, Q) = τ , (P, Q) does not have (ε, δ)-mode collapse, (Q, P) does not have (ε, δ)-mode collapse, We provide thte optimal solution analytically and establish that the pairs (P, Q) with weak mode collapse will occupy the bottom part of the evolution of the total variation distances (see Figure 3 right panel), and also will be penalized less under packing. Hence a generator minimizing (approximate) dTV(P m, Qm) is likely to generate distributions with weak mode collapse. Theorem 3. If δ + ε ≤1 and δ −ε ≤τ ≤(δ −ε)/(δ + ε) then the solution to the maximization in (3) is max α+β≤1−τ, ετ δ−ε ≤α,β dTV  Pouter1(α, β)m, Qouter1(α, β)m  , where Pouter1(α, β)m and Qouter1(α, β)m are the m-th order product distributions of discrete random variables distributed as Pouter1(α, β) = [ α(δ−ε)−ετ α−ε , α(α+τ−δ) α−ε , 1 −τ −α −β, β, 0] and Qouter1(α, β) = [0, α, 1 −τ −α −β, β(β+τ−δ) β−ε , β(δ−ε)−ετ β−ε ]. The solution to the minimization in (3) is min ετ δ−ε ≤α≤1−δτ δ−ε dTV  Pinner(α)m, Qinner(α, τ)m  , 6 where Pinner(α) and Qinner(α, τ) are defined as in Theorem 4 in the Appendix. We can prove the exact solution of the optimization for all values of ε and δ, which we provide in the Appendix. We refer also to the appendix of more illustrations of regions occupied by various choices of ε and δ for mode collapsing distributions, and non mode collapsing regions. 4 Experiments On standard benchmark datasets, we compare PacGAN to several baseline GAN architectures, some explicitly designed to mitigate mode collapse: GAN [10], minibatch discrimination (MD) [24], DCGAN [22], VEEGAN [25], Unrolled GANs [20], and ALI [8]. We also implicitly compare against BIGAN [7], which is conceptually identical to ALI. To isolate the effects of packing, we make minimal choices in the architecture and hyperparameters of our packing implementation. Our goal is to reproduce experiments from the literature, apply packing to the simplest baseline GAN, and observe how packing affects performance. Whenever possible, we use the exactly same choice of architecture, hyperparameters, and loss function as a baseline in each experiment; we change only the discriminator to accept packed samples. All code to reproduce our experiments can be found at https://github.com/fjxmlzn/PacGAN. Metrics. We measure several previously-used metrics. The first is number of modes that are produced by a generator [7, 20, 25]. In labelled datasets, this number can be evaluated using a third-party trained classifier that classifies the generated samples [25]. A second metric used in [25] is the number of high-quality samples, which is the proportion of the samples that are within x standard deviations from the center of a mode. Finally, we measure the reverse Kullback-Leibler divergence between the induced distribution from generated samples and the induced distribution from the real samples. Each of these metrics has shortcomings—for example, the number of observed modes ignores class imbalance, and all of the metrics assume the modes are known a priori. Datasets. We use synthetic and real datasets. The 2D-ring [25] is a mixture of eight two-dimensional spherical Gaussians with means (cos((2π/8)i), sin((2π/8)i)) and variances 10−4 in each dimension for i ∈{1, . . . , 8}. The 2D-grid [25] is a mixture of 25 two-dimensional spherical Gaussians with means (−4 + 2i, −4 + 2j) and variances 0.0025 in each dimension for i, j ∈{0, 1, 2, 3, 4}. The MNIST dataset [16] consists of 70K images of handwritten digits, each 28 × 28 pixels. Unmodified, this dataset has 10 modes (digits). As in [20, 25], we augment the number of modes by stacking the images: we generate a new dataset of 128K images where each image consists of three random MNIST images stacked into a 28 × 28 × 3 RGB image. This new stacked MNIST dataset has (with high probability) 1000 = 10 × 10 × 10 modes. Finally, we include experiments on the CelebA dataset, which is a collection of 200K facial images of celebrities [19]. 4.1 Synthetic data experiments Our first experiment measures the effect of the number of discriminator parameters on mode collapse. Packed architectures have more discriminator nodes (and parameters) than the mother architecture, which could artificially mitigate mode collapse by giving the discriminator more capacity. We compare this effect to the effect of packing on the 2D grid dataset. In Figure 4, we evaluate the number of modes recovered and reverse KL divergence for ALI, GAN, MD, and PacGAN, while varying the number of total parameters in each architecture (discriminator and encoder if one exists). The experimental details are included in Appendix A.2. For MD, the metrics first improve and then degrade with the number of parameters. We suspect that this may because MD is very sensitive to experiment settings, as the same architecture of MD has very different performance on 2d-grid and 2d-ring dataset (Appendix A.1). For ALI, GAN and PacGAN, despite varying the number of parameters by an order of magnitude, we do not see significant evidence of the metrics improving with the number of parameters. This suggests that the advantages of PacGAN and ALI compared to GAN do not stem from having more parameters. Packing also seems to increase the number of modes recovered and decrease the reverse KL divergence; we explore this phenomenon more in subsequent experiments. 7 0 100000 200000 300000 400000 500000 600000 700000 800000 15 16 17 18 19 20 21 22 23 24 25 GAN PacGAN2 PacGAN3 PacGAN4 Minibatch Discrimination ALI Modes recovered (higher is better) Parameter Count 0 100000 200000 300000 400000 500000 600000 700000 800000 0.0 0.2 0.4 0.6 0.8 1.0 GAN PacGAN2 PacGAN3 PacGAN4 Minibatch Discrimination ALI Reverse KL divergence (lower is better) Parameter Count Figure 4: Effect of number of parameters on evaluation metrics. 4.2 Stacked MNIST experiments For our stacked MNIST experiments, we generate samples. Each of the three channels in each sample is classified by a pre-trained third-party MNIST classifier, and the resulting three digits determine which of the 1000 modes the sample belongs to. We measure the number of modes captured, as well as the KL divergence between the generated distribution over modes and the expected (uniform) one. In the first experiment, we replicate Table 2 from [25], which measured the number of observed modes in a generator trained on the stacked MNIST dataset, as well as the KL divergence of the generated mode distribution. In line with [25], we used a DCGAN-like architecture for these experiments1 (details in Appendix B.1). Our results are shown in Table 1. The first four rows are copied directly from [25]. The last three rows are computed using a basic DCGAN, with packing in the discriminator. We find that packing gives good mode coverage, reaching all 1,000 modes in every trial. Again, packing the simplest DCGAN fully captures all the modes in the benchmark test, so we do not pursue packing more complex baseline architectures. We also observe that MD is very unstable throughout training, which makes it capture even less modes than GAN. One factor that contributes to MD’s instability may be that MD requires too many parameters. The number of discriminator parameters in MD is 47,976,773, whereas GAN has 4,310,401 and PacGAN4 only needs 4,324,801. Stacked MNIST Modes KL DCGAN [22] 99.0 3.40 ALI [8] 16.0 5.40 Unrolled GAN [20] 48.7 4.32 VEEGAN [25] 150.0 2.95 Minibatch Discrimination [24] 24.5±7.67 5.49±0.418 DCGAN (our implementation) 78.9±6.46 4.50±0.127 PacDCGAN2 (ours) 1000.0±0.00 0.06±0.003 PacDCGAN3 (ours) 1000.0±0.00 0.06±0.003 PacDCGAN4 (ours) 1000.0±0.00 0.07±0.005 Table 1: Two measures of mode collapse proposed in [25] for the stacked MNIST dataset: number of modes captured by the generator and reverse KL divergence over the generated mode distribution. The DCGAN, PacDCGAN, and MD results are averaged over 10 trials, with standard error reported. 4.3 CelebA experiments Finally, we measure the diversity of images generated from the CelebA dataset as in [3] by estimating the probability of collision in a batch of generated images. If there exists at least one pair of nearduplicate images in the batch, a collision is declared, which indicates lack of diversity. The details of 1https://github.com/carpedm20/DCGAN-tensorflow 8 how we determine duplicates and our architecture are deferred to Appendix C. We find that packing significantly improves the diversity of samples, and if the size of the discriminator is small, packing also improves sample quality. See Appendix C for generated samples. discriminator size probability of collision DCGAN PacDCGAN2 273K 1 0.33 4 × 273K 0.42 0 16 × 273K 0.86 0 25 × 273K 0.65 0.17 Table 2: Probability of ≥1 pair of near-duplicate images appearing in a batch of 1024 images generated from DCGAN and PacDCGAN2 on celebA dataset. 5 Discussion In this work, we propose a packing framework that theoretically and empirically mitigates mode collapse with low overhead. Our analysis leads to several interesting open questions, including how to apply these analysis techniques to more general classes of loss functions such as Jensen-Shannon divergence and Wasserstein distances. This will complete the understanding of the superiority of our approach observed in experiments with JS divergence in Section 4 and with Wasserstein distance in Appendix B.3. Another important question is what packing architecture to use. For instance, a framework that provides permutation invariance may give better results such as graph neural networks [6, 26, 15] or deep sets [28]. Acknowledgement The authors would like to thank Sreeram Kannan and Alex Dimakis for the initial discussions that lead to the inception of the packing idea, and Vyas Sekar for valuable discussions about GANs. We thank Srivastava Akash, Luke Metz, Tu Nguyen, and Yingyu Liang for providing insights and/or the implementation details on their proposed architectures for VEEGAN [25], Unrolled GAN [20], D2GAN [21], and MIX+GAN [2]. We thank the anonymous reviewers for their constructive feedback. This work is supported by NSF awards CNS-1527754, CCF-1553452, CCF-1705007, and RI1815535 and Google Faculty Research Award. This work used the Extreme Science and Engineering Discovery Environment (XSEDE), which is supported by National Science Foundation grant number OCI-1053575. Specifically, it used the Bridges system, which is supported by NSF award number ACI-1445606, at the Pittsburgh Supercomputing Center (PSC). This work is partially supported by the generous research credits on AWS cloud computing resources from Amazon. References [1] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein GAN. arXiv preprint arXiv:1701.07875, 2017. [2] S. Arora, R. Ge, Y. Liang, T. Ma, and Y. Zhang. Generalization and equilibrium in generative adversarial nets (GANs). arXiv preprint arXiv:1703.00573, 2017. [3] S. Arora and Y. Zhang. Do gans actually learn the distribution? an empirical study. arXiv preprint arXiv:1706.08224, 2017. [4] D. Blackwell. Equivalent comparisons of experiments. The Annals of Mathematical Statistics, 24(2):265–272, 1953. [5] T. Che, Y. Li, A. P. Jacob, Y. Bengio, and W. Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016. [6] M. Defferrard, X. Bresson, and P. Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3844–3852, 2016. 9 [7] J. Donahue, P. Krähenbühl, and T. Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016. [8] V. Dumoulin, I. Belghazi, B. Poole, A. Lamb, M. Arjovsky, O. Mastropietro, and A. Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016. [9] I. Goodfellow. Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160, 2016. [10] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014. [11] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pages 448–456, 2015. [12] P. Kairouz, S. Oh, and P. Viswanath. The composition theorem for differential privacy. IEEE Transactions on Information Theory, 63(6):4037–4049, June 2017. [13] T. Karras, T. Aila, S. Laine, and J. Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. arXiv preprint arXiv:1710.10196, 2017. [14] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [15] T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [16] Y. LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998. [17] J. Li, A. Madry, J. Peebles, and L. Schmidt. Towards understanding the dynamics of generative adversarial networks. arXiv preprint arXiv:1706.09884, 2017. [18] S. Liu, O. Bousquet, and K. Chaudhuri. Approximation and convergence properties of generative adversarial learning. arXiv preprint arXiv:1705.08991, 2017. [19] Z. Liu, P. Luo, X. Wang, and X. Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), 2015. [20] L. Metz, B. Poole, D. Pfau, and J. Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016. [21] T. Nguyen, T. Le, H. Vu, and D. Phung. Dual discriminator generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2667–2677, 2017. [22] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [23] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. arXiv preprint arXiv:1605.05396, 2016. [24] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pages 2234–2242, 2016. [25] A. Srivastava, L. Valkov, C. Russell, M. Gutmann, and C. Sutton. Veegan: Reducing mode collapse in gans using implicit variational learning. arXiv preprint arXiv:1705.07761, 2017. [26] K. K. Thekumparampil, C. Wang, S. Oh, and L.-J. Li. Attention-based graph neural network for semi-supervised learning. arXiv preprint arXiv:1803.03735, 2018. [27] I. Tolstikhin, S. Gelly, O. Bousquet, C.-J. Simon-Gabriel, and B. Schölkopf. Adagan: Boosting generative models. arXiv preprint arXiv:1701.02386, 2017. [28] M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. R. Salakhutdinov, and A. J. Smola. Deep sets. In Advances in Neural Information Processing Systems, pages 3391–3401, 2017. 10
2018
177
7,338
Bayesian multi-domain learning for cancer subtype discovery from next-generation sequencing count data Ehsan Hajiramezanali Texas A&M University ehsanr@tamu.edu Siamak Zamani Dadaneh Texas A&M University siamak@tamu.edu Alireza Karbalayghareh Texas A&M University alireza.kg@tamu.edu Mingyuan Zhou University of Texas at Austin Mingyuan.Zhou@mccombs.utexas.edu Xiaoning Qian Texas A&M University xqian@ece.tamu.edu Abstract Precision medicine aims for personalized prognosis and therapeutics by utilizing recent genome-scale high-throughput profiling techniques, including next-generation sequencing (NGS). However, translating NGS data faces several challenges. First, NGS count data are often overdispersed, requiring appropriate modeling. Second, compared to the number of involved molecules and system complexity, the number of available samples for studying complex disease, such as cancer, is often limited, especially considering disease heterogeneity. The key question is whether we may integrate available data from all different sources or domains to achieve reproducible disease prognosis based on NGS count data. In this paper, we develop a Bayesian Multi-Domain Learning (BMDL) model that derives domain-dependent latent representations of overdispersed count data based on hierarchical negative binomial factorization for accurate cancer subtyping even if the number of samples for a specific cancer type is small. Experimental results from both our simulated and NGS datasets from The Cancer Genome Atlas (TCGA) demonstrate the promising potential of BMDL for effective multi-domain learning without “negative transfer” effects often seen in existing multi-task learning and transfer learning methods. 1 Introduction In this paper, we study Bayesian Multi-Domain Learning (BMDL) for analyzing count data from next-generation sequencing (NGS) experiments, with the goal of enhancing cancer subtyping in the target domain with a limited number of NGS samples by leveraging surrogate data from other domains, for example relevant data from other well-studied cancer types. Due to both biological and technical limitations, it is often difficult and costly, if not prohibitive, to collect enough samples when studying complex diseases, especially considering the complexity of disease processes. When studying one cancer type, there are typically at most hundreds of samples available with tens of thousands of genes/molecules involved, including in the case of the arguably largest cancer consortium, The Cancer Genome Atlas (TCGA) [The Cancer Genome Atlas Research Network et al., 2008]. Considering the heterogeneity in cancer and the potential cost of clinical studies and profiling, we usually have only less than one hundred samples, which often does not lead to generalizable results. Our goal here is to develop effective ways to derive predictive feature representations using available NGS data from different sources to help accurate and reproducible cancer subtyping. The assumption of having only one domain is restrictive in many practical scenarios due to the nonstationarity of the underlying system and data heterogeneity. Multi-task learning (MTL), transfer learning (TL), and domain adaptation (DA) techniques have recently been utilized to leverage the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. relevant data and knowledge of different domains to improve the predictive power in all domains or one target domain [Pan and Yang, 2010, Patel et al., 2015]. In MTL, there are D different labeled domains where data are related and the goal is to improve the predictive power of all domains altogether. In TL, there are D −1 source domains and one target domain such that we have plenty of labeled data in the source domains and a few labeled data in the target domain, and the goal is to take advantage of source data, for example by domain adaptation, to improve the predictive power in the target domain. Although many TL and MTL methods have been proposed, “negative transfer” may happen with degraded performance when the domains are not related but the methods force to “transfer” the data and model knowledge. There still lacks a rigorous theoretical understanding when data from different domains can help each other due to the discriminative nature of these methods. In this paper, instead of following most of TL/MTL methods relying on discriminative models p(y|θ,⃗n) given high-dimensional count data ⃗n, we propose a generative framework to learn more flexible latent representations of ⃗n from different domains. We first construct a Bayesian hierarchical model p(⃗n), which is essentially a factorization model for counts ⃗n, to derive domain-dependent latent representations allowing both domain-specific and globally shared latent factors. Then the learned low-dimensional representations can be used together with any supervised or unsupervised predictive models for cancer subtyping. Due to its unsupervised nature when deriving latent representations, we term our model as Bayesian Multi-Domain Learning (BMDL). This is desirable in cancer subtyping since we may not always have labeled data and thus the model flexibility of BMDL enables effective transfer learning across different domains, with or without labeled data. By allowing the assignment of the inferred latent factors to each domain independently based on the amount of contribution of each latent factor to that domain, BMDL can automatically learn the sample relevance across domains based on the number of shared latent factors in a data-driven manner. On the other hand, the domain-specific latent factors help keep important information in each domain without severe information loss in the derived domain-dependent latent representations of the original count data. Therefore, BMDL automatically avoids “negative transfer" with which many TL/MTL methods are dealing. At the same time, the number of shared latent factors can serve as one possible measure of domain relevance that may lead to more rigorous theoretical study of TL/MTL methods. Specifically, for BMDL, we propose a novel multi-domain negative binomial (NB) factorization model for over-dispersed NGS count data. Similar as Dadaneh et al. [2018] and Hajiramezanali et al. [2018], we employ NB distributions for count data to obviate the need for multiple ad-hoc preprocessing steps as required in most of gene expression analyses. More precisely, BMDL identifies domain-specific and globally shared latent factors in different sequencing experiments as domains, corresponding to gene modules significant for subtyping different cancer types for example, and then use them to improve subtyping performance in a target domain with a very small number of samples. We introduce latent binary “selector” variables which help assign the factors to different domains. Inspired by Indian Buffet Process (IBP) [Ghahramani and Griffiths, 2006], we impose beta-Bernoulli priors over them, leading to sparse domain-dependent latent factor representations. By exploiting a novel data augmentation technique for the NB distribution [Zhou and Carin, 2015], an efficient Gibbs sampling algorithm with closed-form updates is derived for BMDL. Our experiments on both synthetic and real-world RNA-seq datasets verify the benefits of our model in improving predictive power in domains with small training sets by borrowing information from domains with rich training data. In particular, we demonstrate a substantial increase in cancer subtyping accuracy by leveraging related RNA-seq datasets, and also show that in scenarios with unrelated datasets, our method does not create adverse effects. 2 Related work TL/MTL methods typically assume some notions of relevance across domains of the corresponding tasks: All tasks under study either possess a cluster structure [Xue et al., 2007, Jacob et al., 2009, Kang et al., 2011], share feature representations in common low-dimensional subspaces [Argyriou et al., 2007, Rai and Daume III, 2010], or have parameters drawn from shared prior distributions [Chelba and Acero, 2006]. Most of these methods force the corresponding assumptions for MTL to link the data across domains. However, when tasks are not related to the corresponding data from different underlying distributions, forcing MTL may lead to degraded performance. To solve this problem, Passos et al. [2012] have proposed a Bayesian nonparametric MTL model by representing the task parameters as a mixture of latent factors. However, this model requires the number of both 2 latent factors and mixtures to be less than the number of domains. This may lead to information loss and the model only has shown advantage when the number of domains is high. But in real-world applications, when analyzing cancer data for example, we may only have a small number of domains. Kumar and Daume III [2012] have assumed the task parameters within a group of related tasks lie in a low-dimensional subspace and allowed the tasks in different groups to overlap with each other in one or more bases. But this model requires a large number of training samples across domains. The hierarchical Dirichlet process (HDP) [Teh et al., 2005] has been proposed to borrow statistical strengths across multiple groups by sharing mixture components. Although HDP is aimed for a general family of distributions, to make it more suitable for modeling count data, special efforts pertaining to the application need to be carried out. To directly model the counts assigned to mixture components as NB random variables, Zhou and Carin [2015] have performed a joint count and mixture modeling via the NB process. Under the NB process and integrated to HDP [Teh et al., 2005], NB-HDP employed a Dirichlet process (DP) to model the rate measure of a Poisson process. However, NB-HDP is constructed by fixing the probability parameter of NB distribution. While fixing the probability parameter of NB is a natural choice in mixture modeling, where it appears irrelevant after normalization, it would make a restrictive assumption that each count vector has the same variance-to-mean ratio. This is not proper for NGS count modeling in this paper. Closely related to the multinomial mixed-membership models, Zhou [2018] have proposed the hierarchical gammanegative binomial process (hGNBP) to support countably infinite factors for negative binomial factor analysis (NBFA), where each of the sample J is assigned with a sample-specific GNBP and a globally shared gamma process is mixed with all the J gamma-negative binomial Markov chains (GMNBs). Our BMDL also uses hGNBP to model the counts in each domain, but imposes a spike and slab model to ensure domain-specific latent factors can be identified. In this paper, we propose a hierarchical Bayesian model—BMDL—for multi-domain learning by deriving domain-dependent latent representations of observed data across domains. By jointly deriving latent representations with both domain-specific and shared latent factors, we take the best advantage of shared information across domains for effective multi-domain learning. In the context of cancer subtyping, we are interested in deriving such meaningful representations for accurate and reproducible subtyping in the target domain, where only a limited number of samples are available. We will show first in our experiments that when the source and target data share more latent factors, we can better help subtyping in the target domain with higher accuracy; more importantly, we will also show that even when the domains are distantly related, our method can selectively integrate the information from other domain(s) to improve subtyping in the target domain while prohibit using irrelevant knowledge to avoid performance degradation. 3 Method We would like to model the observed counts n(d) vj from next-generation sequencing (NGS) for gene v ∈{1, ..., V } in sample j ∈{1, ..., Jd} of domain d ∈{1, ..., D} to help cancer subtyping. The main modeling challenges here include: (1) NGS counts are often over-dispersed and requiring n(d) vj p(d) j φk θ(d) kj c(d) j r(d) k zkd cd πk sk γ0 c0 K j = 1, ..., Jd d = 1, ..., D K Figure 1: BMDL based on multi-domain negative binomial factorization model. 3 ad-hoc pre-processing that may lead to biased results; (2) there are a much smaller number of samples with respect to the number of genes (V ≫J), especially in the target domain of interest; and (3) it is often unknown how relevant/similar the samples across different domains are so that forcing the joint learning may lead to degraded performance. We construct a Bayesian Multi-Domain Learning (BMDL) framework based on a domain-dependent latent negative binomial (NB) factor model for NGS counts so that (1) over-dispersion is appropriately modeled and ad-hoc pre-processing is not needed; (2) low-dimensional representations of counts in different domains can help achieve more robust subtyping results; and most importantly, (3) the sample relevance across domains can be explicitly learned to guarantee the effectiveness of joint learning across multiple domains. BMDL achieves flexible multi-domain learning by first constructing a NB factorization model of NGS counts, and then explicitly establishing the relevance of samples across different domains by introducing domain-dependent binary variables that assign latent factors to each domain. The graphical representation of BMDL is illustrated in Fig. 1. We model NGS counts n(d) vj based on the following representations n(d) vj = K X k=1 n(d) vjk, n(d) vjk ∼NB  φvkθ(d) kj , p(d) j  , (1) where n(d) vj is factorized by K sub-counts n(d) vjk, each of which is a latent factor distributed according to a NB distribution. The factor loading parameter φvk quantifies the association between gene v and latent factor k, while the score parameter θ(d) kj captures the popularity of factor k in sample j of domain d. It should be noted that the factor loadings are shared across all domains, and thus making their inference more robust when the number of samples is low, especially in the target domain. This does not put a restriction on the model flexibility in capturing the inter-domain variability as the score parameters determine the significance of corresponding latent factors across domains. The score parameter θ(d) kj is assumed to follow a gamma distribution: θ(d) kj ∼Gamma  r(d) k , 1/c(d) j  , (2) with the scale parameter c(d) j modeling the variability of sample j of domain d and the shape parameter r(d) k capturing the popularity of factor k in domain d. To further enable domain-dependent latent representations, we introduce another hierarchical layer on the shape parameter: r(d) k ∼Gamma (skzkd, 1/cd) , (3) where the set of binary latent variables zkd are considered as domain-dependent selector variables to allow different latent representations with the corresponding r(d) k being present or absent across domains: When zkd = 1, the latent factor k is present for factorization of counts in domain d; and it is absent otherwise. In our multi-domain learning framework, as the sample relevance across domains can vary significantly, this layer provides the additional model flexibility to model the sample relevance in the given data across domains. In (3), sk is the global popularity of factor k in all domains. Inspired by the beta-Bernoulli process [Thibaux and Jordan, 2007], whose marginal representation is also known as the Indian Buffet Process (IBP) [Ghahramani and Griffiths, 2006], and its use in nonparametric Bayesian sparse factor analysis [Zhou et al., 2009], we impose a beta-Bernoulli prior to the assignment variables: zkd ∼Bernoulli(πk), πk ∼Beta(c/K, c(1 −1/K)), (4) which can be seen as an infinite spike-and-slab model as K →∞, where the spikes are provided by the beta-Bernoulli process and the slab is provided by the top-level gamma process. As a result, the proposed model assigns positive probability to only a subset of latent factors, selected independently of their masses. We further complete the hierarchical Bayesian model for multi-domain learning by placing appropriate priors on the model parameters in (1), (2), (3) and (4): (φ1k, . . . , φV k) ∼Dir(η, . . . , η), η ∼Gamma(s0, w0), p(d) j ∼Beta(a0, b0), c(d) j ∼Gamma(e0, 1/f0), cd ∼Gamma(h0, 1/u0), sk ∼Gamma(γ0/K, 1/c0), γ0 ∼Gamma(a0, 1/b0), c0 ∼Gamma(s0, 1/t0). (5) 4 From a biological perspective, K factors may correspond to the underlying biological processes, cellular components, or molecular functions causing cancer subtypes, or more generally different phenotypes or treatment responses in biomedicine. The corresponding sub-counts n(d) vjk can be viewed as the result of the contribution of underlying biological process k to the expression of gene v in sample j of domain d. The probability parameter p(d) j , which depends on the sample index, accounts for the potential effect of varying sequencing depth of sample j in domain d. More precisely, the expected expression of gene v in sample j and domain d is PK k=1 φvkθ(d) kj p(d)) j 1−p(d) j , and hence the term (PK k=1 φvkθ(d) kj ) can be viewed as the true abundance of gene v in domain d, after adjusting for the sequencing depth variation across samples. Specifically, it comprises of contributions from both domain-dependent and globally shared latent factors, where the amount of contribution of each latent factor can automatically be learned for the sample relevance across domains. Given the BMDL model in Fig. 1, we derive an efficient Gibbs sampling algorithm with closed-form updating steps for inferring the model parameters by exploiting the data augmentation technique in Zhou and Carin [2015]. The detailed Gibbs sampling procedure is provided in the supplemental materials. For real-world NGS datasets that are deeply sequenced and thus possess large counts, the steps in Gibbs sampling involving the Chinese Restaurant Table (CRT) distribution in Zhou and Carin [2015] are the source of main computational burden. To speed up sampling from CRT, we propose the following scheme: to draw ℓ∼CRT(n, r), when n is large, we first draw ℓ1 ∼CRT(m, r), where m ≪n. Then, we draw ℓ2 ∼Pois (r[ψ(n + r) −ψ(m + r)]), where ψ(·) is the digamma function. Finally, we have ℓ≈ℓ1 + ℓ2. This approximation is inspired by Le Cam’s theory [Le Cam, 1960], and reduces the number of Bernoulli draws required for CRT from n to m, and hence speeding up the Gibbs sampling substantially in our experiments with TCGA NGS data, where it is not uncommon for n > 105. 4 Experimental Results To verify the advantages of our BMDL model with the flexibility to capture the varying sample relevance across domains with both domain-specific and globally shared latent factors, we have designed experiments based on both simulated data and RNA-seq count data from TCGA [The Cancer Genome Atlas Research Network et al., 2008]. We have implemented BMDL to extract domain-dependent low-dimensional latent representations and then examined how well using these extracted representations in an unsupervised manner can subtype new testing samples. We also have compared the performance of BMDL to other Bayesian latent models for multi-domain learning, including • NB-HDP [Zhou and Carin, 2012], for which all domains are assumed to share a set of latent factors. This is done by involving a simple Bayesian hierarchy where the base measure for the child DPs is itself distributed according to a DP. It assumes the probability parameter of NB is fixed at p(d) j = 0.5. • HDP-NBFA: To have fair comparison and make sure that the superior performance of BMDL is not only due to the modeling of the sequencing depth variation across samples, we apply HDP to model latent scores in NB factorization as well. More specifically we model count data as n(d) jk ∼NB(φkθ(d) kj , p(d) j ), where θ(d) kj is hierarchical DP instead of hierarchical gamma process in our model. Fixing c(d) j = 1 in ( 2) is considered here to construct an HDP, whose group-level DPs are normalized from gamma processes with the scale parameters as 1/c(d) j = 1. • hGNBP [Zhou, 2018]: To evaluate the advantages of the beta-Bernoulli modeling in BMDL, we compare the results with hGNBP, which models count data as n(d) jk ∼NB(φkθ(d) kj , p(d) j ). Here, θ(d) kj is a hierarchical gamma process and the parameter zkd in (4) is set to 1. We illustrate that BMDL leads to more effective target domain learning compared to both HDP and hGNBP based models by assigning domain-specific latent factors to domains (using the betaBernoulli process) given observed samples, while learning the latent representations globally in a similar fashion as HDP and hGNBP. In addition, we also have compared with hGNBP-NBFA [Zhou, 5 50 40 30 20 10 0 Number of shared latent factors 0.05 0.1 0.15 0.2 0.25 0.3 0.35 Classification error BMDL hGNBP-NBFA 10 20 30 40 Number of target samples 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 BMDL hGNBP-NBFA (b) (a) Figure 2: The classification error of BMDL and hGNBP-NBFA as a function of (a) domain relevance, and (b) the number of target samples. 2018], which can be considered as the baseline model as it extracts latent representations only using the samples from the target domain. Comparing to this baseline, we expect to show that BMDL effectively borrows the signal strength across domains to improve classification accuracy in a target domain with very small samples. For all the experiments, we fix the truncation level K = 100 and consider 3,000 Gibbs sampling iterations, and retain the weights {r(d) k }1,K and the posterior means of {φk}1,K as factors, and use the last Markov chain Monte Carlo (MCMC) sample for the test procedure. With these K inferred factors and weights, we further apply 1,000 blocked Gibbs sampling iterations and collect the last 500 MCMC samples to estimate the posterior mean of the latent factor score θ(dt) j , for every sample of target domain dt in both the training and testing sets. We then train a linear support vector machine (SVM) classifier [Schölkopf and Smola, 2002] on all ¯θ(dt) j in the training set and use it to classify each ¯θ(dt) j in the test set, where ¯θ(dt) j ∈RK is the estimated feature vector for sample j in the target domain. For each binary classification task, we report the classification accuracy based on ten independent runs. Note that although we fix K with a large enough value, we expect only a small subset of the K latent factors to be used and all the others to be shrunken towards zero. More precisely, inspired by the inherent shrinkage property of the gamma process, we have imposed Gamma(γ0/K, 1/c0) as the prior on each factor strength parameter sk, leading to a truncated approximation of the gamma process using K atoms. 4.1 Synthetic data experiments For synthetic experiments, we compare BMDL and the baseline hGNBP-NBFA using only target samples to illustrate multi-domain learning can help better prediction in the target domain. For the first set of synthetic data experiments, we generate the varying sample relevance across domains. The degree of relevance is controlled by varying the number of latent factors shared by the domains. In this setup, we set two domains, 1,000 features, 50 latent factors per domain, 200 samples in the source domain, and 20 samples in the target domain while the number of samples for both classes is 10. The number of shared latent factors between two domains changes from 50 to 0 to cover different degree of domain relevance. The factor loading matrix of the first domain is generated based on a Dirichlet distribution. To simulate the loading matrix for the second domain, we first select NKc shared latent factors from the first domain, and then randomly generate 50 −NKc latent factors as unique ones for the second domain, where NKc ∈{0, 10, 20, . . . , 50}. The dispersion parameters of both domains are generated from a gamma process: Gamma(sk, 1/cd), where sk is generated by Gamma(γ0/K, 1/c0). The hyperparameters γ0, and c0 are drawn from Gamma(0.01, 0.01). To distinguish two classes of generated samples in the target domain, we generate their factor scores 6 by different scale parameters c(d) j ∼Gamma(a, 0.01), where a is set to be 100 and 150 in the first and second class, respectively. From Figure 2(a), the first interesting observation is that BMDL automatically avoids “negative transfer”: the classification errors of BMDL by jointly learning the latent representations are consistently lower than the classification errors using only the target domain data no matter how many shared latent factors exist across simulated domains. Furthermore, the classification error in the target domain decreases monotonically with the number of shared latent factors, which agrees with our intuition that BMDL can achieve higher predictive power when data across domains are more relevant. This demonstrates that the number of shared latent factors across domains may serve as a new measure of the domain relevance. In the second simulation study, we investigate how the number of target samples affects the classification performance. In this simulation setup, we simulate two related domains with 40 shared latent factors out of 50 total ones. The number of samples in the target domain is changing from 10 to 40, keeping the other setups the same as in the first experiment. Figure 2(b) shows that increasing the number of target samples will improve the performance of both the baseline hGNBP-NBFA using only target data and BMDL integrating data across domains, which is again expected. More interestingly, the improvement of BMDL over hGNBP-NBFA decreases with the number of target samples, which agrees with the general trend shown in the TL/MTL literature [Pardoe and Stone, 2010, Karbalayghareh et al., 2018] that the prediction performance eventually converges to the optimal Bayes error when there are enough samples in the target domain. 4.2 Case study: Lung cancer We consider two setups of analyzing RNA-seq count data from the studies on two subtypes of lung cancer, i.e. Lung Adenocarcinoma (LUAD) and Lung Squamous Cell Carcinoma (LUSC) from TCGA [The Cancer Genome Atlas Research Network et al., 2008]. First, we take two types of NGS data, RNA-seqV2 and RNA-seq of the same lung cancer study, as two highly-related domains since the source and target domain difference is simply due to profiling techniques. Second, we use RNA-seq data from a Head and Neck Squamous Cell Carcinoma (HNSC) cancer study as the source domain and the above RNA-seq lung cancer data as the target domain. These are considered as low-related domains as these two cancer types have quite different disease mechanisms. In this set of experiments, we take 10 samples for each subtype of lung cancer in the target domain to test cancer subtyping performance. We also investigate the effect of the number of source samples, Ns, on cancer subtyping in the target domain by setting Ns = 25 and 100. For all the TCGA NGS datasets, we first have selected the genes appeared in all the datasets and then filtered out the genes whose total read counts across samples are less than 50, resulting in roughly 14,000 genes in each dataset. We first have divided the lung cancer datasets into training and test sets, and then the differential gene expression analysis has been performed on the training set using DeSeq2 [Love et al., 2014], by which 1,000 out of the top 5,000 genes with higher log2 fold change between LUAD and LUSC have been selected for consequent analyses. We first check the subtyping accuracy by directly applying linear SVM to the raw counts in the target domain, which gives an average accuracy of 59.28% with a sample standard deviation (STD) of 5.54% from ten independent runs. We also transform the count data to standard normal data after removing the sequencing depth effect using DESeq2 [Love et al., 2014] and then apply regularized logistic regression provided by the LIBLINEAR (https://www.csie.ntu.edu.tw/~cjlin/liblinear/) package [Fan et al., 2008]. The classification accuracy becomes 74.10% ± 4.41%. Table 1 provides cancer subtyping performance comparison between BMDL, NB-HDP, HDP-NBFA, hGNBP, as well as the baseline hGNBP-NBFA using only the samples form the target domain. In fact, when analyzing data across highly-related domains of lung cancer, from the identified 100 latent factors in the target domain by BMDL, there are 98 shared ones between two RNA-seq techniques. While for low-related domains of lung cancer and HMSC, only 25 of 62 extracted latent factors in lung cancer by BMDL are shared with HNSC. This is consistent with our biological knowledge regarding the sample relevance in two setups. From the table, BMDL consistently achieves better cancer subtyping in both highly- and low-related setups. On the contrary, as the results show, not only HDP based methods cannot improve the results in the low-related setup, but also the performance will be degraded with more severe “negative transfer” adversarial effects when using more source samples. The reason for this is that HDP assumes a latent factor with higher weight in the shared DP will occur more frequently within each sample [Williamson et al., 2010]. This might be an 7 Table 1: Lung cancer subtyping results (average accuracy (%) and STD) highly-related (Ns) low-related (Ns) Method 25 100 25 100 NB-HDP 55.22 ± 3.69 56.52 ± 4.61 54.57 ± 7.73 53.83 ± 7.79 HDP-NBFA 63.48 ± 1.23 65.65 ± 4.22 54.89 ± 7.38 51.83 ± 8.32 hGNBP 74.13 ± 7.07 77.61 ± 3.54 72.94 ± 1.70 74.55 ± 8.84 BMDL 78.46 ± 5.97 81.49 ± 5.12 78.85 ± 4.55 78.10 ± 5.65 hGNBP-NBFA 73.38 ± 7.29 undesirable assumption, especially when the domains are distantly related. For example, a latent factor might not be present throughout the HNSC samples but dominant within the samples of lung cancer. HDP based methods are not able to discover these latent factors given observed samples due to the limited number of lung cancer samples. In addition to this undesirable assumption, NB-HDP does not account for the sequencing-depth heterogeneity of different samples, which may lead to biased results deteriorating subtyping performance as shown in Table 1. HDP-NBFA explores the advantages of modeling the NB dispersion and improves over the NB-HDP due to the flexibility of learning p(d) j , especially in the highly-related setup. This demonstrates the benefits of inferring the sequencing depth in RNA-seq count applications. Although in highly-related setup the HDP-NBFA performance has been improved with the increasing number of source samples, we still observe the same “negative transfer” effect in the low-related setup. Again, integrating more source samples is beneficial when the samples across domains are highly relevant but it can be detrimental when the relevance assumption does not hold as both NB-HDP and HDP-NBFA force a similar structure of latent factors across domains. The better performance of the gamma process based models compared to HDP based models, in both scenarios with low and high domain relevance, may be explained by the negative correlation structure that the Dirichlet process imposes on the weights of latent factors, while the gamma process models these weights independently, and hence allowing more flexibility for adjustment of latent representations across domains. On the other hand, when comparing the performance of BMDL and hGNBP, domain-specific latent factor assignment using the beta-Bernoulli process can be considered as the main reason for the superior performance of BMDL, especially in the low-related setup. Compared to the baseline hGNBP-NBFA, BMDL can clearly improve cancer subtyping performance. Even using a small portion of the related source domain samples, the subtyping accuracy can be improved up around 5%. With more highly-related source samples, the improvement can be up to 8%. Compared to the HDP based methods, BMDL can achieve up to 16% improvement in the highly-related setup due to the benefits brought by the gamma process modeling of count data instead of using DP in HDP models, which forces negative correlation and restricts the distribution over latent factor abundance [Williamson et al., 2010]. Compared to hGNBP, BMDL can achieve up to 4% and 6% accuracy improvement, respectively, in highly- and low-related setups due to domain-specific latent factor assignment using the beta-Bernoulli process. Since the selector variables zkd in BMDL help to assign only a finite number of latent factors for each domain, it is sufficient merely to ensure that the sum of any finite subset of top-level atoms is finite. This eliminates the restrictions on factor score parameters imposed by DP, and improves subtyping accuracy since the latent factor abundance is independent. BMDL also does not have any restriction on the number of domains and can be applied to more than two domains. To show this, we also have done another case study with three domains using both the highly- and low-related TCGA datasets. The accuracy of BMDL is 79.71% ± 5.32% and 81.96% ± 4.96% when using N (ds1) s = N (ds2) s = 25 and 100 samples for two source domains as described earlier, respectively. Compared to one source and one target domain with 25 source samples, the accuracy of using three domains has improved by 1%. Having two source domains with more samples (N (ds1) s + N (ds2) s = 50) leads to more robust estimation of φvk and improves the subtyping accuracy. When there are enough number of samples (N (ds1) s = 100) in highly-related domain, adding another low-related domain does not improve the subtyping results. But it is notable 8 that the accuracy has increased around 4% when adding the highly-related domain with 100 samples to 100 low-related samples. The results show that 1) using more domains with more samples does help subtyping in the target domain; 2) BMDL avoids negative transfer even when adding samples from low-related domains. We would like to emphasize again that, unlike existing methods, BMDL infers the domain relevance given in the data and derive domain-adaptive latent factors to improve predictive power in the target domain, regardless of the degree of domain relevance. This is important in real-world setups when the samples across domains are distantly related or the sample relevance is uncertain. As the results have demonstrated, BMDL achieves the similar performance improvement in the low-related setup as in the highly-related setup without “negative transfer” symptom, often witnessed in existing TL/MTL methods. It shows the great potential for effective data integration and joint learning even in the low-related setup: the performance is better than competing methods as well as the baseline hGNBP-NBFA using only target samples and increasing the number of source samples does not hurt the performance. 5 Conclusions We have developed a multi-domain NB latent factorization model, tailored for Bayesian multi-domain learning of NGS count data—BMDL. By introducing this hierarchical Bayesian model with selector variables to flexibly assign both domain-specific and globally shared latent factors to different domains, the derived latent representations of NGS data preserves predictive information in corresponding domains so that accurate cancer subtyping is possible even with a limited number of samples. As BMDL learns domain relevance based on given samples across domains and enables the flexibly of sharing useful information through common latent factors (if any), BMDL performs consistently better than single-domain learning regardless of the domain relevance level. Our experiments have shown the promising potential of BMDL in accurate and reproducible cancer subtyping with “small” data through effective multi-domain learning by taking advantage of available data from different sources. Acknowledgements We would like to thank Dr. Sahar Yarian for insightful discussions. We also thank Texas A&M High Performance Research Computing and Texas Advanced Computing Center for providing computational resources to perform experiments in this work. This work was supported in part by the NSF Awards CCF-1553281, IIS-1812641, and IIS-1812699. References A. Argyriou, T. Evgeniou, and M. Pontil. Multi-task feature learning. In Advances in neural information processing systems, pages 41–48, 2007. C. Chelba and A. Acero. Adaptation of maximum entropy capitalizer: Little data can help a lot. Computer Speech & Language, 20(4):382–399, 2006. S. Z. Dadaneh, X. Qian, and M. Zhou. BNP-Seq: Bayesian nonparametric differential expression analysis of sequencing count data. Journal of the American Statistical Association, 113(521):81–94, 2018. doi: 10.1080/01621459.2017.1328358. R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. Liblinear: A library for large linear classification. Journal of machine learning research, 9(Aug):1871–1874, 2008. Z. Ghahramani and T. L. Griffiths. Infinite latent feature models and the Indian buffet process. In Advances in neural information processing systems, pages 475–482, 2006. E. Hajiramezanali, S. Z. Dadaneh, P. de Figueiredo, S.-H. Sze, M. Zhou, and X. Qian. Differential expression analysis of dynamical sequencing count data with a gamma Markov chain. arXiv preprint arXiv:1803.02527, 2018. L. Jacob, J.-P. Vert, and F. R. Bach. Clustered multi-task learning: A convex formulation. In Advances in neural information processing systems, pages 745–752, 2009. Z. Kang, K. Grauman, and F. Sha. Learning with whom to share in multi-task feature learning. In ICML, pages 521–528, 2011. 9 A. Karbalayghareh, X. Qian, and E. R. Dougherty. Optimal Bayesian Transfer Learning. IEEE Transactions on Signal Processing, 2018. A. Kumar and H. Daume III. Learning task grouping and overlap in multi-task learning. arXiv preprint arXiv:1206.6417, 2012. L. Le Cam. An approximation theorem for the Poisson binomial distribution. Pacific Journal of Mathematics, 10(4):1181–1197, 1960. M. I. Love, W. Huber, and S. Anders. Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome biology, 15(12):550, 2014. S. J. Pan and Q. Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345–1359, 2010. D. Pardoe and P. Stone. Boosting for regression transfer. In Proceedings of the 27th International Conference on International Conference on Machine Learning, pages 863–870. Omnipress, 2010. A. Passos, P. Rai, J. Wainer, and H. Daume III. Flexible modeling of latent task structures in multitask learning. arXiv preprint arXiv:1206.6486, 2012. V. M. Patel, R. Gopalan, R. Li, and R. Chellappa. Visual domain adaptation: A survey of recent advances. IEEE signal processing magazine, 32(3):53–69, 2015. P. Rai and H. Daume III. Infinite predictor subspace models for multitask learning. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 613–620, 2010. B. Schölkopf and A. J. Smola. Learning with kernels: Support vector machines, regularization, optimization, and beyond. MIT press, 2002. Y. W. Teh, M. I. Jordan, M. J. Beal, and D. M. Blei. Sharing clusters among related groups: Hierarchical Dirichlet processes. In Advances in neural information processing systems, pages 1385–1392, 2005. The Cancer Genome Atlas Research Network et al. Comprehensive genomic characterization defines human glioblastoma genes and core pathways. Nature, 455(7216):1061, 2008. R. Thibaux and M. I. Jordan. Hierarchical beta processes and the Indian buffet process. In Artificial Intelligence and Statistics, pages 564–571, 2007. S. Williamson, C. Wang, K. Heller, and D. Blei. The IBP compound Dirichlet process and its application to focused topic modeling. 2010. Y. Xue, X. Liao, L. Carin, and B. Krishnapuram. Multi-task learning for classification with Dirichlet process priors. Journal of Machine Learning Research, 8(Jan):35–63, 2007. M. Zhou. Nonparametric Bayesian negative binomial factor analysis. Bayesian Analysis, pages 1061–1089, 2018. M. Zhou and L. Carin. Augment-and-conquer negative binomial processes. In Advances in Neural Information Processing Systems, pages 2546–2554, 2012. M. Zhou and L. Carin. Negative binomial process count and mixture modeling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):307–320, 2015. M. Zhou, H. Chen, L. Ren, G. Sapiro, L. Carin, and J. W. Paisley. Non-parametric Bayesian dictionary learning for sparse image representations. In Advances in neural information processing systems, pages 2295–2303, 2009. 10
2018
178
7,339
Multilingual Anchoring: Interactive Topic Modeling and Alignment Across Languages Michelle Yuan University of Maryland myuan@cs.umd.edu Benjamin Van Durme John Hopkins University vandurme@jhu.edu Jordan Boyd-Graber University of Maryland jbg@umiacs.umd.edu Abstract Multilingual topic models can reveal patterns in cross-lingual document collections. However, existing models lack speed and interactivity, which prevents adoption in everyday corpora exploration or quick moving situations (e.g., natural disasters, political instability). First, we propose a multilingual anchoring algorithm that builds an anchor-based topic model for documents in different languages. Then, we incorporate interactivity to develop MTAnchor (Multilingual Topic Anchors), a system that allows users to refine the topic model. We test our algorithms on labeled English, Chinese, and Sinhalese documents. Within minutes, our methods can produce interpretable topics that are useful for specific classification tasks. 1 Introduction: Exploring multilingual document collections Modeling multilingual topics aids exploration of large corpora across languages [1]. These models help align topics cross-lingually and uncover latent relationships between languages, such as observing the differences in describing economic issues between English and Spanish speakers [2]. Incorporating multilingual information also forms better monolingual topics [3]. Multilingual topic models usually depend on some resource to bridge languages. These resources include word alignments [4], dictionaries [3, 5], topic alignments in documents [6], or all of the above [7]. Existing multilingual models have several shortcomings; they assume extensive knowledge about languages, preclude human refinement, and are slow. Thus, a topic model may not be appropriate in emergent sitations on low resource languages when time is of the essence: e.g., when relief workers must triage relief messages in Hatian Creole [8]. Beyond these practical concerns, adding interactivity to topic modeling allows machine learning non-experts to build models better suited to their needs [9–11]. One way to quickly incorporate human knowledge into the model is through anchor words [12]. Inference in anchor-based topic models is driven by anchors, which are words that have high probability in one topic and low probability in remaining topics [13, 14]. The anchoring algorithm scales with the number of unique word types, making it fast enough for interactive updates. We present two contributions for modeling multilingual topics. First, we develop a multilingual anchoring algorithm, which is an extension to anchor-based topic inference for comparable corpora.1 Second, we introduce MTAnchor, a human-in-the-loop system that uses multilingual anchoring to align topics and enables users to make further adjustments to the model.2 Through interaction, the model produces interpretable, low-dimensional representations of documents. These vector representations improve intra-lingual or cross-lingual text classification. The topic model generates coherent topic aligments for comparable corpora because users themselves align topics. 1Comparable corpora across languages are collections of documents about the same themes but that are not translations. Compared to more typical parallel data [15, 16], comparable data are more challenging. 2http://github.com/forest-snow/mtanchor_demo. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 2 Anchor-based topic models A topic model discovers topics: a distribution over words that evinces a coherent theme [17]. Well-known methods for constructing topic models are latent Dirichlet allocation [18, LDA] and latent semantic analysis [19, LSA]. Another computationally attractive option is the anchor word algorithm [13] that uses the row-normalized word co-occurrence matrix ¯Q , where ¯Qi,j = p(w2 = j | w1 = i). The vector ¯Qi is the ith row of ¯Q and represents the conditional distribution of words in a document given that word i has occurred. Anchor word s appears with high probability in only one topic, so ¯Qs resembles a topic’s word distribution in topic models like LDA. For example, if “concealer” is an anchor word for a cosmetics topic, then its conditional distribution will have high probability for cosmetics-related words and low probability for other words. Still, these are not the distributions that typically define probabilistic topic models: the probability of a word given a topic. 2.1 Anchoring To discover topic distributions, anchor word approaches [14] search for coefficients that describe non-anchor words’ document contexts with anchor words’ conditional distributions. The word “liner” has meanings that are explained by “album” in a music topic, “concealer” in a cosmetics topic, and “carburetor” in an automotive topic. Then, the conditional distribution of “liner” can be expressed as a convex combination of the conditional distributions of “album”, “concealer”, and “carburetor”. Given anchor words s1, . . . , sK, the conditional distribution of word i can be approximated as ¯Qi ≈ K X k=1 Ci,k ¯Qsk subject to K X k=1 Ci,k = 1 and Ci,k ≥0. (1) The coefficient Ci,k represents p(z = k | w = i), the probability of topic k given a word i. These coefficients are recovered using the RecoverL2 algorithm [14], which minimizes the quadratic loss between ¯Qi and PK k=1 Ci,k ¯Qsk. Using Bayes’ rule, we can obtain the standard topic matrix A, Ai,k = p(w = i | z = k) ∝p(z = k | w = i)p(w = i) = Ci,k V X j=1 ¯Qi,j. (2) For a large vocabulary size V , finding these anchor words is a challenge, but understanding the geometric intuition behind the anchoring algorithm can help us select the right words. Points inside a convex hull are expressed as the convex combination of their vertices. If we want to approximate ¯Qi as the convex combination of ¯Qs1, . . . , ¯QsK (Equation 1), then ¯Qs1, . . . , ¯QsK should be the vertices of the convex hull of ¯Q. However, finding the vertices to a V -dimensional convex hull is timeconsuming [13]. Instead, Arora et al. [14] use FastAnchorWords, a greedy approach similar to Gram-Schmidt orthogonalization, to construct an approximate convex hull of ¯Q and expand it as much as possible with each choice of anchor word. Other methods include projecting ¯Q to a lowdimensional space and finding the vertices of its exact convex hull [20], adding another dimension to capture metadata [21], or finding nonparametric anchor words [22]. 2.2 Multiword anchoring Finding topics in anchor-based models is fast, so it can be used in an interactive setting where users iteratively choose anchor words for every topic [12]. Nevertheless, users may want to choose multiple anchor words for a topic, such as selecting both “concealer” and “lipstick” for a cosmetics topic. Therefore, Lund et al. [12] propose multiword anchoring: users select a set Gk of multiple anchor words for topic k. After users select G1, . . . , GK, ¯Q is augmented so that new rows ¯QV +1, . . . , ¯QV +K represent these pseudo-anchors in the conditional word co-occurrence space. Lund et al. [12] construct these vectors ¯QV +k as ¯QV +k,j =    P i∈Gk ¯Q−1 i,j |Gk|    −1 . (3) The motivation for using the harmonic mean (Equation 3) is that the function can centralize input values and ignore large outliers. Finding topics follows the same algorithm as before using single word anchors. Instead of modeling ¯Qi as the convex combination of ¯Qs1, . . . , ¯QsK, a convex combination of ¯QV +1, . . . , ¯QV +K models ¯Qi with minimal quadratic loss. 2 concealer cosmopolitan lipstick liner concealer carburetor album liner melody melody Figure 1: Visualizing the importance of choice in anchor words for approximating conditional distributions. The chosen anchor words are the black dots and their span is the white triangle. On the left, the span of anchor words is small, so the words “melody” and “liner” are too close together. On the right, the span of anchor words is large, so the conditional distributions of words “melody” and “liner” are approximated more accurately. 3 Bridging languages: How do you say anchor in Chinese? Anchor-based topic models are well-defined for individual languages, but a multilingual model requires topics that are thematically connected across languages. Discovering two separate sets of anchor words does not suffice. In this section, we propose multilingual anchoring as an algorithm to cross-lingually link topics and their corresponding anchor words. First, we can connect anchor words across languages as anchor links. For example, “anchor” may be linked to “錨(máo)” in Chinese under a nautical context. After anchor words are linked, all words in the same topic across languages will be form a coherent multilingual topic. A straightforward way to link words across languages is through a dictionary, much as a human would. Just as possessing a Chinese dictionary does not enable someone to speak Chinese, a dictionary does not magically create multilingual topics. To construct an overall coherent model, anchor links should be carefully selected. We define these links in more detail. A language L is a set of word types w. A bilingual dictionary B is a subset of the Cartesian product L(1) × L(2) , where L(1), L(2) are two different languages. An element (w(1), w(2)) of B represents a dictionary entry where words w(1) ∈L(1) and w(2) ∈L(2) are translations of each other. While B is a binary relation, it is not necessarily a function. Other multilingual topic models require that the dictionary is a one-to-one correspondence [3, 23, 2]. We relax this restriction on B to extract as much information from the dictionary as possible. We could select anchor words s1, ..., sK independently for each language by considering all words w(1) ∈L(1) and w(2) ∈L(2) as possible candidates for anchors (e.g., independent runs of anchor algorithm). Instead, we want to jointly choose anchor words for both languages. First, we use dictionary entries to create links between words. Then, we choose anchor words s(1) k for Language 1 and s(2) k for Language 2 such that s(1) k and s(2) k are linked. Through this process, we obtain a set of K anchor words for each language and can obtain topics using RecoverL2 [14]. 3.1 Multilingual anchoring If there is only one anchor word for each topic, our goal of building a coherent multilingual topic model would fail. Any imperfection in the dictionary would scupper the topic model. Fortunately, Arora et al. [14] assert that there exist many anchor word choices for a topic. Even if we reduce the pool for candidate anchors, we can still find suitable anchor words for each topic. Recall that anchor words are the vertices to the convex hull of words in the conditional distribution space (Section 2). Finding the actual vertices of the convex hulls is too expensive, so FastAnchorWords searches for a set of anchors with maximal span. This span should approximate the convex hull of ¯Q. Without a large enough span, we can never find accurate approximations for words in the conditional distribution space. All words w will have indistinguishable conditional distributions (Figure 1). As a result, every topic will have indistinct word distributions and the resulting topics will be copies of one another. 3 concealer forest carburetor cosmopolitan album bourgeoisie 螘ቭ 䌕蜉 玕ရ瑊 祜຋ य़᮷䨝 Bourgeoisie does not have a Chinese translation, so it cannot be picked as an anchor word even if it is the farthest word from the convex hull. य़᮷䨝 G£GòK¼L LVWKHSRLQWIDUWKHVW DZD\IURPWKH&KLQHVHFRQYH[KXOOEXW LWVWUDQVODWLRQFRVPRSROLWDQLVWRRFORVH WRWKH(QJOLVKFRQYH[KXOOWKHUHE\ HOLPLQDWLQJWKHPDVDQFKRUZRUG FKRLFHV Forest and its translation 祜຋ VËQO°Q are not the furthest points from their respective convex hull, but neither are too close. So, they are chosen as the next anchor words. Figure 2: Selecting anchor links for multilingual anchoring. The purple (blue) area represents the conditional distribution space of words in the English (Chinese) corpus. The white triangle designates the space spanned by chosen anchor words. Dashed lines depict anchor links across spaces. Black points denote words already chosen as anchors, white points are unchosen words, and pink stars are most optimal anchors for the current iteration. Multilingual anchors should maximize area spanned by white triangles in both spaces. To maximize span of anchor words, FastAnchorWords [14] chooses anchor word sk such that sk = argmax w d span ¯Qs1, ..., ¯Qsk−1  , ¯Qw  , (4) where d(P, i) is defined as the Euclidean distance from point i to subspace P, or the norm of the projection of i onto the orthogonal complement of P. To extend the greedy approach to multilingual settings, we need anchor words that can guide topic inference in multiple languages. This motivates our approach for linking words with a dictionary. By choosing linked anchor words, the algorithm can align topics cross-lingually so that the aligned topics form one multilingual topic. However, randomly choosing translation pairs as anchor links will not produce coherent multilingual topics. We need multilingual anchors that also inherit the geometric properties of monolingual anchors. So, the span of anchor words should be maximized in both languages for optimal topic inference. To clearly state our objective, we define P (l) j as the subspace spanned by j chosen anchor words in the conditional distribution space of language l, P (l) j = span  ¯Q(l) s(l) 1 , ..., ¯Q(l) s(l) j  . (5) Word w is a good choice of a kth anchor if ¯Qw is far enough from P (l) k−1 so that having ¯Qw as an additional vertex can greatly expand span of anchors. A word might be a great choice for an anchor in one language, but we cannot select it if its translation is a poor choice for the other language (Figure 2). We need to pick linked words w ∈L(1) and v ∈L(2) such that w is far from P (1) k−1 and v is also far away from P (2) k−1. Then, adding w and v as anchor words can increase total span of anchor word set in both languages. Using this intuition, we maximize the lower bound on the distance from anchor words to P (1) k−1 and P (2) k−1. We select anchor words w and v such that s(1) k , s(2) k = argmax w,v min n d  P (1) k−1, ¯Q(1) w  , d  P (2) k−1, ¯Q(2) v o subject to (w, v) ∈B. (6) We greedily select anchors s(1) k ∈L(1), s(2) k ∈L(2) such that Equation 6 is satisfied on every iteration k. Words with multiple translations are elegantly addressed: if an anchor word w is picked already, then it is not likely to be picked again. The algorithm expands both convex hulls simultaneously with each iteration. Indeed, more translations aid our anchor search because there will be more linked anchors to choose from. Even if the algorithm chooses anchor words similar in meaning within the same language, interactivity can help remove duplicate topics (Section 3.2). After 4 Figure 3: The user interface for exploring topics in English and Chinese documents. Anchor words are in the center, while the most likely words for each topic are on the left and right sides of the interface. The user can drag words from the side and add them as anchor words. When the user hovers over “亞種(yàzhˇong)”, then its translation, “subspecies”, appears at the bottom of the screen. When the user presses on the word, all occurrences of it and its translation are highlighted in yellow. Users can type words in the “Search words” box to find which words are in the vocabulary. These features help the user explore topics in an unfamiliar language. picking a set of anchor words for each language, multilingual anchoring follows FastAnchorWords (Section 2.1). Topic matrices A(1) and A(2) are separately recovered (Equations 1, 2). These matrices are the output of multilingual anchoring. In the next sections, we show how MTAnchor further updates A(1) and A(2) based on human feedback. Lacking dictionary entries. If dictionary entries are scarce, then we cannot constrain the anchor words to only be words from the dictionary. So, we independently find anchor words for each language using RecoverL2. This reduction to monolingual settings resembles other cross-lingual models: JointLDA reduces to LDA and PTLDA reduces to TLDA when there are no dictionary entries [3, 7]. Predicting labels from topics. Multilingual anchoring is an unsupervised method, but the topic distribution acts as a low-dimensional representation for each document [24–26]. To infer the topic distribution of documents, we pass in the topic matrices as inputs into variational inference [18], where topic variational parameter β is fixed and only document variational parameter γ is fitted. Then, we train a linear SVM on the topic distributions of documents [27] to classify document labels. 3.2 Interactive topic alignment Multilingual anchoring uses translations to find anchor words that can lead to better topics for both languages. However, we cannot completely rely on dictionary entries to construct the topic model. In reality, translations may not be available, could be a poor fit for the dataset, or might be wrong. In addition to problems with the dictionary, the data may be too noisy, or the anchoring algorithm returns a topic model unsuited for our needs (e.g., if a user needs to separate news from opinion and the topic model puts them together). Thus, we incorporate interactivity into MTAnchor so that we can extract linguistic and cultural knowledge from humans. First, MTAnchor takes in a comparable corpora and a bilingual dictionary as inputs. Next, it uses multilingual anchoring (Section 3.1) to find sets of anchor words for each language. After the algorithm recovers topic matrices, the interface shows information about the topic model. The user can press on the red “X” to delete any incoherent or duplicate topics (Figure 3). The user can also add new topics by pressing on “Add Topics”. The interface will create a new blank row beneath the 5 Table 1: Comparison of multilingual topic modeling methods. Multilingual anchoring scores higher in classification accuracy and topic coherence than MCTA. MTAnchor does as well as multilingual anchoring on average, but a few users can achieve the best results for every metric. Classification accuracy Topic coherence Dataset Method EN-I ZH-I SI-I EN-C ZH-C SI-C EN-I ZH-I SI-I EN-E ZH-E SI-E Wikipedia (EN-ZH) Multilingual anchoring 69.49% 71.24% 50.37% 47.76% 0.141 0.178 0.084 0.128 MTAnchor (maximum) 80.71% 75.33% 57.62% 54.54% 0.195 0.198 0.103 0.147 MTAnchor (median) 69.49% 71.44% 50.27% 47.22% 0.141 0.178 0.084 0.129 MCTA 51.56% 33.35% 23.24% 39.79% 0.126 0.085 0.000 0.037 Amazon (EN-ZH) Multilingual anchoring 59.79% 61.10% 51.73% 53.20% 0.069 0.061 0.031 0.045 MCTA 49.53% 50.64% 50.27% 49.49% -0.028 0.019 0.017 0.011 LORELEI (EN-SI) Multilingual anchoring 20.78% 32.65% 24.49% 24.68% 0.077 0.000 0.025 n/a MCTA 12.99% 26.53% 4.08% 15.58% 0.132 0.000 0.036 n/a existing topics. Then, the user can add words as anchors to the new topic. These features are similar to the ones used for interactively modeling monolingual topics [12]. Once the user finishes choosing anchor words for each topic, they press “Update Topics”. This is a signal for MTAnchor to retrieve new anchor words from the interface and run multiword anchoring (Section 2.2). The algorithm approximates ¯Qw for every word w in the vocabulary and then recomputes the topic matrices for each language. When MTAnchor finds new topics, the user can see the updated topics on the interface. At this point, anchors no longer have to be linked by dictionary entries because MTAnchor does not select anchors based on Equation 6. After the initial alignment, users define anchors and customize the topic model to their own needs. 4 Experiments The first dataset consists of Wikipedia articles: 11,043 in English and 10,135 in Chinese. We shorten the articles to contain no more than three sections. We lemmatize the English articles using WordNet Lemmatizer [28] and segment the Chinese articles using Stanford CoreNLP [29]. For both languages, the articles fall under one of six categories: film, music, animals, politics, religion, and food. Another dataset consists of Amazon reviews: 53,558 in English and 53,160 in Chinese (mostly from Taiwan) [30]. Each review has a rating, ranging from one to five. Since about half of the reviews have a rating of five, we change the classification task to a binary problem by labeling reviews with rating of five as “1” and the rest as “0”. For the Wikipedia and Amazon datasets, the training-test split is set to 80:20. For the Chinese-English dictionary, we use entries from MDBG.3 To test low-resource languages, we use data from the LORELEI Sinhalese language pack [31]. These language packs are created to develop technologies that can process data in low-resource languages. In the pack, only a small subset of documents are labeled based on need type.4 So, we treat the classification task as a semi-supervised problem. There are eight possible labels: evacuation, food supply, search/rescue, utilities, infrastructure, medical assistance, shelter, and water supply [32]. Out of the 1,100 (4,790) English (Sinhalese) documents, only 77 (49) of them have labels. For each language, half of the labeled documents are in the training set and the other half are in the test set. For the Sinhalese-English dictionary, we use entries from the LORELEI Sinhalese language pack. We run experiments to evaluate three methods: multilingual anchoring, MTAnchor, and MCTA (Multilingual Cultural-common Topic Analysis) [33]. We choose MCTA as a baseline because it is a recent work on multilingual topic models with readily available code and aligns topics using a bilingual dictionary. We train models on multilingual anchoring and MCTA with twenty topics. For MTAnchor, we initially show users twenty topics, but the final number of topics is their choice. All methods are implemented in Python on a 2.3 GHz Intel Core i5 processor. 3https://www.mdbg.net/chinese/dictionary?page=cc-cedict. 4Documents in LORELEI language pack have multiple need types, but we have simplified the classification task by assigning only the first label to each document. 6 0 0.2 0.4 0.6 0.8 F1 Score Train: Chinese Method MCTA MTAnchor (max) Multilingual Anchoring Train: English Test: Chinese 0 100 200 300 0 0.2 0.4 0.6 0.8 0 100 200 300 Time (min) Test: English Figure 4: Classification accuracy over time until MCTA converges. For the Wikipedia dataset, multilingual anchoring converges within 5 minutes, but MCTA takes 5 hours and 18 minutes to converge. Multilingual anchoring outperforms MCTA in speed and classification accuracy. The data for the MTAnchor user study are the English-Chinese Wikipedia articles. We invite twenty participants on Amazon Mechanical Turk (MTurk) to partake in the study. Each user is given thirty minutes to interact with the interface.5 MTAnchor scales with the number of unique word types, rather than number of documents or number of words in the documents, so updates to the system take no longer than seven seconds on average. We only approve HITs from workers who have completed the task for the first time. After worker finishes the task, the interface provides a unique code for them to enter on MTurk. These rules ensure fair assessment of workers’ interaction with MTAnchor. 4.1 Evaluating multilingual topics Ideally, topic models should have topics that are interpretable and useful as classification features. So, we primarily base evaluation on two measures: classification accuracy and topic coherence. Measuring topic coherence considers both intrinsic and extrinsic scores [34]. The difference between the two is the reference corpus.6 The intrinsic score uses the trained corpus itself, whereas the extrinsic score uses an external, larger dataset. The Sinhalese extrinsic coherence scores are not available because a large reference corpus cannot be formed for low-resource languages. By measuring both, we can evaluate the model’s interpretability within a local and global context. We evaluate these metrics separately for each language: English (EN), Chinese (ZH), and Sinhalese (SI). To classify labels from topics, we use the same procedure as described in Section 3.1. Then, we measure intra-lingual (I) and cross-lingual accuracy (C) with F1 scores. Intra-lingual accuracy refers to percentage of documents classified correctly using a classifier trained on documents in the same language. Cross-lingual accuracy refers to percentage of documents classified correctly using a classifier trained on documents in a different language (testing the algorithm’s ability to generalize). For topic coherence, we use the NPMI (normalized pointwise mutual information) variant of automated topic intepretability scores over the fifteen most probable words in a topic [34]. For intrinsic scores (I), we use the trained corpus itself as the reference corpus. For extrinsic scores (E), we use 2.2M English Wikipedia articles and 1.1M Chinese Wikipedia articles. During the user study, we hold out 100 documents as a development set for each corpus. Each time the user updates topics, the interface shows classification accuracy on the development set. When the user finally submits final anchor words, we evaluate their topics on the test set. 5Synopsis of user instructions: “There are 11,000 English Wikipedia articles and 10,000 Chinese Wikipedia articles, which belong to one of six categories: film, music, animals, politics, religion, food. Your goal is to find topics that can help classify documents within 30 minutes.” 6Measuring topic coherence requires a reference corpus to sample lexical probabilities. 7 0.4 0.5 0.6 0.7 0.8 0.9 F1 Score Train: Chinese Train: English Dev: Chinese 0 10 20 0.4 0.5 0.6 0.7 0.8 0.9 0 10 20 Time (min) Dev: English 0.4 0.5 0.6 0.7 0.8 F1 Score Train: Chinese Train: English Test: Chinese 10 15 20 25 30 0.4 0.5 0.6 0.7 0.8 10 15 20 25 30 Time (min) Test: English Figure 5: Classification accuracy of each participant in the MTAnchor user study over time. Each plot indicates the language of topics that the classifier is trained on and the language of topics that the classifier is tested on. The black horizontal line denotes multilingual anchoring score (no interactive updates). Each colored line represents a different user interaction and shows the fluctuation in scores on development set (left). Each colored point represents the final classification score on the test set; the point’s x-coordinate indicates total duration of user’s session (right). 4.2 Results In experiments, multilingual anchoring converges much faster than MCTA (Figure 4). We compare scores across experiments for multilingual anchoring, MTAnchor, and MCTA, but only report the maximum and median scores from MTAnchor user experiments (Table 1). For English-Chinese datasets, multilingual anchoring performs better than MCTA in all metrics. For English-Sinhalese LORELEI dataset, topics from multilingual anchoring are more useful for classification tasks but are less coherent than MCTA topics. In every metric, the MTAnchor maximum score across all users is higher than scores from other methods (Table 1). The MTAnchor median score across all users is approximately same as those of multilingual anchoring for all metrics. A few users outperform multilingual anchoring by spending more time interacting with the model (Figure 5). Within thirty minutes, a user can improve topic coherence and reach up to a 0.40 increase in any one of the classification scores. 5 Related work and discussion Prior work on multilingual topic models mainly follow a generative approach. The Polylingual Topic Model [1] assumes that documents are topically aligned to track topic trends across languages. JointLDA [3] makes use of a bilingual dictionary and introduces “concepts" as a way to connect words from different languages. The model learns better monolingual models through optimizing cross-lingual corpora than LDA does when trained only on monolingual data. The Polylingual Treebased Topic Model [7] builds tree priors to incorporate word correlation and document alignment information. MCTA [33] is another generative, multilingual model, but uses dictionary entries to capture “cultural-common” topics. Multilingual anchoring is a spectral approach to modeling multilingual topics. The algorithm converges much faster than generative methods (Figure 4) and resulting topics form better vector representations for documents (Table 1). An advantage of anchoring over generative models is its robustness and practicality [14]. Generative methods need long documents to correctly estimate topic-word distributions, but anchoring handles documents of any size [13]. This is evident in models built on the Amazon dataset, which contains reviews with only one to three sentences. The health topic for multilingual anchoring is more interpretable than that of MCTA (Table 2). Arora et al. [14] observe that more specific words appear in the top words of anchor-based topics. This is clearly shown in the LORELEI experiments; a topic from MCTA has general words like “help” and “need”, while a topic from multilingual anchoring has specific words like “aranayanke” and “nbro” (Table 2). Both topics are about the 2016 Sri Lankan floods, but the topic from MCTA cannot 8 Table 2: Top seven words of sample English and Chinese topics are shown with anchors bolded. Topics from multilingual anchoring and MTAnchor are more relevant to document labels, thereby making them more useful as features for classification. Dataset Method Topic Wikipedia MCTA dog san movie mexican fighter novel california 主演改編本小說拍攝角色戰士 Multilingual anchoring adventure daughter bob kong hong robert movie 主演改編本片飾演冒 冒 冒險 險 險講述編劇 MTAnchor kong hong movie office martial box reception 主演改編飾演本片演 演 演員 員 員編 編 編劇 劇 劇講述 Amazon MCTA woman food eat person baby god chapter 來貨頂頂水耳機貨物張傑傑同樣 Multilingual anchoring eat diet food recipe healthy lose weight 健 健 健康 康 康幫吃身體全面同事中醫 LORELEI MCTA help need floodrelief please families needed victim Multilingual anchoring aranayake warning landslide site missing nbro areas specify the “need” type of documents. So, accuracy is higher when using topics from multilingual anchoring to classify documents. However, LORELEI experiments show that multilingual anchoring topics are less interpretable than MCTA topics. This might be caused by the obscure top topic words. Arayanake is a Sri Lankan town and “nbro” stands for National Building Research Organization. These words may have lowered coherence because they do not co-occur frequently with other top topic words. In this case, using MTAnchor can possibly increase topic coherence. In the user study, a few participants create topics that are more applicable for specific tasks. In one experiment, a user finds the topic with anchor words “adventure” and “冒險(màoxiˇan)” too vague. The user knows that the task is to classify Wikipedia articles into one of six categories, so they add movie-related terms as anchors, like “movie”, “演員(yˇanyuán)”, and “編劇(bi¯anjù)”. Afterward, their topics significantly improves in classification accuracy and coherence. Other participants do not significantly change the topic model through interactive updates. More work can look into improving MTAnchor so that updates change topic distributions more drastically. Interestingly, the scores for English topics increase considerably after user interaction compared to Chinese topics (Table 1). The participants are anonymous MTurk workers, so we are not aware of their language skills. We believe that workers are most likely fluent in English because the MTurk website is only available in English. If this fact holds true, then it can explain why the English topics have much higher scores than the Chinese ones. It also shows that people can improve topic models with prior knowledge, which supports the need for human-in-the-loop algorithms. In the future, it would be interesting to observe how language fluency affects quality of multilingual topics. 6 Conclusion We present spectral and interactive topic models for multilingual document collections. The goal is to bridge the language gap using a multitude of resources: a dictionary, corpora, statistical models, and human input. A model that relies entirely on one resource is impractical for use in many settings, especially for low-resource situations. Multilingual anchoring can work with or without label supervision. Dictionary entries can be scarce or not fully accurate. People can use MTAnchor without a deep knowledge of topic modeling or machine learning. The method’s versatility and speed make it an alternative to models like neural networks, which need a preponderance of labeled data. Future work can focus on understanding the effect of human input on multilingual topic models and accurately reflecting their feedback in cross-lingual representations. 9 Acknowledgments We thank the anonymous reviewers for their insightful and constructive comments. Additionally, we thank Leah Findlater, Jeff Lund, Thang Nguyen, Shi Feng, Mozhi Zhang, Weiwei Yang, Eric Wallace, and Manasij Venkatesh for their helpful feedback. This work was supported in part by the JHU Human Language Technology Center of Excellence (HLTCOE) and Raytheon BBN Technologies, by DARPA award HR0011-15-C-0113. Any opinions, findings, conclusions, or recommendations expressed here are those of the authors and do not necessarily reflect the view of the sponsors. References [1] Mimno, D., H. M. Wallach, J. Naradowsky, et al. Polylingual topic models. In Proceedings of Empirical Methods in Natural Language Processing. 2009. [2] Gutiérrez, E. D., E. Shutova, P. Lichtenstein, et al. Detecting cross-cultural differences using a multilingual topic model. Transactions of the Association for Computational Linguistics, 2016. [3] Jagarlamudi, J., H. Daumé. Extracting multilingual topics from unaligned comparable corpora. In Proceedings of the European Conference on Information Retrieval. 2010. [4] Zhao, B., E. P. Xing. BiTAM: Bilingual topic admixture models for word alignment. In Proceedings of International Conference on Computational Linguistics. 2006. [5] Boyd-Graber, J., P. Resnik. Holistic sentiment analysis across languages: Multilingual supervised latent dirichlet allocation. In Proceedings of Empirical Methods in Natural Language Processing. 2010. [6] Ni, X., J.-T. Sun, J. Hu, et al. Mining multilingual topics from Wikipedia. In Proceedings of the World Wide Web Conference. 2009. [7] Hu, Y., K. Zhai, V. Eidelman, et al. Polylingual tree-based topic models for translation domain adaptation. In Proceedings of the Association for Computational Linguistics. 2014. [8] Morrow, N., N. Mock, A. Papendieck, et al. Independent evaluation of the Ushahidi Haiti project. Development Information Systems International, 2011. [9] Choo, J., C. Lee, C. K. Reddy, et al. Utopian: User-driven topic modeling based on interactive nonnegative matrix factorization. IEEE transactions on visualization and computer graphics, 2013. [10] Hu, Y., J. Boyd-Graber, B. Satinoff, et al. Interactive topic modeling. Machine Learning, 2014. [11] Lee, T. Y., A. Smith, K. Seppi, et al. The human touch: How non-expert users perceive, interpret, and fix topic models. International Journal of Human-Computer Studies, 2017. [12] Lund, J., C. Cook, K. Seppi, et al. Tandem anchoring: A multiword anchor approach for interactive topic modeling. In Proceedings of the Association for Computational Linguistics. 2017. [13] Arora, S., R. Ge, A. Moitra. Learning topic models–going beyond SVD. In Foundations of Computer Science (FOCS). 2012. [14] Arora, S., R. Ge, Y. Halpern, et al. A practical algorithm for topic modeling with provable guarantees. In Proceedings of the International Conference of Machine Learning. 2013. [15] Mauro, C., G. Christian, F. Marcello. Wit3: Web inventory of transcribed and translated talks. In Proceedings of the European Association for Machine Translation. 2012. [16] Graff, D. UN Parallel Text, 1994. https://catalog.ldc.upenn.edu/LDC94T4A. [17] Boyd-Graber, J., Y. Hu, D. Mimno. Applications of topic models. Foundations and Trends R⃝in Information Retrieval, 2017. [18] Blei, D. M., A. Y. Ng, M. I. Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 2003. 10 [19] Landauer, T. K., P. W. Foltz, D. Laham. An introduction to latent semantic analysis. Discourse processes, 1998. [20] Lee, M., D. Mimno. Low-dimensional embeddings for interpretable anchor-based topic inference. In Proceedings of Empirical Methods in Natural Language Processing. 2014. [21] Nguyen, T., J. Boyd-Graber, J. Lund, et al. Is your anchor going up or down? fast and accurate supervised topic models. In Conference of the North American Chapter of the Association for Computational Linguistics. 2015. [22] Yurochkin, M., A. Guha, X. Nguyen. Conic scan-and-cover algorithms for nonparametric topic modeling. In Proceedings of Advances in Neural Information Processing Systems. 2017. [23] Boyd-Graber, J., D. M. Blei. Multilingual topic models for unaligned text. In Proceedings of Uncertainty in Artificial Intelligence. 2009. [24] Bengio, Y., A. Courville, P. Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013. [25] Xiao, M., Y. Guo. A novel two-step method for cross language representation learning. In Proceedings of Advances in Neural Information Processing Systems. 2013. [26] Rastogi, P., B. Van Durme, R. Arora. Multiview LSA: Representation learning via generalized CCA. In Conference of the North American Chapter of the Association for Computational Linguistics. 2015. [27] Fan, R.-E., K.-W. Chang, C.-J. Hsieh, et al. LIBLINEAR: A library for large linear classification. Journal of Machine Learning Research, 2008. [28] Bird, S., E. Klein, E. Loper. Natural language processing with Python: analyzing text with the natural language toolkit. " O’Reilly Media, Inc.", 2009. [29] Manning, C., M. Surdeanu, J. Bauer, et al. The Stanford CoreNLP natural language processing toolkit. In Proceedings of the Association for Computational Linguistics. 2014. [30] Constant, N., C. Davis, C. Potts, et al. The pragmatics of expressive content: Evidence from large corpora. Sprache und Datenverarbeitung, 2009. [31] Strassel, S., J. Tracey. LORELEI language packs: Data, tools, and resources for technology development in low resource languages. In Language Resources and Evaluation Conference. 2016. [32] Strassel, S., A. Bies, J. Tracey. Situational awareness for low resource languages: the LORELEI situation frame annotation task. In Exploitation of Social Media for Emergency Relief and Preparedness. 2017. [33] Shi, B., W. Lam, L. Bing, et al. Detecting common discussion topics across culture from news reader comments. In Proceedings of the Association for Computational Linguistics. 2016. [34] Lau, J. H., D. Newman, T. Baldwin. Machine reading tea leaves: Automatically evaluating topic coherence and topic model quality. In Proceedings of the European Chapter of the Association for Computational Linguistics. 2014. [35] Hao, S., M. J. Paul, J. Boyd-Graber. Lessons from the bible on modern topics: Multilingual topic model evaluation on low-resource languages. In Conference of the North American Chapter of the Association for Computational Linguistics. 2018. [36] Nguyen, T., Y. Hu, J. Boyd-Graber. Anchors regularized: Adding robustness and extensibility to scalable topic-modeling algorithms. In Proceedings of the Association for Computational Linguistics. 2014. 11
2018
179
7,340
Objective and efficient inference for couplings in neuronal networks Yu Terada1,2, Tomoyuki Obuchi2, Takuya Isomura1, Yoshiyuki Kabashima2 1Laboratory for Neural Computation and Adaptation, RIKEN Center for Brain Science, 2-1 Hirosawa, Wako, Saitama 351-0198, Japan 2Department of Mathematical and Computer Science Tokyo Institute of Technology Tokyo 152-8550, Japan yu.terada@riken.jp, obuchi@c.titech.ac.jp, takuya.isomura@riken.jp, kaba@c.titech.ac.jp Abstract Inferring directional couplings from the spike data of networks is desired in various scientific fields such as neuroscience. Here, we apply a recently proposed objective procedure to the spike data obtained from the Hodgkin–Huxley type models and in vitro neuronal networks cultured in a circular structure. As a result, we succeed in reconstructing synaptic connections accurately from the evoked activity as well as the spontaneous one. To obtain the results, we invent an analytic formula approximately implementing a method of screening relevant couplings. This significantly reduces the computational cost of the screening method employed in the proposed objective procedure, making it possible to treat large-size systems as in this study. 1 Introduction Recent advances in experimental techniques make it possible to simultaneously record the activity of multiple units. In neuroscience, multi-electrodes and optical imaging techniques capture largescale behaviors of neuronal networks, which facilitate a deeper understanding of the information processing mechanism of nervous systems beyond the single neuron level [1-6]. This preferable situation, however, involves technical issues in dealing with such datasets because they usually consist of a large amount of high-dimensional data which are difficult to be handled by naive usages of conventional statistical methods. A statistical-physics-based approach for tackling these issues was presented using the Ising model [7]. Although the justification to use the Ising model for analyzing neuronal systems is not completely clear [8,9,10], its performance was empirically demonstrated [7], which triggered further applications [11-22]. An advantage of using the Ising model is that several analytical techniques for inverse problems are available [23-29], which allows us to infer couplings between neurons with a feasible computational cost. Another advantage is that it is straightforward to introduce variants of the model. Beyond the conventional data analysis, an important variant is the kinetic Ising model, which is more suitable to take into account the correlations in time, since this extended model removes the symmetric-coupling constraint of the Ising model. A useful mean-field (MF) inverse formula for the kinetic Ising model has been presented in [25,26]. Two problems arise when treating neuronal systems’ data in the framework of the Ising models. The first problem is how to determine an appropriate size of time bins when discretizing original signals in time; the appropriate size differs from the intrinsic time-scale of the original neuronal sys32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. tems because the Ising models are regarded as a coarse-grained description of the original systems. Hence, the way of the transformation to the models of this type is nontrivial. The second problem is extracting relevant couplings from the solution of the inverse problem; unavoidable noises in experimental data contaminate the inferred couplings, and hence, we need to screen the relevant ones among them. In a previous study [30], an information-theoretic method and a computational-statistical technique were proposed for resolving the aforementioned first and second problems, respectively. Those methods were validated in two cases: in a numerical simulation based on the Izhikevich models and in analyzing in vitro neuronal networks. The result is surprisingly good: their synaptic connections are reconstructed with fairly high accuracy. This finding motivates us to further examine the methods proposed in [30]. Based on this motivation, this study applies these methods to the data from the Hodgkin–Huxley model, which describes the firing dynamics of a biological neuron more accurately than the Izhikevich model. Further, we examine the situation where responses of neuronal networks are evoked by external stimuli. We implement this situation both in the Hodgkin–Huxley model and in a cultured neuronal network of a previously described design [31], and test the methods in both the cases. Besides, based on the previously described MF formula of [25,26], we derive an efficient formula implementing the previous method of screening relevant couplings within a significantly smaller computational cost. In practice, the naive implementation of the screening method is computationally expensive, and can be a bottleneck when applied to large-scale networks. Hence, we exploit the simplicity of the model, and use the advanced statistical processing with reasonable time in this work. Below, we address those three points by employing the simple kinetic Ising model, to efficiently infer synaptic couplings in neuronal networks. 2 Inference procedure The kinetic Ising model consists of N units, {si}N i=1, and each unit takes bipolar values as si(t) = ±1. Its dynamics is governed by the so-called Glauber dynamics: P (s(t + 1)|s(t); {Jij, θi(t)}) = N ∏ i=1 exp [si(t + 1)Hi(t; {Jij, θi(t)})] exp [Hi(t; {Jij, θi(t)})] + exp [−Hi(t; {Jij, θi(t)})], (1) where Hi(t) is the effective field, defined as Hi(t) = θi(t) + ∑N j=1 Jijsj(t), θi(t) is the external force, and Jij is the coupling strength from j to i. This model also corresponds to a generalized McCulloch–Pitts model in theoretical neuroscience and logistic regression in statistics. When applying this to spike train data, we regard the state si(t) = 1 (-1) as the firing (non-firing) state. The inference framework we adopt here is the standard maximum-likelihood (ML) framework. We repeat R experiments and denote a firing pattern {s∗ ir(t)}N i=1 for t = 1, 2, · · · , M in an experiment r(= 1, 2, · · · , R). The ML framework requires us to solve the following maximization problem on the variable set {Jij, θi(t)}: { ˆJij, ˆθi(t)} = arg max {Jij,θi(t)} { 1 R R ∑ r=1 M ∑ t=1 log P (s∗ r(t + 1)| s∗ r(t); {Jij, θi(t)}) } . (2) This cost function is concave with respect to {Jij, θi(t)}, and hence, a number of efficient solvers are available [32]. However, we do not directly maximize eq. (2) in this study but instead we employ the MF formula proposed previously [25,26]. The MF formula is reasonable in terms of the computational cost and sufficiently accurate when the dataset size R is large. Moreover, the availability of an analytic formula enables us to construct an effective approximation to reduce the computational cost in the post-processing step, as shown in Sec. 2.3. Unfortunately, in many experimental settings, it is not easy to conduct a sufficient number of independent experiments [33,34], as in the case of Sec. 4. Hence, below we assume the stationarity of any statistics, and ignore the time dependence of θ(t). This allows us to identify the average over time as the ensemble average, which significantly improves statistics. We admit this assumption is not always valid, particularly in the case where time-dependent external forces are present, although we treat such cases in Sec. 3.2 and Sec. 4.2. Despite this limitation, we still stress that the present approach can extract synaptic connections among neurons accurately, although the existence of the 2 time-dependent inputs may decrease its performance. Possible directions to overcome this limitation are discussed in Sec. 5. 2.1 Pre-processing: Discretization of time and binarization of state In the pre-processing step, we have to decide the duration of the interval that should be used to transform the real time to the unit time ∆τ in the Ising scheme. We term ∆τ the bin size. Once the bin size is determined, the whole real time interval [0, T ] is divided into the set of time bins that are labelled as {t}M=T /∆τ t=1 . Given this set of the time bins, we binarize the neuron states: if there is no spike train of the neuron i in the time bin with a label t, then s∗ i (t) = −1; otherwise s∗ i (t) = 1. This is the whole pre-processing step we adopt, and is a commonly used approach [7]. Determination of the bin size ∆τ can be a crucial issue: different values of ∆τ may lead to different results. To determine it in an objective way, we employ an information-theory-based method proposed previously [30]. Following this method, we determine the bin size as ∆τopt = arg max ∆τ    ( T ∆τ −1 ) ∑ i̸=j ˆI∆τ (si(t + 1); sj(t))   , (3) where I∆τ (si(t + 1); sj(t)) denotes the mutual information between si(t + 1) and sj(t) in the coarse-grained series with ∆τ, and ˆI∆τ (si(t + 1); sj(t)) is its plug-in estimator. The explicit formula is ˆI∆τ (si(t + 1); sj(t)) = ∑ (α,β)∈{+,−}2 rαβ(i, t + 1; j, t) log rαβ(i, t + 1; j, t) rα(i, t + 1)rβ(j, t), (4) where r++(i, t + 1; j, t) denotes the realized ratio of the pattern (si(t + 1), sj(t)) = (+1, +1), r++(i, t + 1; j, t) ≡(1/(M −1))#{(si(t + 1), sj(t)) = (+1, +1)}, and the other double-subscript quantities {r+−, r−+, r−−} are defined similarly. Single-subscript quantities are also the realized ratios of the corresponding state, for example, r+(j, t) ≡(1/M)#{sj(t) = +1}. The meaning of eq. (3) is clear: the formula inside the brace brackets of the right-hand side, hereafter termed gross mutual information, is merely the likelihood of a (null) hypothesis that si(t + 1) and sj(t) are firing without any correlation. The optimal value ∆τopt is chosen to reject this hypothesis most strongly. This can also be regarded as a generalization of the chi-square test. 2.2 Inference algorithm: The MF formula The previously derived MF formula [25,26] is given by ˆJMF = A−1DC−1, (5) where      µi(t) = ⟨si(t)⟩, Aij(t) = ( 1 −µ2 i (t) ) δij, Cij(t) = ⟨si(t)sj(t)⟩−µi(t)µj(t), Dij(t) = ⟨si(t + 1)sj(t)⟩−µi(t + 1)µj(t). (6) Note that the estimate ˆJMF seemingly depends on time, but it is known that the time dependence is very weak and ignorable. Once given ˆJMF, the MF estimate of the external field is given as ˆθMF i (t) = tanh−1 (µi(t + 1)) − ∑ j ˆJMF ij µj(t), (7) although we focus on the couplings between neurons and do not estimate the external force in this study. The literal meaning of the brackets is the ensemble average corresponding to (1/R) ∑R r=1 in eq. (2), but here we identify it as the average over time. Here, we use the time-averaged statistics of {µ, C, D, θ}, as declared above. 3 2.3 Post-processing: Screening relevant couplings and its fast approximation The basic idea of our screening method is to compare the coupling estimated from the original data with the one estimated from randomized data in which the time series of firing patterns of each neuron is randomly independently permuted. We do not explain the detailed procedures here because similar methods have been described previously [7,30]. Instead, here we state the essential point of the method and derive an approximate formula implementing the screening method in a computationally efficient manner. The key of the method is to compute the probability distribution of ˆJij, P( ˆJij), when applying our inference algorithm to the randomized data. Once we obtain the probability distribution, we can judge how unlikely our original estimate is as compared to the estimates from the randomized data. If the original estimate is sufficiently unlikely, we accept it as a relevant coupling; otherwise, we reject it. Evaluation of the above probability distribution is not easy in general, and hence, it is common to have recourse to numerical sampling, which can be a computational burden. Here, we avoid this problem by computing it in an analytical manner under a reasonable approximation. For the randomized data, we may assume that two neurons si and sj fire independently with fixed means µi and µj, respectively. Under this assumption, by the central limit theorem, each diagonal component of C converges to Cii = 1 −µ2 i = Aii, while its non-diagonal component becomes a zero-mean Gaussian variable whose variance is proportional to 1/(M −1), and is thus, small. All the components of D behave similarly to the non-diagonal ones of C. This consideration leads to the expression ˆJran ij = ∑ k (A−1)iiDik(C−1)kj ≈(A−1)iiDij(A−1)jj = 1 (1 −µ2 i )(1 −µ2 j)Dij. (8) By the independence between si and sj, the variance of Dij becomes (1 −µ2 i )(1 −µ2 j)/(M −1). Hence the probability P ( | ˆJran ij | ≥Φth ) is obtained as P ( | ˆJran ij | ≥Φth ) ≈1 −erf  Φth √ (1 −µ2 i )(1 −µ2 j)(M −1) 2  , (9) where erf(x) is the error function defined as erf(x) ≡ 2 √π ∫x 0 dy e−y2. (10) Inserting the absolute value of the original estimate of ˆJij in Φth, we obtain its likelihood, and can judge whether it should be accepted. Below, we set the significance level pth associated with (Φth)ij as (Φth)ij = √ 2 (1 −µ2 i )(1 −µ2 j)(M −1) erf−1 (1 −pth) (11) and accept only ˆJij such that | ˆJij| > (Φth)ij. 3 Hodgkin–Huxley networks We first evaluate the accuracy of our methods using synthetic systems consisting of the Hodgkin– Huxley neurons. The dynamics of the neurons are given by C dVi dτ = −¯gKn4 i (Vi −EK) −¯gNam3 i hi (Vi −ENa) −¯gL (Vi −EL) + Iex i , (12) dni dτ = αn (Vi) (1 −ni) −βn (Vi) ni, (13) dmi dτ = αm (Vi) (1 −mi) −βm (Vi) mi, (14) dhi dτ = αh (Vi) (1 −hi) −βh (Vi) hi, (15) 4 where Vi is the membrane potential of ith neuron, ni is the activation variable that represents the ratio of the open channels for K+ ion, and mi and hi are the activation and inactivation variables for Na+ ion, respectively. All parameters, except the external input term Iex i , are set as described in [35]. The input forces are given by Iex i = ci(τ) + N ∑ j=1 KijVjΘ (Vj −Vth) + a ∑ k δ ( τ −τ k i ) , (16) where ci(t) represents the environmental noise with a Poisson process, the second term represents the couplings with the threshold voltage Vth = 30 mV and the Heaviside step function Θ(·), and the last term denotes the impulse stimulations with the delta function. Here, we consider no-delay simple couplings, which we term the synaptic connections, and aim to reconstruct their structure with the excitatory/inhibitory signs using our methods. We use N = 100 neuron networks, where the 90 neurons are excitatory and have positive outgoing couplings while the others are inhibitory. The rate and strength of the Poisson process are set as λ = 180 Hz and b = 2 mV, respectively, for all neurons. We generate their time series, integrating (12)-(15) by the Euler method with dτ = 0.01 ms, where we suppose a neuron is firing when its voltage exceeds Vth, and use the spike train data with the whole period T = 106 ms for our inference. 3.1 Spontaneous activity case At first, we consider a system on a chain network in which each neuron has three synaptic connections to adjoint neurons in one direction. The connection strength Kij is drawn from the uniform distributions in [0.015, 0.03] for the excitatory and in [−0.06, −0.03] for the inhibitory neurons, respectively. Here, we set a = 0 mV to study the spontaneous activity. An example of the spike trains generated during 3 seconds is shown in Fig. 1 (a), where the spike times and corresponding neuronal indices are plotted. Subsequently, using the whole spike train data, we calculate the gross mutual information for different ∆τ, and the result is indicated by the red curve in Fig. 1 (b). The curve has the unimodal feature, which implies the existence of the optimal time bin size of approximately ∆τ = 3 ms, although the original system does not have the delay. We suppose that inputs must accumulate sufficiently to generate a spike, which costs some time scale, and this is a possible reason for the emergence of the nontrivial time-scale. To validate our approximation (8), we randomize the coarse-grained series with ∆τ = 3 ms in the time direction independently, rescale ˆJran ij by multiplying √ (1 −µ2 i )(1 −µ2 j)(M −1), and compare the results of 1000 randomized data with the standard Gauss distribution in Fig. 1 (c), which shows their good correspondence. Using ∆τ = 3 ms to make the spike trains coarse-grained, we apply the inverse formula to the series and screen relevant couplings with pth = 10−3, which leads to the estimated coupling matrix shown in Fig. 1 (e), while the one used to generate the data is shown in Fig. 1 (d). The asymmetric network structure is recovered sufficiently with the discrimination of the signs of the couplings. The conditional ratios of the correctness are shown in Fig. 1 (f), where the inference results obtained with different values of ∆τ are also shown. This demonstrates the fairly accurate reconstruction result obtained using our inference procedure. We also show the receiver operating characteristic (ROC) curves obtained by gradually changing the value pth in Fig. 1 (g), with the different values of ∆τ. We conclude that using non-optimal time bins drastically decreases the accuracy of the inference results. To illustrate the robustness of the optimality of the time bin, in Fig. 1 (i) we plot the means and standard deviations of the gross mutual information through the 10 different simulations, showing that the variance is small enough and the result is well robust. To consider a more general situation, we also employ a Hodgkin–Huxley system on a random network. The directional synaptic connection between every pair of neurons is generated with the probability 0.1, and the excitatory and inhibitory couplings are drawn from the uniform distributions within [0.01, 0.02] and [−0.04, −0.02], respectively. The corresponding inference results for its spontaneous activity are shown by green curves in Figs. 1 (b) and (f). The ROC curves for the three different three values of ∆τ are also shown in (h). We confirm that the inference is sufficiently effective in the random-network system as well as in the chain system. 5 (a) (b) (c) (d) (e) (f) 0 1000 2000 3000 10 20 30 40 50 60 70 80 90 100 [ms] 101 100 102 103 0 [ms] 2 4 6 8 10 14 12 20 40 60 80 100 20 40 60 80 100 20 40 60 80 100 20 40 60 80 100 1 0.5 0 Existence Absence Excitatory Inhibitory Δτ = 3 ms (chain) Δτ = 1 ms (chain) Δτ = 10 ms (chain) Δτ = 3 ms (random network) chain random network 4 2 0 -2 -4 0 0.2 0.4 0.1 0.3 Standard Gauss distribution Rescaled (g) Δτ = 3 ms Δτ = 1 ms Δτ = 10 ms 0 0 1 1 0.5 0.5 (h) 0 0 1 1 0.5 0.5 Δτ = 3 ms Δτ = 1 ms Δτ = 10 ms time neuron Δτ j i j i False Positive Ratio True Positive Ratio False Positive Ratio True Positive Ratio (i) 101 100 102 103 [ms] Δτ 0 2 4 6 8 10 14 12 Figure 1: Application of the proposed approach to the Hodgkin–Huxley models. (a) Spontaneous spike trains during 3 seconds. (b) Gross mutual information v.s. time bin size ∆τ. The red curve shows the chain network while the green curve shows the random network. (c) Histogram of rescaled ˆJran ij obtained by randomizing the original series, and the standard Gauss distribution. (d) An example of the chain networks that we used, where the red and blue elements indicate the excitatory and inhibitory couplings, respectively. (e) Corresponding inferred coupling network with ∆τ = 3 ms. (f) Conditional correctness ratios for the existence, absence, excitatory coupling, and inhibitory coupling, where the standard deviations of 10 different simulations are shown with the error bars. (g,h) Receiver operating characteristic curves for different coarse-grained series in the systems (g) on the chain and (h) on the random network, where the error bars indicate the standard deviations of 10 different simulations. The marked points indicate pth = 10−3 used in (e) and (f). (i) The mean and standard deviation of the gross mutual information for 10 independent simulations of the chain systems. The result is shown to be robust. 3.2 Evoked activity case We next investigate performance in systems where responses are evoked by impulse stimuli. The model parameters, except for a, are the same as those in the chain model in Sec. 3.1. The strength of the external force is set as a = 5.3 mV, and the stimulations are injected to all neurons with interval 1 s. In Fig. 2 (a) we show the spike trains, where we observe that most of the neurons fire at the injection times τ = 0.5, 1.5, 2.5 s. The gross mutual information against ∆τ is shown in Fig. 2 (b). Although the curve feature is modified due to the existence of the impulse inputs, we observe that its peak is located at a similar value of ∆τ. Therefore, we use the same value ∆τ = 3 ms. Applying our inference procedure with ∆τ = 3 ms and pth = 10−3, we obtain the inferred couplings which are shown in Fig. 2 (c), where the original network is in Fig. 1 (d). On comparing Fig. 2 (c) with Fig. 1 (e), while the inference detects the existence of the synaptic connections, we observe more false couplings in the evoked case. The conditional ratios in Fig. 2 (d) indicate that the existence of the external inputs may increase the false positive rate with the same pth. The ROC curves are shown in Fig. 2 (f). 6 (a) (b) (c) (d) (e) 0 1000 2000 3000 10 20 30 40 50 60 70 80 90 100 [ms] 101 100 102 103 0 [ms] 5 10 20 15 20 40 60 80 100 20 40 60 80 100 1 0.5 0 Existence Absence Excitatory Inhibitory 25 Δτ = 3 ms Δτ = 1 ms Δτ = 10 ms 0 0 1 1 0.5 0.5 False Positive Ratio True Positive Ratio time neuron Δτ j i Δτ = 3 ms Δτ = 1 ms Δτ = 10 ms 101 100 102 103 0 [ms] 5 10 20 15 25 Δτ (f) Figure 2: Application of the proposed approach to the evoked activity in the Hodgkin–Huxley models. (a) Evoked spike trains during 3 seconds, where the red line expresses the injection times of the stimuli. (b) Gross mutual information v.s. time bin size. (c) Inferred coupling matrix with the red excitatory and blue inhibitory elements using ∆τ = 3 ms, where the generative network is the one shown in Fig. 1 (b). (d) Conditional correctness ratios. (e) Receiver operating characteristic curves for different coarse-grained series, where the points denoting pth = 10−3 are marked. (f) The mean and standard deviation of the gross mutual information for 10 independent simulations. The result is shown to be robust. 4 Cultured neuronal networks We apply our inference methods to the real neuronal systems introduced in a previous study [31], where rat cortical neurons were cultured in micro wells. The wells had a circular structure, and consequently the synapses of the neurons were likely to form a physically asymmetric chain network, which is similar to the situation in the Hodgkin–Huxley models we used in Sec. 3. The activity of the neurons was recorded by the multi-electrode array with 40 µs time resolution, and the Efficient Technology of Spike sorting method [36] was used to identify the spike events of individual neurons. We study the spontaneous and evoked activities here. 4.1 Spontaneous activity case We first use the spontaneous activity data recorded during 120 s. The spike sorting identified 100 neurons which generated the spikes. The spike raster plot during 3 seconds is displayed in Fig. 3 (a). We calculate the gross mutual information as in case of the Hodgkin–Huxley models, and the obtained optimal bin size is approximately ∆τ = 5 ms. We also confirm that the inferred couplings are similar to the results described previously [30], and this supports the validity of our novel approximation method introduced in Sec. 2.3. We show the inferred network in Figs. 3 (bd) with different values pth = 10−3, 10−6, 10−9, where we locate the nodes denoting the neurons on a circle following the experimental design [31]. A more strict threshold provides us with clear demonstration of the relevant couplings here. 4.2 Evoked activity case We next study an evoked neuronal system, where an electrical pulse stimulation is injected from an electrode after every 3 seconds, and the other experimental settings are similar to those of the spontaneous case. In this case the activity of 149 neurons were identified by the spike sorting. The example of the spike trains is shown in Fig. 4 (a). The gross mutual information is shown in Fig. 4 (b), where we can see the peak around ∆τ = 10 ms. Setting ∆τ = 10 ms and pth = 10−3, 10−6, we obtain the estimated coupling matrices in Figs. 4 (c,d). In these cases, we can also observe the bold diagonal elements representing the asymmetric chain structure, although with the lower 7 (b) (c) (d) (d) (a) 20 40 60 80 100 1000 2000 3000 [ms] time neuron 1st half 2nd half 101 100 102 10-1 [ms] Δτ 0 1 2 3 4 Figure 3: Application of the proposed approach to a cultured-neuronal system. (a) Spike trains during 3 seconds. (b-d) Inferred networks, where the nodes are located on the circle corresponding to the experimental design. The different significant levels used are: (b) 10−3, (c) 10−6, and (d) 10−9. The red and blue directional arrows represent the excitatory and inhibitory couplings, respectively. (e) The gross mutual information for the 1st and 2nd halves of the data. The figure shows the robustness of the result. significant level some far-diagonal elements emerge due to the existence of the external inputs, which is a situation similar to that in the Hodgkin–Huxley simulation in Sec. 3.2. The inferred network with the strict threshold pth = 10−9 is displayed in Fig. 4 (e), where some long-range couplings are still estimated while physical connections corresponding to them do not exist because of the experimental design. 5 Conclusion and discussion We propose a systematic inference procedure for extracting couplings from point-process data. The contribution of this study is three-fold: (i) invention of an analytic formula to screen relevant couplings in a computationally efficient manner; (ii) examination in the Hodgkin–Huxley model, with and without impulse stimuli; (iii) examination in an evoked cultured neuronal network. The applications to the synthetic data, with and without the impulse stimuli, demonstrate the fairly accurate reconstructions of synaptic connections by our inference methods. The application to the real data of the spontaneous activity in the cultured neuronal system also highlights the effectiveness of the proposed methods in detecting the synaptic connections. From the comparison between the analyses of the spontaneous and evoked activities, we found that the inference accuracy becomes degraded by the external stimuli. One of the potential origins is the breaking of our stationary assumption of the statistics {µ, C, D} because of the time-varying external force θ. To overcome this, certain techniques resolving the insufficiency of samples, such as regularization, will be helpful. A promising approach might be the introduction of an ℓ1 regularization into eq. (2), which enables us to automatically screen out irrelevant couplings. Comparing it with the present approach based on computational statistics will be an interesting future work. Acknowledgments This work was supported by MEXT KAKENHI Grant Numbers 17H00764 (YT, TO, and YK) and 18K11463 (TO), and RIKEN Center for Brain Science (YT and TI). 8 (a) (b) (d) (e) 20 40 60 80 100 20 40 60 80 100 10-1 100 101 102 0 70 10 20 60 50 40 30 [ms] 120 140 120 140 20 40 60 80 100 1000 2000 3000 [ms] 120 140 time neuron Δτ j i (c) 20 40 60 80 100 20 40 60 80 100 120 140 120 140 j i 1st half 2nd half (f) 101 100 102 10-1 [ms] Δτ 0 10 20 30 40 Figure 4: Application of the proposed approach to an evoked cultured-neuronal system. (a) Spike trains during 3 seconds, where the red line indicates the injection time. (b) Gross mutual information v.s. time bin size. (c,d) Inferred coupling matrices for (c) pth = 10−3 and (d) pth = 10−6. (e) Inferred network with pth = 10−9. (f) The gross mutual information for the 1st and 2nd halves of the data. The figure shows the robustness of the result. References [1] Brown, E.N., Kass, R.E. & Mitra, P.P. (2004) Multiple neural spike train data analysis: state-of-the-art and future challenges. Nature Neuroscience 7 456-461. [2] Buzsáki, G. (2004) Large-scale recording of neuronal ensembles. Nature Neuroscience 7 446-451. [3] Yuste, R. (2015) From the neuron doctrine to neuronal networks. Nature Reviews Neuroscience 16 487-497. [4] Roudi, Y., Dunn, B. & Hertz, J. (2015) Multi-neuronal activity and functional connectivity. Current Opinion in Neurobiology 32 38-44. [5] Gao, P. & Ganguli, S. (2015) On simplicity and complexity in the brave new world of large-scale neuroscience. Current Opinion in Neurobiology 32 148-155. [6] Maass, W. (2016) Searching for principles of brain computation. Current Opinion in Behavioral Sciences 11 81-92. [7] Schneidman, E., Berry, M.J., Segev, R. & Bialek, W. (2006) Weak pairwise correlations imply strongly correlated network states in a neural population. Nature 440 1007-1012. [8] Obuchi, T., Cocco, S. & Monasson, S. (2015) Learning probabilities from random observables in high dimensions: the maximum entropy distribution and others. Journal of Statistical Physics 161 598-632. [9] Obuchi, T. & Monasson, R. (2015) Learning probability distributions from smooth observables and the maximum entropy principle: some remarks. Journal of Physics: Conference Series 638 012018. [10] Ferrari, U., Obuchi, T. & Mora, T., (2017) Random versus maximum entropy models of neural population activity. Physical Review E 95 042321. [11] Sessak, V. & Monasson, R. (2009) Small-correlation expansions for the inverse Ising problem. Journal of Physics A: Mathematical and Theoretical 42 055001. [12] Roudi, Y., Tyrcha, J. & Hertz, J. (2009) Ising model for neural data: Model quality and approximate methods for extracting functional connectivity. Physical Review E 79 051915. [13] Shlens, J., Field, G.D., Gauthier, J.L., Grivich, M.I., Petrusca, D., Sher, A., Litke, A.M. & Chichilnisky, E. (2006) The Structure of Multi-Neuron Firing Patterns in Primate Retina. The Journal of Neuroscience 26 8254-8266. 9 [14] Tang, A., Jackson, D., Hobbs, J., Chen, W., Smith, J.L., Patel, H., Prieto, A., Petrusca, D., Grivich, M.I., Sher, A., Hottowy, P., Dabrowski, W., Litke, A.M. & Beggs J.M. (2008) A Maximum Entropy Model Applied to Spatial and Temporal Correlations from Cortical Networks In Vitro. The Journal of Neuroscience 28 505-518. [15] Cocco, S., Leibler, S. & Monasson, R. (2009) Neuronal couplings between retinal ganglion cells inferred by efficient inverse statistical physics methods. Proceedings of the National Academy of Sciences 106 1405814062. [16] Marre, O., Boustani, S.E., Frégnac, Y., & Destexhe, A. (2009) Prediction of Spatiotemporal Patterns of Neural Activity from Pairwise Correlations. Physical Review Letters 102 138101. [17] Ohiorhenuan, I.E., Mechler, F., Purpura, K.P., Schmid, A.E., Hu, Q. & Victor, J.D. (2010) Sparse coding and high-order correlations in fine-scale cortical networks. Nature 466 617-621. [18] Ganmor, E., Segev, R. & Schneidman, E. (2011) Sparse low-order interaction network underlies a highly correlated and learnable neural population code. Proceedings of the National Academy of Sciences 108 96799684. [19] Tyrcha, J., Roudi, Y., Marsili, M. & Hertz, J. (2013) The effect of nonstationarity on models inferred from neural data. Journal of Statistical Mechanics: Theory and Experiment P03005. [20] Dunn, B., Mørreaunet, M. & Roudi, Y. (2015) Correlations and Functional Connections in a Population of Grid Cells. PLoS Computational Biology 11 e1004052. [21] Capone, C., Filosa, G., Gigante, G., Ricci-Tersenghi, F. & Del Giudice, P. (2015) Inferring Synaptic Structure in Presence of Neural Interaction Time Scales. PLoS ONE 10 e0118412. [22] Posani, L., Cocco, S. & Monasson, R. (2018) Integration and multiplexing of positional and contextual information by the hippocampal network. bioRxiv 269340. [23] Kappen, H.J. & Rodríguez, F.d.B. (1998) Efficient Learning in Boltzmann Machines Using Linear Response Theory. Neural Computation 10 1137-1156. [24] Tanaka, T. (1998) Mean-field theory of Boltzmann machine learning. Physical Review E 58 2302. [25] Roudi, Y. & Hertz, J. (2011) Mean Field Theory for Nonequilibrium Network Reconstruction. Physical Review Letters 106 048702. [26] Mézard, M. & Sakellariou, J. (2011) Exact mean-field inference in asymmetric kinetic Ising systems. Journal of Statistical Mechanics: Theory and Experiment L07001. [27] Zeng, H.L., Aurell, E., Alava, M. & Mahmoudi, H. (2011) Network inference using asynchronously updated kinetic Ising model. Physical Review E 83 041135. [28] Aurell, E. & Ekeberg, M. (2012) Inverse Ising Inference Using All the Data. Physical Review Letters 108 090201. [29] Zeng, H.L., Alava, M., Aurell, E., Hertz, J. & Roudi, Y. (2013) Mazimum Likelihood Reconstruction for Ising Models with Asynchronous Updates. Physical Review Letters 110 210601. [30] Terada, Y., Obuchi, T., Isomura, T. & Kabashima, Y. (2018) Objective Procedure for Reconstructing Couplings in Complex Systems. arXiv 1803.04738. [31] Isomura, T., Shimba, K., Takayama, Y., Takeuchi, A., Kotani, K. & Jimbo, Y. (2015) Signal transfer within a cultured asymmetric cortical neuron circuit. Journal of Neural Engineering 12 066023. [32] Hastie, T., Tibshirani, R. & Friedman, J. (2016) The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2nd ed. New York, Springer. [33] Churchland, M.M., Yu, B.M., Sahani, M. & Shenoy, K.V. (2007) Techniques for extracting single-trial activity patterns from large-scale neural recordings. Current Opinion in Neurobiology 17 609-618. [34] Cunningham, J.P. & Yu, B.M. (2014) Dimensionality reduction for large-scale neural recordings. Nature Neuroscience 17 1500-1509. [35] Izhikevich, E.M. (2007) Dynamical systems in neuroscience. Cambridge, MIT Press. [36] Takekawa, T., Isomura, Y. & Fukai, T. (2010) Accurate spike sorting for multi-unit recordings. European Journal of Neuroscience 31 263-272. 10
2018
18
7,341
Generalized Inverse Optimization through Online Learning Chaosheng Dong Department of Industrial Engineering University of Pittsburgh chaosheng@pitt.edu Yiran Chen Department of Electrical and Computer Engineering Duke University yiran.chen@duke.edu Bo Zeng Department of Industrial Engineering University of Pittsburgh bzeng@pitt.edu Abstract Inverse optimization is a powerful paradigm for learning preferences and restrictions that explain the behavior of a decision maker, based on a set of external signal and the corresponding decision pairs. However, most inverse optimization algorithms are designed specifically in batch setting, where all the data is available in advance. As a consequence, there has been rare use of these methods in an online setting suitable for real-time applications. In this paper, we propose a general framework for inverse optimization through online learning. Specifically, we develop an online learning algorithm that uses an implicit update rule which can handle noisy data. Moreover, under additional regularity assumptions in terms of the data and the model, we prove that our algorithm converges at a rate of O(1/ √ T) and is statistically consistent. In our experiments, we show the online learning approach can learn the parameters with great accuracy and is very robust to noises, and achieves a dramatic improvement in computational efficacy over the batch learning approach. 1 Introduction Possessing the ability to elicit customers’ preferences and restrictions (PR) is crucial to the success for an organization in designing and providing services or products. Nevertheless, as in most scenarios, one can only observe their decisions or behaviors corresponding to external signals, while cannot directly access their decision making schemes. Indeed, decision makers probably do not have exact information regarding their own decision making process [1]. To bridge that discrepancy, inverse optimization has been proposed and received significant research attention, which is to infer or learn the missing information of the underlying decision models from observed data, assuming that human decision makers are rationally making decisions [2, 3, 4, 5, 1, 6, 7, 8, 9, 10, 11]. Nowadays, extending from its initial form that only considers a single observation [2, 3, 4, 5] with clean data, inverse optimization has been further developed and applied to handle more realistic cases that have many observations with noisy data [1, 6, 7, 9, 10, 11]. Despite of these remarkable achievements, traditional inverse optimization (typically in batch setting) has not proven fully applicable for supporting recent attempts in AI to automate the elicitation of human decision maker’s PR in real time. Consider, for example, recommender systems (RSs) used by online retailers to increase product sales. The RSs first elicit one customer’s PR from the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Figure 1: An overview of inverse optimization through batch learning versus through online learning. Left: Framework of inverse optimization in batch setting. Right: Framework of the generalized inverse optimization in online setting proposed in our paper. historical sequence of her purchasing behaviors, and then make predictions about her future shopping actions. Indeed, building RSs for online retailers is challenging because of the sparsity issue. Given the large amount of products available, customer’s shopping vector, each element of which represents the quantity of one product purchased, is highly sparse. Moreover, the shift of the customer’s shopping behavior along with the external signal (e.g. price, season) aggravates the sparsity issue. Therefore, it is particularly important for RSs to have access to large data sets to perform accurate elicitation [12]. Considering the complexity of the inverse optimization problem (IOP), it will be extremely difficult and time consuming to extract user’s PR from large, noisy data sets using conventional techniques. Thus, incorporating traditional inverse optimization into RSs is impractical for real time elicitation of user’s PR. To automate the elicitation of human decision maker’s PR, we aim to unlock the potential of inverse optimization through online learning in this paper. Specifically, we formulate such learning problem as an IOP considering noisy data, and develop an online learning algorithm to derive unknown parameters occurring in either the objective function or constraints. At the heart of our algorithm is taking inverse optimization with a single observation as a subroutine to define an implicit update rule. Through such an implicit rule, our algorithm can rapidly incorporate sequentially arrived observations into this model, without keeping them in memory. Indeed, we provide a general mechanism for the incremental elicitation, revision and reuse of the inference about decision maker’s PR. Related work Our work is most related to the subject of inverse optimization with multiple observations. The goal is to find an objective function or constraints that explains the observations well. This subject actually carries the data-driven concept and becomes more applicable as large amounts of data are generated and become readily available, especially those from digital devices and online transactions. Solution methods in batch setting for such type of IOP include convex optimization approach [1, 13, 10] and non-convex optimization approach [7]. The former approach often yields incorrect inferences of the parameters [7] while the later approach is known to lead to intractable programs to solve [10]. In contrast, we do inverse optimization in online setting, and the proposed online learning algorithm significantly accelerate the learning process with performance guarantees, allowing us to deal with more realistic and complex PR elicitation problems. Also related to our work is [6], which develops an online learning method to infer the utility function from sequentially arrived observations. They prove a different regret bound for that method under certain conditions, and demonstrate its applicability to handle both continuous and discrete decisions. However, their approach is only possible when the utility function is linear and the data is assumed to be noiseless. Differently, our approach does not make any such assumption and only requires the convexity of the underlying decision making problem. Besides the regret bound, we also show the statistical consistency of our algorithm by applying both the consistency result proven in [7] and the regret bound provided in this paper, which guarantees that our algorithm will asymptotically achieves the best prediction error permitted by the inverse model we consider. Our contributions To the best of authors’ knowledge, we propose the first general framework for eliciting decision maker’s PR using inverse optimization through online learning. This framework can learn general convex utility functions and constraints with observed (signal, noisy decision) pairs. In Figure 1, we provide the comparison of inverse optimization through batch learning versus through online learning. Moreover, we prove that the online learning algorithm, which adopts 2 an implicit update rule, has a O( √ T) regret under certain regularity conditions. In addition, this algorithm is statistically consistent when the data satisfies some rather common conditions, which guarantees that our algorithm will asymptotically achieves the best prediction error permitted by the inverse model we consider. Numerical results show that our algorithm can learn the parameters with great accuracy, is robust to noises even if some assumptions do not hold, and achieves a dramatic improvement over the batch learning approach on computational efficacy. 2 Problem setting 2.1 Decision making problem We consider a family of parameterized decision making problems, in which x ∈Rn is the decision variable, u ∈U ⊆Rm is the external signal, and θ ∈Θ ⊆Rp is the parameter. min x∈Rn f(x, u, θ) s.t. g(x, u, θ) ≤0, DMP where f : Rn × Rm × Rp 7→R is a real-valued function, and g : Rn × Rm × Rp 7→Rq is a vector-valued function. We denote X(u, θ) = {x ∈Rn : g(x, u, θ) ≤0} the feasible region of DMP. We let S(u, θ) = arg min{f(x, u, θ) : x ∈X(u, θ)} be the optimal solution set of DMP. 2.2 Inverse optimization and online setting Consider a learner who monitors the signal u ∈U and the decision maker’ decision x ∈X(u, θ) in response to u. We assume that the learner does not know the decision maker’s utility function or constraints in DMP. Since the observed decision might carry measurement error or is generated with a bounded rationality of the decision maker, i.e., being suboptimal, we denote y the observed noisy decision for u ∈U. Note that y does not necessarily belong to X(u, θ), i.e., it might be infeasible with respect to X(u, θ). Throughout the paper, we assume that the (signal,noisy decision) pair (u, y) is distributed according to some unknown distribution P supported on {(u, y) : u ∈U, y ∈Y}. In our inverse optimization model, the learner aims to learn the decision maker’s objective function or constraints from (signal, noisy decision) pairs. More precisely, the goal of the learner is to estimate the parameter θ of the DMP. In our online setting, the (signal, noisy decision) pair become available to the learner one by one. Hence, the learning algorithm produces a sequence of hypotheses (θ1, . . . , θT +1). Here, T is the total number of rounds, and θ1 is an arbitrary initial hypothesis and θt for t ≥2 is the hypothesis chosen after observing the (t −1)th (signal,noisy decision) pair. Let l(yt, ut, θt) denote the loss the learning algorithm suffers when it tries to predict the tth decision given ut based on {(u1, y1), · · · , (ut−1, yt−1)}. The goal of the learner is to minimize the regret, which is the cumulative loss P t∈[T ] l(yt, ut, θt) against the possible loss when the whole batch of (signal,noisy decision) pairs are available. Formally, the regret is defined as RT = X t∈[T ] l(yt, ut, θt) −min θ∈Θ X t∈[T ] l(yt, ut, θ). In the following, we make a few assumptions to simplify our understanding, which are actually mild and frequently appear in the inverse optimization literature [1, 13, 10, 7]. Assumption 2.1. Set Θ is a convex compact set. There exists D > 0 such that ∥θ∥2 ≤D for all θ ∈Θ. In addition, for each u ∈U, θ ∈Θ, both f(x, u, θ) and g(x, u, θ) are convex in x. 3 Learning the parameters 3.1 The loss function Different loss functions that capture the mismatch between predictions and observations have been used in the inverse optimization literature. In particular, the (squared) distance between the observed decision and the predicted decision enjoys a direct physical meaning, and thus is most widely used [14, 15, 16, 7]. Hence, we take the (squared) distance as our loss function in this paper.In batch 3 setting, statistical properties of inverse optimization with such a loss function have been analyzed extensively in [7]. In this paper, we focus on exploring the performance of the online setting. Given a (signal,noisy decision) pair (u, y) and a hypothesis θ, we define the following loss function as the minimum (squared) distance between y and the optimal solution set S(u, θ). l(y, u, θ) = min x∈S(u,θ)∥y −x∥2 2. Loss Function 3.2 Online implicit updates Once receiving the tth (signal,noisy decision) pair (ut, yt), θt+1 can be obtained by solving the following optimization problem: θt+1 = arg min θ∈Θ 1 2∥θ −θt∥2 2 + ηtl(yt, ut, θ), (1) where ηt is the learning rate in round t, and l(yt, ut, θ) is defined in (Loss Function). The updating rule (1) seeks to balance the tradeoff between "conservativeness" and correctiveness", where the first term characterizes how conservative we are to maintain the current estimation, and the second term indicates how corrective we would like to modify with the new estimation. As there is no closed form for θt+1 in general, we call (1) an implicit update rule [17, 18]. To solve (1), we can replace x ∈S(u, θ) by KKT conditions (or other optimality conditions) of the DMP, and get a mixed integer nonlinear program. Consider, for example, a decision making problem that is a quadratic optimization problem. Namely, the DMP has the following form: min x∈Rn 1 2xT Qx + cT x s.t. Ax ≥b. QP Suppose that b changes over time t. That is, b is the external signal for QP and equals to bt at time t. If we seek to learn c, the optimal solution set for QP can be characterized by KKT conditions as S(bt) = {x : Ax ≥bt, u ∈Rm +, uT (Ax −bt) = 0, Qx + c −AT u = 0}. Here, u is the dual variable for the constraints. Then, the single level reformulation of the update rule by solving (1) is min c∈Θ 1 2∥c −ct∥2 2 + ηt∥yt −x∥2 2 s.t. Ax ≥bt, u ≤Mz, Ax −bt ≤M(1 −z), Qx + c −AT u = 0, c ∈Rm, x ∈Rn, u ∈Rm +, z ∈{0, 1}m, IQP where z is the binary variable used to linearize KKT conditions, and M is an appropriate number used to bound the dual variable u and Ax −bt. Clearly, IQP is a mixed integer second order conic program (MISOCP). More examples are given in the supplementary material. Our application of the implicit updates to learn the parameter of DMP proceeds in Algorithm 1. Remark 3.1. (i) In Algorithm 1, we let θt+1 = θt if the prediction error l(yt, ut, θt) is zero. But in practice, we can set a threshold ϵ > 0 and let θt+1 = θt once l(yt, ut, θt) < ϵ. (ii) Normalization of θt+1 is needed in some situations, which eliminates the impact of trivial solutions. (iii) Minibatches One technique to enhance online learning is to consider multiple observations per update. In our framework, this means that computing θt+1 using |Nt| > 1 noisy decisions in (1). Remark 3.2. To obtain a strong initialization of θ in Algorithm 1, we can incorporate an idea in [1], which imputes a convex objective function by minimizing the residuals of KKT conditions incurred by the noisy data. Assume we have a historical data set eT, which may be of poor qualities for the current learning. This leads to the following initialization problem: min θ∈Θ 1 | e T | P t∈[ e T ] rt c + rt s  s.t. |uT t g(yt, ut, θ)| ≤rt c, ∀t ∈eT, ∥∇f(yt, ut, θ) + ∇uT t g(yt, ut, θ)∥2 ≤rt s, ∀t ∈eT, ut ∈Rm +, rt c ∈R+, rt s ∈R+, ∀t ∈eT, (2) 4 Algorithm 1 Implicit Online Learning for Generalized Inverse Optimization 1: Input: (signal,noisy decision) pairs {(ut, yt)}t∈[T ] 2: Initialization: θ1 could be an arbitrary hypothesis of the parameter. 3: for t = 1 to T do 4: receive (ut, yt) 5: suffer loss l(yt, ut, θt) 6: if l(yt, ut, θt) = 0 then 7: θt+1 ←θt 8: else 9: set learning rate ηt ∝1/ √ t 10: update θt+1 = arg min θ∈Θ 1 2∥θ −θt∥2 2 + ηtl(yt, ut, θ) (solve (1)) 11: end if 12: end for where rt c and rt s are residuals corresponding to the complementary slackness and stationarity in KKT conditions for the t-th noisy decision yt, and ut is the dual variable corresponding to the constraints in DMP. Note that (2) is a convex program. It can be solved quite efficiently compared to solving the inverse optimization problem in batch setting [7]. Other initialization approaches using similar ideas e.g., computing a variational inequality based approximation of inverse model [13], can also be incorporated into our algorithm. 3.3 Theoretical analysis Note that the implicit online learning algorithm is generally applicable to learn the parameter of any convex DMP. In this section, we prove that the average regret RT /T converges at a rate of O(1/ √ T) under certain regularity conditions. Furthermore, we will show that the proposed algorithm is statistically consistent when the data satisfies some common regularity conditions. We begin by introducing a few assumptions that are rather common in literature [1, 13, 10, 7]. Assumption 3.1. (a) For each u ∈U and θ ∈Θ, X(u, θ) is closed, and has a nonempty relative interior. X(u, θ) is also uniformly bounded. That is, there exists B > 0 such that ∥x∥2 ≤ B for all x ∈X(u, θ). (b) f(x, u, θ) is λ-strongly convex in x on Y for fixed u ∈U and θ ∈Θ. That is, ∀x, y ∈Y,  ∇f(y, u, θ) −∇f(x, u, θ) T (y −x) ≥λ∥x −y∥2 2. Remark 3.3. For strongly convex program, there exists only one optimal solution. Therefore, Assumption 3.1.(b) ensures that S(u, θ) is a single-valued set for each u ∈U. However, S(u, θ) might be multivalued for general convex DMP for fixed u. Consider, for example, minx1,x2{x1 + x2 : x1 + x2 ≥1}. Note that all points on line x1 + x2 = 1 are optimal. Indeed, we find such case is quite common when there are many variables and constraints. Actually, it is one of the major challenges when learning parameters of a function that’s not strongly convex using inverse optimization. For convenience of analysis, we assume below that we seek to learn the objective function while constraints are known. Then, the performance of Algorithm 1 also depends on how the change of θ affects the objective values. For ∀x ∈Y, ∀u ∈U, ∀θ1, θ2 ∈Θ, we consider the difference function h(x, u, θ1, θ2) = f(x, u, θ1) −f(x, u, θ2). (3) Assumption 3.2. ∃κ > 0, ∀u ∈U, ∀θ1, θ2 ∈Θ, h(·, u, θ1, θ2) is Lipschitz continuous on Y: |h(x, u, θ1, θ2) −h(y, u, θ1, θ2)| ≤κ∥θ1 −θ2∥2∥x −y∥2, ∀x, y ∈Y. Basically, this assumption says that the objectives functions will not change very much when either the parameter θ or the variable x is perturbed. It actually holds in many common situations, including the linear program and quadratic program. Lemma 3.1. Under Assumptions 2.1 - 3.2, the loss function l(y, u, θ) is uniformly 4(B+R)κ λ Lipschitz continuous in θ. That is, ∀y ∈Y, ∀u ∈U, ∀θ1, θ2 ∈Θ, we have |l(y, u, θ1) −l(y, u, θ2)| ≤4(B + R)κ λ ∥θ1 −θ2∥2. 5 The establishment of Lemma 3.1 is based on the key observation that the perturbation of S(u, θ) due to θ is bounded by the perturbation of θ through applying Proposition 6.1 in [19]. Details of the proof are given in the supplementary material. Remark 3.4. When we seek to learn the constraints or jointly learn the constraints and objective function, similar result can be established by applying Proposition 4.47 in [20] while restricting not only the Lipschitz continuity of the difference function in (3), but also the Lipschitz continuity of the distance between the feasible sets X(u, θ1) and X(u, θ2) (see Remark 4.40 in [20]). Assumption 3.3. For the DMP, ∀y ∈Y, ∀u ∈U, ∀θ1, θ2 ∈Θ, ∀α, β ≥0 s.t. α + β = 1, we have ∥αS(u, θ1) + βS(u, θ2) −S(u, αθ1 + βθ2)∥2 ≤αβ∥S(u, θ1) −S(u, θ2)∥2/(2(B + R)). Essentially, this assumption indicates that the distance between S(u, αθ1 + βθ2) and the convex combination of S(u, θ1) and S(u, θ2) shall be small when S(u, θ1) and S(u, θ2) are close. An example is provided in the supplementary material to show that this assumption can be satisfied. Yet, we note that it probably is restrictive and hard to verify in general. Let θ∗be an optimal inference to minθ∈Θ 1 T P t∈[T ] l(yt, θ), i.e., an inference derived with the whole batch of observations available. Then, the following theorem asserts that RT = P t∈[T ](l(yt, θt) −l(yt, θ∗)) of the implicit online learning algorithm is of O( √ T). Theorem 3.2 (Regret bound). Suppose Assumptions 2.1 - 3.3 hold. Then, choosing ηt = Dλ 2 √ 2(B+R)κ 1 √ t, we have RT ≤8 √ 2(B + R)Dκ λ √ T. Remark 3.5. We establish of the above regret bound by extending Theorem 3.2. in [18]. Our extension involves several critical and complicated analyses for the structure of the optimal solution set S(u, θ) as well as the loss function, which is essential to our theoretical understanding. Moreover, we relax the requirement of smoothness of loss function in that theorem to Lipschitz continuity through a similar argument in Lemma 1 of [21] and [22]. By applying both Theorem 3 in [7] and the regret bound proved in Theorem 3.2, we show the risk consistency of the online learning algorithm in the sense that the average cumulative loss converges in probability to the true risk in the batch setting. Theorem 3.3 (Risk consistency). Let θ0 = arg minθ∈Θ{E [l(y, u, θ)]} be the optimal solution that minimizes the true risk in batch setting. Suppose the conditions in Theorem 3.2 hold. If E[y2] < ∞, then choosing ηt = Dλ 2 √ 2(B+R)κ 1 √ t, we have 1 T X t∈[T ] l(yt, ut, θt) p −→E  l(y, u, θ0)  . Corollary 3.3.1. Suppose that the true parameter θtrue ∈Θ, and y = x + ϵ, where x ∈S(u, θtrue) for some u ∈U, E[ϵ] = 0, E[ϵT ϵ] < ∞, and u, x are independent of ϵ. Let the conditions in Theorem 3.2 hold. Then choosing ηt = Dλ 2 √ 2(B+R)κ 1 √ t, we have 1 T X t∈[T ] l(yt, ut, θt) p −→E[ϵT ϵ]. Remark 3.6. (i) Theorem 3.3 guarantees that the online learning algorithm proposed in this paper will asymptotically achieves the best prediction error permitted by the inverse model we consider. (ii) Corollary 3.3.1 suggests that the prediction error is inevitable as long as the data carries noise. This prediction error, however, will be caused merely by the noisiness of the data in the long run. 4 Applications to learning problems in IOP In this section, we will provide sketches of representative applications for inferring objective functions and constraints using the proposed online learning algorithm. Our preliminary experiments have been run on Bridges system at the Pittsburgh Supercomputing Center (PSC) [23]. The mixed integer second order conic programs, which are derived from using KKT conditions in (1), are solved by Gurobi. All the algorithms are programmed with Julia [24]. 6 0 200 400 600 800 1000 10-1 100 101 Cold-start: Estimation error Cold-start: Average error Warm-start: Estimation error Warm-start: Average error (a) T= 5 T= 10 T= 15 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 Batch setting Online setting (b) 0 200 400 600 800 1000 0 0.5 1 1.5 2 Loss Average cumulative loss Loss per round E[ T ] (c) Figure 2: Learning the utility function over T = 1000 rounds. (a) We run 100 repetitions of the experiments using Algorithm 1 with two settings. Cold-start means that we initialize r as a vector of zeros. Warm-start means that we initialize r by solving (2) with 1000 (price,noisy decision) pairs. We plot the estimation errors over round t in pink and brown for all the 100 repetitions, respectively. We also plot the average estimation errors of the 100 repetitions in red line and dashed brown line, respectively. (b) The dotted brown line is the error bar plot of the average running time over 10 repetitions in batch setting. The blue line is the error bar plot of the average running time over 100 repetitions in online setting. Here, the error bar is [mean-std, mean+std]. (c) We randomly pick one repetition. The loss over round is indicated by the dot. The average cumulative loss is indicated by the line. The dotted line indicates the variance of the noise. Here, E[ϵT ϵ] = 0.2083. 4.1 Learning consumer behavior We now study the consumer’s behavior problem in a market with n products. The prices for the products are denoted by pt ∈Rn + which varies over time t ∈[T]. We assume throughout that the consumer has a rational preference relation, and we take u to be the utility function representing these preferences. The consumer’s decision making problem of choosing her most preferred consumption bundle x given the price vector pt and budget b can be stated as the following utility maximization problem (UMP) [25]. max x∈Rn + u(x) s.t. pT t x ≤b, UMP where pT t x ≤b is the budget constraint at time t. For this application, we will consider a concave quadratic representation for u(x). That is, u(x) = 1 2xT Qx + rT x, where Q ∈Sn −(the set of symmetric negative semidefinite matrices), r ∈Rn. We consider a problem with n = 10 products, and the budget b = 40. Q and r are randomly generated and are given in the supplementary material. Suppose prices are changing in T rounds. In each round, the learner would receive one (price,noisy decision) pair (pt, yt). Her goal is to learn the utility function or budget of the consumer. The (price,noisy decision) pair in each round is generated as follows. In round t, we generate the prices from a uniform distribution, i.e. pt i ∼U[pmin, pmax], with pmin = 5 and pmax = 25. Then, we solve UMP and get the optimal decision xt. Next, the noisy decision yt is obtained by corrupting xt with noise that has a jointly uniform distribution with support [−0.25, 0.25]2. Namely, yt = xt + ϵt, where each element of ϵt ∼U(−0.25, 0.25). Learning the utility function In the first set of experiments, the learner seeks to learn r given {(pt, yt)}t∈[T ] that arrives sequentially in T = 1000 rounds. We assume that r is within [0, 5]10. The learning rate is set to ηt = 5/ √ t. Then, we implement Algorithm 1 with two settings. We report our results in Figure 2. As can be seen in Figure 2a, solving the initialization problem provides quite good initialized estimations of r, and Algorithm 1 with Warm-start converges faster than that with Cold-start. Note that (2) is a convex program and the time to solve it is negligible in Algorithm 1. Thus, the running times with and without Warm-start are roughly the same. This suggests that one might prefer to use Algorithm 1 with Warm-start if she wants to get a relatively good estimation of the parameters in few iterations. However, as shown in the figure, both settings would return very similar estimations on r in the long run. To keep consistency, we would use Algorithm 1 with Cold-start in the remaining experiments. We can also see that estimation errors over rounds for different repetitions concentrate around the average, indicating that our algorithm is pretty robust to noises. Moreover, Figure 2b shows that inverse optimization in online setting is drastically faster 7 0 200 400 600 800 1000 0 10 20 30 40 Estimation error per round Average estimation error (a) T= 50 T= 100 T= 250 0 500 1000 1500 2000 Batch setting Online setting (b) 0 200 400 600 800 1000 0 0.2 0.4 0.6 0.8 1 1.2 Loss Average cumulative loss Loss per round E[ T ] (c) Figure 3: Learning the budget over T = 1000 rounds. (a) We run 100 repetitions of the experiments. We plot the estimation error over round t for all the 100 repetitions in pink. We also plot the average estimation error of the 100 repetitions in red. (b) The dotted brown line is the error bar plot of the average running time over 10 repetitions in batch setting. The blue line is the error bar plot of the average running time over 100 repetitions in online setting. (c) We randomly pick one repetition. The loss over round is indicated by the dot. The average cumulative loss is indicated by the line. The dotted line is the reference line indicating the variance of the noise. Here, E[ϵT ϵ] = 0.2083. than in batch setting. This also suggests that windowing approach for inverse optimization might be practically infeasible since it fails even with a small subset of data, such as window size equals to 10. We then randomly pick one repetition and plot the loss over round and the average cumulative loss in Figure 2c. We see clearly that the average cumulative loss asymptotically converges to the variance of the noise. This makes sense because the loss merely reflects the noise in the data when the estimation converges to the true value as stated in Remark 3.6. Learning the budget In the second set of experiments, the learner seeks to learn the budget b in T = 1000 rounds. We assume that b is within [0, 100]. The learning rate is set to ηt = 100/ √ t. Then, we apply Algorithm 1 with Cold-start. We show the results in Figure 3. All the analysis for the results in learning the utility function apply here. One thing to emphasize is that learning the budget is much faster than learning the utility function, as shown in Figure 2b and 3b. The main reason is that the budget b is a one dimensional vector, while the utility vector r is a ten dimensional vector, making it drastically more complex to solve (1). 4.2 Learning the transportation cost We now consider the transshipment network G = (Vs ∪Vd, E), where nodes Vs are producers and the remaining nodes Vd are consumers. The production level is yv for node v ∈Vs, and has a maximum capacity of wv. The demand level is dt v for node v ∈Vs and varies over time t ∈[T]. We assume that producing yv incurs a cost of Cv(yv) for node v ∈Vs; furthermore, we also assume that there is a transportation cost cexe associated with edge e ∈E, and the flow xe has a maximum capacity of ue. The transshipment problem can be formulated in the following: min P v∈Vs Cv(yv) + P e∈E cexe s.t. P e∈δ+(v) xe − P e∈δ−(v) xe = yv, ∀v ∈Vs, P e∈δ+(v) xe − P e∈δ−(v) xe = dt v, ∀v ∈Vd, 0 ≤xe ≤ue, 0 ≤yv ≤wv, ∀e ∈E, ∀v ∈Vs, TP where we want to learn the transportation cost ce for e ∈E. For this application, we will consider a convex quadratic cost for Cv(yv). That is, Cv(yv) = 1 2λvy2 v, where λv ≥0. We create instances of the problem based on the network in Figure 4a. λ1, λ2, {ue}e∈E, {wv}v∈Vs and the randomly generated {ce}e∈E are given in supplementary material. In each round, the learner would receive the demands {dt v}v∈Vd, the production levels {yv}v∈Vs and the flows {xe}e∈E, where the later two are corrupted by noises. In round t, we generate the dt v for v ∈Vd from a uniform distribution, i.e. dt v ∼U[−1.25, 0]. Then, we solve TP and get the optimal production levels and flows. Next, the noisy production levels and flows are obtained by corrupting the optimal ones with noise that has a jointly uniform distribution with support [−0.25, 0.25]8. 8 3 4 1 2 5 (a) 0 200 400 600 800 1000 0 1 2 3 4 Estimation error per round Average estimation error (b) 0 200 400 600 800 1000 0 0.2 0.4 0.6 0.8 1 1.2 Loss Average cumulative loss Loss per round E[ T ] (c) Figure 4: Learning the transportation cost over T = 1000 rounds. (a) We plot the five-node network in our experiment. (b) Denote c ∈R|E| the vector of transportation costs. We run 100 repetitions of the experiments. We plot the estimation error at each round t for all the 100 experiments. We also plot the average estimation error of the 100 repetitions. (c) We randomly pick one repetition. The loss over round is indicated by the dot. The average cumulative loss is indicated by the line. The dotted line is the reference line indicating the variance of the noise. Here, E[ϵT ϵ] = 0.1667. Suppose the transportation cost on edge (2, 3) and (2, 5) are unknown, and the learner seeks to learn them given the (demand,noisy decision) pairs that arrive sequentially in T = 1000 rounds. We assume that ce for e ∈E is within [1, 10]. The learning rate is set to ηt = 2/ √ t. Then, we implement Algorithm 1 with Cold-start. Figure 4b shows the estimation error of c in each round over the 100 repetitions. We also plot the average estimation error of the 100 repetitions. As shown in this figure, ct asymptotically converges to the true transportation cost cture pretty fast. Also. estimation errors over rounds for different repetitions concentrate around the average, indicating that our algorithm is pretty robust to noises. We then randomly pick one repetition and plot the loss over round and the average cumulative loss in Figure 4c. Note that the variance of the noise E[ϵT ϵ] = 0.1667. We can see that the average cumulative loss asymptotically converges to the variance of the noise. 5 Conclusions and final remarks In this paper, an online learning method to infer preferences or restrictions from noisy observations is developed and implemented. We prove a regret bound for the implicit online learning algorithm under certain regularity conditions, and show that the algorithm is statistically consistent, which guarantees that our algorithm will asymptotically achieves the best prediction error permitted by the inverse model. Experiment results show that our algorithm can learn the parameters with great accuracy, is robust to noises even if some assumptions are not satisfied or difficult to be verified, and achieves a dramatic improvement over the batch learning approach on computational efficacy. Future research directions include the algorithm development with more sophisticated online learning techniques for a stronger performance, and the theoretical investigation with less restriction assumptions and a broader applicability. Acknowledgments This work was partially supported by CMMI-1642514 from the National Science Foundation. This work used the Bridges system, which is supported by NSF award number ACI-1445606, at the Pittsburgh Supercomputing Center (PSC). References [1] Arezou Keshavarz, Yang Wang, and Stephen Boyd. Imputing a convex objective function. In Intelligent Control (ISIC), 2011 IEEE International Symposium on, pages 613–619. IEEE, 2011. [2] Ravindra K Ahuja and James B Orlin. Inverse optimization. Operations Research, 49(5):771– 783, 2001. [3] Garud Iyengar and Wanmo Kang. Inverse conic programming with applications. Operations Research Letters, 33(3):319–330, 2005. 9 [4] Andrew J. Schaefer. Inverse integer programming. Optimization Letters, 3(4):483–489, 2009. [5] Lizhi Wang. Cutting plane algorithms for the inverse mixed integer linear programming problem. Operations Research Letters, 37(2):114–116, 2009. [6] Andreas Bärmann, Sebastian Pokutta, and Oskar Schneider. Emulating the expert: Inverse optimization through online learning. In ICML, 2017. [7] Anil Aswani, Zuo-Jun Shen, and Auyon Siddiq. Inverse optimization with noisy data. Operations Research, 2018. [8] Timothy CY Chan, Tim Craig, Taewoo Lee, and Michael B Sharpe. Generalized inverse multiobjective optimization with application to cancer therapy. Operations Research, 62(3):680– 695, 2014. [9] Dimitris Bertsimas, Vishal Gupta, and Ioannis Ch Paschalidis. Inverse optimization: A new perspective on the black-litterman model. Operations research, 60(6):1389–1403, 2012. [10] Peyman Mohajerin Esfahani, Soroosh Shafieezadeh-Abadeh, Grani A Hanasusanto, and Daniel Kuhn. Data-driven inverse optimization with imperfect information. Mathematical Programming, pages 1–44, 2017. [11] Chaosheng Dong and Bo Zeng. Inferring parameters through inverse multiobjective optimization. arXiv preprint arXiv:1808.00935, 2018. [12] Charu C Aggarwal. Recommender Systems: The Textbook. Springer, 2016. [13] Dimitris Bertsimas, Vishal Gupta, and Ioannis Ch Paschalidis. Data-driven estimation in equilibrium using inverse optimization. Mathematical Programming, 153(2):595–633, 2015. [14] Hai Yang, Tsuna Sasaki, Yasunori Iida, and Yasuo Asakura. Estimation of origin-destination matrices from link traffic counts on congested networks. Transportation Research Part B: Methodological, 26(6):417–434, 1992. [15] Stephan Dempe and Sebastian Lohse. Inverse linear programming. In Recent Advances in Optimization, pages 19–28. Springer, 2006. [16] Timothy CY Chan, Taewoo Lee, and Daria Terekhov. Inverse optimization: Closed-form solutions, geometry, and goodness of fit. Management Science, 2018. [17] Li Cheng, Dale Schuurmans, Shaojun Wang, Terry Caelli, and Svn Vishwanathan. Implicit online learning with kernels. In NIPS, 2007. [18] Brian Kulis and Peter L. Bartlett. Implicit online learning. In ICML, 2010. [19] J Frédéric Bonnans and Alexander Shapiro. Optimization problems with perturbations: A guided tour. SIAM Review, 40(2):228–264, 1998. [20] J Frédéric Bonnans and Alexander Shapiro. Perturbation analysis of optimization problems. Springer Science & Business Media, 2013. [21] Jialei Wang, Weiran Wang, and Nathan Srebro. Memory and communication efficient distributed stochastic optimization with minibatch-prox. Proceedings of Machine Learning Research, 65:1–37, 2017. [22] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011. [23] Nicholas A. Nystrom, Michael J. Levine, Ralph Z. Roskies, and J. Ray Scott. Bridges: A uniquely flexible hpc resource for new communities and data analytics. In Proceedings of the 2015 XSEDE Conference: Scientific Advancements Enabled by Enhanced Cyberinfrastructure, XSEDE ’15, pages 30:1–30:8, New York, NY, USA, 2015. ACM. [24] Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B Shah. Julia: A fresh approach to numerical computing. SIAM Review, 59(1):65–98, 2017. [25] Andreu Mas-Collell, Michael Whinston, and Jerry R Green. Microeconomic theory. 1995. 10
2018
180
7,342
Sanity Checks for Saliency Maps Julius Adebayo∗, Justin Gilmer♯, Michael Muelly♯, Ian Goodfellow♯, Moritz Hardt♯†, Been Kim♯ juliusad@mit.edu, {gilmer,muelly,goodfellow,mrtz,beenkim}@google.com ♯Google Brain †University of California Berkeley Abstract Saliency methods have emerged as a popular tool to highlight features in an input deemed relevant for the prediction of a learned model. Several saliency methods have been proposed, often guided by visual appeal on image data. In this work, we propose an actionable methodology to evaluate what kinds of explanations a given method can and cannot provide. We find that reliance, solely, on visual assessment can be misleading. Through extensive experiments we show that some existing saliency methods are independent both of the model and of the data generating process. Consequently, methods that fail the proposed tests are inadequate for tasks that are sensitive to either data or model, such as, finding outliers in the data, explaining the relationship between inputs and outputs that the model learned, and debugging the model. We interpret our findings through an analogy with edge detection in images, a technique that requires neither training data nor model. Theory in the case of a linear model and a single-layer convolutional neural network supports our experimental findings2. 1 Introduction As machine learning grows in complexity and impact, much hope rests on explanation methods as tools to elucidate important aspects of learned models [1, 2]. Explanations could potentially help satisfy regulatory requirements [3], help practitioners debug their model [4, 5], and perhaps, reveal bias or other unintended effects learned by a model [6, 7]. Saliency methods3 are an increasingly popular class of tools designed to highlight relevant features in an input, typically, an image. Despite much excitement, and significant recent contribution [8–21], the valuable effort of explaining machine learning models faces a methodological challenge: the difficulty of assessing the scope and quality of model explanations. A paucity of principled guidelines confound the practitioner when deciding between an abundance of competing methods. We propose an actionable methodology based on randomization tests to evaluate the adequacy of explanation approaches. We instantiate our analysis on several saliency methods for image classification with neural networks; however, our methodology applies in generality to any explanation approach. Critically, our proposed randomization tests are easy to implement, and can help assess the suitability of an explanation method for a given task at hand. In a broad experimental sweep, we apply our methodology to numerous existing saliency methods, model architectures, and data sets. To our surprise, some widely deployed saliency methods are independent of both the data the model was trained on, and the model parameters. Consequently, ∗Work done during the Google AI Residency Program. 2All code to replicate our findings will be available here: https://goo.gl/hBmhDt 3We refer here to the broad category of visualization and attribution methods aimed at interpreting trained models. These methods are often used for interpreting deep neural networks particularly on image data. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Original Image Gradient SmoothGrad Guided BackProp Guided GradCAM Integrated Gradients Integrated Gradients SmoothGrad Gradient Input Edge Detector Junco Bird Corn Wheaten Terrier Figure 1: Saliency maps for some common methods compared to an edge detector. Saliency masks for 3 inputs for an Inception v3 model trained on ImageNet. We see that an edge detector produces outputs that are strikingly similar to the outputs of some saliency methods. In fact, edge detectors can also produce masks that highlight features which coincide with what appears to be relevant to a model’s class prediction. We find that the methods most similar (see Appendix for SSIM metric) to an edge detector, i.e., Guided Backprop and its variants, show minimal sensitivity to our randomization tests. these methods are incapable of assisting with tasks that depend on the model, such as debugging the model, or tasks that depend on the relationships between inputs and outputs present in the data. To illustrate the point, Figure 1 compares the output of standard saliency methods with those of an edge detector. The edge detector does not depend on model or training data, and yet produces results that bear visual similarity with saliency maps. This goes to show that visual inspection is a poor guide in judging whether an explanation is sensitive to the underlying model and data. Our methodology derives from the idea of a statistical randomization test, comparing the natural experiment with an artificially randomized experiment. We focus on two instantiations of our general framework: a model parameter randomization test, and a data randomization test. The model parameter randomization test compares the output of a saliency method on a trained model with the output of the saliency method on a randomly initialized untrained network of the same architecture. If the saliency method depends on the learned parameters of the model, we should expect its output to differ substantially between the two cases. Should the outputs be similar, however, we can infer that the saliency map is insensitive to properties of the model, in this case, the model parameters. In particular, the output of the saliency map would not be helpful for tasks such as model debugging that inevitably depend on the model parameters. The data randomization test compares a given saliency method applied to a model trained on a labeled data set with the method applied to the same model architecture but trained on a copy of the data set in which we randomly permuted all labels. If a saliency method depends on the labeling of the data, we should again expect its outputs to differ significantly in the two cases. An insensitivity to the permuted labels, however, reveals that the method does not depend on the relationship between instances (e.g. images) and labels that exists in the original data. Speaking more broadly, any explanation method admits a set of invariances, i.e., transformations of data and model that do not change the output of the method. If we discover an invariance that is incompatible with the requirements of the task at hand, we can safely reject the method. As such, our tests can be thought of as sanity checks to perform before deploying a method in practice. Our contributions 1. We propose two concrete, easy to implement tests for assessing the scope and quality of explanation methods: the model parameter randomization test, and the data randomization test. These tests apply broadly to explanation methods. 2. We conduct extensive experiments with several explanation methods across data sets and model architectures, and find, consistently, that some of the methods tested are independent of both the model parameters and the labeling of the data that the model was trained on. 2 3. Of the methods we tested, Gradients & GradCAM pass the sanity checks, while Guided BackProp & Guided GradCAM fail. In the other cases, we observe a visual perception versus ranking dichotomy, which we describe in our results. 4. Consequently, our findings imply that the saliency methods that fail our tests are incapable of supporting tasks that require explanations that are faithful to the model or the data generating process. 5. We interpret our findings through a series of analyses of linear models and a simple 1-layer convolutional sum-pooling architecture, as well as a comparison with edge detectors. 2 Methods and Related Work In our formal setup, an input is a vector x ∈Rd. A model describes a function S : Rd →RC, where C is the number of classes in the classification problem. An explanation method provides an explanation map E : Rd →Rd that maps inputs to objects of the same shape. We now briefly describe some of the explanation methods we examine. The supplementary materials contain an in-depth overview of these methods. Our goal is not to exhaustively evaluate all prior explanation methods, but rather to highlight how our methods apply to several cases of interest. The gradient explanation for an input x is Egrad(x) = ∂S ∂x [8, 22, 23]. The gradient quantifies how much a change in each input dimension would a change the predictions S(x) in a small neighborhood around the input. Gradient ⊙Input. Another form of explanation is the element-wise product of the input and the gradient, denoted x ⊙∂S ∂x , which can address “gradient saturation”, and reduce visual diffusion [13]. Integrated Gradients (IG) also addresses gradient saturation by summing over scaled versions of the input [14]. IG for an input x is defined as EIG(x) = (x −¯x) × R 1 0 ∂S(¯x+α(x−¯x) ∂x dα, where ¯x is a “baseline input” that represents the absence of a feature in the original input x. Guided Backpropagation (GBP) [9] builds on the “DeConvNet” explanation method [10] and corresponds to the gradient explanation where negative gradient entries are set to zero while backpropagating through a ReLU unit. Guided GradCAM. Introduced by Selvaraju et al. [19], GradCAM explanations correspond to the gradient of the class score (logit) with respect to the feature map of the last convolutional unit of a DNN. For pixel level granularity GradCAM can be combined with Guided Backpropagation through an element-wise product. SmoothGrad (SG) [16] seeks to alleviate noise and visual diffusion [14, 13] for saliency maps by averaging over explanations of noisy copies of an input. For a given explanation map E, SmoothGrad is defined as Esg(x) = 1 N PN i=1 E(x+gi), where noise vectors gi ∼N(0, σ2)) are drawn i.i.d. from a normal distribution. 2.1 Related Work Other Methods & Similarities. Aside gradient-based approaches, other methods ‘learn’ an explanation per sample for a model [20, 17, 12, 15, 11, 21]. More recently, M. Ancona [24] showed that for ReLU networks (with zero baseline and no biases) the ϵ-LRP and DeepLift (Rescale) explanation methods are equivalent to the input ⊙gradient. Similarly, Lundberg and Lee [18] proposed SHAP explanations which approximate the shapley value and unify several existing methods. Fragility. Ghorbani et al. [25] and Kindermans et al. [26] both present attacks against saliency methods; showing that it is possible to manipulate derived explanations in unintended ways. Nie et al. [27] theoretically assessed backpropagation based methods and found that Guided BackProp and DeconvNet, under certain conditions, are invariant to network reparamaterizations, particularly random Gaussian initialization. Specifically, they show that Guided BackProp and DeconvNet both seem to be performing partial input recovery. Our findings are similar for Guided BackProp and its variants. Further, our work differs in that we propose actionable sanity checks for assessing explanation approaches. Along similar lines, Mahendran and Vedaldi [28] also showed that some backpropagation-based saliency methods lack neuron discriminativity. 3 Current assessment methods. Both Samek et al. [29] and Montavon et al. [30] proposed an input perturbation procedure for assessing the quality of saliency methods. Dabkowski and Gal [17] proposed an entropy-based metric to quantify the amount of relevant information an explanation mask captures. Performance of a saliency map on an object localization task has also been used for assessing saliency methods. Montavon et al. [30] discuss explanation continuity and selectivity as measures of assessment. Randomization. Our label randomization test was inspired by the work of Zhang et al. [31], although we use the test for an entirely different purpose. 2.2 Visualization & Similarity Metrics We discuss our visualization approach and overview the set of metrics used in assessing similarity between two explanations. Visualization. We visualize saliency maps in two ways. In the first case, absolute-value (ABS), we take absolute values of a normalized4 map. For the second case, diverging visualization, we leave the map as is, and use different colors to show positive and negative importance. Similarity Metrics. For quantitative comparison, we rely on the following metrics: Spearman rank correlation with absolute value (absolute value), Spearman rank correlation without absolute value (diverging), the structural similarity index (SSIM), and the Pearson correlation of the histogram of gradients (HOGs) derived from two maps. We compute the SSIM and HOGs similarity metric on ImageNet examples without absolute values.5 These metrics capture a broad notion of similarity; however, quantifying human visual perception is still an active area of research. 3 Model Parameter Randomization Test The parameter settings of a model encode what the model has learned from the data during training, and determine test set performance. Consequently, for a saliency method to be useful for debugging a model, it ought to be sensitive to model parameters. As an illustrative example, consider a linear function of the form f(x) = w1x1 + w2x2 with input x ∈R2. A gradient-based explanation for the model’s behavior for input x is given by the parameter values (w1, w2), which correspond to the sensitivity of the function to each of the coordinates. Changes in the model parameters therefore change the explanation. Our proposed model parameter randomization test assesses an explanation method’s sensitivity to model parameters. We conduct two kinds of randomization. First we randomly re-initialize all weights of the model both completely and in a cascading fashion. Second, we independently randomize a single layer at a time while keeping all others fixed. In both cases, we compare the resulting explanation from a network with random weights to the one obtained with the model’s original weights. 3.1 Cascading Randomization Overview. In the cascading randomization, we randomize the weights of a model starting from the top layer, successively, all the way to the bottom layer. This procedure destroys the learned weights from the top layers to the bottom ones. Figure 2 visualizes the cascading randomization for several saliency methods. In Figures 3 and 4, we show the Spearman metrics as well as the SSIM and HOGs similarity metrics. The gradient shows sensitivity while Guided BackProp is invariant. We find that the gradient map is sensitive to model parameters. We also observe sensitivity for the GradCAM masks. On the other hand, across all architectures and datasets, Guided BackProp and Guided GradCAM show no change regardless of model degradation. 4We normalize the maps to the range [−1.0, 1.0]. Normalizing in this manner potentially ignores peculiar characteristics of some saliency methods. For example, Integrated gradients has the property that the attributions sum up to the output value. This property cannot usually be visualized. We contend that such properties will not affect the manner in which the output visualizations are perceived. 5See appendix for a discussion on calibration of these metrics. 4 Gradient Gradient-SG Gradient Input Guided Back-propagation GradCAM Integrated Gradients Integrated Gradients-SG logits conv2d_1a_3x3 mixed_7c mixed_7b conv2d_2a_3x3 conv2d_2b_3x3 conv2d_4a_3x3 mixed_7a mixed_6e mixed_6d mixed_6c mixed_6b mixed_6a mixed_5d mixed_5c mixed_5b conv2d_3b_1x1 Original Explanation Guided GradCAM Cascading randomization from top to bottom layers Original Image Figure 2: Cascading randomization on Inception v3 (ImageNet). Figure shows the original explanations (first column) for the Junco bird. Progression from left to right indicates complete randomization of network weights (and other trainable variables) up to that ‘block’ inclusive. We show images for 17 blocks of randomization. Coordinate (Gradient, mixed_7b) shows the gradient explanation for the network in which the top layers starting from Logits up to mixed_7b have been reinitialized. The last column corresponds to a network with completely reinitialized weights. The danger of the visual assessment. On visual inspection, we find that integrated gradients and gradient⊙input show a remarkable visual similarity to the original mask. In fact, from Figure 2, it is still possible to make out the structure of the bird even after multiple blocks of randomization. This visual similarity is reflected in the rank correlation with absolute value (Figure 3-Top), SSIM, and the HOGs metric (Figure 4). However, re-initialization disrupts the sign of the map, so that the Spearman rank correlation without absolute values goes to zero (Figure 3-Bottom) almost as soon as the top layers are randomized. This observed visual perception versus numerical ranking dichotomy indicates that naive visual inspection of the masks does not distinguish networks of similar structure but widely differing parameters. We explain the source of this phenomenon in our discussion section. 3.2 Independent Randomization Overview. As a different form of the model parameter randomization test, we conduct an independent layer-by-layer randomization with the goal of isolating the dependence of the explanations by layer. Consequently, we can assess the dependence of saliency masks on lower versus higher layer weights. Results. We observe a correspondence between the results from the cascading and independent layer randomization experiments (see Figures ??, ??, ??, and ?? in the Appendix). As previously observed, Guided Backprop and Guided GradCAM masks remain almost unchanged regardless of the layer that is independently randomized across all networks. Similarly, we observe that the structure of the input is maintained, visually, for the gradient⊙input and Integrated Gradient methods. 5 CNN - Fashion MNIST MLP- MNIST Inception v3 - ImageNet output-fc fc2 original conv-hidden2 conv-hidden1 output hidden3 original hidden2 hidden1 Mixed 7c 7b 7a 6e 6d 6c 6b 6a 5d 5c 5b 4a 3b 2b 2a 1a logits original Conv2d Rank Correlation ABS output-fc fc2 original conv-hidden2 conv-hidden1 output hidden3 original hidden2 hidden1 Mixed 7c 7b 7a 6e 6d 6c 6b 6a 5d 5c 5b 4a 3b 2b 2a 1a logits original Conv2d Rank Correlation No ABS See Caption Note See Note Figure 3: Similarity Metrics for Cascading Randomization. We show results for Inception v3 on ImageNet, CNN on Fashion MNIST, and MLP on MNIST. See appendix for MLP on Fashion MNIST and CNN on MNIST. In all plots, y axis is the rank correlation between original explanation and the randomized explanation derived for randomization up to that layer/block, while the x axis corresponds to the layers/blocks of the DNN starting from the output layer. The vertical black dashed line indicates where successive randomization of the network begins, which is at the top layer. Top: Spearman Rank correlation with absolute values, Bottom: Spearman Rank correlation without absolute values. Caption Note: For Inception v3 on ImageNet no ABS, the IG, gradient-input, and gradients all coincide. For MLP-MNIST IG and gradient-input coincide. HOGs Similarity: Inception v3 - ImageNet Mixed 7c 7b 7a 6e 6d 6c 6b 6a 5d 5c 5b 4a 3b 2b 2a 1a logits original Conv2d SSIM: Inception v3 - ImageNet Mixed 7c 7b 7a 6e 6d 6c 6b 6a 5d 5c 5b 4a 3b 2b 2a 1a logits Conv2d original See Caption Note Figure 4: Similarity Metrics for Cascading Randomization. Figure showing HOGs similarity and SSIM between original input masks and the masks generated as the Inception v3 is randomized in a cascading manner. Caption Note: For SSIM: Inception v3 - ImageNet, IG and gradient⊙input coincide, while GradCAM, Guided GradCAM, and Guided BackProp are clustered together at the top. 4 Data Randomization Test The feasibility of accurate prediction hinges on the relationship between instances (e.g., images) and labels encoded by the data. If we artificially break this relationship by randomizing the labels, no predictive model can do better than random guessing. Our data randomization test evaluates the sensitivity of an explanation method to the relationship between instances and labels. An explanation method insensitive to randomizing labels cannot possibly explain mechanisms that depend on the relationship between instances and labels present in the data generating process. For example, if an explanation did not change after we randomly assigned diagnoses to CT scans, then evidently it did not explain anything about the relationship between a CT scan and the correct diagnosis in the first place (see [32] for an application of Guided BackProp as part of a pipepline for shadow detection in 2D Ultrasound). In our data randomization test, we permute the training labels and train a model on the randomized training data. A model achieving high training accuracy on the randomized training data is forced to memorize the randomized labels without being able to exploit the original structure in the data. As it 6 turns out, state-of-the art deep neural networks can easily fit random labels as was shown in Zhang et al. [31]. In our experiments, we permute the training labels for each model and data set pair, and train the model to greater than 95% training set accuracy. Note that the test accuracy is never better than randomly guessing a label (up to sampling error). For each resulting model, we then compute explanations on the same test bed of inputs for a model trained with true labels and the corresponding model trained on randomly permuted labels. CNN - MNIST True Labels Random Labels Gradient Gradient-SG Guided BackProp GradCAM Guided GradCAM Integrated Gradients Integrated Gradients-SG Gradient Input True Labels Random Labels Gradient Gradient-SG Guided BackProp GradCAM Guided GradCAM Integrated Gradients Integrated Gradients-SG Gradient Input Rank Correlation - Abs Rank Correlation - No Abs Absolute-Value Visualization Diverging Visualization Figure 5: Explanation for a true model vs. model trained on random labels. Top Left: Absolutevalue visualization of masks for digit 0 from the MNIST test set for a CNN. Top Right: Saliency masks for digit 0 from the MNIST test set for a CNN shown in diverging color. Bottom Left: Spearman rank correlation (with absolute values) bar graph for saliency methods. We compare the similarity of explanations derived from a model trained on random labels, and one trained on real labels. Bottom Right: Spearman rank correlation (without absolute values) bar graph for saliency methods for MLP. See appendix for corresponding figures for CNN, and MLP on Fashion MNIST. Gradient is sensitive. We find, again, that gradients, and its smoothgrad variant, undergo substantial changes. In addition, the GradCAM masks also change becoming more disconnected. Sole reliance on visual inspection can be misleading. For Guided BackProp, we observe a visual change; however, we find that the masks still highlight portions of the input that would seem plausible, given correspondence with the input, on naive visual inspection. For example, from the diverging masks (Figure 5-Right), we see that the Guided BackProp mask still assigns positive relevance across most of the digit for the network trained on random labels. For gradient⊙input and integrated gradients, we also observe visual changes in the masks obtained, particularly, in the sign of the attributions. Despite this, the input structure is still clearly prevalent in the masks. The effect observed is particularly prominent for sparse inputs like MNIST where the background is zero; however, we observe similar effects for Fashion MNIST (see Appendix). With visual inspection alone, it is not inconceivable that an analyst could confuse the integrated gradient and gradient⊙input masks derived from a network trained on random labels as legitimate. 5 Discussion We now take a step back to interpret our findings. First, we discuss the influence of the model architecture on explanations derived from NNs. Second, we consider methods that approximate an element-wise product of input and gradient, as several local explanations do [33, 18]. We show, empirically, that the input “structure” dominates the gradient, especially for sparse inputs. Third, we explain the observed behavior of the gradient explanation with an appeal to linear models. We then consider a single 1-layer convolution with sum-pooling architecture, and show that saliency explanations for this model mostly capture edges. Finally, we return to the edge detector and make comparisons between the methods that fail our sanity checks and an edge detector. 7 5.1 The role of model architecture as a prior The architecture of a deep neural network has an important effect on the representation derived from the network. A number of results speak to the strength of randomly initialized models as classification priors [34, 35]. Moreover, randomly initialized networks trained on a single input can perform tasks like denoising, super-resolution, and in-painting [36] without additional training data. These prior works speak to the fact that randomly initialized networks correspond to non-trivial representations. Explanations that do not depend on model parameters or training data might still depend on the model architecture and thus provide some useful information about the prior incorporated in the model architecture. However, in this case, the explanation method should only be used for tasks where we believe that knowledge of the model architecture on its own is sufficient for giving useful explanations. 5.2 Element-wise input-gradient products A number of methods, e.g., ϵ-LRP, DeepLift, and integrated gradients, approximate the element-wise product of the input and the gradient (on a piecewise linear function like ReLU). To gain further insight into our findings, we can look at what happens to the input-gradient product E(x) = x⊙∂S ∂x , if the input is kept fixed, but the gradient is randomized. To do so, we conduct the following experiment. For an input x, sample two random vectors u, v (we consider both the truncated normal and uniform distributions) and consider the element-wise product of x with u and v, respectively, i.e., x ⊙u, and x ⊙v. We then look at the similarity, for all the metrics considered, between x ⊙u and x ⊙v as noise increases. We conduct this experiment on ImageNet samples. We observe that the input does indeed dominate the product (see Figure ?? in Appendix). We also observe that the input dominance persists even as the noisy gradient vectors change drastically. This experiment indicates that methods that approximate the “input-times-gradient” could conceivably mostly return the input, in cases where the gradients look visually noisy as they tend to do. 5.3 Analysis for simple models Gradient Gradient SmoothGrad GBP IG RGB Gray Scale Figure 6: Explanations derived for the 1-layer Sum-Pooling Convolution architecture. We show gradient, SmoothGrad, Integrated Gradients, and Guided BackProp explanations. (See Appendix for Similarity Metrics). To better understand our findings, we analyze the output of the saliency methods tested on two simple models: a linear model and a 1-layer sum pooling convolutional network. We find that the output of the saliency methods, on a linear model, returns a coefficient that intuitively measures the sensitivity of the model with respect to that variable. However, these methods applied to a random convolution seem to result in visual artifacts that are akin to an edge detector. Linear Model. Consider a linear model f : Rd →R defined as f(x) = w · x where w ∈Rd are the model weights. For gradients we have Egrad(x) = ∂(w·x) ∂x = w. Similarly for SmoothGrad we have Esg(x) = w (the gradient is independent of the input, so averaging gradients over noisy inputs yields the same model weight). Integrated Gradients reduces to “gradient ⊙input” for this case: EIG(x) = (x −¯x) ⊙ Z 1 0 ∂f(¯x + α(x −¯x)) ∂x dα = (x −¯x) ⊙ Z 1 0 wαdα = (x −¯x) ⊙w/2 . Consequently, we see that the application of the basic gradient method to a linear model will pass our sanity check. Gradients on a random model will return an image of white noise, while integrated gradients will return a noisy version of the input image. We did not consider Guided Backprop and GradCAM here because both methods are not defined for the linear model considered above. 1 Layer Sum-Pool Conv Model. We now show that the application of these same methods to a 1-layer convolutional network may result in visual artifacts that can be misleading unless further 8 analysis is done. Consider a single-layer convolutional network applied to a grey-scale image x ∈Rn×n. Let w ∈R3×3 denote the 3 × 3 convolutional filter, indexed as wij for i, j ∈{−1, 0, 1}. We denote by w ∗x ∈Rn×n the output of the convolution operation on the image x. Then the output of this network can be written as l(x) = nP i=1 nP j=1 σ(w ∗x)ij , where σ is the ReLU non-linearity applied point-wise. In particular, this network applies a single 3x3 convolutional filter to the input image, then applies a ReLU non-linearity and finally sum-pools over the entire convolutional layer for the output. This is a similar architecture to the one considered in [34]. As shown in Figure 6, we see that different saliency methods do act like edge detectors. This suggests that the convolutional structure of the network is responsible for the edge detecting behavior of some of these saliency methods. To understand why saliency methods applied to this simple architecture visually appear to be edge detectors, we consider the closed form of the gradient ∂ ∂xij l(x). Let aij = 1 {(w ∗x)ij ≥0} indicate the activation pattern of the ReLU units in the convolutional layer. Then for i, j ∈[2, n −1] we have ∂ ∂xij l(x) = 1 X k=−1 1 X l=−1 σ′((w ∗x)i+k,j+l)wkl = 1 X k=−1 1 X l=−1 ai+k,j+lwkl (Recall that σ′(x) = 0 if x < 0 and 1 otherwise). This implies that the 3 × 3 activation pattern local to pixel xij uniquely determines ∂ ∂xij . It is now clear why edges will be visible in the produced saliency mask — regions in the image corresponding to an “edge” will have a distinct activation pattern from surrounding pixels. In contrast, pixel regions of the image which are more uniform will all have the same activation pattern, and thus the same value of ∂ ∂xij l(x). Perhaps a similar principle applies for stacked convolutional layers. 5.4 The case of edge detectors. An edge detector, roughly speaking, is a classical tool to highlight sharp transitions in an image. Notably, edge detectors are typically untrained and do not depend on any predictive model. They are solely a function of the given input image. As some of the saliency methods we saw, edge detection is invariant under model and data transformations. In Figure 1 we saw that edge detectors produce images that are strikingly similar to the outputs of some saliency methods. In fact, edge detectors can also produce pictures that highlight features which coincide with what appears to be relevant to a model’s class prediction. However, here the human observer is at risk of confirmation bias when interpreting the highlighted edges as an explanation of the class prediction. In Figure ?? (In Appendix), we show a qualitative comparison of saliency maps of an input image with the same input image multiplied element-wise by the output of an edge detector. The result indeed looks strikingly similar, illustrating that saliency methods mostly use the edges of the image. While edge detection is a fundamental and useful image processing technique, it is typically not thought of as an explanation method, simply because it involves no model or training data. In light of our findings, it is not unreasonable to interpret some saliency methods as implicitly implementing unsupervised image processing techniques, akin to edge detection, segmentation, or denoising. To differentiate such methods from model-sensitive explanations, visual inspection is insufficient. 6 Conclusion and future work The goal of our experimental method is to give researchers guidance in assessing the scope of model explanation methods. We envision these methods to serve as sanity checks in the design of new model explanations. Our results show that visual inspection of explanations alone can favor methods that may provide compelling pictures, but lack sensitivity to the model and the data generating process. Invariances in explanation methods give a concrete way to rule out the adequacy of the method for certain tasks. We primarily focused on invariance under model randomization, and label randomization. Many other transformations are worth investigating and can shed light on various methods we did and did not evaluate. Along these lines, we hope that our paper is a stepping stone towards a more rigorous evaluation of new explanation methods, rather than a verdict on existing methods. 9 Acknowledgments We thank the Google PAIR team for open source implementation of the methods used in this work. We thank Martin Wattenberg and other members of the Google Brain team for critical feedback that helped improved the work. Lastly, we thank anonymous reviewers for feedback that helped improve the manuscript. References [1] Alfredo Vellido, José David Martín-Guerrero, and Paulo JG Lisboa. Making machine learning models interpretable. In ESANN, volume 12, pages 163–172. Citeseer, 2012. [2] Finale Doshi-Velez, Mason Kortz, Ryan Budish, Chris Bavitz, Sam Gershman, David O’Brien, Stuart Schieber, James Waldo, David Weinberger, and Alexandra Wood. Accountability of ai under the law: The role of explanation. arXiv preprint arXiv:1711.01134, 2017. [3] Bryce Goodman and Seth Flaxman. European union regulations on algorithmic decision-making and a" right to explanation". arXiv preprint arXiv:1606.08813, 2016. [4] Gabriel Cadamuro, Ran Gilad-Bachrach, and Xiaojin Zhu. Debugging machine learning models. In ICML Workshop on Reliable Machine Learning in the Wild, 2016. [5] Jorge Casillas, Oscar Cordón, Francisco Herrera Triguero, and Luis Magdalena. Interpretability issues in fuzzy modeling, volume 128. Springer, 2013. [6] Himabindu Lakkaraju, Ece Kamar, Rich Caruana, and Jure Leskovec. Interpretable & explorable approximations of black box models. arXiv preprint arXiv:1707.01154, 2017. [7] Fulton Wang and Cynthia Rudin. Causal falling rule lists. arXiv preprint arXiv:1510.05189, 2015. [8] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. [9] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. [10] Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014. [11] Maximilian Alber Klaus-Robert Müller Dumitru Erhan Been Kim Sven Dähne Pieter-Jan Kindermans, Kristof T. Schütt. Learning how to explain neural networks: Patternnet and patternattribution. International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id= Hkn7CBaTW. [12] Luisa M Zintgraf, Taco S Cohen, Tameem Adel, and Max Welling. Visualizing deep neural network decisions: Prediction difference analysis. arXiv preprint arXiv:1702.04595, 2017. [13] Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv preprint arXiv:1605.01713, 2016. [14] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3319–3328, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/ sundararajan17a.html. [15] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1135–1144. ACM, 2016. [16] Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825, 2017. [17] Piotr Dabkowski and Yarin Gal. Real time image saliency for black box classifiers. In Advances in Neural Information Processing Systems, pages 6970–6979, 2017. 10 [18] Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pages 4768–4777, 2017. [19] Ramprasaath R Selvaraju, Abhishek Das, Ramakrishna Vedantam, Michael Cogswell, Devi Parikh, and Dhruv Batra. Grad-cam: Why did you say that? arXiv preprint arXiv:1611.07450, 2016. [20] Ruth C Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. arXiv preprint arXiv:1704.03296, 2017. [21] Jianbo Chen, Le Song, Martin Wainwright, and Michael Jordan. Learning to explain: An informationtheoretic perspective on model interpretation. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 883–892, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/chen18j.html. [22] Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. University of Montreal, 1341(3):1, 2009. [23] David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and Klaus-Robert MÞller. How to explain individual classification decisions. Journal of Machine Learning Research, 11 (Jun):1803–1831, 2010. [24] A. C. Öztireli M. Gross M. Ancona, E. Ceolini. Towards better understanding of gradient-based attribution methods for deep neural networks. International Conference on Learning Representations (ICLR 2018), 2018. [25] Amirata Ghorbani, Abubakar Abid, and James Zou. Interpretation of neural networks is fragile. arXiv preprint arXiv:1710.10547, 2017. [26] Pieter-Jan Kindermans, Sara Hooker, Julius Adebayo, Maximilian Alber, Kristof T Schütt, Sven Dähne, Dumitru Erhan, and Been Kim. The (un) reliability of saliency methods. arXiv preprint arXiv:1711.00867, 2017. [27] Weili Nie, Yang Zhang, and Ankit Patel. A theoretical explanation for perplexing behaviors of backpropagation-based visualizations. In ICML, 2018. [28] Aravindh Mahendran and Andrea Vedaldi. Salient deconvolutional networks. In European Conference on Computer Vision, pages 120–135. Springer, 2016. [29] Wojciech Samek, Alexander Binder, Grégoire Montavon, Sebastian Lapuschkin, and Klaus-Robert Müller. Evaluating the visualization of what a deep neural network has learned. IEEE transactions on neural networks and learning systems, 28(11):2660–2673, 2017. [30] Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 2017. [31] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In In Proc. 5th ICLR, 2017. [32] Qingjie Meng, Christian Baumgartner, Matthew Sinclair, James Housden, Martin Rajchl, Alberto Gomez, Benjamin Hou, Nicolas Toussaint, Jeremy Tan, Jacqueline Matthew, et al. Automatic shadow detection in 2d ultrasound. 2018. [33] Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. In In Proc. 6th ICLR, 2018. [34] Andrew M Saxe, Pang Wei Koh, Zhenghao Chen, Maneesh Bhand, Bipin Suresh, and Andrew Y Ng. On random weights and unsupervised feature learning. In ICML, pages 1089–1096, 2011. [35] Guillaume Alain and Yoshua Bengio. Understanding intermediate layers using linear classifier probes. arXiv preprint arXiv:1610.01644, 2016. [36] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. arXiv preprint arXiv:1711.10925, 2017. 11
2018
181
7,343
Differentially Private Uniformly Most Powerful Tests for Binomial Data Jordan Awan Department of Statistics Penn State University University Park, PA 16802 awan@psu.edu Aleksandra Slavkovi´c Department of Statistics Penn State University University Park, PA 16802 sesa@psu.edu Abstract We derive uniformly most powerful (UMP) tests for simple and one-sided hypotheses for a population proportion within the framework of Differential Privacy (DP), optimizing finite sample performance. We show that in general, DP hypothesis tests can be written in terms of linear constraints, and for exchangeable data can always be expressed as a function of the empirical distribution. Using this structure, we prove a ‘Neyman-Pearson lemma’ for binomial data under DP, where the DP-UMP only depends on the sample sum. Our tests can also be stated as a post-processing of a random variable, whose distribution we coin “Truncated-Uniform-Laplace” (Tulap), a generalization of the Staircase and discrete Laplace distributions. Furthermore, we obtain exact p-values, which are easily computed in terms of the Tulap random variable. We show that our results also apply to distribution-free hypothesis tests for continuous data. Our simulation results demonstrate that our tests have exact type I error, and are more powerful than current techniques. 1 Introduction Differential Privacy (DP), introduced by DMNS06, offers a rigorous measure of disclosure risk. To satisfy DP, a procedure cannot be a deterministic function of the sensitive data, but must incorporate additional randomness, beyond sampling. Subject to the DP constraint, it is natural to search for a procedure which maximizes the utility of the output. Many works address the goal of minimizing the distance between the output of the randomized DP procedure and standard non-private algorithms, but few attempt to infer properties about the underlying population (for some notable exceptions, see related work), which is typically the goal in statistics and scientific research. In this paper, we study the setting where each individual contributes a sensitive binary value, and we wish to infer the population proportion via hypothesis tests, subject to DP. In particular, we derive uniformly most powerful (UMP) tests for simple and one-sided hypotheses, optimizing finite sample performance. UMP tests are fundamental to classical statistics, being closely linked to sufficiency, likelihood inference, and confidence sets. However, finding UMP tests can be hard and in many cases they do not even exist (see Sch96, Section 4.4). Our results are the first to achieve UMP tests under (ϵ, δ)−DP, and are among the first steps towards a general theory of optimal inference under DP. Related work Vu and Slavkovi´c [VS09] are among the first to perform hypothesis tests under DP. They develop private tests for population proportions as well as for independence in 2 × 2 contingency tables. In both settings, they fix the noise adding distribution, and use approximate sampling distributions to perform these DP tests. A similar approach is used by Sol14 to develop tests for normally distributed data. The work of VS09 is extended by WLK15 and GLRV16, developing additional tests for multinomial data. To implement their tests, WLK15 develop asymptotic sampling distributions, verifying via simulations that the type I errors are reliable. On the other hand, GLRV16 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. use simulations to compute an empirical type I error. Uhler et al. [USF13] develop DP chi-squared tests and p-values for GWAS data, and derive the exact sampling distribution of their noisy statistic. Working under “Local Differential Privacy,” a stronger notion of privacy than DP, GR18 develop multinomial tests based on asymptotic distributions. Given a DP output, She17 and BRC17 develop significance tests for regression coefficients. Outside the hypothesis testing setting, there is some work on optimal population inference under DP. Duchi et al. [DJW18] give general techniques to derive minimax rates under local DP, and in particular give minimax optimal point estimates for the mean, median, generalized linear models, and nonparametric density estimation. Karwa and Vadhan [KV17] develop nearly optimal confidence intervals for normally distributed data with finite sample guarantees, which could potentially be inverted to give UMP-unbiased tests. Related work on developing optimal DP mechanisms for general loss functions such as GV16a and GRS09, give mechanisms that optimize symmetric convex loss functions, centered at a real statistic. Similarly, AS18 derive optimal mechanisms among the class of K-Norm Mechanisms. Our contributions The previous literature on DP hypothesis testing has a few characteristics in common: 1) nearly all of these proposed methods first add noise to the data, and perform their test as a post-processing procedure, 2) all of the hypothesis tests use either asymptotic distributions or simulations to derive approximate decision rules, and 3) while each procedure is derived intuitively based on classical theory, none show that they are optimal among all possible DP algorithms. In contrast, in this paper we search over all DP hypothesis tests at level α, deriving the uniformly most powerful (UMP) test for a population proportion. In Section 3, we show that arbitrary DP hypothesis tests, which report ‘Reject’ or ‘Fail to Reject’, can be written in terms of linear inequalities. In Theorem 3.2, we show that for exchangeable data, DP tests need only depend on the empirical distribution. We use this structure to find closed-form DP-UMP tests for simple hypotheses in Theorems 4.5 and 5.2, and extend these results to obtain one-sided DP-UMP tests in Corollary 5.3. These tests are closely tied to our proposed “Truncated-Uniform-Laplace” (Tulap) distribution, which extends both the discrete Laplace distribution (studied in GRS09), and the Staircase distribution of GV16a to the setting of (ϵ, δ)-DP. We prove that the Tulap distribution satisfies (ϵ, δ)-DP in Theorem 6.1. While the tests developed in the previous sections only resulted in the output ‘Reject’ or ‘Fail to Reject’, in Section 6, we show that our DP-UMP tests can be stated as a post-processing of a Tulap random variable. From this formulation, we obtain exact p-values via Theorem 6.2 and Algorithm 1 which agree with our DP-UMP tests. In Section 7, we show that our results apply to distribution-free hypothesis tests of continuous data. In Section 8, we verify through simulations that our UMP tests have exact type I error, and are more powerful than current techniques. 2 Background and notation We use capital letters to denote random variables and lowercase letters for particular values. For a random variable X, we denote FX as its cumulative distribution function (cdf), fX as either its probability density function (pdf) or probability mass function (pmf), depending on the context. For any set X , the n-fold cartesian product of X is X n = {(x1, x2, . . . , xn) | xi ∈X }. We denote elements of X n with an underscore to emphasize that they are vectors. The Hamming distance metric on X n is H : X n × X n →Z≥0, defined by H(x, x′) = #{i | xi ̸= x′ i}. Differential Privacy, introduced by DMNS06, provides a formal measure of disclosure risk. The notion of DP that we give in Definition 2.1 more closely resembles the formulation in WZ10, which uses the language of distributions rather than random mechanisms. It is important to emphasize that the notion of Differential Privacy in Definition 2.1 does not involve any distribution model on X n. Definition 2.1 (Differential Privacy: DMNS06, WZ10). Let ϵ > 0, δ ≥0, and n ∈{1, 2, . . .} be given. Let X be any set, and (Y , F) be a measurable space. Let P = {Px | x ∈X n} be a set of probability measures on (Y , F). We say that P satisfies (ϵ, δ)-Differential Privacy ((ϵ, δ) - DP) if for all B ∈F and all x, x′ ∈X n such that H(x, x′) = 1, we have Px(B) ≤eϵPx′(B) + δ. In Definition 2.1, we interpret x ∈X n as the database we collect, where X is the set of possible values that one individual can contribute, and Y ∼Px as the statistical result we report to the public. With this interpretation, if a set of distributions satisfies (ϵ, δ)-DP for small values of ϵ and δ, then if one person’s data is changed in the database, the distribution of Y does not change much. Ideally ϵ is 2 a small value less than 1, and δ ≪1 n allows us to disregard events which have small probability. We refer to (ϵ, 0)-DP as pure DP, and (ϵ, δ)-DP as approximate DP. The focus of this paper is to find uniformly most powerful (UMP) hypothesis tests, subject to DP. As the output of a DP method is necessarily a random variable, we work with randomized hypothesis tests, which we review in Definition 2.2. Our notation follows that of Sch96, Chapter 4. Definition 2.2 (Hypothesis Test). Let (X1, . . . , Xn) ∈X n be distributed Xi iid∼fθ, where θ ∈Θ. Let Θ0, Θ1 be a partition of Θ. A (randomized) test of H0 : θ ∈Θ0 versus H1 : θ ∈Θ1 is a measurable function φ : X n →[0, 1]. We say a test φ is at level α if supθ∈Θ0 Efθφ ≤α.The power of φ at θ is denoted βφ(θ) = Efθφ. Let Φ be a set of tests. We say that φ∗∈Φ is the uniformly most powerful level α (UMP-α) test among Φ for H0 : θ ∈Θ0 versus H1 : θ ∈Θ1 if 1) supθ∈Θ0 βφ∗(θ) ≤α and 2) for any φ ∈Φ such that supθ∈Θ0 βφ(θ) ≤α we have βφ∗(θ) ≥βφ(θ), for all θ ∈Θ1. In Definition 2.2, φ(x) is the probability of rejecting the null hypothesis, given that we observe x ∈X n. That is, the output of a test is either ‘Reject’, or ‘Fail to Reject’ with respective probabilities φ(x), and 1 −φ(x). While the condition of (ϵ, δ)-DP does not involve the randomness of X, for hypothesis testing, the level, and power of a test depend on the model for X. In Section 3, we study the set of hypothesis tests which satisfy (ϵ, δ)-DP. 3 Problem setup and exchangeability condition We begin this section by considering arbitrary hypothesis testing problems under DP. Let φ : X n → [0, 1] be any test. Since the only possible outputs of the mechanism are ‘Reject’ or ‘Fail to Reject’ with probabilities φ(x) and 1 −φ(x), the test φ satisfies (ϵ, δ)-DP if and only if for all x, x′ ∈X n such that H(x, x′) = 1, φ(x) ≤eϵφ(x′) + δ and (1 −φ(x)) ≤eϵ(1 −φ(x′)) + δ. (1) Remark 3.1. For any simple hypothesis test, where Φ0 and Φ1 are both singleton sets, the DP-UMP test φ∗is the solution to a linear program. If X is finite, this observation allows one to explore the structure of DP-UMP tests through numerical linear program solvers. Given the random vector X ∈X n, initially it may seem that we need to consider all φ, which are arbitrary functions of X. However, assuming that X is exchangeable, Theorem 3.2 below says that for any DP hypothesis tests, we need only consider tests which are functions of the empirical distribution of X. In other words, φ need not consider the order of the entries in X. This result is reminiscent of De Finetti’s Theorem (see Sch96, Theorem 1.48) in classical statistics. Theorem 3.2. Let Θ be a set and {µθ}θ∈Θ be a set of exchangeable distributions on X n. Let φ : X n →[0, 1] be a test satisfying (1). Then there exists φ′ : X n →[0, 1] satisfying (1) which only depends on the empirical distribution of X, such that R φ′(x) dµθ = R φ(x) dµθ, for all θ ∈Θ. Proof. Define φ′ by φ′(x) = 1 n! P π∈σ(n) φ(π(x)), where σ(n) is the symmetric group on n letters. For any π ∈σ(n), φ(π(x)) satisfies (ϵ, δ)-DP. By exchangeability, R φ(π(x)) dµθ = R φ(x) dµθ. Since condition 1 is closed under convex combinations, and integrals are linear, the result follows. We now state the particular problem which is the focus for the remainder of the paper, where each individual contributes a sensitive binary value to the database. Let X ∈{0, 1}n be a random vector, where Xi is the sensitive data of individual i. We model X as Xi iid∼Bern(θ), where θ is unknown. Then the statistic X = Pn i=1 Xi ∼Binom(n, θ) encodes the empirical distribution of X. By Theorem 3.2, we can restrict our attention to tests which are functions of X. Such tests φ : {0, 1, . . . , n} →[0, 1] satisfy (ϵ, δ) -DP if and only if for all x ∈{1, 2, . . . , n}, φ(x) ≤eϵφ(x −1) + δ (2) φ(x −1) ≤eϵφ(x) + δ (3) 3 (1 −φ(x)) ≤eϵ(1 −φ(x −1)) + δ (4) (1 −φ(x −1)) ≤eϵ(1 −φ(x)) + δ. (5) We denote the set of all tests which satisfy (2)-(5) as Dn ϵ,δ =  φ : φ satisfies (2)-(5) . Remark 3.3. For arbitrary DP hypothesis testing problems, the number of constraints generated by (1) could be very large, even infinite, but for our problem we only have 4n constraints. 4 Simple DP-UMP tests when δ = 0 In this section, we derive the DP-UMP test when δ = 0 for simple hypotheses. In particular, given n, ϵ > 0, α > 0, θ0 < θ1, and X ∼Binom(n, θ), we find the UMP test at level α among Dn ϵ,0 for testing H0 : θ = θ0 versus H1 : θ = θ1. Before developing these tests, we introduce the Truncated-Uniform-Laplace (Tulap) distribution, defined in Definition 4.1, which is central to all of our main results. To motivate this distribution, recall that GV16a show for general loss functions, adding discrete Laplace noise L ∼DLap(e−ϵ) to X is optimal under (ϵ, 0)-DP. For this reason, it is natural to consider a test which post-processes X + L. However, we know by classical UMP theory that since X + L is discrete, a randomized test is required. Instead of using a randomized test, by adding uniform noise U ∼Unif(−1/2, 1/2) to X + L, we obtain a continuous sampling distribution, from which a deterministic test is available. We call the distribution of (X + L + U) | X as Tulap(X, b, 0). The distribution Tulap(X, b, q) is obtained by truncating within the central (1 −q)th-quantiles of Tulap(X, b, 0). In Definition 4.1, we use the nearest integer function [·] : R →Z. For any real number t ∈R, [t] is defined to be the integer nearest to t. If there are two distinct integers which are nearest to t, we take [t] to be the even one. Note that, [−t] = −[t] for all t ∈R. Definition 4.1 (Truncated-Uniform-Laplace (Tulap)). Let N and N0 be real-valued random variables. Let m ∈R, b ∈(0, 1) and q ∈[0, 1). We say that N0 ∼Tulap(m, b, 0) and N ∼Tulap(m, b, q) if N0 and N have the following cdfs: FN0(x) = ( b−[x−m] 1+b b + (x −m −[x −m] + 1 2)(1 −b)  if x ≤[m] 1 −b[x−m] 1+b b + ([x −m] −(x −m) + 1 2)(1 −b)  if x > [m], FN(x) =      0 if FN0 < q/2 FN0(x)−q 2 1−q if q 2 ≤FN0(x) ≤1 −q 2 1 if FN0 > 1 −q 2. Note that a Tulap random variable Tulap(m, b, q) is continuous and symmetric about m. Remark 4.2. The Tulap distribution extends the staircase and discrete Laplace distributions as follows: Tulap(0, b, 0) d= Staircase(b, 1/2) and [Tulap(0, b, 0)] d= DLap(b), where Staircase(b, γ) is the distribution in GV16a. GV16a show that for a real valued statistic T and convex symmetric loss functions centered at T, the optimal noise distribution for ϵ-DP is Staircase(b, γ) for b = e−ϵ and some γ ∈(0, 1). If the statistic is a count, then GRS09 show that DLap(b) is optimal. Our results agree with these works when δ = 0, and extend them to the case of arbitrary δ. Now that we have defined the Tulap distribution, we are ready to develop the UMP test among Dn ϵ,0 for the simple hypotheses H0 : θ = θ0 versus H1 : θ = θ1. In classical statistics, the UMP for this test is given by the Neyman-Pearson lemma, however in the DP framework, our test must satisfy (2)-(5). Within these constraints, we follow the logic behind the Neyman-Pearson lemma as follows. Let φ ∈Dn ϵ,0. Thinking of φ(x) defined recursively, equations (2)-(5) give upper and lower bounds for φ(x) in terms of φ(x −1). Since θ1 > θ0, and binomial distributions have a monotone likelihood ratio (MLR) in X, larger values of X give more evidence for θ1 over θ0. Thus, φ(x) should be increasing in x as much as possible, subject to (2)-(5). Lemma 4.3 shows that taking φ(x) to be such a function is equivalent to having φ(x) be the cdf of a Tulap random variable. Lemma 4.3. Let ϵ > 0 be given. Let φ : {0, 1, 2, . . . , n} →(0, 1). The following are equivalent: 1) There exists m ∈(0, 1) such that φ(0) = m and φ(x) = min{eϵφ(x−1), 1−e−ϵ(1−φ(x−1))} for x = 1, . . . , n. 4 2) There exists m ∈(0, 1) such that φ(0) = m and for x = 1, . . . , n, φ(x) = ( eϵφ(x −1) if φ(x −1) ≤ 1 1+eϵ 1 −e−ϵ(1 −φ(x −1)) if φ(x −1) > 1 1+eϵ . 3) There exists m ∈R such that φ(x) = FN0(x −m) for x = 0, 1, 2, . . . , n, where N0 ∼ Tulap(0, b = e−ϵ, 0). Proof Sketch. First show that 1) and 2) are equivalent by checking which constraint is active. Then verify that FN0(x −m) satisfies the recurrence of 2). This can be done using the properties of the Tulap cdf, stated in Lemma 10.2, found in the Supplementary Material. While the form of 1) in Lemma 4.3 is intuitive, the connection to the Tulap cdf in 3) allows for a usable closed-form of the test. This connection with the Tulap distribution is crucial for the development in Section 6, which shows that the test in Lemma 4.3 can be achieved by post-processing X + N, where N is distributed as Tulap. It remains to show that the tests in Lemma 4.3 are in fact UMP among Dn ϵ,0. The main tool used to prove this is Lemma 4.4, which is a standard result in the classical hypothesis testing theory. Lemma 4.4. Let (X , F, µ) be a measure space and let f and g be two densities on X with respect to µ. Suppose that φ1, φ2 : X →[0, 1] are such that R φ1f dµ ≥ R φ2f dµ, and there exists k ≥0 such that φ1 ≥φ2 when g ≥kf and φ1 ≤φ2 when g < kf. Then R φ1g dµ ≥ R φ2g dµ. Proof. Note that (φ1 −φ2)(g −kf) ≥0 for almost all x ∈X (with respect to µ). This implies that R (φ1 −φ2)(g −kf) dµ ≥0. Hence, R φ1g dµ − R φ2g dµ ≥k R φ1f dµ − R φ2f dµ  ≥0. Next we present our key result, Theorem 4.5, which can be viewed as a ‘Neyman-Pearson lemma’ for binomial data under (ϵ, 0)-DP. We extend this result in Theorem 5.2 for (ϵ, δ)-DP. Theorem 4.5. Let ϵ > 0, α ∈(0, 1), 0 ≤θ0 < θ1 ≤1, and n ≥1 be given. Observe X ∼ Binom(n, θ), where θ is unknown. Set the decision rule φ∗: Z →[0, 1] by φ∗(x) = FN0(x −m), where N0 ∼Tulap(0, b = e−ϵ, 0) and m is chosen such that Eθ0φ∗(x) = α. Then φ∗is UMP-α test of H0 : θ = θ0 versus H1 : θ = θ1 among Dn ϵ,0. Proof Sketch. Let φ be any other test which satisfies (2)-(5) at level α. Then, since φ∗can be written in the form of 1) in Lemma 4.3, there exists y ∈Z such that φ∗(x) ≥φ(x) when x ≥y and φ∗(x) ≤φ(x) when x < y. By MLR of the binomial distribution and Lemma 4.4, we have βφ∗(θ1) ≥βφ(θ1). While the classical Neyman-Pearson lemma results in an acceptance and rejection region, the DPUMP always has some probability of rejecting the null, due to the constraints (2)-(5). As ϵ ↑∞, the DP-UMP converges to the non-private UMP. 5 Simple and one-sided DP-UMP tests when δ ≥0 In this section, we extend the results of Section 4 to allow for δ ≥0. We begin by proposing the form of the DP-UMP test for simple hypotheses. As in Section 4, the DP-UMP test is increasing in x as much as (2)-(5) allow. Lemma 5.1 states that such a test can be written as the cdf of a Tulap random variable, where the parameter q depends on ϵ and δ. We omit the proof of Theorem 5.2, which mimics the proof of Theorem 4.5. Lemma 5.1. Let ϵ > 0 and δ ≥0 be given and set b = e−ϵ and q = 2δb 1−b+2δb. Let φ : {0, 1, 2, . . . , n} →[0, 1]. The following are equivalent: 1) There exists y ∈{0, 1, 2, . . . , n} and m ∈(0, 1) such that φ(x) =    0 if x < y m if x = y min{eϵφ(x −1) + δ, 1 −e−ϵ(1 −φ(x −1)) + e−ϵδ, 1} if x > y. 5 2) There exists y ∈{0, 1, 2, . . . , n} and m ∈(0, 1) such that φ(x) =              0 if x < y m if x = y eϵφ(x −1) + δ if x > y and φ(x −1) ≤ 1−δ 1+eϵ 1 −e−ϵ(1 −φ(x −1)) + e−ϵδ if x > y and 1−δ 1+eϵ ≤φ(x −1) ≤1 −δ 1 if x > y and φ(x −1) > 1 −δ. 3) There exists m ∈R such that φ(x) = FN(x −m) where N ∼Tulap(0, b, q). Proof Sketch. The equivalence of 1) and 2) only requires determining which constraints are active. To show the equivalence of 2 and 3, we verify that FN(x −m) satisfies the recurrence of 2), using the expression of FN(x) in terms of FN0(x) given in Definition 4.1, and the results of Lemma 4.3. Theorem 5.2. Let ϵ > 0, δ ≥0, α ∈(0, 1), 0 ≤θ0 < θ1 ≤1, and n ≥1 be given. Observe X ∼Binom(n, θ), where θ is unknown. Set b = e−ϵ and q = 2δb 1−b+2δb. Define φ∗: Z →[0, 1] by φ∗(x) = FN(x −m) where N ∼Tulap(0, b, q) and m is chosen such that Eθ0φ∗(x) = α. Then φ∗ is UMP-α test of H0 : θ = θ0 versus H1 : θ = θ1 among Dn ϵ,δ. So far we have focused on simple hypothesis tests, but since our test only depends on θ0, and not on θ1, our test is in fact the DP-UMP for one-sided tests, as stated in Corollary 5.3. Corollary 5.3 also shows that we can use our tests to build DP-UMP tests for H0 : θ ≥θ0 versus H1 : θ < θ0 as well. Hence, Corollary 5.3 is our most general result so far, containing Theorems 4.5 and 5.2 as special cases. Corollary 5.3. Let X ∼Binom(n, θ). Set φ∗(x) = FN(x −m1) and ψ∗(x) = 1 −FN(x −m2), where N ∼Tulap  0, b = e−ϵ, q = 2δb 1−b+2δb  and m1, m2 are chosen such that Eθ0φ∗(x) = α and Eθ0ψ∗(x) = α. Then φ∗(x) is UMP-α among Dn ϵ,δ for testing H0 : θ ≤θ0 versus H1 : θ > θ0, and ψ∗(x) is UMP-α among Dn ϵ,δ for testing H0 : θ ≥θ0 versus H1 : θ < θ0. 6 Optimal one-sided private p-values For the DP-UMP tests developed in Sections 4 and 5, the output is simply to ‘Reject’ or ‘Fail to Reject’ H0. In scientific research, however, p-values are often used to weigh the evidence in favor of the alternative hypothesis over the null. Informally, a p-value is the smallest level α, for which a test outputs ‘Reject’. A more formal definition is given in Definition 10.4, in the Supplementary Material. In this section, we show that our proposed DP-UMP tests can be achieved by post-processing a Tulap random variable. Using this, we develop a differentially private algorithm for releasing a private p-value which agrees with the DP-UMP tests in Sections 4 and 5. While we state our p-values for one-sided tests, they also apply to simple tests as a special case. Since our DP-UMP test from Theorem 5.2 rejects with probability φ∗(x) = FN(x −m), given N ∼FN, φ∗(x) rejects the null if and only if X + N ≥m. So, our DP-UMP tests can be stated as a post-processing of X + N. Theorem 6.1 states that releasing X + N satisfies (ϵ, δ)-DP. By the post-processing property of DP (see DR14, Proposition 2.1), once we release X + N, any function of X + N also satisfies (ϵ, δ)-DP. Thus, we can compute our private UMP-α tests as a function of X + N for any α. The smallest α for which we reject the null is the p-value for that test. In fact Algorithm 1 and Theorem 6.2 give a more elegant method of computing this p-value. Theorem 6.1. Let X be any set, and T : X n →Z, with ∆(T) = sup |T(x) −T(x′)| = 1, where the supremum is over the set {(x, x′) ∈X n × X n | H(x, x′) = 1}. Then the set of distributions n Tulap  T(x), b = e−ϵ, 2δb 1−b+2δb  x ∈X no satisfies (ϵ, δ)-DP. Proof Sketch. Since Tulap random variables are continuous and have MLR in T(x), by Lemma 10.3 in the Supplementary Material, it suffices to show that for all t ∈R, the cdf of a Tulap random variable FN(t −T(x)) satisfies (1), with φ(x) replaced with FN(t −T(x)). This already established in Lemma 5.1, by the equivalence of 1) and 3). 6 Theorem 6.2. Let ϵ > 0, δ ≥0, X ∼Binom(n, θ) where θ is unknown, and Z|X ∼Tulap(X, b = e−ϵ, q = 2δb 1−b+2δb). Then 1) p(θ0, Z) := P(X + N ≥Z | Z) is a p-value for H0 : θ ≤θ0 versus H1 : θ > θ0, where the probability is over X ∼Binom(n, θ0) and N ∼Tulap(0, b, q). 2) Let 0 < α < 1 be given. The test φ∗(x) = PZ∼Tulap(x,b,q)(p(θ0, Z) ≤α | X) is UMP-α for H0 : θ ≤θ0 versus H1 : θ > θ0 among Dn ϵ,δ. 3) The output of Algorithm 1 is equal to p(θ0, Z). It follows from Theorem 6.2 that p(θ0, Z) is the stochastically smallest possible p-value for the hypothesis test H0 : θ ≤θ0 versus H1 : θ > θ0 under (ϵ, δ)-DP. Note that 1 −p(θ0, Z) = P(X + N ≤Z | Z) is the p-value for H0 : θ ≥θ0 versus H1 : θ < θ0, which agrees with the UMP-α test in Corollary 5.3. Algorithm 1 UMP one-sided p-value for binomial data under (ϵ, δ)-DP INPUT: n ∈N, θ0 ∈(0, 1), ϵ > 0, δ ≥0, Z ∼Tulap  X, b = e−ϵ, q = 2δb 1−b+2δb  , 1: Set FN as the cdf of N ∼Tulap(0, b, q) 2: Set F = (FN(0 −Z), FN(1 −Z), . . . , FN(n −Z))⊤ 3: Set B = ( n 0  θ0 0(1 −θ0)n−0, n 1  θ1 0(1 −θ0)n−1, . . . , n n  θn 0 (1 −θ0)n−n)⊤ OUTPUT: F ⊤B To implement Algorithm 1, we must be able to sample a Tulap random variable, which Algorithm 2 provides. The algorithm is based on the expression of Tulap(m, b, 0) in terms of geometric and uniform variables, and uses rejection sampling when q > 0 (see Bis06, Chapter 11 for an introduction to rejection sampling). A detailed proof that the output of this algorithm follows the correct distribution can be found in Lemma 10.1 in the Supplementary Material. Algorithm 2 Sample from Tulap distribution: N ∼Tulap(m, b, q) INPUT: m ∈R, b ∈(0, 1), q ∈[0, 1). 1: Draw G1, G2 iid ∼Geom(1 −b) and U ∼Unif(−1/2, 1/2) 2: Set N = G1 −G2 + U + m 3: If FN0(N) < q/2 or FN0(N) > 1 −q/2, where N0 ∼Tulap(m, b, 0), go to 1: OUTPUT: N Remark 6.3. Since we know that releasing X + N, where N is a Tulap random variable, satisfies (ϵ, δ)-DP, we can compute more than just p-values by post-processing X + N. We can also compute point estimates for θ, derive posterior distribution of θ given a prior, and compute confidence intervals for θ as post-processing of X + N. In the full version of this paper, we will study each of these objectives, and connect confidence intervals with the DP-UMP tests derived here. Remark 6.4. One may wonder about the asymptotic properties of the DP-UMP test. It is not hard to show that for any fixed ϵ > 0, δ, and θ0 ∈(0, 1), our proposed DP-UMP test has asymptotic relative efficiency (ARE) of 1, relative to the non-private UMP test (see vdV00, Section 14.3 for an introduction to ARE). Let X ∼Binom(n, θ0). Define the two test statistics as T1 = X and T2 = X + N, where N ∼Tulap(0, b, q). The ARE of the DP-UMP relative to the non-private UMP test is (C2/C1)2, where Ci = lim n→∞  d dθEθTi θ=θ0  .p n Varθ0(Ti), for i = 1, 2. We compute EθTi = nθ, Varθ0(T1) = nθ0(1 −θ0), and Varθ0(T2) = nθ0(1 −θ0) + Var(N). Since Var(N) is a constant, we have that C1 = C2 = (θ0(1 −θ0))−1/2. 7 Application to distribution-free inference In this section, we show how our DP-UMP tests for count data can be used to test certain hypotheses for continuous data. In particular, we give a DP version of the sign and median test allowing one to test the median of either paired or independent samples. For an introduction to the sign and median tests, see Sections 5.4 and 6.4 of GC14. Let ϵ > 0 and δ ∈[0, 1) be given, and let N ∼Tulap(0, b, q) for b = e−ϵ and q = 2δb 1−b−2δb. 7 Sign test: We observe n iid pairs (Xi, Yi) for i = 1, . . . , n. Then for all i = 1, . . . , n, Xi d= X and Yi d= Y for some random variables X and Y . We assume that for any pair (Xi, Yi) we can determine if Xi > Yi or not. For simplicity, we also assume that there are no pairs with Xi = Yi. Denote the unknown probability θ = P(X > Y ). We want to test a hypothesis such as H0 : θ ≤θ0 versus H1 : θ > θ0. The sign test uses the test statistic T = #{Xi > Yi}. Since the sensitivity of T is 1, by Theorem 6.1, T + N satisfies (ϵ, δ)-DP. Note that the test statistic is distributed as T ∼Binom(n, θ). Using Algorithm 1, we obtain a private p-value for the sign test as a post-processing of T + N. Median test: We observe two independent sets of iid data {Xi}n i=1 and {Yi}n i=1, where all Xi and Yi are distinct values, and we have a total ordering on these values. Then there exists random variables X and Y such that Xi d= X and Yi d= Y for all i. We want to test H0 : median(X) ≤ median(Y ) versus H1 : median(X) > median(Y ). The median test uses the test statistic T = #{i | rank(Xi) > n}, where rank(Xi) = #{Xj ≤Xi} + #{Yj ≤Xi}. Since the sensitivity of T is 1, by Theorem 6.1, T + N satisfies (ϵ, δ)-DP. When median(X) = median(Y ), T ∼ HyperGeom(n = n, m = n, k = n). Using Algorithm 1, with B replaced with the pmf of HyperGeom(n = n, m = n, k = n), we obtain a private p-value for the median test as a postprocessing of T + N. 8 Simulations In this section, we study both the empirical power and the empirical type I error of our DP-UMP test against the normal approximation proposed by VS09. We define the empirical power to be the proportion of times a test ‘Rejects’ when the alternative is true, and the empirical type I error as the proportion of times a test ‘Rejects’ when the null is true. For our simulations, we focus on small samples as the noise introduced by DP methods is most impactful in this setting. In Figure 1, we plot the empirical power of our UMP test, the Normal Approximation from VS09, and the non-private UMP. For each n, we generate 10,000 samples from Binom(n, .95). We privatize each X by adding N ∼Tulap(0, e−ϵ, 0) for the DP-UMP and L ∼Lap(1/ϵ) for the Normal Approximation. We compute the UMP p-value via Algorithm 1 and the approximate p-value for X+L, using the cdf of N X, n/4 + 2/ϵ2 . The empirical power is given by (10000)−1#{p-value< .05}. The DP-UMP test indeed gives higher power compared to the Normal Approximation, but the approximation does not lose too much power. Next we see that type I error is another issue. In Figure 2 we plot the empirical type I error of the DP-UMP and the Normal Approximation tests. We fix ϵ = 1 and δ = 0, and vary θ0. For each θ0, we generate 100,000 samples from Binom(30, θ0). For each sample, we compute the DP-UMP and Normal Approximation tests at type I error α = .05. We plot the proportion of times we reject the null as well as moving average curves. The DP-UMP, which is provably at type I error α = .05 achieves type I error very close to .05, but the Normal Approximation has a higher type I error for small values of θ0, and a lower type I error for large values of θ0. 9 Discussion and future directions In this paper, we derived uniformly most powerful simple and one-sided tests for binary data among all DP α-level tests. Previously, while various hypothesis tests under DP have been proposed, none have satisfied such an optimality criterion. While our initial DP-UMP tests only output ‘Reject’ or ‘Fail to Reject’, we showed that they can be achieved by post-processing a noisy sufficient statistic. This allows us to produce private p-values which agree with the DP-UMP tests. Our results can also be applied to obtain p-values for distribution-free tests, to test some hypotheses about continuous data under DP. A simple, yet fundamental observation that underlies our results is that DP tests can be written in terms of linear constraints. This idea alone allows for a new perspective on DP hypothesis testing, which is particularly applicable to other discrete problems, such as multinomial models or difference of population proportions. Stating the problem in this form allows for the consideration of all possible DP tests, and allows the exploration of UMP tests through numerical linear program solvers. While the focus of this work is on hypothesis testing, these results can also be applied to obtain optimal length confidence intervals for binomial data. In fact, classical statistical theory establishes a 8 0.2 0.4 0.6 0.8 1.0 n empirical power 16 32 64 128 256 512 G G G G G G G DP UMP DP Normal Approximation Non−private UMP Figure 1: Empirical power for UMP and Normal Approximation tests for H0 : θ ≤.9 versus H1 : θ ≥.9. The true value is θ = .95. ϵ = 1 and δ = 0. n varies along the x-axis. 0.040 0.045 0.050 0.055 0.060 theta empirical type I error 0.05 0.15 0.25 0.35 0.45 0.55 0.65 0.75 0.85 0.95 G G G G G G G G G G G G G G G G G G G G UMP Normal Approximation Figure 2: Empirical type I error α for UMP and Normal Approximation tests for H0 : θ ≤θ0 versus H1 : θ ≥θ0. θ0 varies along the x-axis. n = 30, ϵ = 1, and δ = 0. Target is α = .05. connection between UMP tests and Uniformly Most Accurate (UMA) confidence intervals. Besides confidence intervals, the p-value function for the test H0 : θ ≥θ0 versus H1 : θ < θ0 is a cdf which generates a confidence distribution; see XS13 for a review. Since this p-value corresponds to the DP-UMP test, this confidence distribution is stochastically more concentrated about the true θ, than any other private confidence distribution. In the full paper, we plan to explore confidence intervals and confidence distributions in detail, establishing connections between our approach here and optimal inference in these settings. We showed that for exchangeable data, DP tests need only depend on the empirical distribution. For binary data, the empirical distribution is equivalent to the sample sum, which is a complete sufficient statistic for the binomial model. However, in general it is not clear whether optimal DP tests are always a function of complete sufficient statistics as is the case for classical UMP tests. It would be worth investigating whether there is a notion of sufficiency which applies for DP tests. When δ = 0, our optimal noise adding mechanism, the proposed Tulap distribution, is related to the discrete Laplace distribution, which GRS09 and GV16a also found is optimal for a general class of loss functions. For δ > 0, a truncated discrete Laplace distribution is optimal for our problem. Little previous work has looked into optimal noise adding mechanisms for approximate DP. GV16b studied this problem to some extent, but did not explore truncated Laplace distributions. Steinke [Ste18] proposes that truncated Laplace can be viewed as the canonical distribution for approximate DP in a way that Laplace is canonical for pure DP. Further exploration in the use of truncated Laplace distributions in the approximate DP setting may be of interest. Acknowledgements We would like to thank Vishesh Karwa and Matthew Reimherr for helpful discussions and feedback on previous drafts. We also thank the reviewers for their helpful comments and suggestions, which have contributed to many improvements in the presentation of this work. This work is supported in part by NSF Award No. SES-1534433 to The Pennsylvania State University. References [AS18] Jordan Awan and Aleksandra Slavkovi´c. Structure and sensitivity in differential privacy: Comparing k-norm mechanisms. ArXiv e-prints, January 2018. Under Review. 9 [Bis06] Christopher M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. [BRC17] A. Barrientos, A. Reiter, J.and Machanavajjhala, and Y. Chen. Differentially private significance tests for regression coefficients. ArXiv e-prints, May 2017. [CB02] G. Casella and R.L. Berger. Statistical Inference. Duxbury advanced series in statistics and decision sciences. Thomson Learning, 2002. [DJW18] John C. Duchi, Michael I. Jordan, and Martin J. Wainwright. Minimax optimal procedures for locally private estimation. Journal of the American Statistical Association, 113(521):182–201, 2018. [DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating Noise to Sensitivity in Private Data Analysis, pages 265–284. Springer Berlin Heidelberg, Berlin, Heidelberg, 2006. [DR14] Cynthia Dwork and Aaron Roth. The algorithmic foundations of differential privacy. Foundations and Trends in Theoretical Computer Science, 9:211–407, August 2014. [GC14] J.D. Gibbons and S. Chakraborti. Nonparametric Statistical Inference, Fourth Edition: Revised and Expanded. Taylor & Francis, 2014. [GLRV16] Marco Gaboardi, Hyun Lim, Ryan Rogers, and Salil Vadhan. Differentially private chi-squared hypothesis testing: Goodness of fit and independence testing. In Maria Florina Balcan and Kilian Q. Weinberger, editors, Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 2111–2120, New York, New York, USA, 20–22 Jun 2016. PMLR. [GR18] Marco Gaboardi and Ryan Rogers. Local private hypothesis testing: Chi-square tests. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 1626–1635, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. [GRS09] Arpita Ghosh, Tim Roughgarden, and Mukund Sundararajan. Universally utilitymaximizing privacy mechanisms. In Proceedings of the Forty-first Annual ACM Symposium on Theory of Computing, STOC ’09, pages 351–360, New York, NY, USA, 2009. ACM. [GV16a] Quan Geng and Pramod Viswanath. The optimal noise-adding mechanism in differential privacy. IEEE Transactions on Information Theory, 62(2):925–951, 2 2016. [GV16b] Quan Geng and Pramod Viswanath. Optimal noise adding mechanisms for approximate differential privacy. IEEE Trans. Information Theory, 62(2):952–969, 2016. [IK06] Seidu Inusah and Tomasz J. Kozubowski. A discrete analogue of the laplace distribution. Journal of Statistical Planning and Inference, 136(3):1090 – 1102, 2006. [KV17] Vishesh Karwa and Salil P. Vadhan. Finite sample differentially private confidence intervals. CoRR, abs/1711.03908, 2017. [Sch96] M.J. Schervish. Theory of Statistics. Springer Series in Statistics. Springer New York, 1996. [She17] Or Sheffet. Differentially private ordinary least squares. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 3105–3114, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. [Sol14] Eftychia Solea. Differentially private hypothesis testing for normal random variables. Master’s thesis, The Pennsylvania State University, May 2014. [Ste18] Thomas Steinke. Private correspondence, 2018. 10 [USF13] Caroline Uhler, Aleksandra Slavkovi´c, and Stephen Fienberg. Privacy-preserving data sharing for genome-wide association studies". Journal of Privacy and Confidentiality, 5, 2013. [vdV00] A.W. van der Vaart. Asymptotic Statistics. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2000. [VS09] Duy Vu and Aleksandra Slavkovi´c. Differential privacy for clinical trial data: Preliminary evaluations. In Proceedings of the 2009 IEEE International Conference on Data Mining Workshops, ICDMW ’09, pages 138–143, Washington, DC, USA, 2009. IEEE Computer Society. [WLK15] Y. Wang, J. Lee, and D. Kifer. Revisiting Differentially Private Hypothesis Tests for Categorical Data. ArXiv e-prints, November 2015. [WZ10] Larry Wasserman and Shuheng Zhou. A statistical framework for differential privacy. JASA, 105:489:375–389, 2010. [XS13] Min-ge Xie and Kesar Singh. Confidence distribution, the frequentist distribution estimator of a parameter: A review. International Statistical Review, 81(1):3–39, 2013. 11
2018
182
7,344
Bayesian Alignments of Warped Multi-Output Gaussian Processes Markus Kaiser Siemens AG Technical University of Munich markus.kaiser@siemens.com Clemens Otte Siemens AG clemens.otte@siemens.com Thomas Runkler Siemens AG Technical University of Munich thomas.runkler@siemens.com Carl Henrik Ek University of Bristol carlhenrik.ek@bristol.ac.uk Abstract We propose a novel Bayesian approach to modelling nonlinear alignments of time series based on latent shared information. We apply the method to the real-world problem of finding common structure in the sensor data of wind turbines introduced by the underlying latent and turbulent wind field. The proposed model allows for both arbitrary alignments of the inputs and non-parametric output warpings to transform the observations. This gives rise to multiple deep Gaussian process models connected via latent generating processes. We present an efficient variational approximation based on nested variational compression and show how the model can be used to extract shared information between dependent time series, recovering an interpretable functional decomposition of the learning problem. We show results for an artificial data set and real-world data of two wind turbines. 1 Introduction Many real-world systems are inherently hierarchical and connected. Ideally, a machine learning method should model and recognize such dependencies. Take wind power production, which is one of the major providers for renewable energy today, as an example: To optimize the efficiency of a wind turbine the speed and pitch have to be controlled according to the local wind conditions (speed and direction). In a wind farm turbines are typically equipped with sensors for wind speed and direction. The goal is to use these sensor data to produce accurate estimates and forecasts of the wind conditions at every turbine in the farm. For the ideal case of a homogeneous and very slowly changing wind field, the wind conditions at each geometrical position in a wind farm can be estimated using the propagation times (time warps) computed from geometry, wind speed, and direction [21, 4, 18]. In the real world, however, wind fields are not homogeneous, exhibit global and local turbulences, and interfere with the turbines and the terrain inside and outside the farm and further, sensor faults may lead to data loss. This makes it extremely difficult to construct accurate analytical models of wind propagation in a farm. Also, standard approaches for extracting such information from data, e.g. generalized time warping [24], fail at this task because they rely on a high signal to noise ratio. Instead, we want to construct Bayesian nonlinear dynamic data based models for wind conditions and warpings which handle the stochastic nature of the system in a principled manner. In this paper, we look at a generalization of this type of problem and propose a novel Bayesian approach to finding nonlinear alignments of time series based on latent shared information. We view the power production of different wind turbines as the outputs of a multi-output Gaussian process 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. (MO-GP) [1] which models the latent wind fronts. We embed this model in a hierarchy, adding a layer of non-linear alignments on top and a layer of non-linear warpings [19, 14] below which increases flexibility and encodes the original generative process. We show how the resulting model can be interpreted as a group of deep Gaussian processes with the added benefit of covariances between different outputs. The imposed structure is used to formulate prior knowledge in a principled manner, restrict the representational power to physically plausible models and recover the desired latent wind fronts and relative alignments. The presented model can be interpreted as a group of D deep GPs all of which share one layer which is a MO-GP. This MO-GP acts as an interface to share information between the different GPs which are otherwise conditionally independent. The paper has the following contributions: In Section 2, we propose a hierarchical, warped and aligned multi-output Gaussian process (AMO-GP). In Section 3, we present an efficient learning scheme via an approximation to the marginal likelihood which allows us to fully exploit the regularization provided by our structure, yielding highly interpretable results. We show these properties for an artificial data set and for real-world data of two wind turbines in Section 4. 2 Model Definition We are interested in formulating shared priors over a set of functions {fd}D d=1 using GPs, thereby directly parameterizing their interdependencies. In a traditional GP setting, multiple outputs are considered conditionally independent given the inputs, which significantly reduces the computational cost but also prevents the utilization of shared information. Such interdependencies can be formulated via convolution processes (CPs) as proposed by Boyle and Frean [5], a generalization of the linear model of coregionalization (LMC) [13, 7]. In the CP framework, the output functions are the result of a convolution of the latent processes wr with smoothing kernel functions Td,r for each output fd, defined as fd(x) = R X r=1 Z Td,r(x −z) · wr(z) dz. (1) In this model, the convolutions of the latent processes generating the different outputs are all performed around the same point x. We generalize this by allowing different alignments of the observations which depend on the position in the input space. This allows us to model the changing relative interaction times for the different latent wind fronts as described in the introduction. We also assume that the dependent functions fd are latent themselves and the data we observe is generated via independent noisy nonlinear transformations of their values. Every function fd is augmented with an alignment function ad and a warping gd on which we place independent GP priors. For simplicity, we assume that the outputs are evaluated all at the same positions X = {xn}N n=1. This can easily be generalized to different input sets for every output. In our application, the xn are one-dimensional time indices. However, since the model can be generalized to multi-dimensional inputs, we do not restrict ourselves to the one-dimensional case. We note that in the multi-dimensional case, reasoning about priors on alignments can be challenging. We call the observations associated with the d-th function yd and use the stacked vector y = (y1, . . . , yD) to collect the data of all outputs. The final model is then given by yd = gd(fd(ad(X))) + ϵd, (2) where ϵd ∼N(0, σ2 y,dI) is a noise term. The functions are applied element-wise. This encodes the generative process described above: For every turbine yd, observations at positions X are generated by first aligning to the latent wind fronts using ad, applying the front in fd, imposing turbine-specific components gd and adding noise in ϵd. We assume independence between ad and gd across outputs and apply GP priors of the form ad ∼ GP(id, ka,d) and gd ∼GP(id, kg,d). By setting the prior mean to the identity function id(x) = x, the standard CP model is our default assumption. During learning, the model can choose the different ad and gd in a way to reveal the independent shared latent processes {wr}R r=1 on which we also place GP priors wr ∼GP(0, ku,r). Similar to Boyle and Frean [5], we assume the latent processes to be independent white noise processes by setting cov[wr(z), wr′(z′)] = δrr′δzz′. Under this prior, the fd are also GPs with zero mean and cov[fd(x), fd′(x′)] = PR r=1 R Td,r(x −z)Td′,r(x′ −z) dz. 2 ma d mf d mg d Xd ad fd gd yd Xd′ ad′ fd′ gd′ yd′ ma d′ mf d′ mg d′ w1 ... wR 0 1 0 1 X a 0 1 0 1 X a 0 1 -1 1 a f -1 1 -1 1 f g1 -1 1 -1 1 f g2 0 1 -1 1 X y1 0 1 -1 1 X y2 Figure 1: The graphical model of AMO-GP with variational parameters (blue). A CP, informed by R latent processes, models shared information between multiple data sets with nonlinear alignments and warpings. This CP connects multiple deep GPs through a shared layer. Figure 2: An artificial example of hierarchical composite data with multiple observations of shared latent information. This hierarchy generates two data sets using a dampened sine function which is never observed directly. Using the squared exponential kernel for all Td,r, the integral can be shown to have a closed form solution. With {σd,r, ℓd,r} denoting the kernel hyper parameters associated with Td,r, it is given by cov[fd(x), fd′(x′)] = R X r=1 (2π) K 2 σd,rσd′,r QK k=1 ˆℓ −1 d,d′,r,k exp −1 2 K X k=1 (xk −x′ k)2 ˆℓ2 d,d′,r,k ! , (3) where x is K-dimensional and ˆℓd,d′,r,k = q ℓ2 d,r,k + ℓ2 d′,r,k. 3 Variational Approximation Since exact inference in this model is intractable, we present a variational approximation to the model’s marginal likelihood in this section. A detailed derivation of the variational bound can be found in Appendix A. Analogously to y, we denote the random vectors which contain the function values of the respective functions and outputs as a and f. The joint probability distribution of the data can then be written as p(y, f, a | X) = p(f | a) D Y d=1 p(yd | fd) p(ad | X), ad | X ∼N(X, Ka,d + σ2 a,dI), f | a ∼N(0, Kf + σ2 fI), yd | fd ∼N(fd, Kg,d + σ2 y,dI). (4) Here, we use K to refer to the Gram matrices corresponding to the respective GPs. All but the convolution processes factorize over the different levels of the model as well as the different outputs. 3.1 Variational Lower Bound To approximate a single deep GP, that is a single string of GPs stacked on top of each other, Hensman and Lawrence [11] proposed nested variational compression in which every GP in the hierarchy is handled independently. In order to arrive at their lower bound they make two variational approximations. First, they consider a variational approximation q(ˆa, u) = p(ˆa | u) q(u) to the true posterior of a single GP first introduced by Titsias [22]. In this approximation, the original model is augmented with inducing variables u together with their inducing points Z which are assumed to 3 be latent observations of the same function and are thus jointly Gaussian with the observed data. In contrast to [22], the distribution q(u) is not chosen optimally but optimized using the closed form q(u) ∼N(u | m, S). This gives rise to the Scalable Variational GP presented in [10]. Second, in order to apply this variational bound for the individual GPs recursively, uncertainties have to be propagated through subsequent layers and inter-layer cross-dependencies are avoided using another variational approximation. The variational lower bound for the AMO-GP is given by log p(y | X, Z, u) ≥ D X d=1 log N  yd Ψg,dK −1 ug,dug,dmg,d, σ2 y,dI  − D X d=1 1 2σ2 a,d tr(Σa,d) − 1 2σ2 f  ψf −tr  ΦfK −1 uf uf  − D X d=1 1 2σ2 y,d  ψg,d −tr  Φg,dK −1 ug,dug,d  − D X d=1 KL(q(ua,d) ∥p(ua,d)) −KL(q(uf) ∥p(uf)) − D X d=1 KL(q(uy,d) ∥p(uy,d)) − 1 2σ2 f tr Φf −Ψ T fΨf  K −1 uf uf mfm T f + Sf  K −1 uf uf  − D X d=1 1 2σ2 y,d tr Φg,d −Ψ T g,dΨg,d  K −1 ug,dug,d mg,dm T g,d + Sg,d  K −1 ug,dug,d  , (5) where KL denotes the KL-divergence. A detailed derivation can be found in Appendix A. The bound contains one Gaussian fit term per output dimension and a series of regularization terms for every GP in the hierarchy. The KL-divergences connect the variational approximations to the prior and the different trace terms regularize the variances of the different GPs (for a detailed discussion see [11]). This bound depends on the hyper parameters of the kernel and likelihood {ℓ, σ} and the variational parameters {Zl,d, ml,d, Sl,d | l ∈{a, f, d}, d ∈[D]}. The bound can be calculated in O(NM 2) time and factorizes along the data points which enables stochastic optimization. Since every of the N data points is associated with one of the D outputs, the computational cost of the model is independent of D. Information is only shared between the different outputs using the inducing points in f. As the different outputs share a common function, increasing D allows us to reduce the number of variational parameters per output, because the shared function can still be represented completely. A central component of this bound are expectations over kernel matrices, the three Ψ-statistics ψf = Eq(a)[tr(Kff)], Ψf = Eq(a)[Kfu] and Φf = Eq(a)[KufKfu]. Closed form solutions for these statistics depend on the choice of kernel and are known for specific kernels, such as linear or RBF kernels, for example shown in [8]. In the following subsection we will give closed form solutions for these statistics required in the shared CP-layer of our model. 3.2 Convolution Kernel Expectations The uncertainty about the first layer is captured by the variational distribution of the latent alignments a given by q(a) ∼N(µa, Σa). Every aligned point in a corresponds to one output of f and ultimately to one of the yd. Since the closed form of the multi output kernel depends on the choice of outputs, we will use the notation ˆf(an) to denote fd(an) such that an is associated with output d. For simplicity, we only consider one single latent process wr. Since the latent processes are independent, the results can easily be generalized to multiple processes. Then, ψf is given by ψf = Eq(a)[tr(Kff)] = N X n=1 ˆσ2 nn. (6) Similar to the notation ˆf(·), we use the notation ˆσnn′ to mean the variance term associated with the covariance function cov[ ˆf(an), ˆf(an′)] as shown in (3). The expectation Ψf = Eq(a)[Kfu] 4 connecting the alignments and the pseudo inputs is given by Ψf = Eq(a)[Kfu], with (Ψf)ni = ˆσ2 ni s (Σa)−1 nn ˆℓni + (Σa)−1 nn exp −1 2 (Σa) −1 nnˆℓni (Σa)−1 nn + ˆℓni ((µa)n −Zi)2 ! , (7) where ˆℓni is the combined length scale corresponding to the same kernel as ˆσni. Lastly, Φf = Eq(a)[KufKfu] connects alignments and pairs of pseudo inputs with the closed form Φf = Eq(a)[KufKfu], with (Φf)ij = N X n=1 ˆσ2 niˆσ2 nj s (Σa)−1 nn ˆℓni + ˆℓnj + (Σa)−1 nn exp  −1 2 ˆℓniˆℓnj ˆℓni + ˆℓnj (Zi −Zj)2 −1 2 (Σa) −1 nn(ˆℓni + ˆℓnj) (Σa)−1 nn + ˆℓni + ˆℓnj (µa)n − ˆℓniZi + ˆℓnjZj ˆℓni + ˆℓnj !2 . (8) The Ψ-statistics factorize along the data and we only need to consider the diagonal entries of Σa. If all the data belong to the same output, the Ψ-statistics of the squared exponential kernel can be recovered as a special case. This case is used for the output-specific warpings g. 3.3 Model Interpretation The graphical model shown in Figure 1 illustrates that the presented model can be interpreted as a group of D deep GPs all of which share one layer which is a CP. This CP acts as an interface to share information between the different GPs which are otherwise conditionally independent. This modelling-choice introduces a new quality to the model when compared to standard deep GPs with multiple output dimensions, since the latter are not able in principle to learn dependencies between the different outputs. Compared to standard multi-output GPs, the AMO-GP introduces more flexibility with respect to the shared information. CPs make strong assumptions about the relative alignments of the different outputs, that is, they assume constant time-offsets. The AMO-GP extends this by introducing a principled Bayesian treatment of general nonlinear alignments ad on which we can place informative priors derived from the problem at hand. Together with the warping layers gd, our model can learn to share knowledge in an informative latent space learnt from the data. Alternatively, this model can be interpreted as a shared and warped latent variable model with a very specific prior: The indices X are part of the prior for the latent space ad(X) and specify a sense of order for the different data points y which is augmented with uncertainty by the alignment functions. Using this order, the convolution processes enforce the covariance structure for the different datapoints specified by the smoothing kernels. In order to derive an inference scheme, we need the ability to propagate uncertainties about the correct alignments and latent shared information through subsequent layers. We adapted the approach of nested variational compression by Hensman and Lawrence [11], which is originally concerned with a single deep GP. The approximation is expanded to handle multiple GPs at once, yielding the bound in (5). The bound reflects the dependencies of the different outputs as the sharing of information between the different deep GPs is approximated through the shared inducing variables uf,d. Our main contribution for the inference scheme is the derivation of a closed-form solution for the Ψ-statistics of the convolution kernel in (6) to (8). 4 Experiments In this section we show how to apply the AMO-GP to the task of finding common structure in time series observations. In this setting, we observe multiple time series Td = (Xd, yd) and assume that there exist latent time series which determine the observations. We will first apply the AMO-GP to an artificial data set in which we define a decomposed system of dependent time series by specifying a shared latent function generating the observations together 5 0 1 -1 1 f 0 1 -1 1 X X y1 y2 -1 1 y1 0 1 -1 1 X y2 (a) Shallow GP with RBF kernel. 0 1 -1 1 f 0 1 -1 1 X X y1 y2 -1 1 y1 0 1 -1 1 X y2 (b) Multi-Output GP with dependent RBF kernel. 0 1 -2 2 X a 0 1 -2 2 X -2 2 -5 5 f -2 2 -5 5 -3 3 -1 1 g1 -3 3 -1 1 g2 -1 1 y1 0 1 -1 1 X y2 (c) Deep GP with RBF kernels. 0 1 -2 2 X a 0 1 -1.5 2.5 X -2 2 -2 4 f -2 2 -1.5 2.5 -2 4 -1 1 g1 -1.5 2.5 -1 1 g2 -1 1 y1 0 1 -1 1 X y2 (d) AMO-GP with (dependent) RBF kernels. Figure 3: A comparison of the AMO-GP with other GP models. The plots show mean predictions and a shaded area of two standard deviations. If available, the ground truth is displayed as a dashed line. Additional lines are noiseless samples drawn from the model. The shallow and deep GPs in Figures 3a and 3c model the data independently and revert back to the prior in y2. Because of the nonlinear alignment, a multi-output GP cannot model the data in Figure 3b. The AMO-GP in Figure 3d recovers the alignment and warping and shares information between the two outputs. with relative alignments and warpings for the different time series. We will show that our model is able to recover this decomposition from the training data and compare the results to other approaches of modeling the data. Then we focus on a real world data set of a neighbouring pair of wind turbines in a wind farm, where the model is able to recover a representation of the latent prevailing wind condition and the relative timings of wind fronts at the two turbines. 4.1 Artificial data set Our data set consists of two time series T1 and T2 generated by a dampened sine function. We choose the alignment of T1 and the warping of T2 to be the identity in order to prevent us from directly observing the latent function and apply a sigmoid warping to T1. The alignment of T2 is selected to be a quadratic function. Figure 2 shows a visualization of this decomposed system of dependent time 6 Table 1: Test-log-likelihoods for the models presented in Section 4. Experiment Test set GP MO-GP DGP AMO-GP (Ours) Artificial [0.7, 0.8] ⊆T1 -0.12 -0.053 0.025 1.54 [0.35, 0.65] ⊆T2 -0.19 -5.66 -0.30 0.72 Wind [40, 45] ⊆T2 -4.42 -2.31 -1.80 -1.43 [65, 75] ⊆T2 -7.26 -0.73 -1.93 -0.69 series. To obtain training data we uniformly sampled 500 points from the two time series and added Gaussian noise. We subsequently removed parts of the training sets to explore the generalization behaviour of our model, resulting in |T1| = 450 and |T2| = 350. We use this setup to train our model using squared exponential kernels both in the conditionally independent GPs ad and gd and as smoothing kernels in f. We can always choose one alignment and one warping to be the identity function in order to constrain the shared latent spaces a and f and provide a reference the other alignments and warpings will be relative to. Since we assume our artificial data simulates a physical system, we apply the prior knowledge that the alignment and warping processes have slower dynamics compared to the shared latent function which should capture most of the observed dynamics. To this end we applied priors to the ad and gd which prefer longer length scales and smaller variances compared to f. Otherwise, the model could easily get stuck in local minima like choosing the upper two layers to be identity functions and model the time series independently in the gd. Additionally, our assumption of identity mean functions prevents pathological cases in which the complete model collapses to a constant function. Figure 3d shows the AMO-GP’s recovered function decomposition and joint predictions. The model successfully recovered a shared latent dampened sine function, a sigmoid warping for the first time series and an approximate quadratic alignment function for the second time series. In Figures 3a to 3c, we show the training results of a standard GP, a multi-output GP and a three-layer deep GP on the same data. For all of these models, we used RBF kernels and, in the case of the deep GP, applied priors similar to our model in order to avoid pathological cases. In Table 1 we report test log-likelihoods for the presented models, which illustrate the qualitative differences between the models. Because all models are non-parametric and converge well, repeating the experiments with different initializations leads to very similar likelihoods. Both the standard GP and deep GP cannot learn dependencies between time series and revert back to the prior where no data is available. The deep GP has learned that two layers are enough to model the data and the resulting model is essentially a Bayesian warped GP which has identified the sigmoid warping for T1. Uncertainties in the deep GP are placed in the middle layer areas where no data are available for the respective time series, as sharing information between the two outputs is impossible. In contrast to the other two models, the multi-output GP can and must share information between the two time series. As discussed in Section 2 however, it is constrained to constant time-offsets and cannot model the nonlinear alignment in the data. Because of this, the model cannot recover the latent sine function and can only model one of the two outputs. 4.2 Pairs of wind turbines This experiment is based on real data recorded from a pair of neighbouring wind turbines in a wind farm. The two time series T1 and T2 shown in gray in Figure 4 record the respective power generation of the two turbines over the course of one and a half hours, which was smoothed slightly using a rolling average over 60 seconds. There are 5400 data points for the first turbine (blue) and 4622 data points for the second turbine (green). We removed two intervals (drawn as dashed lines) from the second turbine’s data set to inspect the behaviour of the model with missing data. This allows us to evaluate and compare the generative properties of our model in Figure 5. The power generated by a wind turbine is mainly dependent on the speed of the wind fronts interacting with the turbine. For system identification tasks concerned with the behaviour of multiple wind turbines, associating the observations on different turbines due to the same wind fronts is an important task. However it is usually not possible to directly measure these correspondences or wind propagation 7 0.4 0.8 1.2 y1 [MW] −7.5 0 7.5 ∆X [min] 0 15 30 45 60 75 90 0.4 0.8 1.2 X [min] y2 [MW] Figure 4: The joint posterior for two time series y1 and y2 of power production for a pair of wind turbines. The top and bottom plots show the two observed time series with training data and dashed missing data. The AMO-GP recovers an uncertain relative alignment of the two time series shown in the middle plot. High uncertainty about the alignment is placed in areas where multiple explanations are plausible due to the high amount of noise or missing data. 0.6 0.8 1 1.2 y2 [MW] (a) Samples from a GP. 0.6 0.8 1 1.2 y2 [MW] (b) Samples from a MO-GP. 39 47 0.6 0.8 1 1.2 X [min] y2 [MW] (c) Samples from a DGP. 39 47 0.6 0.8 1 1.2 X [min] y2 [MW] (d) Samples from the AMO-GP. Figure 5: A comparison of noiseless samples drawn from a GP, a MO-GP, a DGP and the AMOGP. The separation of uncertainties implied by the model structure of AMP-GP gives rise to an informative model. Since the uncertainty in the generative process is mainly placed in the relative alignment shown in Figure 4, all samples in Figure 5d resemble the underlying data in structure. speeds between turbines, which means that there is no ground truth available. An additional problem is that the shared latent wind conditions are superimposed by turbine-specific local turbulences. Since these local effects are of comparable amplitude to short-term changes of wind speed, it is challenging to decide which parts of the signal to explain away as noise and which part to identify as the underlying shared process. Our goal is the simultaneous learning of the uncertain alignment in time a and of the shared latent wind condition f. Modelling the turbine-specific parts of the signals is not the objective, so they need to be explained by the Gaussian noise term. We use a squared exponential kernel as a prior for the alignment functions ad and as smoothening kernels in f. For the given data set we can assume the output warpings gd to be linear functions because there is only one dimension, the power generation, which in this data set is of similar shape for both turbines. Again we encode a preference 8 for alignments with slow dynamics with a prior on the length scales of ad. As the signal has turbinespecific autoregressive components, plausible alignments are not unique. To constrain the AMO-GP, we want it to prefer alignments close to the identity function which we chose as a prior mean function. Figure 4 shows the joint model learned from the data in which a1 is chosen to be the identity function. The possible alignments identified match the physical conditions of the wind farm. For the given turbines, time offsets of up to six minutes are plausible and for most wind conditions, the offset is expected to be close to zero. For areas where the alignment is quite certain however, the two time series are explained with comparable detail. The model is able to recover unambiguous associations well and successfully places high uncertainty on the alignment in areas where multiple explanations are plausible due to the noisy signal. As expected, the uncertainty about the alignment also grows where data for the second time series is missing. This uncertainty is propagated through the shared function and results in higher predictive variances for the second time series. Because of the factorization in the model however, we can recover the uncertainties about the alignment and the shared latent function separately. Figure 5 compares samples drawn from our model with samples drawn from a GP, a MO-GP and a DGP. The GP reverts to their respective priors when data is missing, while the MO-GP does not handle short-term dynamics and smoothens the signal enough such that the nonlinear alignment can be approximated as constant. Samples drawn from a DGP model showcase the complexity of a DGP prior. Unconstrained composite GPs are hard to reason about and make the model very flexible in terms of representable functions. Since the model’s evidence is very broad, the posterior is uninformed and inference is hard. Additionally, as discussed in Appendix B and [11], the nested variational compression bound tends to loosen with high uncertainties. AMO-GP shows richer structure: Due to the constraints imposed by the model, more robust inference leads to a more informed model. Samples show that it has learned that a maximum which is missing in the training data has to exist somewhere, but the uncertainty about the correct alignment due to the local turbulence means that different samples place the maximum at different locations in X-direction. 5 Conclusion We have proposed the warped and aligned multi-output Gaussian process (AMO-GP), in which MOGPs are embedded in a hierarchy to find shared structure in latent spaces. We extended convolution processes [5] with conditionally independent Gaussian processes on both the input and output sides, giving rise to a highly structured deep GP model. This structure can be used to both regularize the model and encode expert knowledge about specific parts of the system. By applying nested variational compression [11] to inference in these models, we presented a variational lower bound which combines Bayesian treatment of all parts of the model with scalability via stochastic optimization. We compared the model with GPs, deep GPs and multi-output GPs on an artificial data set and showed how the richer model-structure allows the AMO-GP to pick up on latent structure which the other approaches cannot model. We then applied the AMO-GP to real world data of two wind turbines and used the proposed hierarchy to model wind propagation in a wind farm and recover information about the latent non homogeneous wind field. With uncertainties decomposed along the hierarchy, our approach handles ambiguities introduced by the stochasticity of the wind in a principled manner. This indicates the AMO-GP is a good approach for these kinds of dynamical system, where multiple misaligned sensors measure the same latent effect. 6 Acknowledgement The project this report is based on was supported with funds from the German Federal Ministry of Education and Research under project number 01IB15001. The sole responsibility for the reports contents lies with the authors. 9 References [1] Mauricio A. Alvarez, Lorenzo Rosasco, and Neil D. Lawrence. “Kernels for Vector-Valued Functions: a Review”. In: arXiv:1106.6251 [cs, math, stat] (June 2011). arXiv: 1106.6251. [2] Mauricio A. Alvarez et al. “Efficient Multioutput Gaussian Processes through Variational Inducing Kernels.” In: AISTATS. Vol. 9. 2010, pp. 25–32. [3] Mauricio Alvarez and Neil D. Lawrence. “Sparse convolved Gaussian processes for multioutput regression”. In: Advances in neural information processing systems. 2009, pp. 57–64. [4] Eilyan Bitar and Pete Seiler. “Coordinated control of a wind turbine array for power maximization”. In: American Control Conference (ACC), 2013. IEEE, 2013, pp. 2898–2904. [5] Phillip Boyle and Marcus R. Frean. “Dependent Gaussian Processes.” In: NIPS. Vol. 17. 2004, pp. 217–224. [6] Phillip Boyle et al. Multiple output gaussian process regression. Tech. rep. 2005. [7] Timothy C. Coburn. Geostatistics for natural resources evaluation. Taylor & Francis Group, 2000. [8] Andreas C. Damianou and Neil D. Lawrence. “Deep Gaussian Processes”. In: arXiv:1211.0358 [cs, math, stat] (Nov. 2012). arXiv: 1211.0358. [9] David Duvenaud et al. Avoiding pathologies in very deep networks. 2014. [10] James Hensman, Nicolo Fusi, and Neil D. Lawrence. “Gaussian Processes for Big Data”. In: arXiv:1309.6835 [cs, stat] (Sept. 2013). [11] James Hensman and Neil D. Lawrence. “Nested Variational Compression in Deep Gaussian Processes”. In: arXiv:1412.1370 [stat] (Dec. 2014). arXiv: 1412.1370. [12] James Hensman, Alex Matthews, and Zoubin Ghahramani. “Scalable Variational Gaussian Process Classification”. In: arXiv:1411.2005 [stat] (Nov. 2014). arXiv: 1411.2005. [13] Andre G. Journel and Ch J. Huijbregts. Mining geostatistics. Academic press, 1978. [14] Miguel Lázaro-Gredilla. “Bayesian warped Gaussian processes”. In: Advances in Neural Information Processing Systems. 2012, pp. 1619–1627. [15] Alexander G. de G. Matthews et al. “GPflow: A Gaussian process library using TensorFlow”. In: Journal of Machine Learning Research 18.40 (2017), pp. 1–6. [16] Carl Edward Rasmussen and Christopher K I Williams. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2006. [17] Hugh Salimbeni and Marc Deisenroth. “Doubly Stochastic Variational Inference for Deep Gaussian Processes”. In: arXiv:1705.08933 [stat] (May 2017). arXiv: 1705.08933. [18] J. G. Schepers and S. P. Van der Pijl. “Improved modelling of wake aerodynamics and assessment of new farm control strategies”. In: Journal of Physics: Conference Series. Vol. 75. IOP Publishing, 2007, p. 012039. [19] Edward Snelson, Carl Edward Rasmussen, and Zoubin Ghahramani. “Warped Gaussian Processes”. In: MIT Press, 2004, pp. 337–344. [20] Jasper Snoek et al. “Input Warping for Bayesian Optimization of Non-stationary Functions”. In: arXiv:1402.0929 [cs, stat] (Feb. 2014). arXiv: 1402.0929. [21] Maryam Soleimanzadeh and Rafael Wisniewski. “Controller design for a wind farm, considering both power and load aspects”. In: Mechatronics 21.4 (2011), pp. 720–727. [22] Michalis K. Titsias. “Variational Learning of Inducing Variables in Sparse Gaussian Processes.” In: AISTATS. Vol. 5. 2009, pp. 567–574. [23] Michalis K. Titsias and Neil D. Lawrence. “Bayesian Gaussian process latent variable model”. In: International Conference on Artificial Intelligence and Statistics. 2010, pp. 844–851. [24] Feng Zhou and Fernando De la Torre. “Generalized time warping for multi-modal alignment of human motion”. In: Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on. IEEE, 2012, pp. 1282–1289. 10
2018
183
7,345
Semidefinite relaxations for certifying robustness to adversarial examples Aditi Raghunathan, Jacob Steinhardt and Percy Liang Stanford University {aditir, jsteinhardt, pliang}@cs.stanford.edu Abstract Despite their impressive performance on diverse tasks, neural networks fail catastrophically in the presence of adversarial inputs—imperceptibly but adversarially perturbed versions of natural inputs. We have witnessed an arms race between defenders who attempt to train robust networks and attackers who try to construct adversarial examples. One promise of ending the arms race is developing certified defenses, ones which are provably robust against all attackers in some family. These certified defenses are based on convex relaxations which construct an upper bound on the worst case loss over all attackers in the family. Previous relaxations are loose on networks that are not trained against the respective relaxation. In this paper, we propose a new semidefinite relaxation for certifying robustness that applies to arbitrary ReLU networks. We show that our proposed relaxation is tighter than previous relaxations and produces meaningful robustness guarantees on three different foreign networks whose training objectives are agnostic to our proposed relaxation. 1 Introduction Many state-of-the-art classifiers have been shown to fail catastrophically in the presence of small imperceptible but adversarial perturbations. Since the discovery of such adversarial examples [25], numerous defenses have been proposed in attempt to build classifiers that are robust to adversarial examples. However, defenses are routinely broken by new attackers who adapt to the proposed defense, leading to an arms race. For example, distillation was proposed [22] but shown to be ineffective [5]. A proposed defense based on transformations of test inputs [20] was broken in only five days [2]. Recently, seven defenses published at ICLR 2018 fell to the attacks of Athalye et al. [3]. A recent body of work aims to break this arms race by training classifiers that are certifiably robust to all attacks within a fixed attack model [13, 23, 29, 8]. These approaches construct a convex relaxation for computing an upper bound on the worst-case loss over all valid attacks—this upper bound serves as a certificate of robustness. In this work, we propose a new convex relaxation based on semidefinite programming (SDP) that is significantly tighter than previous relaxations based on linear programming (LP) [29, 8, 9] and handles arbitrary number of layers (unlike the formulation in [23], which was restricted to two). We summarize the properties of our relaxation as follows: 1. Our new SDP relaxation reasons jointly about intermediate activations and captures interactions that the LP relaxation cannot. Theoretically, we prove that there is a square root dimension gap between the LP relaxation and our proposed SDP relaxation for neural networks with random weights. 2. Empirically, the tightness of our proposed relaxation allows us to obtain tight certificates for foreign networks—networks that were not specifically trained towards the certification procedure. For instance, adversarial training against the Projected Gradient Descent (PGD) attack [21] has led to networks that are “empirically” robust against known attacks, but which have only been certified against small perturbations (e.g. ϵ=0.05 in the ℓ∞-norm for the MNIST dataset [9]). We use our SDP 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. to provide the first non-trivial certificate of robustness for a moderate-size adversarially-trained model on MNIST at ϵ=0.1. 3. Furthermore, training a network to minimize the optimum of particular relaxation produces networks for which the respective relaxation provides good robustness certificates [23]. Notably and surprisingly, on such networks, our relaxation provides tighter certificates than even the relaxation that was optimized for during training. Related work. Certification methods which evaluate the performance of a given network against all possible attacks roughly fall into two categories. The first category leverages convex optimization and our work adds to this family. Convex relaxations are useful for various reasons. Wong and Kolter [29], Raghunathan et al. [23] exploited the theory of duality to train certifiably robust networks on MNIST. In recent work, Dvijotham et al. [8], Wong et al. [30] extended this approach to train bigger networks with improved certified error and on larger datasets. Solving a convex relaxation for certification typically involves standard techniques from convex optimization. This enables scalable certification by providing valid upper bounds at every step in the optimization [9]. The second category draws techniques from formal verification such as SMT [16, 17, 7, 14], which aim to provide tight certificates for any network using discrete optimization. These techniques, while providing tight certificates on arbitrary networks, are often very slow and worst-case exponential in network size. In prior work, certification would take up to several hours or longer for a single example even for a small network with around 100 hidden units [7, 16]. However, in concurrent work, Tjeng and Tedrake [26] impressively scaled up exact verification through careful preprocessing and efficient pruning that dramatically reduces the search space. In particular, they concurrently obtain non-trivial certificates of robustness on a moderately-sized network trained using the adversarial training objective of [21] on MNIST at perturbation level ϵ=0.1. 2 Setup Our main contribution is a semidefinite relaxation of an optimization objective that arises in certification of neural networks against adversarial examples. In this section, we set up relevant notation and present the optimization objective that will be the focus of the rest of the paper. Notation. For a vector z ∈Rn, we use zi to denote the ith coordinate of z. For a matrix Z ∈Rm×n, Zi ∈Rn denotes the ith row. For any function f :R→R and a vector z ∈Rn, f(z) is a vector in Rn with (f(z))i =f(zi), e.g., z2 ∈Rn represents the function that squares each component. For z,y∈Rn, z ⪰y denotes that zi ≥yi for i=1,2,...,n. We use z1⊙z2 to represent the elementwise product of the vectors z1 and z2. We use Bϵ(¯x) def = {x|∥x−¯x∥∞≤ϵ} to denote the ℓ∞ball around ¯x. When it is necessary to distinguish vectors from scalars (in Section 4.1), we use⃗x to represent a vector in Rn that is semantically associated with the scalar x. Finally, we denote the vector of all zeros by 0 and the vector of all ones by 1. Multi-layer ReLU networks for classification. We focus on multi-layer neural networks with ReLU activations. A network f with L hidden layers is defined as follows: let x0 ∈Rd denote the input and x1,...,xL denote the activation vectors at the intermediate layers. Suppose the network has mi units in layer i. xi is related to xi−1 as xi = ReLU(W i−1xi−1) = max(W i−1xi−1,0), where W i−1 ∈Rmi×mi−1 are the weights of the network. For simplicity of exposition, we omit the bias terms associated with the activations (but consider them in the experiments). We are interested in neural networks for classification where we classify an input into one of k classes. The output of the network is f(x0)∈Rk such that f(x0)j =c⊤ j xL represents the score of class j. The class label y assigned to the input x0 is the class with the highest score: y=argmaxj=1,...,kf(x0)j. Attack model and certificate of robustness. We study classification in the presence of an attacker A that takes a clean test input ¯x∈Rd and returns an adversarially perturbed input A(¯x). In this work, we focus on attackers that are bounded in the ℓ∞norm: A(¯x)∈Bϵ(¯x) for some fixed ϵ>0. The attacker is successful on a clean input label pair (¯x,¯y) if f(A(¯x))̸= ¯y, or equivalently if f(A(¯x))y >f(x0)¯y for some y̸= ¯y. We are interested in bounding the error against the worst-case attack (we assume the attacker has full knowledge of the neural network). Let ℓ⋆ y(¯x,¯y) denote the worst-case margin of an incorrect class y that can be achieved in the attack model: ℓ⋆ y(¯x,¯y) def = max A(x)∈Bϵ(¯x)(f(A(x))y−f(A(x))¯y). (1) 2 A network is certifiably robust on (¯x,¯y) if ℓ⋆ y(¯x,¯y)<0 for all y ̸= ¯y. Computing ℓ⋆ y(¯x,¯y) for a neural network involves solving a non-convex optimization problem, which is intractable in general. In this work, we study convex relaxations to efficiently compute an upper bound Ly(¯x,¯y)≥ℓ⋆ y(¯x,¯y). When Ly(¯x,¯y)<0, we have a certificate of robustness of the network on input (¯x,¯y). Optimization objective. For a fixed class y, the worst-case margin ℓ⋆ y(¯x,¯y) of a neural network f with weights W can be expressed as the following optimization problem. The decision variable is the input A(x), which we denote here by x0 for notational convenience. The quantity we are interested in maximizing is f(x0)y −f(x0)¯y = (cy −c¯y)⊤xL, where xL is the final layer activation. We set up the optimization problem by jointly optimizing over all the activations x0,x1,x2,...xL, imposing consistency constraints dictated by the neural network, and restricting the input x0 to be within the attack model. Formally, ℓ⋆ y(¯x,¯y)= max x0,...,xL (cy−c¯y)⊤xL (2) subject to xi =ReLU(W i−1xi−1) for i=1,2,...,L (Neural network constraints) ∥x0 j −¯xj∥∞≤ϵ for j =1,2,...,d (Attack model constraints) Computing ℓ⋆ y is computationally hard in general. In the following sections, we present how to relax this objective to a convex semidefinite program and discuss some properties of this relaxation. 3 Semidefinite relaxations In this section, we present our approach to obtaining a computationally tractable upper bound to the solution of the optimization problem described in (2). Key insight. The source of the non-convexity in (2) is the ReLU constraints. Consider a ReLU constraint of the form z = max(x,0). The key observation is that this constraint can be expressed equivalently as the following three linear and quadratic constraints between z and x: (i) z(z−x)=0, (ii) z ≥x, and (iii) z ≥0. Constraint (i) ensures that z is equal to either x or 0 and constraints (ii) and (iii) together then ensure that z is at least as large as both. This reformulation allows us to replace the non-linear ReLU constraints of the optimization problem in 2 with linear and quadratic constraints, turning it into a quadratically constrained quadratic program (QCQP). We first show how this QCQP can be relaxed to a semidefinite program (SDP) for networks with one hidden layer. The relaxation for multiple layers is a straightforward extension and is presented in Section 5. 3.1 Relaxation for one hidden layer Consider a neural network with one hidden layer containing m nodes. Let the input be denoted by x ∈Rd. The hidden layer activations are denoted by z ∈Rm and related to the input x as z =ReLU(Wx) for weights W ∈Rm×d. Suppose that we have lower and upper bounds l,u ∈Rd on the inputs such that lj ≤xj ≤uj. For example, in the ℓ∞attack model we have l= ¯x−ϵ1 and u= ¯x+ϵ1 where ¯x is the clean input. For the multi-layer case, we discuss how to obtain these bounds for the intermediate activations in Section 5.2. We are interested in optimizing a linear function of the hidden layer: f(x)=c⊤z, where c∈Rm. For instance, while computing the worst case margin of an incorrect label y over true label ¯y, c=cy−c¯y. We use the key insight that the ReLU constraints can be written as linear and quadratic constraints, allowing us to embed these constraints into a QCQP. We can also express the input constraint lj ≤xj ≤uj as a quadratic constraint, which will be useful later. In particular, lj ≤xj ≤uj if and only if (xj−lj)(xj−uj)≤0, thereby yielding the quadratic constraint x2 j ≤(lj+uj)xj−ljuj. This gives us the final QCQP below: ℓ⋆ y(¯x,¯y)=fQCQP =max x,z c⊤z (3) s.t. z ≥0, z ≥Wx, z2 =z⊙(Wx) (ReLU constraints) x2 ≤(l+u)⊙x−l⊙u (Input constraints) We now relax the non-convex QCQP (3) to a convex SDP. The basic idea is to introduce a new set of variables representing all linear and quadratic monomials in x and z; the constraints in (3) can then be written as linear functions of these new variables. 3 (a) (b) Figure 1: (a) Plot showing the feasible regions for the vectors⃗x (green) and⃗z (red). The input constraints restrict ⃗x to lie within the green circle. The ReLU constraint ⃗z ⊥⃗z−⃗x forces ⃗z to lie on the dashed red circle and the constraint ⃗z·⃗e≥⃗x·⃗e restricts it to the solid arc. (b) For a fixed value of input ⃗x·⃗e, when the angle made by⃗x with⃗e increases, the arc spanned by⃗z has a larger projection on⃗e and leading to a looser relaxation. Secondly, for a fixed value of ⃗x·⃗e, as θ increases, the norm ∥⃗x∥increases and vice versa. In particular, let v def = " 1 x z # . We define a matrix P def = vv⊤and use symbolic indexing P[·] to index the elements of P, i.e P =   P[1] P[x⊤] P[z⊤] P[x] P[xx⊤] P[xz⊤] P[z] P[zx⊤] P[zz⊤]  . The SDP relaxation of (3) can be written in terms of the matrix P as follows. fSDP =max P c⊤P[z] (4) s.t P[z]≥0, P[z]≥WP[x], diag(P[zz⊤])=diag(WP[xz⊤]) (ReLU constraints) diag(P[xx⊤])≤(l+u)⊙P[x]−l⊙u (Input constraints) P[1]=1, P ⪰0 (Matrix constraints). When the matrix P admits a rank-one factorization vv⊤, the entries of the matrix P exactly correspond to linear and quadratic monomials in x and z. In this case, the ReLU and input constraints of the SDP are identical to the constraints of the QCQP. However, this rank-one constraint on P would make the feasible set non-convex. We instead consider the relaxed constraint on P that allows factorizations of the form P =V V ⊤, where V can be full rank. Equivalently, we consider the set of matrices P such that P ⪰0. This set is convex and is a superset of the original non-convex set. Therefore, the above SDP is a relaxation of the QCQP in 3 with fSDP ≥fQCQP, providing an upper bound on ℓ⋆ y(¯x,¯y) that could serve as a certificate of robustness. We note that this SDP relaxation is different from the one proposed in [23], which applies only to neural networks with one hidden layer. In contrast, the construction presented here naturally generalizes to multiple layers, as we show in Section 5. Moreover, we will see in Section 6 that our new relaxation often yields substantially tighter bounds than the approach of [23]. 4 Analysis of the relaxation Before extending the SDP relaxation defined in (4) to multiple layers, we will provide some geometric intuition for the SDP relaxation. 4.1 Geometric interpretation First consider the simple case where m = d = 1 and W = c = 1, so that the problem is to maximize z subject to z =ReLU(x) and l≤x≤u. In this case, the SDP relaxation of (4) is as follows: fSDP =max P P[z] (5) s.t P[z]≥0, P[z]≥P[x], P[z2]=P[xz] (ReLU constraints) P[x2]≤(l+u)P[x]−lu (Input constraints) P[1]=1, P ⪰0 (Matrix constraints). 4 (a) (b) (c) Figure 2: (a) Visualization of the LP and SDP for a single ReLU unit with input x and output z. The LP is bounded by the line joining the extreme points. (b) Let z1 =ReLU(x1+x2) and z2 =ReLU(x1−x2). On fixing the inputs x1 and x2 (both equal to 0.5ϵ), we plot the feasible activations of the LP and SDP relaxation. The LP feasible set is a simple product over the independent sets, while the SDP enforces joint constraints to obtain a more complex convex set. (c) We plot the set (z1,z2) across all feasible inputs (x1,x2) for the same setup as (b) and the objective of maximizing z1+z2. We see that fSDP <fLP. The SDP operates on a PSD matrix P and imposes linear constraints on the entries of the matrix. Since feasible P can be written as V V ⊤, the entries of P can be thought of as dot products between vectors, and constraints as operating on these dot products. For the simple example above, V def = " ←⃗e→ ←⃗x→ ←⃗z → # for some vectors ⃗e,⃗x,⃗z ∈R3. The constraint P[1]=1, for example, imposes ⃗e·⃗e=1 i.e., ⃗e is a unit vector. The linear monomials P[x],P[z] correspond to projections on this unit vector, ⃗x·⃗e and ⃗z·⃗e. Finally, the quadratic monomials P[xz], P[x2] and P[z2] correspond to ⃗x·⃗z, ∥⃗x∥2 and ∥⃗z∥2 respectively. We now reason about the input and ReLU constraints and visualize the geometry (see Figure 1a). Input constraints. The input constraint P[x2] ≤(l + u)P[x] −lu equivalently imposes ∥⃗x∥2 ≤ (l+u)(⃗x·⃗e)−lu. Geometrically, this constrains vector ⃗x on a sphere with center at 1 2(l+u)⃗e and radius 1 2(l−u). Notice that this implicitly bounds the norm of ⃗x. This is illustrated in Figure 1a where the green circle represents the space of feasible vectors ⃗x, projected onto the plane containing ⃗e and ⃗x. ReLU constraints. The constraint on the quadratic terms (P[z2] = P[zx]) is the core of the SDP. It says that the vector ⃗z is perpendicular to ⃗z −⃗x. We can visualize ⃗z on the plane containing ⃗x and ⃗e in Figure 1a; the component of ⃗z perpendicular to this plane is not relevant to the SDP, because it’s neither constrained nor appears in the objective. The feasible ⃗z trace out a circle with 1 2⃗x as the center (because the angle inscribed in a semicircle is a right angle). The linear constraints restrict ⃗z to the arc that has a larger projection on ⃗e than ⃗x, and is positive. Remarks. This geometric picture allows us to make the following important observation about the objective value max ⃗z·⃗e  of the SDP relaxation. The largest value that ⃗z·⃗e can take depends on the angle θ that ⃗x makes with ⃗e. In particular, as θ decreases, the relaxation becomes tighter and as the vector deviates from ⃗e, the relaxation gets looser. Figure 1b provides an illustration. For large θ, the radius of the circle that ⃗z traces increases, allowing ⃗z·⃗e to take large values. That leads to the natural question: For a fixed input value ⃗x·⃗e (corresponding to x), what controls θ? Since ⃗x·⃗e=∥⃗x∥cosθ, as the norm of ⃗x increases, θ increases. Hence a constraint that forces ∥⃗x∥ to be close to ⃗x·⃗e will cause the output ⃗z·⃗e to take smaller values. Porting this intuition into the matrix interpretation, this suggests that constraints forcing P[x2]=∥⃗x∥2 to be small lead to tighter relaxations. 4.2 Comparison with linear programming relaxation In contrast to the SDP, another approach is to relax the objective and constraints in (2) to a linear program (LP) [18, 10, 9]. As we will see below, a crucial difference from the LP is that our SDP can “reason jointly” about different activations of the network in a stronger way than the LP can. We briefly review the LP approach and then elaborate on this difference. Review of the LP relaxation. We present the LP relaxation for a neural network with one hidden layer, where the hidden layer activations z ∈Rm are related to the input x ∈Rd as z = ReLU(Wx). As before, we have bounds l,u∈Rd such that l≤x≤u. 5 In the LP relaxation, we replace the ReLU constraints at hidden node j with a convex outer envelope as illustrated in Figure 2a. The envelope is lower bounded by the linear constraints z ≥Wx and z ≥0. In order to construct the upper bounding linear constraints, we compute the extreme points s= min l≤x≤uWx and t = max l≤x≤uWx and construct lines that connect (s, ReLU(s)) and (t, ReLU(t)). The final LP for the neural network is then written by constructing the convex envelopes for each ReLU unit and optimizing over this set as follows: fLP =max c⊤z (6) s.t z ≥0, z ≥Wx, (Lower bound lines) z ≤ ReLU(t)−ReLU(s) t−s  ·(Wx−s)+ReLU(s), (Upper bound lines) l≤x≤u (Input constraints). The extreme points s and t are the optima of a linear transformation (by W) over a box in Rd and can be computed using interval arithmetic. In the ℓ∞attack model where l = ¯x−ϵ1 and u = ¯x+ϵ1, we have sj =W ¯x−ϵ∥Wj∥1 and tj =W ¯x+ϵ∥Wj∥1 for j =1,2,...m. From Figure 2a, we see that for a single ReLU unit taken in isolation, the LP is tighter than the SDP. However, when we have multiple units, the SDP is tighter than the LP. We illustrate this with a simple example in 2 dimensions with 2 hidden nodes (See Figure 2b). Simple example to compare the LP and SDP. Consider a two dimensional example with input x = [x1,x2] and lower and upper bounds l = [−ϵ,−ϵ] and u = [ϵ,ϵ], respectively. The hidden layer activations z1 and z2 are related to the input as z1 = ReLU(x1 +x2) and z2 = ReLU(x1 −x2). The objective is to maximize z1+z2. The LP constrains z1 and z2 independently. To see this, let us set the input x to a fixed value and look at the feasible values of z1 and z2. In the LP, the convex outer envelope that bounds z1 only depends on the input x and the bounds l and u and is independent of the value of z2. Similarly, the outer envelope of z2 does not depend on the value of z1, and the feasible set for (z1,z2) is simply the product of the individual feasible sets. In contrast, the SDP has constraints that couple z1 and z2. As a result, the feasible set of (z1,z2) is a strict subset of the product of the individual feasible sets. Figure 2b plots the LP and SDP feasible sets [z1,z2] for x=[ ϵ 2, ϵ 2]. Recall from the geometric observations (Section 4.1) that the arc of ⃗z1 depends on the configuration of ⃗x1+ ⃗x2, while that of ⃗z2 depends on ⃗x1−⃗x2. Since the vectors ⃗x1+ ⃗x2 and ⃗x1−⃗x2 are dependent, the feasible sets of ⃗z1 and ⃗z2 are also dependent on each other. An alternative way to see this is from the matrix constraint that P ⪰0 in 4. This matrix constraint does not factor into terms that decouple the entries P[z1] and P[z2], hence z1 and z2 cannot vary independently. When we reason about the relaxation over all feasible points x, the joint reasoning of the SDP allows it to achieve a better objective value. Figure 2c plots the feasible sets [z1,z2] over all valid x where the optimal value of the SDP, fSDP, is less than that of the LP, fLP. We can extend the preceding example to exhibit a dimension-dependent gap between the LP and the SDP for random weight matrices. In particular, for a random network with m hidden nodes and input dimension d, with high probability, fLP =Θ(md) while fSDP =Θ(m √ d+d√m). More formally: Proposition 1. Suppose that the weight matrix W ∈Rm×d is generated randomly by sampling each element Wij uniformly and independently from {−1,+1}. Also let the output vector c be the all-1s vector, 1. Take ¯x=0 and ϵ=1. Then, for some universal constant γ, fLP ≥1 2md almost surely, while fSDP ≤γ·(m √ d+d√m) with probability 1−exp(−(d+m)). We defer the proof of this to Section A. 5 Multi-layer networks The SDP relaxation to evaluate robustness for multi-layer networks is a straightforward generalization of the relaxation presented for one hidden layer in Section 3.1. 6 Grad-NN [23] LP-NN [29] PGD-NN PGD-attack 15% 18% 9% SDP-cert (this work) 20% 20% 18% LP-cert 97% 22% 100% Grad-cert 35% 93% n/a Table 1: Fraction of non-certified examples on MNIST. Different certification techniques (rows) on different networks (columns). SDP-cert is consistently better than other certificates. All numbers are reported for ℓ∞attacks at ϵ=0.1. 5.1 General SDP The interactions between xi−1 and xi in (2) (via the ReLU constraint) are analogous to the interaction between the input and hidden layer for the one layer case. Suppose we have bounds li−1,ui−1 ∈Rmi−1 on the inputs to the ReLU units at layer i such that li−1 ≤xi−1 ≤ui−1. We discuss how to obtain these bounds and their significance in Section 5.2. Writing the constraints for each layer iteratively gives us the following SDP: f SDP y (¯x,¯y)=max P (cy−c¯y)⊤P[xL] (7) s.t. for i=1,...,L P[xi]≥0, P[xi]≥W i−1P[xi−1], diag(P[xi(xi)⊤])=diag(WP[xi−1(xi)⊤]), (ReLU constraints for layer i) diag(P[xi−1(xi−1)⊤])≤(li−1+ui−1)⊙P[xi−1]−li−1⊙ui−1, (Input constraints for layer i) P[1]=1, P ⪰0 (Matrix constraints). 5.2 Bounds on intermediate activations From the geometric interpretation of Section 4.1, we made the important observation that adding constraints that keep P[x2] small aid in obtaining tighter relaxations. For the multi-layer case, since the activations at layer i−1 act as input to the next layer i, adding constraints that restrict P[(xi j)2] will lead to a tighter relaxation for the overall objective. The SDP automatically obtains some bound on P[(xi j)2] from the bounds on the input, hence the SDP solution is well-defined and finite even without these bounds. However, we can tighten the bound on P[(xi j)2] by relating it to the linear monomial P[(xi j)] via bounds on the value of the activation xi j. One simple way to obtain bounds on activations xi j is to treat each hidden unit separately, using simple interval arithmetic to obtain l0 = ¯x−ϵ1 (Attack model), u0 = ¯x+ϵ1 (Attack model), (8) li =[W i−1]+li−1+[W i−1]−ui−1, ui =[W i−1]+ui−1+[W i−1]−li−1, where ([M]+)ij =max(Mij,0) and ([M]−)ij =min(Mij,0). In our experiments on real networks (Section 6), we observe that these simple bounds are sufficient to obtain good certificates. However tighter bounds could potentially lead to tighter certificates. 6 Experiments In this section, we evaluate the performance of our certificate (7) on neural networks trained using different robust training procedures, and compare against other certificates in the literature. Networks. We consider feedforward networks that are trained on the MNIST dataset of handwritten digits using three different robust training procedures. 1. Grad-NN. We use the two-layer network with 500 hidden nodes from [23], obtained by using an SDP-based bound on the gradient of the network (different from the SDP presented here) as a regularizer. We obtained the weights of this network from the authors of [23]. 2. LP-NN. We use a two-layer network with 500 hidden nodes (matching that of Grad-NN) trained via the LP-based robust training procedure of [29]. The authors of [29] provided the weights. 7 0 2 4 6 8 10 Margin 0 50 100 150 200 250 300 Number of points PGD Margin of closest incorrect class for SDP verified points (a) 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 Margin 0 5 10 15 20 25 30 Number of points PGD Margin of closest incorrect class for SDP unverified points (b) Figure 3: Histogram of PGD margins for (a) points that are certified by the SDP and (b) points that are not certified by the SDP. 3. PGD-NN. We consider a fully-connected network with four layers containing 200,100 and 50 hidden nodes (i.e., the architecture is 784-200-100-50-10). We train this network using adversarial training [12] against the strong PGD attack [21]. We train to minimize a weighted combination of the regular cross entropy loss and adversarial loss. We tuned the hyperparameters based on the performance of the PGD attack on a holdout set. The stepsize of the PGD attack was set to 0.1, number of iterations to 40, perturbation size ϵ=0.3 and weight on adversarial loss to 1 3. The training procedures for SDP-NN and LP-NN yield certificates of robustness (described in their corresponding papers), but the training procedure of PGD-NN does not. Note that all the networks are “foreign networks” to our SDP, as their training procedures do not incorporate the SDP relaxation. Certification procedures. Recall from Section 2 that an upper bound on the maximum incorrect margin can be used to obtain certificates. We consider certificates from three different upper bounds. 1. SDP-cert. This is the certificate we propose in this work. This uses the SDP upper bound that we defined in Section 5. The exact optimization problem is presented in (7) and the bounds on intermediate activations are obtained using the interval arithmetic procedure presented in (8). 2. LP-cert. This uses the upper bound based on the LP relaxation discussed in Section 4.2 which forms the basis for several existing works on scalable certification [9, 10, 28, 29]. The LP uses layer-wise bounds for intermediate nodes, similar to li,ui in our SDP formulation (7). For Grad-NN and LP-NN with a single hidden layer, the layerwise bounds can be computed exactly using interval arithmetic. For the four-layer PGD-NN, in order to have a fair comparison with SDP-cert, we use the same procedure (interval arithmetic) (8). 3. Grad-cert. We use the upper bound proposed in [23]. This upper bound is based on the maximum norm of the gradient of the network predictions and only holds for two-layer networks. Table 1 presents the performance of the three different certification procedures on the three networks. For each certification method and network, we evaluate the associated upper bounds on the same 1000 random test points and report the fraction of points that were not certified. Computing the exact worst-case adversarial error is not computationally tractable. Therefore, to provide a comparison, we also compute a lower bound on the adversarial error—the error obtained by the PGD attack. Performance of proposed SDP-cert. SDP-cert provides non-vacuous certificates for all networks considered. In particular, we can certify that the four layer PGD-NN has an error of at most 18% at ϵ = 0.1. To compare, a lower bound on the robust error (PGD attack error) is 9%. On the two-layer networks, SDP-cert improves the previously-known bounds. For example, it certifies that Grad-NN has an error of at most 20% compared to the previously known 35%. Similarly, SDP-cert improves the bound for LP-NN from 22% to 20%. The gap between the lower bound (PGD) and upper bound (SDP) is because of points that cannot be misclassified by PGD but are also not certified by the SDP. In order to further investigate these points, we look at the margins obtained by the PGD attack to estimate the robustness of different points. Formally, let xPGD be the adversarial example generated by the PGD attack on clean input ¯x with true label ¯y. We compute min y̸=¯y[f(xPGD)¯y −f(xPGD)y], the margin of the closest incorrect class. A small value indicates that the xPGD was close to being misclassified. Figure 3 shows the histograms of the above PGD margin. The examples which are not certified by the SDP have much smaller margins than those examples that are certified: the average PGD margin is 1.2 on points that are not certified 8 and 4.5 on points that are certified. From Figure 3, we see that a large number of the SDP uncertified points have very small margin, suggesting that these points might be misclassified by stronger attacks. Remark. As discussed in Section 5, we could consider a version of the SDP that does not include the constraints relating linear and quadratic terms at the intermediate layers of the network. Empirically, such an SDP produces vacuous certificates (>90% error). Therefore, these constraints at intermediate layers play a significant role in improving the empirical performance of the SDP relaxation. Comparison with other certification approaches. From Table 1, we observe that SDP-cert consistently performs better than both LP-cert and Grad-cert for all three networks. Grad-cert and LP-cert provide vacuous (> 90% error) certificates on networks that are not trained to minimize these certificates. This is because these certificates are tight only under some special cases that can be enforced by training. For example, LP-cert is tight when the ReLU units do not switch linear regions [29]. While a typical input causes only 20% of the hidden units of LP-NN to switch regions, 75% of the hidden units of Grad-NN switch on a typical input. Grad-cert bounds the gradient uniformly across the entire input space. This makes the bound loose on arbitrary networks that could have a small gradient only on the data distribution of interest. Comparison to concurrent work [26]. A variety of robust MNIST networks are certified by Tjeng and Tedrake [26]. On Grad-NN, their certified error is 30% which is looser than our SDP certified error (20%). They also consider the CNN counterparts of LP-NN and PGD-NN, trained using the procedures of [29] and [21]. The certified errors are 4.4% and 7.2% respectively. This reduction in the errors is due to the CNN architecture. Further discussion on applying our SDP to CNNs appears in Section 7. Optimization setup. We use the YALMIP toolbox [19] with MOSEK as a backend to solve the different convex programs that arise in these certification procedures. On a 4-core CPU, the average SDP computation took around 25 minutes and the LP around 5 minutes per example. 7 Discussion In this work, we focused on fully connected feedforward networks for computational efficiency. In principle, our proposed SDP can be directly used to certify convolutional neural networks (CNNs); unrolling the convolution would result in a (large) feedforward network. Naively, current off-the-shelf solvers cannot handle the SDP formulation of such large networks. Robust training on CNNs leads to better error rates: for example, adversarial training against the PGD adversary on a four-layer feedforward network has error 9% against the PGD attack, while a four-layer CNN trained using a similar procedure has error less than 3% [21]. An immediate open question is whether the network in [21], which has so far withstood many different attacks, is truly robust on MNIST. We are hopeful that we can scale up our SDP to answer this question, perhaps borrowing ideas from work on highly scalable SDPs [1] and explicitly exploiting the sparsity and structure induced by the CNN architecture. Current work on certification of neural networks against adversarial examples has focused on perturbations bounded in some norm ball. In our work, we focused on the common ℓ∞attack because the problem of securing multi-layer ReLU networks remains unsolved even in this well-studied attack model. Different attack models lead to different constraints only at the input layer; our SDP framework can be applied to any attack model where these input constraints can be written as linear and quadratic constraints. In particular, it can also be used to certify robustness against attacks bounded in ℓ2 norm. [13] provide alternative bounds for ℓ2 norm attacks based on the local gradient. Guarantees for the bounded norm attack model in general are sufficient but not necessary for robustness against adversaries in the real world. Many successful attacks involve inconspicious but clearly visible perturbations [11, 24, 6, 4], or large but semantics-preserving perturbations in the case of natural language [15]. These perturbations do not currently have well-defined mathematical models and present yet another layer of challenge. However, we believe that the mathematical ideas we develop for the bounded norm will be useful building blocks in the broader adversarial game. 9 Reproducibility. All code, data and experiments for this paper are available on the Codalab platform at https://worksheets.codalab.org/worksheets/ 0x6933b8cdbbfd424584062cdf40865f30/. Acknowledgements. This work was partially supported by a Future of Life Institute Research Award and Open Philanthrophy Project Award. JS was supported by a Fannie & John Hertz Foundation Fellowship and an NSF Graduate Research Fellowship. We thank Eric Wong for providing relevant experimental results. We are also grateful to Moses Charikar, Zico Kolter and Eric Wong for several helpful discussions and anonymous reviewers for useful feedback. References [1] A. A. Ahmadi and A. Majumdar. DSOS and SDSOS optimization: more tractable alternatives to sum of squares and semidefinite optimization. arXiv preprint arXiv:1706.02586, 2017. [2] A. Athalye and I. Sutskever. Synthesizing robust adversarial examples. arXiv preprint arXiv:1707.07397, 2017. [3] A. Athalye, N. Carlini, and D. Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018. [4] T. B. Brown, D. Mané, A. Roy, M. Abadi, and J. Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017. [5] N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, pages 39–57, 2017. [6] N. Carlini, P. Mishra, T. Vaidya, Y. Zhang, M. Sherr, C. Shields, D. Wagner, and W. Zhou. Hidden voice commands. In USENIX Security, 2016. [7] N. Carlini, G. Katz, C. Barrett, and D. L. Dill. Ground-truth adversarial examples. arXiv, 2017. [8] K. Dvijotham, S. Gowal, R. Stanforth, R. Arandjelovic, B. O’Donoghue, J. Uesato, and P. Kohli. Training verified learners with learned verifiers. arXiv preprint arXiv:1805.10265, 2018. [9] K. Dvijotham, R. Stanforth, S. Gowal, T. Mann, and P. Kohli. A dual approach to scalable verification of deep networks. arXiv preprint arXiv:1803.06567, 2018. [10] R. Ehlers. Formal verification of piece-wise linear feed-forward neural networks. In International Symposium on Automated Technology for Verification and Analysis (ATVA), pages 269–286, 2017. [11] I. Evtimov, K. Eykholt, E. Fernandes, T. Kohno, B. Li, A. Prakash, A. Rahmati, and D. Song. Robust physical-world attacks on machine learning models. arXiv, 2017. [12] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations (ICLR), 2015. [13] M. Hein and M. Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems (NIPS), pages 2263–2273, 2017. [14] S. Huang, N. Papernot, I. Goodfellow, Y. Duan, and P. Abbeel. Adversarial attacks on neural network policies. arXiv, 2017. [15] R. Jia and P. Liang. Adversarial examples for evaluating reading comprehension systems. In Empirical Methods in Natural Language Processing (EMNLP), 2017. [16] G. Katz, C. Barrett, D. Dill, K. Julian, and M. Kochenderfer. Reluplex: An efficient SMT solver for verifying deep neural networks. arXiv preprint arXiv:1702.01135, 2017. [17] G. Katz, C. Barrett, D. L. Dill, K. Julian, and M. J. Kochenderfer. Towards proving the adversarial robustness of deep neural networks. arXiv, 2017. [18] J. Z. Kolter and E. Wong. Provable defenses against adversarial examples via the convex outer adversarial polytope (published at ICML 2018). arXiv preprint arXiv:1711.00851, 2017. 10 [19] J. Löfberg. YALMIP: A toolbox for modeling and optimization in MATLAB. In CACSD, 2004. [20] J. Lu, H. Sibai, E. Fabry, and D. Forsyth. No need to worry about adversarial examples in object detection in autonomous vehicles. arXiv preprint arXiv:1707.03501, 2017. [21] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations (ICLR), 2018. [22] N. Papernot, P. McDaniel, X. Wu, S. Jha, and A. Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In IEEE Symposium on Security and Privacy, pages 582–597, 2016. [23] A. Raghunathan, J. Steinhardt, and P. Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations (ICLR), 2018. [24] M. Sharif, S. Bhagavatula, L. Bauer, and M. K. Reiter. Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition. In ACM SIGSAC Conference on Computer and Communications Security, pages 1528–1540, 2016. [25] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations (ICLR), 2014. [26] V. Tjeng and R. Tedrake. Verifying neural networks with mixed integer programming. arXiv preprint arXiv:1711.07356, 2017. [27] R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. arXiv, 2010. [28] T. Weng, H. Zhang, H. Chen, Z. Song, C. Hsieh, D. Boning, I. S. Dhillon, and L. Daniel. Towards fast computation of certified robustness for relu networks. arXiv preprint arXiv:1804.09699, 2018. [29] E. Wong and J. Z. Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning (ICML), 2018. [30] E. Wong, F. Schmidt, J. H. Metzen, and J. Z. Kolter. Scaling provable adversarial defenses. arXiv preprint arXiv:1805.12514, 2018. 11
2018
184
7,346
Compact Representation of Uncertainty in Clustering Craig S. Greenberg 1,2 Nicholas Monath1 Ari Kobren1 Patrick Flaherty3 Andrew McGregor1 Andrew McCallum1 1College of Information and Computer Sciences, University of Massachusetts Amherst 2National Institute of Standards and Technology 3Department of Mathematics and Statistics, University of Massachusetts Amherst {csgreenberg,nmonath,akobren,mcgregor,mccallum}@cs.umass.edu flaherty@math.umass.edu Abstract For many classic structured prediction problems, probability distributions over the dependent variables can be efficiently computed using widely-known algorithms and data structures (such as forward-backward, and its corresponding trellis for exact probability distributions in Markov models). However, we know of no previous work studying efficient representations of exact distributions over clusterings. This paper presents definitions and proofs for a dynamic-programming inference procedure that computes the partition function, the marginal probability of a cluster, and the MAP clustering—all exactly. Rather than the N th Bell number, these exact solutions take time and space proportional to the substantially smaller powerset of N. Indeed, we improve upon the time complexity of the algorithm introduced by Kohonen and Corander [11] for this problem by a factor of N. While still large, this previously unknown result is intellectually interesting in its own right, makes feasible exact inference for important real-world small data applications (such as medicine), and provides a natural stepping stone towards sparse-trellis approximations that enable further scalability (which we also explore). In experiments, we demonstrate the superiority of our approach over approximate methods in analyzing real-world gene expression data used in cancer treatment. 1 Introduction Probabilistic models provide a rich framework for expressing and analyzing uncertain data because they provide a full joint probability distribution rather than an uncalibrated score or point estimate. There are many well-established, simple probabilistic models, for example Hidden Markov Models (HMMs) for modeling sequences. Inference in HMMs is performed using the forward-backward algorithm, which relies on an auxiliary data structure called a trellis (a graph-based dynamic programming table). This trellis structure serves as a compact representation of the distribution over state sequences. Many model structures compactly represent distributions and allow for efficient exact or approximate inference of joint and marginal distributions. Clustering is a classic unsupervised learning task. Classic clustering algorithms and even modern ones, however, only provide a point estimate of the “best” partitioning by some metric. In many applications, there are other partitions of the data that are nearly as good as the best one. Therefore representing uncertainty in clustering can allow one to chose the most interpretable clustering from among a nearly equivalent set of options. We explore the benefits of representing uncertainty in clustering in a real-world gene expression analysis application in the experiments section. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Representing discrete distributions can be rather challenging, since the size of the support of the distribution can grow extremely rapidly. In the case of HMMs, the number of sequences that need to be represented is exponential in the sequence length. Despite this, the forward-backward algorithm (i.e., belief-propagation in a non-loopy graph) performs exact inference in time linear in the size of the sequence multiplied by the square of the size of the state space. In the case of clustering, the problem is far more difficult. The number of clusterings of N elements, known as the N th Bell number [2], grows super exponentially in the number of elements to be clustered. For example, there are more than a billion ways to cluster 15 elements. An exhaustive approach would require enumerating and scoring each clustering. We seek a more compact representation of distributions over clusterings. In this paper, we present a dynamic programming inference procedure that exactly computes the partition function, the marginal probability of a cluster, and the MAP clustering. Crucially, our approach computes exact solutions in time and space proportional to the size of the powerset of N, which is substantially less than the N th Bell number complexity of the exhaustive approach. While the size of the powerset of N is still large, this is a previously unknown result that on its own bears intellectual interest. It further acts as a stepping stone towards approximations enabling larger scalability and provides insight on small data sets as shown in the experiments section. The approach works by creating a directed acyclic graph (DAG), where each vertex represents an element of the powerset and there are edges between pairs of vertices that represent maximal subsets/minimal supersets of one another. We refer to this DAG as a cluster trellis. The dynamic programs can operate in either a top-down or bottom up fashion on the cluster trellis, labeling vertices with local partition functions and maximum values. It is also possible to read likely splits and joins of clusters (see Appendix M), as well as marginals from this structure. These programs work in any circumstance where the energy of a cluster can be computed. We prove that our programs return exact values and provide an analysis of their time and space complexity. This paper also describes an approach to approximating the partition function, marginal probabilities, and MAP inference for clustering in reduced time and space. It works by performing exact computations on a sparsified version of the cluster trellis, where only a subset of the possible vertices are represented. This is analogous to using beam search [17] in HMMs. We prove that our programs return exact values for DAG-consistent partitions and that the time and space complexity are now measured in the size of the sparse cluster trellis. When not in the text, proofs of all facts and theorems can be found in the Appendix. We develop our method in further detail in the context of correlation clustering [1]. In correlation clustering, the goal is to construct a clustering that maximizes the sum of cluster energies (minus the sum of the across cluster energies), where a cluster energy can be computed from pairwise affinities among data points. We give a dynamic program that computes the energies of all possible clusters. Our approach proceeds in a bottom up fashion with respect to the cluster trellis, annotating cluster energies at each step. This all can be found in the Appendix. Previous work has examined the related problem of computing MAP k-clusterings exactly, including dynamic programming approaches [8, 9, 22], as well as using fast convolutions [11]. Our method has a smaller runtime complexity than using these approaches for computing the MAP clustering and partition function for all possible partitions (irrespective of k). Further, none of this related work discusses how to reduce complexity using approximation (as we do in Section 4), and it is unclear how their work might be extended for approximation. The most closely related work [10] models distributions over clusterings using Perturb and MAP [16]. Unlike the Perturb and MAP approach, our work focuses on exact inference in closed form. Being able to compactly represent probability distributions over clusterings is a fundamental problem in managing uncertainty. This paper presents a dynamic programming approach to exact inference in clustering, reducing the time complexity of the problem from super exponential to sub-quadratic in the size of the cluster trellis. 2 Uncertainty in Clustering Clustering is the task of dividing a dataset into disjoint sets of elements. Formally, Definition 1. (Clustering) Given a dataset of elements, D = {xi}N i=1, a clustering is a set of subsets, C = {C1, C2, . . . , CK} such that Ci ✓D, SK i=1 Ci = D, and Ci \Cj = ; for all Ci, Cj 2 C, i 6= j. Each element of C is known as a cluster. 2 a b c d ab ac ad bc bd cd abc abd acd bcd abcd Figure 1: A cluster trellis, T , over a dataset D = {a, b, c, d}. Each node in the trellis represents a specific cluster, i.e., subset, of D corresponding to its label. Solid lines indicate parent-child relationships. Note that a parent may have multiple children and a child may have multiple parents. Our goal is to design data structures and algorithms for efficiently computing the probability distribution over all clusterings of D. We adopt an energy-based probability model for clustering, where the probability of a clustering is proportional to the product of the energies of the individual clusters making up the clustering. The primary assumption in energy based clustering is that clustering energy is decomposable as the product of cluster energies. While it is intuitive that the probability of elements being clustered together would be independent of the clustering of elements disjoint from the cluster, one could conceive of distributions that violate that assumption. An additional assumption is that exponentiating pairwise scores preserves item similarity. This is the Gibbs distribution, which has been found useful in practice [6]. Definition 2. (Energy Based Clustering) Let D be a dataset, C be a clustering of D and ED(C) be the energy of C. Then, the probability of C with respect to D, PD(C), is equal to the energy of C normalized by the partition function, Z(D). This gives us PD(C) = ED(C) ZD and Z(D) = P C2CD ED(C). The ED(C) energy of C is defined as the product of the energies of its clusters: ED(C) = Q C2C ED(C) We use CD to refer to all clusterings of D. In general, we assume that D is fixed and so we omit subscripts to simplify notation. Departing from convention [12], clusterings with higher energy are preferred to those with lower energy. Note that computing the membership probability of any element xi in any cluster Cj, as is done in mixture models, is ill-suited for our goal. In particular, this computation assumes a fixed clustering whereas our work focuses on computations performed with respect to the distribution over all possible clusterings. 3 The Cluster Trellis Recall that our goal is compute a distribution over the valid clusterings of an instance of energy based clustering as efficiently as possible. Given a dataset D, a naïve first step in computing such a distribution is to iterate through its unique clusters and, for each, compute its energy and add it to a running sum. If the number of elements is |D| = N, the number of unique clusters is the N th Bell Number, which is super-exponential in N [14]. Note that a cluster C may appear in many clusterings of D. For example, consider the dataset D0 = {a, b, c, d}. The cluster {a, b} appears in 2 of the clusterings of D0. More precisely, in a dataset comprised of N elements, a cluster of M elements appears in the (N −M)th Bell Number of its clusterings. This allows us to make use of memoization to compute the distribution over clusterings more efficiently, in a procedure akin to variable elimination in graphical models [4, 25]. Unlike variable elimination, our procedure is agnostic to the ordering of the elimination. To support the exploitation of this memoization approach, we introduce an auxiliary data structure we call a cluster trellis. Definition 3. (Cluster Trellis) A cluster trellis, T , over a dataset D is a graph, (V (T ), E(T )), whose vertices represent all valid clusters of elements of D. The edges of the graph connect a pair vertices if one (the “child” node) is a maximal strict subset of the other (the “parent” node). 3 In this paper, we refer to a cluster trellis simply as a trellis. In more detail, each trellis vertex, v 2 V (T ), represents a unique cluster of elements; the vertices in T map one-to-one with the nonempty members of the powerset of the elements of D. We define D(v) to be the elements in the cluster represented by v. There exists an edge from v0 to v, if D(v) ⇢D(v0) and D(v0) = D(v) [ {xi} for some element xi 2 D (or vice versa). See Figure 1 for a visual representation of a trellis over 4 elements. Each vertex stores the energy of its associated cluster, E(D(v)), and can be queried in constant time. We borrow terminology from trees and say vertex v0 is a parent of vertex v, if there is an edge from v0 to v, and that vertex v00 is an ancestor of v if there is a directed path from v00 to v. 3.1 Computing the Partition Function Computing a distribution over an event space requires computing a partition function, or normalizing constant. We present an algorithm for computing the partition function, Z(D), with respect to all possible clusterings of the elements of D. Our algorithm uses the trellis and a particular memoization scheme to significantly reduce the computation required: from super-exponential to exponential. The full partition function, Z(D), can be expressed in terms of cluster energies and the partition functions of a specific set of subtrellises. A subtrellis rooted at v, denoted T [v] contains all nodes in T that are descendants of v. Formally, a subtrellis T [v] = (V (T [v]), E(T [v])) has vertices and edges satisfying the following properties: (1) V (T [v]) = {u|u 2 V (T ) ^ D(u) ✓D(v)}, and (2) E(T [v]) = {(u, u0)|(u, u0) 2 E(T ) ^ u, u0 2 V (T [v])}. Note that T [v] is always a valid trellis. The following procedure not only computes Z(D), but also generalizes in a way that the partition function with respect to clusterings for any subset D(v) ⇢D can also be computed. We refer to the partition function for a dataset D(v) memoized at the trellis/subtrellis T [D(v)] as the partition function for the trellis/subtrellis, Z(T [D(v)]). Algorithm 1 PartitionFunction(T , D) Pick xi 2 D Z(D) = 0 for v in V (T )(i) do Let v0 be such that D(v0) = D \ D(v) if Z(D(v0)) has not been assigned then Z(D(v0)) = PartitionFunction(T [v0], D(v0)) Z(D) Z(D) + E(D(v)) ⇤Z(D(v0)) return Z(D) Define V (T )(i) = {v|v 2 V (T ) ^ xi 2 D(v)} and V (T )(i) = V (T )\V (T )(i). In other words, V (T )(i) is the set of all vertices in the trellis containing the element xi and V (T )(i) is the set of all vertices that do not contain xi. Fact 1. Let v 2 V (T ) and xi 2 D(v). The partition function with respect to D(v) can be written recursively, with Z(D(v)) = P vi2V (T [v])(i) E(vi) · Z(D(v)\D(vi)) and Z(;) = 1. Proof. The partition function Z(D(v)) is defined as: Z(D(v)) = X C2CD(v) Y C2C E(C) For a given element xi in D(v), the set of all clusterings of D(v) can be re-written to factor out the cluster containing xi in each clustering: CD(v) = {{vi} [ C|vi 2 V (i), C 2 CD(v)\D(vi)} Note that CD(v)\D(vi) refers to all clusterings on the elements D(v)\D(vi). Using this expansion and since E({vi} [ Ci) = E({vi})E(Ci), we can rewrite the partition function as below. By performing 4 algebraic re-arrangements and applying our definitions: Z(D(v)) = X vi2V (i) X C2CD(v)\D(vi) E(vi)E(C) = X vi2V (i) X C2CD(v)\D(vi) E(vi) Y C2C E(C) = X vi2V (i) E(vi) X C2CD(v)\D(vi) Y C2C E(C) = X vi2V (i) E(vi)Z(D(v) \ D(vi)) As a result of Fact 1, we are able to construct a dynamic program for computing the partition function of a trellis as follows: (1) select an arbitrary element xi from the dataset; (2) construct V (T )(i) as defined above; (3) for each vertex vi 2 V (T )(i), compute and memoize the partition function of D(v) \ D(vi) if it is not already cached; (4) sum the partition function values obtained in step (3). The pseudocode for this dynamic program appears in Algorithm 1. We use Algorithm 1 and Fact 1 to analyze the time and space complexity of computing the partition function. Consider a trellis T over a dataset D = {xi}N i=1. Our goal is to compute the partition function, Z(T ). When the partition function of all subtrellises of T have already been computed, Algorithm 1 is able to run without recursion. Fact 2. Let T be a trellis such that the partition function corresponding to each of its subtrellises T ’ is memoized and accessible in constant time. Then, Z(T ) can be computed by summing exactly 2N−1 terms. Given that the partition function of every strict sub-trellis of T (i.e., any sub-trellis of T that is not equivalent to T ) has been memoized and is accessible in constant time, then Z(T ) is computed by taking the sum of exactly 2N−1 terms. We now consider the more general case, where the partition function of all subtrellises of T have not yet been computed: Theorem 1. Let T be a trellis over D = {xi}N i=1. Then, Z(T ) can be computed in O(3N−1) = O(|V (T )|log(3)) time. A proof of Theorem 1 can be found in the Appendix in Section E. 3.2 Finding the Maximal Energy Clustering By making a minor alteration to Algorithm 1, we are also able to compute the value of and find the clustering with maximal energy. Specifically, at each vertex in the trellis, v, store the clustering of D(v) with maximal energy (and its associated energy). We begin by showing that there exists a recursive form of the max-partition calculation analogous to the computation of the partition function in Fact 1. Definition 4. (Maximal Clustering) Let v 2 V (T ) and xi 2 D(v). The maximal clustering over the elements of D(v), C?(D(v)), is defined as: C?(D(v)) = argmaxC2CD(v) E(C). Fact 3. C?(D(v)) can be written recursively as C?(D(v)) = argmaxv02V (T [v])(i) E(v0)·E(C?(D(v)\ D(v0))). In other words, the clustering with maximal energy over the set of elements, D(v) can be written as the energy of any cluster, C, in that clustering multiplied by a clustering with maximal energy over the elements D(v)\C. Using this recursive definition, we modify Algorithm 1 to compute the maximum clustering instead of the partition function, resulting in Algorithm 2 (in Appendix). The correctness of this algorithm is demonstrated by Fact 3. We can now analyze the time complexity of the algorithm. We use similar memoized notation for the algorithm where C?(T [D(v)]) is the memoized value for C?(D(v)) stored at v. Fact 4. Let TD be a trellis over D = {xi}N i=1. Then, C?(TD) can be computed in O(3N−1) time. 5 3.3 Computing Marginals The trellis facilitates the computation of two types of cluster marginals. First, the trellis can be used to compute the probability of a specific cluster, D(v), with respect to the distribution over all possible clusterings; and second, it can be used to compute the probability that any group of elements, X, are clustered together. We begin by analyzing the first style of marginal computation as it is used in computing the second. Let C(v) 2 C be the set of clusterings that contain the cluster D(v). Then the marginal probability of D(v) is given by P(D(v)) = P C2C(v) E(C) Z(D) , where Z(D) is the partition function with respect to the full trellis described in section 2. This probability can be re-written in terms of the complement of D(v), i.e., P(D(v)) = P C2C(v) E(C) Z(D) = P C2C(v) E(D(v))E(C\D(v)) Z(D) = E(D(v)) P C02CD\D(v) E(C0) Z(D) = E(D(v))Z(D\D(v)) Z(D) . Note that if Z(D \ D(v)) were memoized during Algorithm 1, then computing the marginal probability requires constant time and space equal to the size of the trellis. This is only true for clusters whose complements do not contain element xi (selected to compute Z(D) in Algorithm 1), which is true for |V (T )|/(2|V (T )| −1) of the vertices in the trellis. Otherwise, we may need to repeat the calculation from Algorithm 1 to compute Z(D \ D(v)). We note that due to memoization, the complexity of computing the partition function of the remaining verticies is no greater than the complexity of Algorithm 1. This machinery makes it possible to compute the second style of marginal. Given a set of elements, X, the marginal probability of the elements of X being clustered together is: P(X) = P D(v)2T :X✓D(v) P(D(v)). The probability that the elements of X is distinct from the marginal probability of a cluster in that P(X) sums the marginal probabilities of all clusters that include all elements of X. Once the marginal probability of each cluster is computed, the marginal probability of any sets of elements being clustered together can be computed in time and space linear in the size of the trellis. 4 The Sparse Trellis The time to compute the partition function scales sub-quadratically with the size of the trellis (Theorem 1). Unfortunately, the size of the trellis scales exponentially with the size of the dataset, which limits the use of the trellis in practice. In this section, we show how to approximate the partition function and maximal partition of a sparse trellis, which is a trellis with some nodes omitted. Increasing the sparsity of a trellis enables the computation of approximate clustering distributions for larger datasets. Definition 5. (Sparse Trellis) Given a trellis T = (V (T ), E(T )), define a sparse trellis with respect to T to be any bT = (bV , ˆE) satisfying the following properties: bV 6= ;, bV ⇢V (T ), and ˆE = {(v, v0)| D(v0) ⇢D(v) ^ @u : D(v0) ⇢D(u) ⇢D(v)}. Note that there exist a number of sparse trellises that contain no valid clusterings. As an example, consider bT = (bV = {v1, v2, v3}, bE = ;) where D(v1) = {a, b}, D(v2) = {b, c}, and D(v3) = {a, c}. For ease of analysis, we focus on a specific family of sparse trellises which are closed under recursive complement 1. This property ensures that the trellises contain only valid partitions. For trellises in this family we show that the partition function and the clustering with maximal energy can be computed using algorithms similar to those described in Section 3. Since these algorithms have complexity measured in the number of nodes in the trellis, their efficiency improves with trellis-sparsity. We also present the family of tree structured sparse trellises with tree specific partition function and max partition algorithms. The more general family of all sparse trellises is also discussed briefly. The key challenge of analyzing a sparse trellis, bT , is how to treat any cluster C that is not represented by a vertex v 2 bT , i.e., C = D(v) ^ v 62 bT . Although there are several feasible approaches to reasoning about such clusters, in this paper we assume that any cluster that is not represented by a 1A set of sets, S, is closed under recursive complement iff 8x, y 2 S, x ⇢y =) 9z 2 S : x S z = y ^ x \ z = ;. 6 vertex in bT has zero energy. Since the energy of a clustering, C, is the product of its clusters’ energies (Definition 2), E(C) = 0 if it contains one or more clusters with zero energy. 4.1 Approximating The Partition Function and Max Partition Given a sparse trellis, ˆT , we are able to compute the partition function by using Algorithm 1. Fact 5. Let bT = (bV , bE) be a sparse trellis whose vertices are closed under recursive complement. Then Algorithm 1 computes Z( bT ) in O(| bT |log(3)). If bT is not closed under recursive complement, we cannot simply run Algorithm 1 because not all vertices for which the algorithm must compute energy (or the partition function) are guaranteed to exist. How to compute the partition function using such a trellis is an area of future study. Given a sparse trellis, ˆT , closed under recursive complement, we are able to compute the max partition by using Algorithm 2. Doing so takes O(| ˆT |log(3)) time and O(| ˆT |) space. The correctness and complexity analysis is the same as in Section 4.1. The often-used hierarchical (tree structured) clustering encompasses one family of sparse trellises. Algorithms for tree structured trellises can be found in the Appendix in Section J. 5 Experiments In this section, we demonstrate the utility of the cluster trellis via experiments on real-world gene expression data. To begin, we provide a high-level background on cancer subtypes to motivate the use of our method in the experiment in Section 5.3. 5.1 Background For an oncologist, determining a prognosis and constructing a treatment plan for a patient is dependent on the subtype of that patient’s cancer [13]. This is because different subtypes react well to some treatments, for example, to radiation and not chemotherapy, and for other subtypes the reverse is true [20]. For example, basal and erbB2+ subtypes of breast cancer are more sensitive to paclitaxel- and doxorubicin-containing preoperative chemotherapy (approx. 45% pathologic complete response) than the luminal and normal-like cancers (approx. 6% pathologic complete response)[18]. Unfortunately, identifying cancer subtypes is often non-trivial. One common method of learning about a patient’s cancer subtype is to cluster their gene expression data along with other available expression data for which previous treatments and treatment outcomes are known [21]. 5.2 Data & Methods We use breast cancer transcriptome profiling (FPKM-UQ) data from The Cancer Genome Atlas (TCGA) because much is known about the gene expression patterns of this cancer type, yet there is heterogeneity in the clinical response of patients who are classified into the same subtype by standard approaches [23]. The data are subselected for African American women with Stage I breast cancer. We select African American women because there is a higher prevalence of the basal-like subtype among premenopausal African American women [15] and there is some evidence that there is heterogeneity (multiple clusters) even within this subtype [23]. Stage I breast cancer patients were selected because of the prognostic value in distinguishing aggressive subtypes from non-aggressive subtypes at an early stage. Despite the considerable size of TCGA, there are only 11 samples meeting this basic, necessary inclusion/exclusion criteria. Each of the 11 samples is a 20,000 dimensional feature vector, where each dimension is a measure of how strongly a given gene is expressed. We begin by sub-selecting the 3000 features with greatest variance across the samples. We then add an infinitesimal value prior to taking the log of the remaining features, since genome expression data is believed to be normally distributed in log-space [19]. A similar data processing was shown to be effective in prior work [19]. We use correlation clustering as the energy model. Pairwise similarities are exponentiated negative euclidean distances. We subtract from each the mean pairwise similarity so that similarities are both positive and negative. We then compute the marginal probabilities for each pair (i.e., the probability 7 −100 −50 0 50 100 Pairwise Log Energies −600 −500 −400 −300 −200 −100 0 Pairwise Log Marginals Pairwise Energies and Marginals 74ca & 62da 74ca & d6fa 62da & d6fa Figure 2: For each pair of patients with Stage I cancer, we plot the energy and marginal probability of the pair being in the same cluster as described in Section 5.3. −4 −3 −2 −1 0 Exact Pairwise Log Marginals −2.5 −2.0 −1.5 −1.0 −0.5 Approximate Pairwise Log Marginals Approximate vs. Exact Marginal Log Probability of Pairs Of Points Figure 3: The approximate vs. exact pairwise marginals for each pair of gene expressions. Approximate marginals are computed using a Perturb-and-MAP based method [10]. Figure 4: Heatmap of the pairwise energies between the patients. The pair 74ca and d6fa has an energy of -4.7, 74ca and 62da have 91.09, and d6fa and 62da have 44.5. Figure 5: Heatmap of the marginal probability that a pair will be clustered together. Patients 74ca and d6fa have a pairwise marginal that is nearly one, despite having a low pairwise energy. that the two samples appear in the same cluster). See Section 3.3 for how to compute these values using the trellis. 5.3 Model Evaluation using Marginals One method for evaluating a set of cancer subtype clustering models is to identify pairs of samples that the evaluator believes should be clustered together and inspect their pairwise energies. However, high pairwise energies do not necessarily mean the points will be clustered together by the model (which considers how the pairs’ cluster assignment impacts the rest of the data). Similarly, a low pairwise energy does not necessarily mean the two samples will not be clustered together. The pairwise marginal on the other hand exactly captures the probability that the model will place the two samples in the same cluster. We test if the corresponding unnormalized pairwise energies or a simple approximation of the marginals could reasonably be used as a proxy for exact pairwise marginals. 5.3.1 Pairwise Energies vs. Marginals & Exact vs. Approximate Marginals Figure 2 plots the pairwise log energies vs. pairwise log marginals of the sub-sampled TCGA data2. The pairwise scores and marginals are not strongly correlated, which suggests that unnormalized pairwise energies cannot reasonably be used as a proxy for pairwise marginals. For example, the sample pair of patients (partial id numbers given) 74ca and d6fa have an energy of -4.7 (low), but a pairwise marginal that is nearly one. This is because both 74ca and d6fa have high energy with sample 62da, with pairwise energies 91.09 (the fourth largest) and 44.5, respectively. Figures 4 and 5 that visualize the pairwise energies and pairwise marginals, respectively. 2The MAP clustering of the dataset is in the Appendix in Section P. 8 We also explore the extent to which an approximate method can accurately capture pairwise marginals. We use an approach similar to Perturb-and-MAP [10]. We sample clusterings by adding Gumbel distributed noise to the pairwise energies and using Algorithm 2 to find the maximal clustering with the modified energies. We approximate the marginal probability of a given pair being clustered together by measuring how many of these sampled clusters contain the pair in the same cluster. Figure 3 plots the approximate vs. exact pairwise marginal for each pair of points in the dataset. The figure shows that the approximate method overestimates many of the pairwise marginals. Like the pairwise scores (rather than exact marginals), using the approximate marginals in practice may lead to errors in data analysis. 6 Related Work While there is, to the best of our knowledge, no prior work on compact representations for exactly computing distributions over clusterings, there is a small amount related work on computing the MAP k-clustering exactly, as well as a wide array of related work in approximate methods, graphical models, probabilistic models for clustering, and clustering methods. The first dynamic programming approach to computing the MAP k-clustering was given in [9], which focuses on minimizing the sum of square distances within clusters. It works by considering distributional form of the clusterings, i.e., all possible sizes of the clusters that comprise the clustering, and defines “arcs” between them. However, no full specification of the dynamic program is given and, as the author notes, many redundant computations are required, since there are many clusterings that share the same distributional form. In [8], the first implementation is given, with some of the redundancies removed, and the implementation and amount of redundancy is further improved upon in [22]. In each of these cases, the focus is on finding the best k-clustering, which can be done using these methods in O(3n) time. These methods can also be used to find the MAP clustering for all K, however doing so would result in an O(n ⇤3n) time, which is worse than our O(3n) result. In [11], the authors use fast convolutions to compute the MAP k-clustering and k-partition function. Fast convolutions use a Mobius transform and Mobius inversion on the subset lattice to compute the convolution in e O(n22n) time. It would seem promising to use this directly in our work, however, our algorithm divides the subset lattice in half,which prevents us from applying the fast transform directly. The authors note that, similar to the above dynamic programming approaches, their method can be used to compute the clustering partition function and MAP in O(n ⇤3n), which is larger than our result of O(3n). Their use of convolutions to compute posteriors of k-clusterings also implies the existence of an e O(n32n) algorithm to compute the pair-wise posterior matrix, i.e., the probability that items i and j are clustered together, though the authors mention that, due to numerical instability issues, using fast convolutions to computing the pair-wise posterior matrix is only faster in theory. Recently proposed perturbation based methods [10] approximate distributions over clusterings as well as marginal distributions over clusters. They use the Perturb and MAP approach [16], originally proposed by Papandreou, which is based on adding Gumbel distributed noise to the clustering energy function. Unfortunately, for Perturb and MAP to approach the exact distribution, independent samples from the Gumbel distribution must be added to each clustering energy, which would require a super-exponential number of draws. To overcome this, Kappes et al. [10] propose adding Gumbel noise to the pairwise real-valued affinity scores, thus requiring fewer draws, but introducing some dependence among samples. They must also perform an outer relaxation in order obtain a computable bound for the log partition function. As a result, the method approaches a distribution with unknown approximation bounds. 7 Conclusion In this paper, we present a data structure and dynamic-programming algorithm to compactly represent and compute probability distributions over clusterings. We believe this to be the first work on efficient representations of exact distributions over clusterings. We reduce the computation cost of the naïve exhaustive method from the N th Bell number to sub-quadratic in the substantially smaller powerset of N. We demonstrate how this result is a first step towards practical approximations enabling larger scalability and show a case study of the method applied to correlation clustering. 9 Acknowledgments We thank the anonymous reviewers for their constructive feedback. This work was supported in part by the Center for Intelligent Information Retrieval, in part by DARPA under agreement number FA8750-13-2-0020, in part by the National Science Foundation Graduate Research Fellowship under Grant No. NSF-1451512 and in part by the National Science Foundation Grant 1637536. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect those of the sponsor. References [1] Nikhil Bansal, Avrim Blum, and Shuchi Chawla. Correlation clustering. Machine Learning, 2004. [2] E. T. Bell. Exponential polynomials. Annals of Mathematics, 1934. [3] Charles Blundell, Yee Whye Teh, and Katherine A Heller. Bayesian rose trees. Conference on Uncertainty in Artificial Intelligence, 2010. [4] Rina Dechter. Bucket elimination: A unifying framework for probabilistic inference. 1999. [5] Dua Dheeru and EfiKarra Taniskidou. UCI machine learning repository, 2017. [6] Stuart Geman and Donald Geman. Stochastic relaxation, gibbs distributions, and the bayesian restoration of images. IEEE Transactions on pattern analysis and machine intelligence, 1984. [7] Katherine A Heller and Zoubin Ghahramani. Bayesian hierarchical clustering. International Conference on Machine Learning, 2005. [8] Lawrence Hubert, Phipps Arabie, and Jacqueline Meulman. Combinatorial data analysis: Optimization by dynamic programming. Society for Industrial and Applied Mathematics, 2001. [9] Robert E. Jensen. A dynamic programming algorithm for cluster analysis. Operations Research, 1969. [10] Jörg Hendrik Kappes, Paul Swoboda, et al. Probabilistic correlation clustering and image partitioning using perturbed multicuts. International Conference on Scale Space and Variational Methods in Computer Vision, 2015. [11] Jukka Kohonen and Jukka Corander. Computing exact clustering posteriors with subset convolution. Communications in Statistics-Theory and Methods, 2016. [12] Yann LeCun, Sumit Chopra, and Raia Hadsell. A tutorial on energy-based learning. 2006. [13] Brian D Lehmann and Jennifer A Pietenpol. Identification and use of biomarkers in treatment strategies for triple-negative breast cancer subtypes. The Journal of pathology, 2014. [14] László Lovász. Combinatorial problems and exercises. 1993. [15] Cancer Genome Atlas Network et al. Comprehensive molecular portraits of human breast tumours. Nature, 2012. [16] George Papandreou and Alan L Yuille. Perturb-and-map random fields: Using discrete optimization to learn and sample from energy models. International Conference on Computer Vision, 2011. [17] D Raj Reddy et al. Speech understanding systems: A summary of results of the five-year research effort. department of computer science, 1977. [18] Roman Rouzier, Charles M Perou, W Fraser Symmans, et al. Breast cancer molecular subtypes respond differently to preoperative chemotherapy. Clinical cancer research, 2005. [19] Hachem Saddiki, Jon McAuliffe, and Patrick Flaherty. Glad: a mixed-membership model for heterogeneous tumor subtype classification. Bioinformatics, 2014. 10 [20] Therese Sørlie, Charles M Perou, Robert Tibshirani, et al. Gene expression patterns of breast carcinomas distinguish tumor subclasses with clinical implications. Proceedings of the National Academy of Sciences, 2001. [21] Therese Sørlie, Robert Tibshirani, Joel Parker, et al. Repeated observation of breast tumor subtypes in independent gene expression data sets. Proceedings of the National Academy of Sciences, 2003. [22] BJ Van Os and Jacqueline J Meulman. Improving dynamic programming strategies for partitioning. Journal of Classification, 2004. [23] Ozlem Yersal and Sabri Barutca. Biological subtypes of breast cancer: Prognostic and therapeutic implications. World journal of clinical oncology, 2014. [24] Giacomo Zanella, Brenda Betancourt, Hanna Wallach, Jeffrey Miller, Abbas Zaidi, and Rebecca C Steorts. Flexible models for microclustering with application to entity resolution. Advances in Neural Information Processing Systems, 2016. [25] Nevin Lianwen Zhang and David Poole. Exploiting causal independence in bayesian network inference. Journal of Artificial Intelligence Research, 1996. 11
2018
185
7,347
DeepPINK: reproducible feature selection in deep neural networks Yang Young Lu ∗ Department of Genome Sciences University of Washington Seattle, WA 98195 ylu465@uw.edu Yingying Fan ∗ Data Sciences and Operations Department Marshall School of Business University of Southern California Los Angeles, CA 90089 fanyingy@marshall.usc.edu Jinchi Lv Data Sciences and Operations Department Marshall School of Business University of Southern California Los Angeles, CA 90089 jinchilv@marshall.usc.edu William Stafford Noble Department of Genome Sciences and Department of Computer Science and Engineering University of Washington Seattle, WA 98195 william-noble@uw.edu Abstract Deep learning has become increasingly popular in both supervised and unsupervised machine learning thanks to its outstanding empirical performance. However, because of their intrinsic complexity, most deep learning methods are largely treated as black box tools with little interpretability. Even though recent attempts have been made to facilitate the interpretability of deep neural networks (DNNs), existing methods are susceptible to noise and lack of robustness. Therefore, scientists are justifiably cautious about the reproducibility of the discoveries, which is often related to the interpretability of the underlying statistical models. In this paper, we describe a method to increase the interpretability and reproducibility of DNNs by incorporating the idea of feature selection with controlled error rate. By designing a new DNN architecture and integrating it with the recently proposed knockoffs framework, we perform feature selection with a controlled error rate, while maintaining high power. This new method, DeepPINK (Deep feature selection using Paired-Input Nonlinear Knockoffs), is applied to both simulated and real data sets to demonstrate its empirical utility. 2 1 Introduction Rapid advances in machine learning techniques have revolutionized our everyday lives and had profound impacts on many contemporary domains such as decision making, healthcare, and finance ∗These authors contributed equally to this work. 2 All code and data will be available here: github.com/younglululu/DeepPINK. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. [28]. In particular, deep learning has received much attention in recent years thanks to its outstanding empirical performance in both supervised and unsupervised machine learning tasks. However, due to the complicated nature of deep neural networks (DNNs) and other deep learning methods, they have been mostly treated as black box tools. In many scientific areas, interpretability of scientific results is becoming increasingly important, as researchers aim to understand why and how a machine learning system makes a certain decision. For example, if a clinical image is predicted to be either benign or malignant, then the doctors are eager to know which parts of the image drive such a prediction. Analogously, if a financial transaction is flagged to be fraudulent, then the security teams want to know which activities or behaviors led to the flagging. Therefore, an explainable and interpretable system to reason about why certain decisions are made is critical to convince domain experts [27]. The interpretability of conventional machine learning models, such as linear regression, random forests, and support vector machines, has been studied for decades. Recently, identifying explainable features that contribute the most to DNN predictions has received much attention. Existing methods either fit a simple model in the local region around the input [33, 38] or locally perturb the input to see how the prediction changes [35, 6, 34, 37]. Though these methods can yield insightful interpretations, they focus on specific architectures of DNNs and can be difficult to generalize. Worse still, Ghorbani et al. [22] systematically revealed the fragility of these widely-used methods and demonstrated that even small random perturbation can dramatically change the feature importance. For example, if a particular region of a clinical image is highlighted to explain a malignant classification, the doctors would then focus on that region for further investigation. However, it would be highly problematic if the choice of highlighted region varied dramatically in the presence of very small amounts of noise. In such a setting, it is desirable for practitioners to select explanatory features in a fashion that is robust and reproducible, even in the presence of noise. Though considerable work has been devoted to creating feature selection methods that select relevant features, it is less common to carry out feature selection while explicitly controlling the associated error rate. Among different feature selection performance measures, the false discovery rate (FDR) [4] can be exploited to measure the performance of feature selection algorithms. Informally, the FDR is the expected proportion of falsely selected features among all selected features, where a false discovery is a feature that is selected but is not truly relevant (For a formal definition of FDR, see section 2.1). Commonly used procedures, such as the Benjamini–Hochberg (BHq) procedure [4], achieve FDR control by working with p-values computed against some null hypothesis, indicating observations that are less likely to be null. In the feature selection setting, existing methods for FDR control utilize the p-values produced by an algorithm for evaluating feature importance, under the null hypothesis that the feature is not relevant. Specifically, for each feature, one tests the significance of the statistical association between the specific feature and the response either jointly or marginally and obtains a p-value. These p-values are then used to rank the feature importance for FDR control. However, for DNNs, how to produce meaningful p-values that can reflect feature importance is still completely unknown. See, e.g., [19] for the nonuniformity of p-values for the specific case of diverging-dimensional generalized linear models. Without a way to produce appropriate p-values, performing feature selection with a controlled error rate in deep learning is highly challenging. To bypass the use of p-values but still achieve FDR control, Candès et al. [10] proposed the model-X knockoffs framework for feature selection with controlled FDR. The salient idea is to generate knockoff features that perfectly mimic the arbitrary dependence structure among the original features but are conditionally independent of the response given the original features. Then these knockoff features can be used as control in feature selection by comparing the feature importance between original features and their knockoff counterpart. See more details in section 2.2 for a review of the model-X knockoffs framework and [2, 3, 10] for more details on different knockoff filters and their theoretical guarantees. In this paper, we integrate the idea of a knockoff filter with DNNs to enhance the interpretability of the learned network model. Through simulation studies, we discover surprisingly that naively combining the knockoffs idea with a multilayer perceptron (MLP) yields extremely low power in most cases (though FDR is still controlled). To resolve this issue, we propose a new DNN architecture named DeepPINK (Deep feature selection using Paired-Input Nonlinear Knockoffs). DeepPINK is built upon an MLP with the major distinction that it has a plugin pairwise-coupling layer containing p filters, one per each input feature, where each filter connects the original feature and its knockoff counterpart. We demonstrate empirically that DeepPINK achieves FDR control with much higher 2 power than many state-of-the-art methods in the literature. We also apply DeepPINK to two real data sets to demonstrate its empirical utility. It is also worth mentioning that the idea of DeepPINK may be generalized to other deep neural networks such as CNNs and RNNs, which is the subject of our ongoing research. 2 Background 2.1 Model setting Consider a supervised learning task where we have n independent and identically distributed (i.i.d.) observations (xi, Yi), i = 1, · · · , n, with xi ∈Rp the feature vector and Yi the scalar response. Here we consider the high-dimensional setting where the feature dimensionality p can be much larger than the sample size n. Assume that there exists a subset S0 ⊂{1, · · · , p} such that, conditional on features in S0, the response Yi is independent of features in the complement Sc 0. Our goal is to learn the dependence structure of Yi on xi so that effective prediction can be made with the fitted model and meanwhile achieve accurate feature selection in the sense of identifying features in S0 with a controlled error rate. 2.2 False discovery rate control and the knockoff filter To measure the accuracy of feature selection, various performance measures have been proposed. The false discovery rate (FDR) is among the most popular ones. For a set of features bS selected by some feature selection procedure, the FDR is defined as FDR = E[FDP] with FDP = |bS ∩Sc 0| |bS| , where | · | stands for the cardinality of a set. Many methods have been proposed to achieve FDR control [5, 36, 1, 15, 16, 40, 14, 23, 20, 44, 17]. However, as discussed in Section 1, most of these existing methods rely on p-values and cannot be adapted to the setting of DNNs. In this paper, we focus on the recently introduced model-X knockoffs framework [10]. The model-X knockoffs framework provides an elegant way to achieve FDR control in a feature selection setting at some target level q in finite sample and with arbitrary dependency structure between the response and features. The idea of knockoff filters was originally proposed in Gaussian linear models [2, 3]. The model-X knockoffs framework generalizes the original method to work in arbitrary, nonlinear models. In brief, knockoff filter achieves FDR control in two steps: 1) construction of knockoff features, and 2) filtering using knockoff statistics. Definition 1 ([10]). Model-X knockoff features for the family of random features x = (X1, · · · , Xp)T are a new family of random features ˜x = ( ˜X1, · · · , ˜Xp)T that satisfies two properties: (1) (x, ˜x)swap(S) d= (x, ˜x) for any subset S ⊂{1, · · · , p}, where swap(S) means swapping Xj and ˜Xj for each j ∈S and d= denotes equal in distribution, and (2) ˜x |= Y |x, i.e., ˜x is independent of response Y given feature x. According to Definition 1, the construction of knockoffs is totally independent of the response Y . If we can construct a set of model-X knockoff features, then by comparing the original features with these control features, FDR can be controlled at target level q. See [10] for theoretical guarantees of FDR control with knockoff filters. Clearly, the construction of model-X knockoff features plays a key role in FDR control. In some special cases such as x ∼N(0, Σ) with Σ ∈Rp×p the covariance matrix, the model-X knockoff features can be constructed easily. More specifically, if x ∼N(0, Σ), then a valid construction of knockoff features is ˜x|x ∼N x −diag{s}Σ−1x, 2diag{s} −diag{s}Σ−1diag{s}  . (1) Here diag {s} with all components of s being positive is a diagonal matrix the requirement that the conditional covariance matrix in Equation 1 is positive definite. Following the above knockoffs 3 construction, the original features and the model-X knockoff features have the following joint distribution (x, ˜x) ∼N  0 0  ,  Σ Σ −diag{s} Σ −diag{s} Σ  . (2) Intuitively, a larger s implies that the constructed knockoff features are more different from the original features and thus can increase the power of the method. With the constructed knockoff features ˜x, we quantify important features via the knockoff by resorting to the knockoff statistics Wj = gj(Zj, ˜Zj) for 1 ≤j ≤p, where Zj and ˜Zj represent feature importance measures for the jth feature Xj and its knockoff counterpart ˜Xj, respectively, and gj(·, ·) is an antisymmetric function satisfying gj(Zj, ˜Zj) = −gj( ˜Zj, Zj). Note that the feature importance measures as well as the knockoff statistics depend on the specific algorithm used to fit the model. For example, in linear regression models one can choose Zj and ˜Zj as the Lasso regression coefficients of Xj and ˜Xj, respectively, and a valid knockoff statistic could be Wj = |Zj| −| ˜Zj|. In principle, the knockoff statistics Wj should satisfy a coin-flip property such that swapping an arbitrary pair of Xj and its knockoff counterpart e Xj only changes the sign of Wj but keeps the signs of other Wk (k ̸= j) unchanged [10]. A desirable property for knockoff statistics Wj’s is that important features are expected to have large positive values, whereas unimportant ones should have small magnitudes symmetric around 0. Given the knockoff statistics as feature importance measures, we sort |Wj|’s in decreasing order and select features whose Wj’s exceed some threshold T. In particular, two choices of threshold are suggested [2, 10] T = min  t ∈W, | {j : Wj ≤−t} | | {j : Wj ≥t} | ≤q  , T+ = min  t ∈W, 1 + | {j : Wj ≤−t} | 1 ∨| {j : Wj ≥t} | ≤q  , (3) where W = {|Wj| : 1 ≤j ≤p} \ {0} is the set of unique nonzero values attained by |Wj|’s and q ∈(0, 1) is the desired FDR level specified by the user. [10] proved that under mild conditions on Wj’s, the knockoff filter with T controls a slightly modified version of FDR and the knockoff+ filter with T+ controls the exact FDR. When the joint distribution of x is unknown, to construct knockoff features one needs to estimate this distribution from data. For the case of Gaussian design, the approximate knockoff features can be constructed by replacing Σ−1 in Equation 1 with the estimated precision matrix bΩ. Following [18], we exploited the ISEE [21] for scalable precision matrix estimation when implementing DeepPINK. 3 Knockoffs inference for deep neural networks In this paper, we integrate the idea of knockoff filters with DNNs to achieve feature selection with controlled FDR. We restrict ourselves to a Gaussian design so that the knockoff features can be constructed easily by following Equation 1. In practice, [10] shows how to generate knockoff variables from a general joint distribution of covariates. We initially experimented with the multilayer preceptron by naively feeding the augmented feature vector (xT , ˜xT )T directly into the networks. However, we discovered that although the FDR is controlled at the target level q, the power is extremely low and even 0 in many scenarios; see Table 1 and the discussions in a later section. To resolve the power issue, we propose a new flexible framework named DeepPINK for reproducible feature selection in DNNs, as illustrated in Figure 1. The main idea of DeepPINK is to feed the network through a plugin pairwise-coupling layer containing p filters, F1, · · · , Fp, where the jth filter connects feature Xj and its knockoff counterpart ˜Xj. Initialized equally, the corresponding filter weights Zj and ˜Zj compete against each other during training. Thus intuitively, Zj being much larger than ˜Zj in magnitude provides some evidence that the jth feature is important, whereas similar values of Zj and ˜Zj indicate that the jth feature is not important. In addition to the competition of each feature against its own knockoff counterpart, features compete against each other. To encourage competitions, we use a linear activation function in the pairwisecoupling layer. 4 ... ... ... ~xp x1 x2 xp ~x1 ~x2 Input Original features Knockoff features Plugin pairwise-coupling layer with linear activation Multilayer perceptron with ReLU activation y ... ... ... Response w(1) w(2) w(3) w(0) z1 z1~ z2 z2~ zp zp~ F1 F2 Fp Figure 1: A graphical illustration of DeepPINK. DeepPINK is built upon an MLP with a plugin pairwisecoupling layer containing p filters, one per input feature, where each filter connects the original feature and its knockoff counterpart. The filter weights Zj and ˜Zj for jth feature and its knockoff counterpart are initialized equally for fair competition. The outputs of the filters are fed into a fully connected MLP with 2 hidden layers, each containing p neurons. Both ReLU activation and L1-regularization are used in the MLP. The outputs of the filters are then fed into a fully connected multilayer perceptron (MLP) to learn a mapping to the response Y . The MLP network has multiple alternating linear transformation and nonlinear activation layers. Each layer learns a mapping from its input to a hidden space, and the last layer learns a mapping directly from the hidden space to the response Y . In this work, we use an MLP with 2 hidden layers, each containing p neurons, as illustrated in Figure 1. We use L1-regularization in the MLP with regularization parameter set to O( q 2 log p n ). We use Adam [24] to train the deep learning model with respect to the mean squared error loss, using an initial learning rate of 0.001 and batch size 10. Let W (0) ∈Rp×1 be the weight vector connecting the filters to the MLP. And let W (1) ∈Rp×p, W (2) ∈Rp×p, and W (3) ∈Rp×1 be the weight matrices connecting the input vector to the hidden layer, hidden layer to hidden layer, and hidden layer to the output, respectively. The importance measures Zj and ˜Zj are determined by two factors: (1) the relative importance between Xj and its knockoff counterpart ˜Xj, encoded by filter weights z = (z1, · · · , zp)T and ˜z = (˜z1, · · · , ˜zp)T , respectively; and (2) the relative importance of the jth feature among all p features, encoded by the weight matrices, w = W (0) ⊙(W (1)W (2)W (3)), where ⊙denotes the entry-wise matrix multiplication. Therefore, we define Zj and ˜Zj as Zj = zj × wj and ˜Zj = ˜zj × wj. (4) With the above introduced importance measures Zj and ˜Zj, the knockoff statistic can be defined as Wj = Z2 j −˜Z2 j , and the filtering step can be applied to the Wj’s to select features. Our definition of feature importance measures naturally applies to deep neural nets with more hidden layers. The choice of 2 hidden layers for the MLP is only for illustration purposes. 4 Simulation studies 4.1 Model setups and simulation settings We use synthetic data to compare the performance of DeepPINK to existing methods in the literature. Since the original knockoff filter [2] and the high-dimensional knockoff filter [3] were only designed for Gaussian linear regression models, we first simulate data from y = Xβ + ε, (5) 5 where y = (Y1, · · · , Yn)T ∈Rn is the response vector, X ∈Rn×p is a random design matrix, β = (β1, β2, · · · , βp)T ∈Rp is the coefficient vector, and ε = (ε1, · · · , εn)T ∈Rn is a vector of noise. Since nonlinear models are more pervasive than linear models in real applications, we also consider the following Single-Index model Yi = g(xT i β) + εi, i = 1, · · · , n, (6) where g is some unknown link function and xi is the feature vector corresponding to the ith observation. We simulate the rows of X independently from N(0, Σ) with precision matrix Σ−1 = ρ|j−k| 1≤j,k≤p with ρ = 0.5. The noise distribution is chosen as ε ∼N(0, σ2In) with σ = 1. For all simulation examples, we set the target FDR level to q = 0.2. For the linear model, we experiment with sample size n = 1000, and consider the high-dimensional scenario with number of features p = 50, 100, 200, 400, 600, 800, 1000, 1500, 2000, 2500, and 3000. The true regression coefficient vector β0 ∈Rp is sparse with s = 30 nonzero signals randomly located, and the nonzero coefficients are randomly chosen from {±1.5}. For the Single-Index model, we fix the sample size n = 1000 and vary feature dimensionality as p = 50, 100, 200, 400, 600, 800, 1000, 1500, 2000, 2500, and 3000. We set the true link function g(x) = x3/2. The true regression coefficient vector is generated similarly with s = 10. 4.2 Simulation results We compare the performance of DeepPINK with three popularly used methods, MLP, DeepLIFT [34], random forest (RF) [9], and support vector regression (SVR) with linear kernel. For RF, the feature importance is measured by Gini importance [8]. For MLP, the feature importance is measured similarly to DeepPINK without the pairwise-coupling layer. For DeepLIFT, the feature importance is measured by the multiplier score. For SVR with linear kernel, the feature importance is measured by the coefficients in the primal problem [11]. We did not compare with SVR with nonlinear kernel because we could not find any feature importance measure with nonlinear kernel in existing software packages. We would like to point out that with the linear kernel, the model is misspecified when observations are generated from the Single-Index model. Due to the very high computational cost for various methods in high dimensions, for each simulation example, we set the number of repetitions to 20. For DeepPINK and MLP, the neural networks are trained 5 times with different random seeds within each repetition. When implementing the knockoff filter, the threshold T+ was used, and the approximate knockoff features were constructed using the estimated precision matrix bΩ(see [18] for more details). The empirical FDR and power are reported in Table 1. We see that DeepPINK consistently control FDR much below the target level even though we choose a pretty loose threshold and has the highest power among the competing methods in almost all settings. MLP, DeepLIFT, and RF control FDR at the target level, but in each case the power is very sensitive to dimensionality and model nonlinearity. For SVR with the linear kernel, occasionally the FDR is above the target level q = 0.2, which could be caused by the very small number of repetitions. It is worth mentioning that the superiority of DeepPINK over MLP and DeepLIFT lies in the pairwise-coupling layer, which encourages the importance competition between original and knockoff features directly. The results on FDR control are consistent with the general theory of knockoffs inference in [10] and [18]. It is worth mentioning that DeepPINK uses the same network architecture across different model settings. 5 Real data analysis In addition to the simulation examples presented in Section 4, we also demonstrate the practical utility of DeepPINK on two real applications. For all studies the target FDR level is set to q = 0.2. 5.1 Application to HIV-1 data We first apply DeepPINK to the task of identifying mutations associated with drug resistance in HIV-1 [32]. Separate data sets are available for resistance against different drugs from three classes: 7 6 DeepPINK MLP DeepLIFT RF SVR p Linear Single-Index Linear Single-Index Linear Single-Index Linear Single-Index Linear Single-Index FDR Power FDR Power FDR Power FDR Power FDR Power FDR Power FDR Power FDR Power FDR Power FDR Power 50 0.046 1 0.13 0.98 0.15 1 0.17 0.89 0.16 1 0.24 0.9 0.005 0.45 0 0 0.18 1 0.180 0.81 100 0.047 1 0.08 1 0.048 1 0.056 0.26 0.16 1 0.13 0.47 0.016 0.61 0.025 0.045 0.22 1 0.094 0.26 200 0.042 0.99 0.042 1 0.11 1 0 0 0.24 0.96 0.034 0.067 0.013 0.54 0.020 0.045 0.21 1 0.061 0.05 400 0.022 0.97 0.022 1 0.29 0.95 0 0 0.034 0.5 0.039 0.069 0.017 0.53 0.033 0.050 0.22 1 0.083 0.01 600 0.031 0.95 0.046 1 0.17 0.8 0.014 0.013 0.003 0.26 0.068 0.16 0.023 0.56 0.11 0.095 0.19 1 0 0 800 0.048 0.95 0.082 1 0.037 0.62 0.016 0.068 0 0.17 0.16 0.24 0.022 0.61 0.061 0.12 0.22 0.98 0 0 1000 0.023 0.97 0.065 1 0.007 0.4 0.037 0.16 0 0.12 0.013 0.33 0.029 0.59 0.081 0.17 0.15 0.67 0 0 1500 0.007 1 0.065 1 0.002 0.41 0.068 0.25 0.001 0.32 0.13 0.44 0.045 0.58 0.098 0.17 0.064 0.043 0 0 2000 0.026 0.99 0.098 1 0.023 0.4 0.063 0.35 0.015 0.37 0.1 0.56 0.033 0.65 0.046 0.14 0.04 0.002 0 0 2500 0.029 0.97 0.067 1 0.21 0.5 0.042 0.35 0.088 0.58 0.32 0.47 0.034 0.62 0.11 0.18 0.02 0.005 0 0 3000 0.046 0.97 0.051 1 0.11 0.43 0.046 0.31 0.069 0.46 0.14 0.44 0.05 0.65 0.087 0.17 0.05 0 0 0 Table 1: Simulation results for linear model and the Single-Index model. protease inhibitors (PIs), 6 nucleoside reverse-transcriptase inhibitors (NRTIs), and 3 nonnucleoside reverse transcriptase inhibitors (NNRTIs). The response Y is the log-transformed drug resistance level to the drug, and the jth column of the design matrix X indicates the presence or absence of the jth mutation. We compare the identified mutations, within each drug class, against the treatment-selected mutations (TSM), which contains mutations associated with treatment by the drug from that class. Following [2], for each drug class, we consider the jth mutation as a discovery for that drug class as long as it is selected for any of the drugs in that class. Before running the selection procedure, we remove patients with missing drug resistance information and only keep those mutations which appear at least three times in the sample. We then apply three different methods to the data set: DeepPINK with model-X knockoffs discussed earlier in this paper, the original fixed-X knockoff filter based on a Gaussian linear model (Knockoff) proposed in [2], and the Benjamini–Hochberg (BHq) procedure [4]. Following [2], z-scores rather than p-values are used in BHq to facilitate comparison with other methods. Figure 2 summarizes the discovered mutations of all methods within each drug class for PI and NRTI. In this experiment, we see several differences among the methods. Compared to Knockoff, DeepPINK obtains equivalent or better power in 9 out of 13 cases with comparable false discovery proportion. In particular, DeepPINK and BHq are the only methods that can identify mutations in DDI, TDF, and X3TC for NRTI. Compared to BHq, DeepPINK obtains equivalent or better power in 10 out of 13 cases with with much better controlled false discovery proportion. In particular, DeepPINK shows remarkable performance for APV where it recovers 18 mutations without any mutation falling outside the TSM list. Finally, it is worth mentioning that DeepPINK does not make assumptions about the underlying models. 5.2 Application to gut microbiome data We next apply DeepPINK to the task of identifying the important nutrient intake as well as bacteria genera in the gut that are associated with body-mass index (BMI). We use a cross-sectional study of n = 98 healthy volunteers to investigate the dietary effect on the human gut microbiome [12, 26, 45]. The nutrient intake consists of p1 = 214 micronutrients whose values are first normalized using the residual method to adjust for caloric intake and then standardized [12]. Furthermore, the composition of p2 = 87 genera are extracted using 16S rRNA sequencing from stool samples. the compositional data is first log-ratio transformed to get rid of the sum-to-one constraint and then centralized. Following [26], 0s are replaced with 0.5 before converting the data to compositional form. Therefore, we treat BMI as the response and the nutrient intake together with genera composition as predictors. Table 2 shows the eight identified nutrient intake and bacteria genera using DeepPINK with the target FDR level q = 0.2. Among them, three overlap with the four genera (Acidaminococcus, Alistipes, Allisonella, Clostridium) identified in [26] using Lasso. At the phylum level, it is known that firmicutes affect human obesity [26], which is consistent with identified firmicutes-dominated genera. In view of the associations with BMI, all identified genera and nutrient intake by DeepPINK are supported by literature evidence shown in Table 2. 7 False Discoveries True Discoveries 18 19 3 17 8 26 10 23 8 20 7 19 6 19 12 20 10 18 5 16 1 18 3 28 10 24 7 22 7 18 4 19 8 18 8 15 2 17 4 19 11 Resistance to APV Resistance to ATV Resistance to IDV Resistance to LPV Resistance to NFV Resistance to RTV Resistance to SQV DeepPINK Knockoff BHq 0 10 20 30 (A) DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq 12 4 10 1 9 6 13 5 16 4 13 9 10 2 6 1 10 10 8 2 6 3 10 2 12 15 8 2 6 Resistance to ABC Resistance to AZT Resistance to D4T Resistance to DDI Resistance to TDF Resistance to X3TC DeepPINK Knockoff BHq 0 10 20 (B) DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq DeepPINK Knockoff BHq n = 767 p = 201 n = 328 p = 147 n = 825 p = 206 n = 515 p = 184 n = 842 p = 207 n = 793 p = 205 n = 824 p = 206 n = 629 p = 283 n = 623 p = 283 n = 626 p = 283 n = 625 p = 281 n = 628 p = 283 n = 351 p = 215 Figure 2: Performance on the HIV-1 drug resistance data. For each drug class, we show the number of mutation positions for (A)PI and (B)NRTI identified by DeepPINK, Knockoff, and BHq at target FDR level q = 0.2. Nutrient intake Bacteria genera Micronutrient Reference Phylum Genus Reference 1 Linoleic [7] Firmicutes Clostridium [26] 2 Dairy Protein [29] Firmicutes Acidaminococcus [26] 3 Choline, Phosphatidylcholine [31] Firmicutes Allisonella [26] 4 Choline, Phosphatidylcholine w/o suppl. [31] Firmicutes Megamonas [25] 5 Omega 6 [39] Firmicutes Megasphaera [43] 6 Phenylalanine, Aspartame [41] Firmicutes Mitsuokella [43] 7 Aspartic Acid, Aspartame [41] Firmicutes Holdemania [30] 8 Theaflavin 3-gallate, flavan-3-ol(2) [42] Proteobacteria Sutterella [13] Table 2: Major nutrient intake and gut microbiome genera identified by DeepPINK with supported literature evidence. 6 Conclusion We have introduced a new method, DeepPINK, that can help to interpret a deep neural network model by identifying a subset of relevant input features, subject to the FDR control. DeepPINK employs a particular DNN architecture, namely, a plugin pairwise-coupling layer, to encourage competitions between each original feature and its knockoff counterpart. DeepPINK achieves FDR control with much higher power than the naive combination of the knockoffs idea with a vanilla MLP. Extending DeepPINK to other neural networks such as CNN and RNN would be interesting directions for future. Reciprocally, DeepPINK in turn improves on the original knockoff inference framework. It is worth mentioning that feature selection always relies on some importance measures, explicitly or implicitly (e.g., Gini importance [8] in random forest). One drawback is that the feature importance measures heavily depend on the specific algorithm used to fit the model. Given the universal approximation property of DNNs, practitioners can now avoid having to handcraft feature importance measures with the help of DeepPINK. 8 Acknowledgments This work was supported by NIH awards 1R01GM131407-01 and R01GM121818, a grant from the Simons Foundation, and an Adobe Data Science Research Award. References [1] Felix Abramovich, Yoav Benjamini, David L. Donoho, and Iain M. Johnstone. Adapting to unknown sparsity by controlling the false discovery rate. The Annals of Statistics, 34:584–653, 2006. [2] Rina Foygel Barber and Emmanuel J Candès. Controlling the false discovery rate via knockoffs. The Annals of Statistics, 43(5):2055–2085, 2015. [3] Rina Foygel Barber and Emmanuel J Candès. A knockoff filter for high-dimensional selective inference. arXiv preprint arXiv:1602.03574, 2016. [4] Yoav Benjamini and Yosef Hochberg. Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society. Series B (Methodological), pages 289–300, 1995. [5] Yoav Benjamini and Daniel Yekutieli. The control of the false discovery rate in multiple testing under dependency. The Annals of Statistics, 29:1165–1188, 2001. [6] Alexander Binder, Grégoire Montavon, Sebastian Lapuschkin, Klaus-Robert Müller, and Wojciech Samek. Layer-wise relevance propagation for neural networks with local renormalization layers. In International Conference on Artificial Neural Networks, pages 63–71. Springer, 2016. [7] Henrietta Blankson, Jacob A Stakkestad, Hans Fagertun, Erling Thom, Jan Wadstein, and Ola Gudmundsen. Conjugated linoleic acid reduces body fat mass in overweight and obese humans. The Journal of Nutrition, 130(12):2943–2948, 2000. [8] Leo Breiman. Classification and regression trees. 1984. [9] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. [10] Emmanuel J Candès, Yingying Fan, Lucas Janson, and Jinchi Lv. Panning for gold: Model-X knockoffs for high-dimensional controlled variable selection. Journal of the Royal Statistical Society Series B, 2018. to appear. [11] Yin-Wen Chang and Chih-Jen Lin. Feature ranking using linear SVM. In Causation and Prediction Challenge, pages 53–64, 2008. [12] Jun Chen and Hongzhe Li. Variable selection for sparse dirichlet-multinomial regression with an application to microbiome data analysis. The Annals of Applied Statistics, 7(1), 2013. [13] Chih-Min Chiu, Wei-Chih Huang, Shun-Long Weng, Han-Chi Tseng, Chao Liang, Wei-Chi Wang, Ting Yang, Tzu-Ling Yang, Chen-Tsung Weng, Tzu-Hao Chang, et al. Systematic analysis of the association between gut flora and obesity through high-throughput sequencing and bioinformatics approaches. BioMed Research International, 2014, 2014. [14] Sandy Clarke and Peter Hall. Robustness of multiple testing procedures against dependence. The Annals of Statistics, 37:332–358, 2009. [15] Bradley Efron. Correlation and large-scale simultaneous significance testing. Journal of the American Statistical Association, 102:93–103, 2007. [16] Jianqing Fan, Peter Hall, and Qiwei Yao. To how many simultaneous hypothesis tests can normal, student’s t or bootstrap calibration be applied? Journal of the American Statistical Association, 102:1282–1288, 2007. [17] Jianqing Fan, Han Xu, and Weijie Gu. Control of the false discovery rate under arbitrary covariance dependence (with discussion). Journal of the American Statistical Association, 107:1019–1045, 2012. 9 [18] Yingying Fan, Emre Demirkaya, Gaorong Li, and Jinchi Lv. RANK: large-scale inference with graphical nonlinear knockoffs. arXiv preprint arXiv:1709.00092, 2017. [19] Yingying Fan, Emre Demirkaya, and Jinchi Lv. Nonuniformity of p-values can occur early in diverging dimensions. arXiv preprint arXiv:1705.03604, 2017. [20] Yingying Fan and Jianqing Fan. Testing and detecting jumps based on a discretely observed process. Journal of Econometrics, 164:331–344, 2011. [21] Yingying Fan and Jinchi Lv. Innovated scalable efficient estimation in ultra-large Gaussian graphical models. The Annals of Statistics, 44(5):2098–2126, 2016. [22] Amirata Ghorbani, Abubakar Abid, and James Zou. Interpretation of neural networks is fragile. arXiv preprint arXiv:1710.10547, 2017. [23] Peter Hall and Qiying Wang. Strong approximations of level exceedences related to multiple hypothesis testing. Bernoulli, 16:418–434, 2010. [24] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [25] Ya-Shu Kuang, Jin-Hua Lu, Sheng-Hui Li, Jun-Hua Li, Ming-Yang Yuan, Jian-Rong He, NianNian Chen, Wan-Qing Xiao, Song-Ying Shen, Lan Qiu, et al. Connections between the human gut microbiome and gestational diabetes mellitus. GigaScience, 6(8):1–12, 2017. [26] Wei Lin, Pixu Shi, Rui Feng, and Hongzhe Li. Variable selection in regression with compositional covariates. Biometrika, 101(4):785–797, 2014. [27] Zachary C Lipton. The mythos of model interpretability. arXiv preprint arXiv:1606.03490, 2016. [28] Ziad Obermeyer and Ezekiel J Emanuel. Predicting the future - big data, machine learning, and clinical medicine. The New England Journal of Medicine, 375(13):1216, 2016. [29] Laura Pimpin, Susan Jebb, Laura Johnson, Jane Wardle, and Gina L Ambrosini. Dietary protein intake is associated with body mass index and weight up to 5 y of age in a prospective cohort of twins. The American Journal of Clinical Nutrition, 103(2):389–397, 2016. [30] Sylvie Rabot, Mathieu Membrez, Florence Blancher, Bernard Berger, Déborah Moine, Lutz Krause, Rodrigo Bibiloni, Aurélia Bruneau, Philippe Gérard, Jay Siddharth, et al. High fat diet drives obesity regardless the composition of gut microbiota in mice. Scientific Reports, 6:32484, 2016. [31] Dominic N Reeds, B Selma Mohammed, Samuel Klein, Craig Brian Boswell, and V Leroy Young. Metabolic and structural effects of phosphatidylcholine and deoxycholate injections on subcutaneous fat: a randomized, controlled trial. Aesthetic Surgery Journal, 33(3):400–408, 2013. [32] Soo-Yon Rhee, Jonathan Taylor, Gauhar Wadhera, Asa Ben-Hur, Douglas L Brutlag, and Robert W Shafer. Genotypic predictors of human immunodeficiency virus type 1 drug resistance. Proceedings of the National Academy of Sciences, 103(46):17355–17360, 2006. [33] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should I trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1135–1144, 2016. [34] Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. arXiv preprint arXiv:1704.02685, 2017. [35] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. 10 [36] John D. Storey, Jonathan E. Taylor, and David Siegmund. Strong control, conservative point estimation and simultaneous conservative consistency of false discovery rates: a unified approach. Journal of the Royal Statistical Society Series B, 66:187–205, 2004. [37] Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. arXiv preprint arXiv:1703.01365, 2017. [38] Ryan Turner. A model explanation system. In Machine Learning for Signal Processing (MLSP), 2016 IEEE 26th International Workshop on, pages 1–6, 2016. [39] Mauno Vanhala, Juha Saltevo, Pasi Soininen, Hannu Kautiainen, Antti J Kangas, Mika AlaKorpela, and Pekka Mäntyselkä. Serum omega-6 polyunsaturated fatty acids and the metabolic syndrome: a longitudinal population-based cohort study. American Journal of Epidemiology, 176(3):253–260, 2012. [40] Wei Biao Wu. On false discovery control under dependence. The Annals of Statistics, 36:364– 380, 2008. [41] Qing Yang. Gain weight by "going diet?" Artificial sweeteners and the neurobiology of sugar cravings: Neuroscience 2010. The Yale Journal of Biology and Medicine, 83(2):101, 2010. [42] Yoon Jung Yang, You Jin Kim, Yoon Kyoung Yang, Ji Yeon Kim, and Oran Kwon. Dietary flavan-3-ols intake and metabolic syndrome risk in korean adults. Nutrition Research and Practice, 6(1):68–77, 2012. [43] Yeojun Yun, Han-Na Kim, Song E Kim, Seong Gu Heo, Yoosoo Chang, Seungho Ryu, Hocheol Shin, and Hyung-Lae Kim. Comparative analysis of gut microbiota associated with body mass index in a large korean cohort. BMC Microbiology, 17(1):151, 2017. [44] Yu Zhang and Jun S. Liu. Fast and accurate approximation to significance tests in genome-wide association studies. Journal of the American Statistical Association, 106:846–857, 2011. [45] Zemin Zheng, Jinchi Lv, and Wei Lin. Nonsparse learning with latent variables. arXiv preprint arXiv:1710.02704, 2017. 11
2018
186
7,348
Supervised autoencoders: Improving generalization performance with unsupervised regularizers Lei Le Department of Computer Science Indiana University Bloomington, IN leile@iu.edu Andrew Patterson and Martha White Department of Computing Science University of Alberta Edmonton, AB T6G 2E8, Canada {ap3, whitem}@ualberta.ca Abstract Generalization performance is a central goal in machine learning, with explicit generalization strategies needed when training over-parametrized models, like large neural networks. There is growing interest in using multiple, potentially auxiliary tasks, as one strategy towards this goal. In this work, we theoretically and empirically analyze one such model, called a supervised auto-encoder: a neural network that jointly predicts targets and inputs (reconstruction). We provide a novel generalization result for linear auto-encoders, proving uniform stability based on the inclusion of the reconstruction error—particularly as an improvement on simplistic regularization such as norms. We then demonstrate empirically that, across an array of architectures with a different number of hidden units and activation functions, the supervised auto-encoder compared to the corresponding standard neural network never harms performance and can improve generalization. 1 Introduction Generalization is a central concept in machine learning: learning functions from a finite set of data, that can perform well on new data. Generalization bounds have been characterized for many functions, including linear functions [1], and those with low-dimensionality [2, 3] and functions from reproducing kernel Hilbert spaces [4]. Many of these bounds are obtained through some form of regularization, typically ℓ2 regularization [5, 6] or from restricting the complexity of the function class such as by constraining the number of parameters [1]. Understanding generalization performance is particularly critical for powerful function classes, such as neural networks. Neural networks have well-known overfitting issues, with common strategies to reduce overfitting including drop-out [7–9], early stopping [10] and data augmentation [11, 12], including adversarial training [13] and label smoothing [14]. Many layer-wise regularization strategies have also been suggested for neural networks, such as with layer-wise training [15, 16], pre-training with layer-wise additions of either unsupervised learning or supervised learning [15] and the use of auxiliary variables for hidden layers [17]. An alternative direction that has begun to be explored is to instead consider regularization with the addition of tasks. Multi-task learning [18] has been shown to improve generalization performance, from early work showing learning tasks jointly reduces the required number of samples [19, 20] and later work particularly focused on trace-norm regularization on the weights of a linear, single hidden-layer neural network for a set of tasks [21–23]. Some theoretical work has also been done for auxiliary tasks [24], with the focus of showing that the addition of auxiliary tasks can improve the representation and so generalization. In parallel, a variety of experiments have demonstrated the utility of adding layer-wise unsupervised errors as auxiliary tasks [15, 16, 25–27]. Auxiliary tasks have also been explored through the use of hints for neural networks [28, 18]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In this work, we investigate an auxiliary-task model for which we can make generalization guarantees, called a supervised auto-encoder (SAE). A SAE is a neural network that predicts both inputs and outputs, and has been previously shown empirically to provide significant improvements when used in a semi-supervised setting [16] and deep neural networks [29]. We provide a novel uniform stability result, showing that linear SAE—which consists of the addition of reconstruction error to a linear neural network— provides uniform stability and so a bound on generalization error. We show that the stability coefficient decays similarly to the stability coefficient under ℓ2 regularization [5], providing effective generalization performance but avoiding the negative bias from shrinking coefficients. The reconstruction error may incur some bias, but is related to the prediction task and so is more likely to prefer a more robust model amongst a set of similarly effective models for prediction. This bound, to the best of our knowledge, is (a) one of the first bounds demonstrating that supervised dimensionality reduction architectures can provide improved generalization performance and (b) provides a much tighter bound than is possible from applying generalization results from multi-task learning [21–23] and learning with auxiliary tasks [24]. Finally, we demonstrate empirically that adding reconstruction error never harms performance compared to the corresponding neural network model, and in some cases can significantly improve classification accuracy. 2 Supervised autoencoders and representation learning We consider a supervised learning setting, where the goal is to learn a function for a vector of inputs x ∈Rd to predict a vector of targets y ∈Rm. The function is trained on a finite batch of i.i.d. data, (x1, y1), . . . , (xt, yt), with the aim to predict well on new samples generated from the same distribution. To do well in prediction, a common goal is representation learning, where the input xi are first transformed into a new representation, for which it is straightforward to learn a simple predictor—such as a linear predictor. Auto-encoders (AE) are one strategy to extract a representation. An AE is a neural network, where the outputs are set to x, the inputs. By learning to reconstruct the input, the AE extracts underlying or abstract attributes that facilitate accurate prediction of the inputs. Linear auto-encoders with a single hidden layer are equivalent to principle components analysis [30][31, Theorem 12.1], which finds (orthogonal) explanatory factors for the data. More generally, nonlinear auto-encoders have indeed been found to extract key attributes, including high-level features [32] and Gabor-filter features [33]. A supervised auto-encoder (SAE) is an auto-encoder with the addition of a supervised loss on the representation layer. For a single hidden layer, this simply means that a supervised loss is added to the output layer, as in Figure 1. For a deeper auto-encoder, the innermost (smallest)1 layer would have a supervised loss added to it—the layer that would usually be handed off to the supervised learner after training the AE. More formally, consider a linear SAE, with a single hidden layer of size k. The weights for the first layer are F ∈Rd×k. The weight for the output layer consist of weights Wp ∈Rk×m to predict y and Wr ∈Rk×d to reconstruct x. Let Lp be the supervised (primary) loss and Lr the loss for the reconstruction error. For example, in regression, both losses might be the squared error, resulting in the objective 1 t t X i=1 [Lp(WpFxi, yi) + Lr(WrFxi, xi)] = 1 2t t X i=1  ∥WpFxi −yi∥2 2 + ∥WrFxi −xi∥2 2  . (1) The addition of a supervised loss to the auto-encoder should better direct representation learning towards representations that are effective for the desired tasks. Conversely, solely training a representation according to the supervised tasks, like learning hidden layers in an neural network, is likely an under-constrained problem, and will find solutions that can well fit the data but that do not find underlying patterns in the data and do not generalize well. In this way, the combination of the two losses has the promise to both balance extracting underlying structure, as well as providing accurate prediction performance. There have been several empirical papers that have demonstrated the capabilities of semi-supervised autoencoders [16, 27, 34]. Those results focus on the semi-supervised component, where the use of auto-encoders enables the representation to be trained with more unlabeled data. In this paper, however, we would like to determine if even in the purely supervised setting, the addition of reconstruction error can have a benefit for generalization. 1The size of the learned representations for deep, nonlinear AEs does not have to be small, but it is common to learn such a lower-dimensional representations. For linear SAEs, the hidden layer size k < d, as otherwise trivial solutions like the replication of the input are able to minimize the reconstruction error. 2 x h x Encoder Decoder y Input Code Output (a) (Linear) Supervised Autoencoder x h1 h2 h3 x Encoder Decoder y Input Code Output (b) Deep Supervised Autoencoder Figure 1: Two examples of Supervised Autoencoders, and where the supervised component—the targets y—are included. We provide generalization performance results for linear SAEs, represented by (a) assuming a linear activation to produce the hidden layer, with arbitrary convex losses on the output layer, such as the cross-entropy for classification. We investigate more general architectures in the experiments, including single-hidden layer SAEs, represented by (a) with nonlinear activations to produce the hidden layer, and deep SAEs, depicted in (b). 3 Uniform stability and generalization bounds for SAE In this section, we show that including the reconstruction error theoretically improves generalization performance. We show that linear supervised auto-encoders are uniformly stable, which means that there is a small difference between models learned for any subsample of data, which differ in only one instance. Uniformly stable algorithms are known to have good generalization performance [5]. Before showing this result, we discuss a few alternatives to justify why we pursue uniform stability. There are at least two alternative strategies that could be considered to theoretically analyze these models: using a multi-task analysis and characterizing the Rademacher complexity of the supervised auto-encoder function class. The reconstruction error can in-fact be considered as multiple tasks, where the multiple tasks help regularize or constrain the solution [35]. Previous results for multi-task learning [21–23] demonstrate improved generalization error bounds when learning multiple tasks jointly. Unfortunately, these bounds show performance is improved on average across tasks. For our setting, we only care about the primary tasks, with the reconstruction error simply included as an auxiliary task to regularize the solution. An average improvement might actually mean that performance on the primary task degrades with inclusion of these other tasks. Earlier multi-task work did consider improvement for each task [36], but assumed different randomly generated features for each task and all tasks binary classification problem, which does not match this setting. Another strategy is to characterize Rademacher complexity of supervised auto-encoders. There has been some work characterizing the Rademacher complexity of unsupervised dimensionality reduction techniques [3, Theorem 3.1]. To the best of our knowledge, however, there as yet does not appear to be an analysis on complexity of supervised dimensionality reduction techniques. There is some work on supervised dimension reduction [2, 3]; however, this analysis assumes a dimensionality reduction step followed by a supervised learning step, rather than a joint training procedure. For these reasons, we pursue a third direction, where we treat the reconstruction error as a regularizer to promote stability. Uniform stability has mainly been obtained using norm-based regularization strategies, such as ℓ2. More recently, Liu et al. [24] showed that auxiliary tasks—acting as regularizers—could also provide uniform stability. Because reconstruction error can be considered to be an auxiliary task, our analysis resembles this auxiliary-task analysis. However, there are key differences, as the result by Liu et al. [24] would be uninteresting if simply applied directly to our setting. In particular, the uniform stability bound would not decay with the number of samples. The bound decays proportionally to the number of samples for the primary task, but in the numerator contains the maximum number of samples for an auxiliary task. For us, this maximum number is exactly the same number of samples as for the primary task, and so they would cancel, making the bound independent of the number of samples. 3 Primary Result We now show that the parameter shared by the primary task and reconstruction error—the forward model F—does not change significantly with the change of one sample. This shows that linear SAEs have uniform stability, which then immediately provides a generalization bound from [5, Theorem 12]. The proofs are provided in the appendix, for space. Let Lp corresponds to the primary part (supervised part) of the loss, with weights Wp, and Lr correspond to the auxiliary tasks that act as regularizers (the reconstruction error), with weights Wr. The full loss can be written L(F) = 1 t t X i=1 Lp (WpFxi, yp,i) + Lr (WrFxi, yr,i) . (2) For our specific setting, yr = x. We use more general notation, however, both to clarify the difference between the inputs and outputs, and for future extensions to this theory for other (auxiliary) targets yr. The loss where the m-th sample (xm, ym) is replaced by a random new instance (x′ m, y′ m) is Lm(F)=1 t h Lp WpFx′ m, y′ p,m  +Lr WrFx′ m, y′ r,m  + t X i=1,i̸=m Lp(WpFxi, yp,i)+Lr(WrFxi, yr,i) i . If we let F, Fm correspond to the optimal forward models for these two losses respectively, then the algorithm is said to be β-uniformly stable if the difference in loss value for these two models for any point (x, y) is bounded by β with high-probability |Lp (WpFmx, yp) −Lp (WpFx, yp)| ≤β To obtain uniform stability, we will need to make several assumptions. The first common assumption is to assume bounded spaces, for the data and learned variables. Assumption 1. The features satisfy ∥x∥2 ≤Bx and the primary targets satisfy ∥yp∥2 ≤By. The parameters spaces are bounded, W = {(Wp, Wr) ∈Rk×m : ∥Wp∥F ≤BWp, ∥Wr∥F ≤BWr} F = {F ∈Rd×k : ∥F∥F ≤BF} for some positive constants Bx, By, BF, BWp, BWr, where ∥· ∥F denotes Frobenius norm, namely the square root of the sum of the squares of all elements. For SAE, yr = x, and so ∥x∥2 ≤Bx implies that ∥yr∥2 ≤Bx. Second, we need to ensure that the reconstruction error is both strongly convex and Lipschitz. The next two assumptions are satisfied, for example, by the ℓ2 loss, Lr(ˆy, y) = ∥ˆy −y∥2 2. Assumption 2. The reconstruction loss Lr(·, y) is σr-admissible, i.e., for possible predictions ˆy, ˆy′ |Lr (ˆy, y) −Lr (ˆy′, y)| ≤σr∥ˆy −ˆy′∥2. Assumption 3. Lr(·, y) is c-strongly-convex ⟨ˆy −ˆy′, ∇Lr (ˆy, y) −∇Lr (ˆy′, y)⟩≥c∥ˆy −ˆy′∥2 2 The growth of the primary loss also needs to be bounded; however, we can use a less stringent requirement than admissibility. Assumption 4. For some σp > 0, for any F, Fm ∈F, |Lp (WpFmx, yp)−Lp (WpFx, yp)| ≤σp∥Wr(Fm −F)x∥2 This requirement should be less stringent because we expect generally that for two forward models F, Fm, ∥Wp(F −Fm)x∥2 ≤∥Wr(F −Fm)x∥2. The matrix Wp ∈Rm×k projects the vector d = (F −Fm)x into a lower-dimensional space, whereas Wr ∈Rd×k projects d into a higherdimensional space. Because the nullspace of Wp is likely larger, it is more likely that Wp will send a non-zero d. In fact, if Wr is full rank—which occurs if k is less than or equal to the intrinsic rank of the data—then we can guarantee this assumption for some σp as long as Lp is σ-admissible, where likely σp can be smaller than σ. In Corollary 1, we specify the value of σp under a full rank Wr and σ-admissible Lp. Finally, we assume that there is a representative set of feature vectors in the sampled data, both in terms of feature vectors (Assumption 5) as well as loss values (Assumption 6). 4 Assumption 5. There exists a subset B = {b1, b2, ..., bn} ⊂{x1, x2, ..., xt} such that with high probability any sampled feature vector x can be reconstructed by B with a small error: x = Pn i=1 αibi + η where αi ∈R, Pn i=1 α2 i ≤r, ∥η∥2 ≤ϵ t. Assumption 5 is similar to [24, Assumption 1], except for our setting the features are the same for all the tasks and the upper bound of ∥η∥decreases as 1 t . This is a reasonable assumption since more samples in the training set make it more likely to be able to reconstruct any x that will be observed with non-negligible probability. In many cases, η = 0 is a mild assumption, as once d independent vectors bi are observed, η = 0. This representative set of points also needs to be representative in terms of the reconstruction error. In particular, we need the average reconstruction error of the representative points to be upper bounded by some constant factor of the average reconstruction error under the training set. Assumption 6. For any two datasets S, Sm, where Sm has the m-th sample replaced with a random new instance, let F, Fm be the corresponding optimal forward models. Let N contain only the reconstruction errors, without the sample that is replaced N(F) = 1 t t X i=1,i̸=m Lr (WrFxi, yr,i) (3) and Nb be the reconstruction error for the representative points Nb(F) = 1 n n X i=1 Lr (WrFbi, yr,bi) (4) where yr,bi is the reconstruction target for representative point bi. Then, there exists a > 0 such that for any small α > 0, [Nb(F) −Nb((1 −α)F + αFm)] + [Nb(Fm) −Nb((1 −α)Fm + αF)] ≤a [N(F) −N((1 −α)F + αFm)] + a [N(Fm) −N((1 −α)Fm + αF)] . The above assumption does not require that the difference under N and Nb be small for the two F and Fm; rather, it only requires that the increase or decrease in error at the two points Fm and F are similar for N and Nb. Both the right-hand-side and left-hand-side in the assumption are nonnegative, because of the convexity of N and Nb. Even if N is higher at F than Fm, and Nb is the opposite, the above bound can hold, because it simply requires that the difference of Nb between Fm and F be bounded above by the difference of N between F and Fm, up to some constant factor a. This assumption is key, because we will need to use Nb to ensure that the bound decays with t, where Nb is only dependent on the number of representative points, unlike N. We can now provide the key result: SAE has uniform stability wrt the shared parameters F. Theorem 1. Under Assumptions 1-6, for a randomly sampled x, y, with high probability |Lp(WpFmx, y) −Lp (WpFx, y)| ≤a(σr+σp)nσp ct  r+ q r2+ 4ϵcBWr BFr a(σr+σp)n  + 2ϵσpBWr BF t (5) Remark: We similarly get O( 1 t ) upper bound on instability from Bousquet and Elisseeff [5], but without requiring the ℓ2 regularizer. The ℓ2 indiscriminately reduces the magnitude of the weights; the reconstruction error, on the other hand, regularizes, but potentially without strongly biasing the solution. It can select amongst a set of possible forward models that predict the targets almost equally well, but that also satisfy reconstruction error. A hidden representation that is useful for reconstructing the inputs is likely to also be effective for predicting the targets—which are a function of the inputs. Corollary 1. In Assumption 4, if Wp ∈Rm×k, Wr ∈Rd×k, d ≥k ≥m, Wr is full rank, Lp is σ-admissible, then for W−1 r the inverse matrix of the first k rows of Wr, σp = σ∥Wp∥F ∥W−1 r ∥F . Finally, we provide a few specific bounds, for particular Lr and Lp, to show how this more general bound can be used (shown explicitly in Appendix B). For example, for a least-squares reconstruction loss Lr, c = 2 and σr = 2BWrBFBx + 2Bx. 5 4 Experiments with SAE: Utility of reconstruction error We now empirically test the utility of incorporating the reconstruction error into NNs, as a method for regularization to improve generalization performance. Our goal is to investigate the impact of the reconstruction error, and so we use the same architecture for SAE and NN, where the only difference is the use of reconstruction error. We test several different architectures, namely single-hidden layer SAEs with different activations, adding non-linearity with kernels before using a linear SAE and a deep SAE with a bottleneck, namely a hidden layer with smaller size than that of the previous layer. Experimental setup and Datasets. We used 10-fold cross-validation to choose the best metaparameters for each algorithm on each dataset. The meta-parameters providing the highest classification accuracy averaged across folds are chosen. Using the meta-parameters chosen by cross-validation, we report the average accuracy and standard error across 20 runs, each with a different randomly sampled training-testing splits. A new training-testing split is generated by shuffling all data points together and selecting the first samples to be the training set, and the remaining to be the testing set. SUSY is a high-energy particle physics dataset [37]. The goal is to classify between a process where supersymmetric particles are produced, and a background process where no detectable particles are produced. SUSY was generated to discover hidden representations of raw sensor features for classification [37], and has 8 features and 5 million data points. Deterding is a vowel dataset [38] containing 11 steady-state vowels of British English spoken by 15 speakers. Every speaker pronounced each of the eleven vowel sounds six times giving 990 labeled data points. The goal is to classify the vowel sound for each spoken vowel, where each speech signal is converted into a 10-dimensional feature vector using log area ratios based on linear prediction coefficients. We normalized each feature between 0 and 1 through Min-Max scaling. CIFAR-10 is an image dataset [39] with 10 classes and 60000 32x32 color images. The classes include objects like horses, deer, trucks and airplanes. For each of the training-test splits, we used a random subset of 50,000 images for training and 10,000 images for testing. We preprocessed the data by averaging together the three colour channels creating gray-scale images to speed up computation. MNIST is a dataset [40] of 70000 examples of 28x28 images of handwritten digits from 0 to 9. We would like to note that for these two benchmark datasets—CIFAR and MNIST—impressive performance has been achieved, such as with a highly complex, deep neural network model for CIFAR [41]. Here, however, we use these datasets to investigate a variety of models, rather than to match performance of the current state-of-the-art. We do not use the provided single training-testing split, but rather treat these large datasets as an opportunity to generate many (different) training-test splits for a thorough empirical investigation. Overall results. Figure 2 shows the performance of SAE versus NN. On the Deterding, SUSY and MNIST datasets, we compare them in three different architectures. First, we compare linear SAE with linear NN, where there is no activation function from the input to the hidden layer. Second, we nonlinearly transform the data with radial basis functions—a Gaussian kernel—and then use linear SAE and linear NNs. The kernel expansion enables nonlinear functions to be learned, despite the fact that the learning step can still benefit from the optimality results provided for linear SAE. Third, we use nonlinear activation functions, sigmoid and ReLu, from the input to the hidden layer. Though this is outside the scope of the theoretical characterization, it is a relatively small departure and important to understand the benefits of the reconstruction error for at least simple nonlinear networks. We investigate only networks with single hidden layers as a first step, and to better match the networks characterized in the theoretical guarantees. Overall, we find that SAE improves performance across settings, in some cases by several percent. Getting even an additional 1% in classification accuracy with just the addition of reconstruction error to relatively simple models is a notable result. We summarize these results in Figure 2 and Table 1. SAE and NN with the same architecture have similar sample variances, so we use a t-test for statistical significance. For all pairs but one, the average accuracy of SAE is statistically significantly higher than that of NN, with significance level 0.0005, though in some cases the differences are quite small, particularly on SUSY and MNIST. In other cases, particularly in kernel representations in Deterding, SAE significantly outperformed NN, with a jump by 18% in classification accuracy. Because we attempted to standardize the models, differing only in SAE using reconstruction error, these results indicate that the reconstruction error has a clear positive impact on generalization performance. 6 SAE NN SAE-Sigmoid NN-Sigmoid SAE-ReLu NN-ReLu SAE-Kernel NN-Kernel 0 20 40 60 80 100 Test Accuracy SA NN SA-Sigmoid NN-Sigmoid SA-ReLu NN-ReLu SA-Kernel NN-Kernel (a) Deterding dataset 0 20 40 60 80 (b) SUSY dataset 0 20 40 60 80 100 (c) MNIST dataset Figure 2: Test accuracy of a three layer neural network (NN) and our supervised auto-encoder model (SAE), on three datasets. We focus on the impact of using reconstruction error, and compare SAE and NN with a variety of nonlinear structures, including sigmoid (SAE-Sigmoid and NN-Sigmoid), ReLu (SAE-ReLu and NN-ReLu) and Gaussian kernel (SAE-Kernel and NN-Kernel). Though not showing the results in the figure, we also tried initializing NN with pre-trained autoencoders and the performance is similar to NN, thus outperformed by SAE as well. Overall, SAE consistently outpeforms NNs, though in some cases the advantage is small. Details are shown in Table 1. Deterding SUSY MNIST Average Accuracy ± Standard Error Average Accuracy ± Standard Error Average Accuracy ± Standard Error Test Training Test Training Test Training SAE 54.98 ± 0.18 63.34 ± 0.17 76.48 ± 0.01 76.50 ± 0.03 92.20 ± 0.40 93.70 ± 0.30 NN 52.50 ± 0.17 61.05 ± 0.14 76.41 ± 0.02 76.42 ± 0.02 91.20 ± 0.20 92.50 ± 0.22 SAE-Sigmoid 90.67 ± 0.12 99.38 ± 0.03 77.79 ± 0.02 77.80 ± 0.01 94.50 ± 0.10 96.35 ± 0.05 NN-Sigmoid 87.00 ± 0.14 97.62 ± 0.05 76.90 ± 0.03 76.90 ± 0.01 92.50 ± 0.10 96.20 ± 0.04 SAE-ReLu 85.47 ± 0.52 90.22 ± 0.41 71.99 ± 0.58 72.04 ± 0.33 98.00 ± 0.10 98.25 ± 0.08 NN-ReLu 72.29 ± 0.67 78.76 ± 0.08 65.27 ± 0.17 75.03 ± 0.11 97.30 ± 0.10 98.10 ± 0.09 SAE-Kernel 92.52 ± 0.10 93.15 ± 0.11 77.27 ± 0.06 77.31 ± 0.12 96.70 ± 0.20 97.40 ± 0.18 NN-Kernel 74.85 ± 0.20 82.37 ± 0.41 77.38 ± 0.06 77.42 ± 0.06 95.50 ± 0.20 96.20 ± 0.20 Table 1: The percentage accuracy for the results presented in Figure 2. SAE outperforms NNs in terms of average test accuracy across settings. The only exception is the Gaussian kernel on SUSY, where the advantage of NN-Kernel is extremely small. We report train accuracies for further insights and completeness. Note that though there is some amount of overfitting occurring, the models were given the opportunity to select a variety of regularization parameters for ℓ2 regularization as well as dropout using cross-validation. In the next few sections, we highlight certain properties of interest, in addition to these more general performance results. We highlight robustness to overfitting as model complexity is increased, for both nonlinear activations and kernel transformations. For these experiments, we choose CIFAR, since it is a more complex prediction problem with a large amount of data. We then report preliminary conclusions on the strategy of over-parametrizing and regularizing, rather than using bottleneck layers. Finally, we demonstrate the structure extracted by SAE, to gain some insight into the representation. Robustness to overfitting. We investigate the impact of increasing the hidden dimension on CIFAR, with sigmoid and ReLu activation functions from the input to the hidden layer. The results are summarized in Figures 3a and 3b, where the hidden dimension is increased from 20 to as large as 10 thousand. Both results indicate that SAE can better take advantage of increasing model complexity, where (a) the NN clearly overfit and obtained poor accuracy with a sigmoid transfer and (b) SAE gained a 2% accuracy improvement over NNs when both used a ReLu transfer. Results with kernels. The overall conclusion is that SAE can benefit much more from model complexity given by kernel representations, than NNs. In Table 1, the most striking difference between SAE and NNs with kernels occurs for the Deterding dataset. SAE outperforms NN by an entire 18%, going from 75% test accuracy to 92% test accuracy. For SUSY, SAE and NNs were essentially tied; but for that dataset, all the nonlinear architectures performed very similarly, suggesting little improvement could be gained. 7 NN test NN train SAE test SAE train Hidden Dimension 2K 4K 6K 8K 10K 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 Accuracy (a) Sigmoid activation Hidden Dimension 2K 4K 6K 8K 10K SAE NN 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 (b) ReLu activation Hidden Dimension 2K 4K 6K 8K 10K SAE NN 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 (c) Kernel Representation Figure 3: Test accuracy of SAE and NN with a variety of nonlinear architectures on CIFAR, with increasing model complexity. For the sigmoid and relu, the hidden dimension is increased; for kernels, the number of centers is increased. (a) For the sigmoid activation, the NN suffers noticeably from overfitting as the hidden dimension increases, whereas SAE is robust to the increase in model complexity. (b) For the ReLu activation, under low model complexity, SAE performed more poorly than the NN. However, given a larger hidden dimension—about a half as large as the input dimension— it reaches the same level of performance and then is better able to take advantage of the increase model complexity. The difference of about 2% accuracy improvement for such a simple addition—the reconstruction error—is a striking result. (c) The result here is similar to ReLu. Note that the size of the hidden dimension corresponds to 10% of the number of centers. On CIFAR, we also investigated the impact of increasing the number of kernel centers, which correspondingly increases model parameters and model complexity. We fixed the hidden dimension to 10% of the number of centers, to see if the SAE could still learn an appropriate model even with an aggressive bottleneck, namely a hidden layer with a relatively very small size, making it hard to reduce the reconstruction error. This helps to verify the hypothesis that the reconstruction error does not incur much bias as a regularizer, and test a more practical setting where an aggressive bottleneck can significantly speed up computation and convergence rate. For the NN, because the number of targets is 10, once the hidden dimension k ≥10, the bottleneck should have little to no impact on performance, which is what we observe. The result is summarized in Figure 3c, which shows that SAE initially suffers when model complexity is low, but then surpasses the NN with increasing model complexity. In general, we anticipate the effects with kernels and SAE to be more pronounced with more powerful selection of kernels and centers. Demonstration of SAE with a Deep Architecture. We investigate the effects of adding the reconstruction loss to deep convolutional models on CIFAR. We use a network with two convolutional layers of sizes {32, 64} and 4 dense layers of sizes {2048, 512, 128, 32} with ReLu activation. Unlike our previous experiments we do not use grey-scale CIFAR, but instead use all three color channels for the deep networks to make maximal use of the convolutional layers. As shown in Figure 4, SAE outperforms NN consistently in both train and test accuracies, suggesting that SAE is able to find a different and better solution than NN in the optimization on the training data and generalize well on the testing data. We show the performance of SAE with decreasing weight on the predictive loss, which increases the effect of the reconstruction error. Interestingly, a value of 0.01 performs the best, but began to degrade with lower values. At the extreme, for a weight of 0 which corresponds to an Autoencoder, performance is significantly worse, so the combination of both is necessary. We discuss other variants we tried in the caption for Figure 4, but the conclusions remain consistent: SAE improves generalization performance over NNs. 5 Conclusion In this paper, we systematically investigated supervised auto-encoders (SAEs), as an approach to using unsupervised auxiliary tasks to improve generalization performance. We showed theoretically that the addition of reconstruction error improves generalization performance, for linear SAEs. We showed empirically, across four different datasets, with a variety of architectures, that SAE never harms performance but in some cases can significantly improve performance, particularly when using kernels and under ReLu activations, for both shallow and deep architectures. 8 NN SAE-0.1 SAE-1.0 SAE-0.01 0.5 0.65 0.6 0 0.7 0.75 0.8 0.85 0.9 0.95 1.0 16 2 4 6 8 10 12 14 Number of Epochs Accuracy (a) Train accuracy 0.5 0.65 0.6 0 0.7 0.75 17 1 3 5 7 9 11 13 15 NN SAE-1.0 SAE-0.01 SAE-0.1 Number of Epochs (b) Test accuracy Figure 4: Train and Test accuracy of SAE and NN with a deep architecture. The numbers 0.01, 0.1 and 1.0 denote the weights on the prediction error, with a constant weights of 1.0 on the reconstruction error. We also compared to Auto-encoders, with a two-stage training strategy where the auto-encoder is trained first, with the representation then used for the supervised learner, but this performed poorly (about 0.4 testing accuracy). We additionally investigated both dropout and ℓ2 regularization. We find that dropout increases the variance of independent runs, and improves each algorithm by approximately three percentage points over its reported test set accuracy. Using ℓ2 regularization did not improve performance. Under both dropout and ℓ2, the advantage of SAE over NN in both train and test accuracies remained consistent, and so these graphs are representative for those additional settings. Finally, we additionally compared to the ResNet-18 architecture [42]. For a fair comparison, we do not use the image augmentation originally used in training ResNet-18. We find that ResNet-18, with nearly double the total learnable parameters, achieved only two percentage points higher on the test set accuracy than our SAE with reconstructive loss. References [1] Sham M Kakade, Karthik Sridharan, and Ambuj Tewari. On the Complexity of Linear Prediction: Risk Bounds, Margin Bounds, and Regularization. In Advances in Neural Information Processing Systems, 2008. [2] Mehryar Mohri, Afshin Rostamizadeh, and Dmitry Storcheus. Generalization Bounds for Supervised Dimensionality Reduction. In NIPS Workshop Feature Extraction Modern Questions and Challenges, 2015. [3] Lee-Ad Gottlieb, Aryeh Kontorovich, and Robert Krauthgamer. Adaptive metric dimensionality reduction. Theoretical Computer Science, 2016. [4] Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: risk bounds and structural results. The Journal of Machine Learning Research, 2002. [5] Olivier Bousquet and André Elisseeff. Stability and Generalization. Journal of Machine Learning Research, 2002. [6] Tong Zhang. Covering Number Bounds of Certain Regularized Linear Function Classes. Journal of Machine Learning Research, 2002. [7] Stefan Wager, Sida Wang, and Percy S Liang. Dropout Training as Adaptive Regularization. In Advances in Neural Information Processing Systems, 2013. [8] N Srivastava, G Hinton, A Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A Simple Way to Prevent Neural Networks from Overfitting . Journal of Machine Learning Research, 2014. [9] Hyeonwoo Noh, Tackgeun You, Jonghwan Mun, and Bohyung Han. Regularizing Deep Neural Networks by Noise: Its Interpretation and Optimization. In Advances in Neural Information Processing Systems, 2017. [10] N Morgan, H Bourlard, and 1990. Generalization and parameter estimation in feedforward nets: Some experiments. In Advances in Neural Information Processing Systems, 1990. [11] Larry Yaeger, Richard Lyon, and Brandyn Webb. Effective Training of a Neural Network Character Classifier for Word Recognition. In Advances in Neural Information Processing Systems, 1997. 9 [12] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In Advances in Neural Information Processing Systems, 2012. [13] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. DeepFool - A Simple and Accurate Method to Fool Deep Neural Networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2016. [14] Bin-Bin Gao, Chao Xing, Chen-Wei Xie, Jianxin Wu, and Xin Geng. Deep Label Distribution Learning With Label Ambiguity. IEEE Transactions on Image Processing, 2017. [15] Yoshua Bengio, Pascal Lamblin, Dan Popovici, and Hugo Larochelle. Greedy layer-wise training of deep networks. In Advances in Neural Information Processing Systems, 2007. [16] Marc’Aurelio Ranzato and Martin Szummer. Semi-supervised learning of compact document representations with deep networks. In International Conference on Machine Learning, 2008. [17] Miguel Á Carreira-Perpiñán and Weiran Wang. Distributed optimization of deeply nested systems. In International Conference on Artificial Intelligence and Statistics, 2014. [18] Rich Caruana. Multitask Learning. Machine Learning, 1997. [19] Jonathan Baxter. Learning internal representations. In Annual Conference on Learning Theory, 1995. [20] Jonathan Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research, 2000. [21] Andreas Maurer. Bounds for Linear Multi-Task Learning. Journal of Machine Learning Research, 2006. [22] Andreas Maurer and Massimiliano Pontil. Excess risk bounds for multitask learning with trace norm regularization. In Annual Conference on Learning Theory, 2013. [23] Andreas Maurer, Massimiliano Pontil, and Bernardino Romera-Paredes. The Benefit of Multitask Representation Learning. arXiv:1509.01240v2, 2015. [24] Tongliang Liu, Dacheng Tao, Mingli Song, and Stephen J Maybank. Algorithm-Dependent Generalization Bounds for Multi-Task Learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. [25] Jason Weston, Frédéric Ratle, and Ronan Collobert. Deep learning via semi-supervised embedding. In International Conference on Machine Learning, 2008. [26] Alexander G Ororbia II, C Lee Giles, and David Reitter. Learning a Deep Hybrid Model for SemiSupervised Text Classification. EMNLP, 2015. [27] Antti Rasmus, Mathias Berglund, Mikko Honkala, Harri Valpola, and Tapani Raiko. Semi-supervised Learning with Ladder Networks. In Advances in Neural Information Processing Systems, 2015. [28] Yaser S Abu-Mostafa. Learning from hints in neural networks. J. Complexity, 1990. [29] Yuting Zhang, Kibok Lee, and Honglak Lee. Augmenting supervised neural networks with unsupervised objectives for large-scale image classification. In International Conference on Machine Learning, pages 612–621, 2016. [30] Pierre Baldi and Kurt Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 1989. [31] Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of Machine Learning. MIT Press, 2012. [32] 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, 2010. [33] Marc’Aurelio Ranzato, Christopher S Poultney, Sumit Chopra, and Yann LeCun. Efficient Learning of Sparse Representations with an Energy-Based Model. In Advances in Neural Information Processing Systems, 2006. [34] Anupriya Gogna and Angshul Majumdar. Semi Supervised Autoencoder. In Neural Information Processing. 2016. [35] R Caruana and V R De Sa. Promoting poor features to supervisors: Some inputs work better as outputs. In Advances in Neural Information Processing Systems, 1997. 10 [36] S Ben-David and R Schuller. Exploiting task relatedness for multiple task learning. Lecture Notes in Computer Science, 2003. [37] Pierre Baldi, Peter Sadowski, and Daniel Whiteson. Searching for Exotic Particles in High-Energy Physics with Deep Learning. arXiv:1509.01240v2, 2014. [38] David Henry Deterding. Speaker normalisation for automatic speech recognition. PhD thesis, University of Cambridge, 1990. [39] A Krizhevsky and G Hinton. Learning Multiple Layers of Features from Tiny Images. Technical report, University of Toronto, 2009. [40] Y LeCun, L Bottou, Y Bengio, and P Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. [41] Benjamin Graham. Fractional Max-Pooling. arXiv:1411.4000v2 [cs.LG], 2014. [42] 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. 11
2018
187
7,349
Understanding Regularized Spectral Clustering via Graph Conductance Yilin Zhang Department of Statistics University of Wisconsin-Madison Madison, WI 53706 yilin.zhang@wisc.edu Karl Rohe Department of Statistics University of Wisconsin-Madison Madison, WI 53706 karl.rohe@wisc.edu Abstract This paper uses the relationship between graph conductance and spectral clustering to study (i) the failures of spectral clustering and (ii) the benefits of regularization. The explanation is simple. Sparse and stochastic graphs create several “dangling sets”, or small trees that are connected to the core of the graph by only one edge. Graph conductance is sensitive to these noisy dangling sets and spectral clustering inherits this sensitivity. The second part of the paper starts from a previously proposed form of regularized spectral clustering and shows that it is related to the graph conductance on a “regularized graph”. When graph conductance is computed on the regularized graph, we call it CoreCut. Based upon previous arguments that relate graph conductance to spectral clustering (e.g. Cheeger inequality), minimizing CoreCut relaxes to regularized spectral clustering. Simple inspection of CoreCut reveals why it is less sensitive to dangling sets. Together, these results show that unbalanced partitions from spectral clustering can be understood as overfitting to noise in the periphery of a sparse and stochastic graph. Regularization fixes this overfitting. In addition to this statistical benefit, these results also demonstrate how regularization can improve the computational speed of spectral clustering. We provide simulations and data examples to illustrate these results. 1 Introduction Spectral clustering partitions the nodes of a graph into groups based upon the eigenvectors of the graph Laplacian [19, 20]. Despite the claims of spectral clustering being “popular”, in applied research using graph data, spectral clustering (without regularization) often returns a partition of the nodes that is uninteresting, typically finding a large cluster that contains most of the data and many smaller clusters, each with only a few nodes. These applications involve brain graphs [2] and social networks from Facebook [21] and Twitter [22]. One key motivation for spectral clustering is that it relaxes a discrete optimization problem of minimizing graph conductance. Previous research has shown that across a wide range of social and information networks, the clusters with the smallest graph conductance are often rather small [15]. Figure 1 illustrates the leading singular vectors on a communication network from Facebook during the 2012 French presidential election [21]. The singular vectors localize on a few nodes, which leads to a highly unbalanced partition. [1] proposed regularized spectral clustering which adds a weak edge on every pair of nodes with edge weight τ/N, where N is the number of nodes in the network and τ is a tuning parameter. [5] proposed a related technique. Figure 1 illustrates how regularization changes the leading singular vectors in the Facebook example. The singular vectors are more spread across nodes. Many empirical networks have a core-periphery structure, where nodes in the core of the graph are more densely connected and nodes in the periphery are sparsely connected [3]. In Figure 1, 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. regularized spectral clustering leads to a “deeper cut” into the core of the graph. In this application, regularization helps spectral clustering provide a more balanced partition, revealing a more salient political division. Figure 1: This figure shows the leading singular vectors of the communication network. In the left panel, the singular vectors from vanilla spectral clustering are localized on a few nodes. In the right panel, the singular vectors from regularized spectral clustering provide a more balanced partition. Previous research has studied how regularization improves the spectral convergence of the graph Laplacian [17, 9, 11]. This paper aims to provide an alternative interpretation of regularization by relating it to graph conductance. We call spectral clustering without regularization Vanilla-SC and with edge-wise regularization Regularized-SC [1]. This paper demonstrates (1) what makes Vanilla-SC fail and (2) how Regularized-SC fixes that problem. One key motivation for Vanilla-SC is that it relaxes a discrete optimization problem of minimizing graph conductance [7]. Yet, this graph conductance problem is fragile to small cuts in the graph. The fundamental fragility of graph conductance that is studied in this paper comes from the type of subgraph illustrated in Figure 2 and defined here. Definition 1.1. In an unweighted graph G = (V, E), subset S ⊂ V is g-dangling if and only if the following conditions hold. - S contains exactly g nodes. - There are exactly g −1 edges within S and they do not form any cycles (i.e. the node induced subgraph from S is a tree). - There is exactly one edge between nodes in S and nodes in Sc. Figure 2: 6-dangling set. The argument in this paper is structured as follows: 1) A g-dangling set has a small graph conductance, approximately (2g)−1 (Section 3.2). 2) For any fixed g, graphs sampled from a sparse inhomogeneous model with N nodes have Θ(N) g-dangling sets in expectation (Theorem 3.4). As such, g-dangling sets are created as an artifact of the sparse and stochastic noise. 3) This makes Θ(N) eigenvalues in the normalized graph Laplacian which have an average value less than (g −1)−1 (Theorem 3.5) and reveal only noise. These small eigenvalues are so numerous that they conceal good cuts to the core of the graph. 4) Θ(N) eigenvalues smaller than 1/g also make the eigengap exceptionally small. This slows down the numerical convergence for computing the eigenvectors and values. 5) CoreCut, which is graph conductance on the regularized graph, does not assign a small value to small sets of nodes. This prevents all of the statistical and computational consequences listed above for g-dangling sets and any other small noisy subgraphs that have a small conductance. Regularized-SC inherits the advantages of CoreCut. The penultimate section evaluates the overfitting of spectral clustering in an experiment with several empirical graphs from SNAP [14]. This experiment randomly divides the edges into training set 2 and test set, then runs spectral clustering using the training edges and with the resulting partition, compares “training edge conductance” to “testing edge conductance.” This shows that Vanilla-SC overfits and Regularized-SC does not. Moreover, Vanilla-SC tends to identify highly unbalanced partitions, while Regularized-SC provides a balanced partition. The paper concludes with a discussion which illustrates how these results might help inform the construction of neural architectures for a generalization of Convolutional Neural Networks to cases where the input data has an estimated dependence structure that is represented as a graph [12, 4, 10, 16]. 2 Notation Graph notation The graph or network G = (V, E) consists of node set V = {1, . . . , N} and edge set E = {(i, j) : i and j connect with each other}. For a weighted graph, the edge weight wij can take any non-negative value for (i, j) ∈E and define wij = 0 if (i, j) ̸∈E. For an unweighted graph, define the edge weight wij = 1 if (i, j) ∈E and wij = 0 otherwise. For each node i, we denote its degree as di = P j wij. Given S ⊂V , the node induced subgraph of S in G is a graph with vertex set S and includes every edge whose end point are both in S, i.e. its edge set is {(i, j) ∈E : i, j ∈S}. Graph cut notation For any subset S ⊂V , we denote |S| = number of nodes in S, and its volume in graph G as vol(S, G) = P i∈S di. Note that any non-empty subset S ⊊V forms a partition of V with its complement Sc. We denote the cut for such partition on graph G as cut(S, G) = X i∈S,j∈Sc wij, and denote the graph conductance of any subset S ⊂V with vol(S, G) ≤vol(Sc, G) as φ(S, G) = cut(S, G) vol(S, G). Without loss of generality, we focus on non-empty subsets S ⊊V with vol(S, G) ≤vol(Sc, G). Notation for Vanilla-SC and Regularized-SC We denote the adjacency matrix A ∈RN×N with Aij = wij, and the degree matrix D ∈RN×N with Dii = di and Dij = 0 for i ̸= j. The normalized graph Laplacian matrix is L = I −D−1/2AD−1/2, with eigenvalues 0 = λ1 ≤λ2 ≤. . . λN ≤2 (here and elsewhere, “leading” refers to the smallest eigenvalues). Let v1, . . . , vN : V →R represent the eigenvectors/eigenfunctions for L corresponding to eigenvalues λ1, . . . , λN. There is a broad class of spectral clustering algorithms which represent each node i in RK with (v1(i), . . . , vK(i)) and cluster the nodes by clustering their representations in RK with some algorithm. For simplicity, this paper focuses on the setting of K = 2 and only uses v2. We refer to Vanilla-SC the algorithm which returns the set Si which solves min i φ(Si, G), where Si = {j : v2(j) ≥v2(i)}. (2.1) This construction of a partition appears in both [19] and in the proof of Cheeger inequality [6, 7], which says that Cheeger inequality: h2 G 2 ≤λ2 ≤2hG, where hG = min S φ(S, G). Edge-wise regularization [1] adds τ/N to every element of the adjacency matrix, where τ > 0 is a tuning parameter. It replaces A by matrix Aτ ∈RN×N, where [Aτ]ij = Aij + τ/N and the node degree matrix D by Dτ, which is computed with the row sums of Aτ (instead of the row sums of A) to get [Dτ]ii = Dii + τ. We define Gτ to be the weighted graph with adjacency matrix Aτ as defined above. Regularized-SC partitions the graph using the K leading eigenvectors of Lτ = I −D−1/2 τ AτD−1/2 τ , which we represent by vτ 1, . . . , vτ K : V →R. Similarly, we only use vτ 2 when K = 2. We refer to Regularized-SC the algorithm which returns the set Si which solves min i φ(Si, Gτ), where Si = {j : vτ 2(j) ≥vτ 2(i)}. 3 3 Vanilla-SC and the periphery of sparse and stochastic graphs For notational simplicity, this section only considers unweighted graphs. 3.1 Dangling sets have small graph conductance. The following fact follows from the definition of a g-dangling set. Fact 3.1. If S is a g-dangling set, then its graph conductance is φ(S) = (2g −1)−1. To interpret the scale of this graph conductance, imagine that a graph is generated from a Stochastic Blockmodel with two equal-size blocks, where any two nodes from the same block connect with probability p and two nodes from different blocks connect with probability q [8]. Then, the graph conductance of one of the blocks is q/(p + q) (up to random fluctuations). If there is a g-dangling set with g > p/(2q) + 1, then the g-dangling set will have a smaller graph conductance than the block. 3.2 There are many dangling sets in sparse and stochastic social networks. We consider random graphs sampled from the following model which generalizes Stochastic Blockmodels. Its key assumption is that edges are independent. Definition 3.2. A graph is generated from an inhomogeneous random graph model if the vertex set contains N nodes and all edges are independent. That is, for any two nodes i, j ∈V , i connects to j with some probability pij and this event is independent of the formation of any other edges. We only consider undirected graphs with no self-loops. Definition 3.3. Node i is a peripheral node in an inhomogeneous random graph with N nodes if there exist some constant b > 0, such that pij < b/N for all other nodes j, where we allow N →∞. For example, an Erdös-Rényi graph is an inhomogeneous random graph. If the Erdös-Rényi edge probability is specified by p = λ/N for some fixed λ > 0, then all nodes are peripheral. As another example, a common assumption in the statistical literature on Stochastic Blockmodels is that the minimum expected degree grows faster than log N. Under this assumption, there are no peripheral nodes in the graph. That log N assumption is perhaps controversial because empirical graphs often have many low-degree nodes. Theorem 3.4. Suppose an inhomogeneous random graph model such that for some ϵ > 0, pij > (1 + ϵ)/N for all nodes i, j. If that model contains a non-vanishing fraction of peripheral nodes Vp ⊂V , such that |Vp| > ηN for some η > 0, then the expected number of distinct g-dangling sets in the sampled graph grows proportionally to N. Theorem 3.4 studies graphs sampled from an inhomogeneous random graph model with a nonvanishing fraction of peripheral nodes. Throughout the paper, we refer to these graphs more simply as graphs with a sparse and stochastic periphery and, in fact, the proof of Theorem 3.4 only relies on the randomness of the edges in the periphery, i.e. the edges that have an end point in Vp. The proof does not rely on the distribution of the node-induced subgraph of the “core” V c p . Combined with Fact 3.1, Theorem 3.4 shows that graphs with a sparse and stochastic periphery generate an abundance of g-dangling sets, which creates an abundance of cuts with small conductance, but might only reveal noise. [15] also shows by real datasets that there is a substantial fraction of nodes that barely connect to the rest of graph, especially 1-whiskers, which is a generalized version of g-dangling sets. Theorem 3.5. If a graph contains Q g-dangling sets, and the rest of the graph has volume at least 4g2, then there are at least Q/2 eigenvalues that is smaller than (g −1)−1. Theorem 3.5 shows that every two dangling sets lead to a small eigenvalue. Due to the abundance of g-dangling sets (Theorem 3.4), there are many small eigenvalues and their corresponding eigenvalues are localized on a small set of nodes. This explains what we see in the data example in Figure 1. Each of these many eigenvectors is costly to compute (due to the small eigengaps) and then one needs to decide which are localized (which requires another tuning). 4 CoreCut ignores small cuts and relaxes to Regularized-SC. Similar to the graph conductance φ(· , G) which relaxes to Vanilla-SC [7, 19, 20], we introduce a new graph conductance CoreCut which relaxes to Regularized-SC. The following sketch illustrates 4 the relations. This section compares φ(· , G) and CoreCut. For ease of exposition, we continue to focus our attention on partitioning into two sets. φ(· , G) CoreCut Vanilla-SC Regularized-SC with Gτ relaxes to relaxes to with Gτ Definition 4.1. Given a subset S ⊂V with vol(S, Gτ) ≤vol(Sc, Gτ), we define its CoreCut as CoreCutτ(S) = cut(S, G) + τ N |S||Sc| vol(S, G) + τ|S| . Fact 4.2. For any S ⊂V with vol(S, Gτ) ≤vol(Sc, Gτ), it follows that CoreCutτ(S) = φ(S, Gτ). With Fact 4.2, we can apply Cheeger inequality to Gτ in order to relate the optimum CoreCut to the second eigenvalue of Lτ, which we denote by λ2(Lτ). h2 τ 2 ≤λ2(Lτ) ≤2hτ where hτ = min S CoreCutτ(S). The fundamental property of CoreCut is that the regularizer τ has larger effect on smaller sets. For example in Figure 3a, Sϵi’s (i = 1, ..., 5) are small peripheral sets and S1, S2 are core sets, each with roughly half of all nodes. From Figure 3, all five peripheral sets have smaller φ(· , G) than the two core sets. Minimizing φ(· , G) tends to cut the periphery rather than cutting the core. By regularizing with τ = 2, the CoreCut of all five peripheral sets increases significantly from φ(· , G) , while CoreCut of the two core sets remain similar to their φ(· , G). In the end, CoreCut will cut the core of the graph because all five peripheral sets have larger CoreCut than the two core sets S1, S2. (a) A core-periphery network. G G G G G G G core sets peripheral sets 0.0 0.2 0.4 0.6 0.8 S1 S2 Sε1 Sε2 Sε3 Sε4 Sε5 Sets Values Type G CoreCut2(S) φ(S, G) Graph conductances on different sets (b) Graph conductances on different sets. Figure 3: Figure (b) shows the CoreCut with τ = 2, and φ(· , G) on different sets in the coreperiphery network in Figure (a). CoreCut is very close to φ(· , G) on the core sets S1 and S2. But on the peripheral sets, φ(· , G) assigns small values, while CoreCut assigns much larger values. Minimizing φ(· , G) will yield a peripheral set, while minimizing CoreCut will cut the core of the graph. CoreCut will succeed if τ overwhelms the peripheral sets, but is negligible to core sets. Corollary 4.7 below makes this intuition precise. It requires the following assumptions, where you should imagine Sϵ to be a peripheral cut and S to be a cut to the core of the graph that we wish to detect. We define the mean degree for any subset S′ ⊂V on G as ¯d(S′, G) = vol(S′, G)/|S′|. Assumption 4.3. For a graph G = (V, E) and subsets Sϵ ⊂V and S ⊂V , there exists ϵ, α > 0, such that 5 1. |Sϵ| < ϵ|V | and vol(Sϵ, G) < ϵvol(V, G), 2. ¯d(Sϵ, G) < 1−ϵ 2(1+α) ¯d(S, G), 3. φ(S, G) < α(1−ϵ) 1+α . Remark 4.4. Assumption 1 indicates that the peripheral set Sϵ is a very small part of G in terms of number of nodes and number of edges. Assumption 2 requires S to be reasonably dense. Assumption 3 requires S and Sc to form a good partition. Proposition 4.5. Given graph G = (V, E), for any set Sϵ ⊂V satisfying Assumption 1, for some constant α > 0, if we choose τ such that τ ≥α ¯d(Sϵ), then CoreCutτ(Sϵ) > α(1 −ϵ) 1 + α . Proposition 4.5 shows that CoreCut of a peripheral set is lower bounded away from zero. Proposition 4.6. Given graph G = (V, E), for any set S ⊂V , for some constant δ > 0, if we choose τ ≤δ ¯d(S, G), then CoreCutτ(S) < φ(S, G) + δ. When S is reasonably large, τ can be chosen such that δ is small. Proposition 4.6 shows that with τ not being too large, the CoreCut of a reasonably large set is close to φ(· , G). Corollary 4.7 follows directly from Proposition 4.5 and 4.6. Corollary 4.7. Given graph G = (V, E), for any subsets Sϵ, S ⊂V satisfying the three assumptions in Assumption 4.3, if we choose τ such that α ¯d(Sϵ, G) ≤τ ≤δ ¯d(S, G), where δ = α(1 −ϵ)/(1 + α) −φ(S, G), then CoreCutτ(S) < CoreCutτ(Sϵ). Corollary 4.7 indicates the lower bound and upper bound of τ for CoreCut to ignore a cut to the periphery and prefer a cut to the core. These bounds on τ lead to a deeper understanding of CoreCut. However, they are difficult to implement in practice. 5 Real data examples This section provides real data examples to show three things. First, Regularized-SC finds a more balanced partition. Second, Vanilla-SC is prone to “catastrophic overfitting”. Third, computing the second eigenvector of Lτ takes less time than computing the second eigenvector of L. This section studies 37 example networks from http://snap.stanford.edu/data [14]. These networks are selected to be relatively easy to interpret and handle. The largest graph used is wiki-talk and has only 2,388,953 nodes in the largest component. The complete list of graphs used is given below. Before computing anything, directed edges are symmetrized and nodes not connected to the largest connected component are removed. Throughout all simulations, the regularization parameter τ is set to be the average degree of the graph. This is not optimized, but is instead a previously proposed heuristic [17]. As defined in Section 2 Equation 2.1, the partitions are constructed by scanning through the second eigenvector. Even though we argue that regularized approaches are trying to minimize CoreCut, every notion of conductance in this section is computed on the unregularized graph G, including the scanning through the second eigenvector. All eigen-computations are performed with rARPACK [13, 18]. In this simulation, half of the edges are removed from the graph and placed into a “testing-set”. Refer to the remaining edges as the “training-edges”. On the training-edges, the largest connected component is again identified. Based upon that subset of the training-edges, the spectral partitions are formed. Each figure in this section corresponds to a different summary value (balance, training conductance, testing conductance, and running time). In all figures, each point corresponds to a single network. 6 The x-axis corresponds to the summary value for Regularized-SC and the y-axis corresponds to the summary value for Vanilla-SC. Each figure includes a black line, which is the line x = y. All plots are on the log-log scale. The size of each point corresponds to the number of nodes in the graph. In Figure 4, the summary value is the number of nodes in the smaller partition set. Notice that the scales of the axes are entirely different. Vanilla-SC tends to identify sets with 100s of nodes or smaller. However, regularizing tends increase the size of the sets into the 1000s. In Figure 5a, the summary value is the conductance computed on the training-edges. Because this is the quantity that Vanilla-SC approximates, it is not surprising that it finds partitions with a smaller conductance. However, Figure 5b shows that if the conductance is computed using only edges in the testing-set, then sometimes the vanilla sets have no internal edges (φ(· , G) = 1). We refer to this as catastrophic overfitting. In these simulations (and others), we find that the partitions produced by both forms of regularization [1] and [5] are exactly equivalent. We find it easier to implement fast code for [5] and moreover, our implementations of it run faster. Implementing [1] to take advantage of the sparsity in the graph requires defining a function which quickly multiplies a vector x by Lτ. This can be done via Lτx = x −D−1/2 τ AD−1/2 τ x −τ/N1(1T x), where 1 is a vector of 1’s. However, with a user defined matrix multiplication, the eigensolver in rARPACK runs slightly slower. Because the regularized form from [5] simply defines Lτ = I −D−1/2 τ AD−1/2 τ , it can use the same eigensolver as Vanilla-SC and, as such, the running times are more comparable. Figure 6 uses this definition of Regularized-SC. Running times are from rARPACK computing two eigenvectors of D−1/2 τ AD−1/2 τ and D−1/2AD−1/2 using the default settings. A line of regression is added to Figure 6. The slope of this line is roughly 1.01 and its intercept is roughly 0.83. The list of SNAP networks is given here: amazon0302, amazon0312, amazon0505, amazon0601, caAstroPh, ca-CondMat, ca-GrQc, ca-HepPh, ca-HepTh, cit-HepPh, cit-HepTh, com-amazon.ungraph, com-youtube.ungraph, email-EuAll, email-Eu-core, facebook-combined, p2p-Gnutella04, p2pGnutella05, p2p-Gnutella06, p2p-Gnutella08, p2p-Gnutella09, p2p-Gnutella24, p2p-Gnutella25, p2p-Gnutella30, p2p-Gnutella31, roadNet-CA, roadNet-PA, roadNet-TX, soc-Epinions1, socSlashdot0811, soc-Slashdot0902, twitter-combined, web-Google, web-NotreDame, web-Stanford, wiki-Talk, wiki-Vote. 10 100 1000 1e+03 1e+05 regularized vanilla N 5e+05 1e+06 Balance vs balance. Regularization increases balance. Figure 4: Regularized-SC identifies clusters that are more balanced. That is, the smallest set in the partition has more nodes. 7 0.001 0.100 0.01 0.10 regularized vanilla N 5e+05 1e+06 Training conductance. Vanilla cuts have much smaller conductance. (a) 0.01 1.00 0.01 0.10 regularized vanilla N 5e+05 1e+06 Testing conductance. Vanilla cuts are sometimes awful. (b) Figure 5: Vanilla-SC finds cuts with a smaller conductance. However, on the testing edges, it can have a catastrophic failure, where there are no internal edges to the smallest set. This corresponds to φ(· , G) = 1. 1 100 0.1 1.0 10.0 regularized vanilla N 5e+05 1e+06 Running time in seconds. Regularized runs ~8x faster. Figure 6: The line of regression suggests that Regularized-SC runs roughly eight times faster than Vanilla-SC in rARPACK [18]. 6 Discussion The results in this paper provide a refined understanding of how regularized spectral clustering prevents overfitting. This paper suggests that spectral clustering overfits to g-dangling sets (and, perhaps, other small sets) because they occur as noise in sparse and stochastic graphs and they have a very small cost function φ. Regularized spectral clustering optimizes a relaxation of CoreCut (a cost function very much related to φ) that assigns a higher cost to small sets like g-dangling sets. As such, when a graph is sparse and stochastic, the patterns identified by regularized spectral clustering are more likely to persist in another sample of the graph from the same distribution. Such overfitting on peripheries may also happen in many other machine learning methods with graph data. There has been an interest in generalizing Convolutional Neural Networks beyond images, to more general graph dependence structures. In these settings, the architecture of the first layer should identify a localized region of the graph [12, 4, 10, 16]. While spectral approaches have been proposed, our results herein suggest potential benefits from regularization. 8 Acknowledgements The authors gratefully acknowledge support from NSF grant DMS-1612456 and ARO grant W911NF15-1-0423. We thank Yeganeh Ali Mohammadi and Mobin YahyazadehJeloudar for their helpful comments. References [1] Arash A Amini, Aiyou Chen, Peter J Bickel, Elizaveta Levina, et al. Pseudo-likelihood methods for community detection in large sparse networks. The Annals of Statistics, 41(4):2097–2122, 2013. [2] Norbert Binkiewicz, Joshua T Vogelstein, and Karl Rohe. Covariate-assisted spectral clustering. Biometrika, 104(2):361–377, 2017. [3] Stephen P Borgatti and Martin G Everett. Models of core/periphery structures. Social networks, 21(4):375–395, 2000. [4] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013. [5] Kamalika Chaudhuri, Fan Chung, and Alexander Tsiatas. Spectral clustering of graphs with general degrees in the extended planted partition model. In Conference on Learning Theory, pages 35–1, 2012. [6] Fan RK Chung. Laplacians of graphs and cheeger’s inequalities. Combinatorics, Paul Erdos is Eighty, 2(157-172):13–2, 1996. [7] Fan RK Chung. Spectral graph theory. Number 92. American Mathematical Soc., 1997. [8] Paul W Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social networks, 5(2):109–137, 1983. [9] Antony Joseph, Bin Yu, et al. Impact of regularization on spectral clustering. The Annals of Statistics, 44(4):1765–1791, 2016. [10] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. [11] Can M Le, Elizaveta Levina, and Roman Vershynin. Sparse random graphs: regularization and concentration of the laplacian. arXiv preprint arXiv:1502.03049, 2015. [12] Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995. [13] Richard B Lehoucq, Danny C Sorensen, and Chao Yang. ARPACK users’ guide: solution of large-scale eigenvalue problems with implicitly restarted Arnoldi methods, volume 6. Siam, 1998. [14] Jure Leskovec and Andrej Krevl. SNAP Datasets: Stanford large network dataset collection. http://snap.stanford.edu/data, June 2014. [15] Jure Leskovec, Kevin J Lang, Anirban Dasgupta, and Michael W Mahoney. Community structure in large networks: Natural cluster sizes and the absence of large well-defined clusters. Internet Mathematics, 6(1):29–123, 2009. [16] Ron Levie, Federico Monti, Xavier Bresson, and Michael M Bronstein. Cayleynets: Graph convolutional neural networks with complex rational spectral filters. arXiv preprint arXiv:1705.07664, 2017. [17] Tai Qin and Karl Rohe. Regularized spectral clustering under the degree-corrected stochastic blockmodel. In Advances in Neural Information Processing Systems, pages 3120–3128, 2013. 9 [18] Yixuan Qiu, Jiali Mei, and authors of the ARPACK library. See file AUTHORS for details. rARPACK: Solvers for Large Scale Eigenvalue and SVD Problems, 2016. R package version 0.11-0. [19] Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. IEEE Transactions on pattern analysis and machine intelligence, 22(8):888–905, 2000. [20] Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007. [21] Yilin Zhang, Marie Poux-Berthe, Chris Wells, Karolina Koc-Michalska, and Karl Rohe. Discovering political topics in facebook discussion threads with spectral contextualization. arXiv preprint arXiv:1708.06872, 2017. [22] Yini Zhang, Chris Wells, Song Wang, and Karl Rohe. Attention and amplification in the hybrid media system: The composition and activity of donald trump’s twitter following during the 2016 presidential election. New Media & Society, page 1461444817744390, 2017. 10
2018
188
7,350
Plug-in Estimation in High-Dimensional Linear Inverse Problems: A Rigorous Analysis Alyson K. Fletcher Dept. Statistics UC Los Angeles akfletcher@ucla.edu Parthe Pandit Dept. ECE UC Los Angeles parthepandit@ucla.edu Sundeep Rangan Dept. ECE NYU srangan@nyu.edu Subrata Sarkar Dept. ECE The Ohio State Univ. sarkar.51@osu.edu Philip Schniter Dept. ECE The Ohio State Univ. schniter.1@osu.edu Abstract Estimating a vector x from noisy linear measurements Ax + w often requires use of prior knowledge or structural constraints on x for accurate reconstruction. Several recent works have considered combining linear least-squares estimation with a generic or “plug-in” denoiser function that can be designed in a modular manner based on the prior knowledge about x. While these methods have shown excellent performance, it has been difficult to obtain rigorous performance guarantees. This work considers plug-in denoising combined with the recentlydeveloped Vector Approximate Message Passing (VAMP) algorithm, which is itself derived via Expectation Propagation techniques. It shown that the mean squared error of this “plug-and-play" VAMP can be exactly predicted for highdimensional right-rotationally invariant random A and Lipschitz denoisers. The method is demonstrated on applications in image recovery and parametric bilinear estimation. 1 Introduction The estimation of an unknown vector x0 ∈RN from noisy linear measurements y of the form y = Ax0 + w ∈RM, (1) where A ∈RM×N is a known transform and w is disturbance, arises in a wide-range of learning and inverse problems. In many high-dimensional situations, such as when the measurements are fewer than the unknown parameters (i.e., M ≪N), it is essential to incorporate known structure on x0 in the estimation process. A fundamental challenge is how to perform structured estimation of x0 while maintaining computational efficiency and a tractable analysis. Approximate message passing (AMP), originally proposed in [1], refers to a powerful class of algorithms that can be applied to reconstruction of x0 from (1) that can easily incorporate a wide class of statistical priors. In this work, we restrict our attention to w ∼N(0, γ−1 w I), noting that AMP was extended to non-Gaussian measurements in [2, 3, 4]. AMP is computationally efficient, in that it generates a sequence of estimates {bxk}∞ k=0 by iterating the steps bxk = g(rk, γk) (2a) vk = y −Abxk + N M ⟨∇g(rk−1, γk−1)⟩vk−1 (2b) rk+1 = bxk + ATvk, γk+1 = M/∥vk∥2, (2c) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. initialized with r0 = ATy, γ0 = M/∥y∥2, v−1 = 0, and assuming A is scaled so that ∥A∥2 F ≈N. In (2), g : RN × R →RN is an estimation function chosen based on prior knowledge about x0, and ⟨∇g(r, γ)⟩:= 1 N PN n=1 ∂gn(r,γ) ∂rn denotes the divergence of g(r, γ). For example, if x0 is known to be sparse, then it is common to choose g(·) to be the componentwise soft-thresholding function, in which case AMP iteratively solves the LASSO [5] problem. Importantly, for large, i.i.d., sub-Gaussian random matrices A and Lipschitz denoisers g(·), the performance of AMP can be exactly predicted by a scalar state evolution (SE), which also provides testable conditions for optimality [6, 7, 8]. The initial work [6, 7] focused on the case where g(·) is a separable function with identical components (i.e., [g(r, γ)]n = g(rn, γ) ∀n), while the later work [8] allowed non-separable g(·). Interestingly, these SE analyses establish the fact that rk = x0 + N(0, I/γk), (3) leading to the important interpretation that g(·) acts as a denoiser. This interpretation provides guidance on how to choose g(·). For example, if x is i.i.d. with a known prior, then (3) suggests to choose a separable g(·) composed of minimum mean-squared error (MMSE) scalar denoisers g(rn, γ) = E(xn|rn = xn + N(0, 1/γ)). In this case, [6, 7] established that, whenever the SE has a unique fixed point, the estimates bxk generated by AMP converge to the Bayes optimal estimate of x0 from y. As another example, if x is a natural image, for which an analytical prior is lacking, then (3) suggests to choose g(·) as a sophisticated image-denoising algorithm like BM3D [9] or DnCNN [10], as proposed in [11]. Many other examples of structured estimators g(·) can be considered; we refer the reader to [8] and Section 5. Prior to [8], AMP SE results were established for special cases of g(·) in [12, 13]. Plug-in denoisers have been combined in related algorithms [14, 15, 16]. An important limitation of AMP’s SE is that it holds only for large, i.i.d., sub-Gaussian A. AMP itself often fails to converge with small deviations from i.i.d. sub-Gaussian A, such as when A is mildly ill-conditioned or non-zero-mean [4, 17, 18]. Recently, a robust alternative to AMP called vector AMP (VAMP) was proposed and analyzed in [19], based closely on expectation propagation [20]—see also [21, 22, 23]. There it was established that, if A is a large right-rotationally invariant random matrix and g(·) is a separable Lipschitz denoiser, then VAMP’s performance can be exactly predicted by a scalar SE, which also provides testable conditions for optimality. Importantly, VAMP applies to arbitrarily conditioned matrices A, which is a significant benefit over AMP, since it is known that ill-conditioning is one of AMP’s main failure mechanisms [4, 17, 18]. Unfortunately, the SE analyses of VAMP in [24] and its extension in [25] are limited to separable denoisers. This limitation prevents a full understanding of VAMP’s behavior when used with nonseparable denoisers, such as state-of-the-art image-denoising methods as recently suggested in [26]. The main contribution of this work is to show that the SE analysis of VAMP can be extended to a large class of non-separable denoisers that are Lipschitz continuous and satisfy a certain convergence property. The conditions are similar to those used in the analysis of AMP with non-separable denoisers in [8]. We show that there are several interesting non-separable denoisers that satisfy these conditions, including group-structured and convolutional neural network based denoisers. An extended version with all proofs and other details are provided in [27]. 2 Review of Vector AMP The steps of VAMP algorithm of [19] are shown in Algorithm 1. Each iteration has two parts: A denoiser step and a Linear MMSE (LMMSE) step. These are characterized by estimation functions g1(·) and g2(·) producing estimates bx1k and bx2k. The estimation functions take inputs r1k and r2k that we call partial estimates. The LMMSE estimation function is given by, g2(r2k, γ2k) := γwATA + γ2kI −1 γwATy + γ2kr2k  , (4) where γw > 0 is a parameter representing an estimate of the precision (inverse variance) of the noise w in (1). The estimate bx2k is thus an MMSE estimator, treating the x as having a Gaussian prior with mean given by the partial estimate r2k. The estimation function g1(·) is called the denoiser and can be designed identically to the denoiser g(·) in the AMP iterations (2). In particular, the denoiser is used to incorporate the structural or prior information on x. As in AMP, in lines 5 and 11, ⟨∇gi⟩ denotes the normalized divergence. 2 Algorithm 1 Vector AMP (LMMSE form) Require: LMMSE estimator g2(·, γ2k) from (4), denoiser g1(·, γ1k), and number of iterations Kit. 1: Select initial r10 and γ10 ≥0. 2: for k = 0, 1, . . . , Kit do 3: // Denoising 4: bx1k = g1(r1k, γ1k) 5: α1k = ⟨∇g1(r1k, γ1k)⟩ 6: η1k = γ1k/α1k, γ2k = η1k −γ1k 7: r2k = (η1kbx1k −γ1kr1k)/γ2k 8: 9: // LMMSE estimation 10: bx2k = g2(r2k, γ2k) 11: α2k = ⟨∇g2(r2k, γ2k)⟩ 12: η2k = γ2k/α2k, γ1,k+1 = η2k −γ2k 13: r1,k+1 = (η2kbx2k −γ2kr2k)/γ1,k+1 14: end for 15: Return bx1Kit. The main result of [24] is that, under suitable conditions, VAMP admits a state evolution (SE) analysis that precisely describes the mean squared error (MSE) of the estimates bx1k and bx2k in a certain large system limit (LSL). Importantly, VAMP’s SE analysis applies to arbitrary right rotationally invariant A. This class is considerably larger than the set of sub-Gaussian i.i.d. matrices for which AMP applies. However, the SE analysis in [24] is restricted separable Lipschitz denoisers that can be described as follows: Let g1n(r1, γ1) be the n-th component of the output of g1(r1, γ1). Then, it is assumed that, bx1n = g1n(r1, γ1) = φ(r1n, γ1), (5) for some function scalar-output function φ(·) that does not depend on the component index n. Thus, the estimator is separable in the sense that the n-th component of the estimate, bx1n depends only on the n-th component of the input r1n as well as the precision level γ1. In addition, it is assumed that φ(r1, γ1) satisfies a certain Lipschitz condition. The separability assumption precludes the analysis of more general denoisers mentioned in the Introduction. 3 Extending the Analysis to Non-Separable Denoisers The main contribution of the paper is to extend the state evolution analysis of VAMP to a class of denoisers that we call uniformly Lipschitz and convergent under Gaussian noise. This class is significantly larger than separable Lipschitz denoisers used in [24]. To state these conditions precisely, consider a sequence of estimation problems, indexed by a vector dimension N. For each N, suppose there is some “true" vector u = u(N) ∈RN that we wish to estimate from noisy measurements of the form, r = u + z, where z ∈RN is Gaussian noise. Let bu = g(r, γ) be some estimator, parameterized by γ. Definition 1. The sequence of estimators g(·) are said to be uniformly Lipschitz continuous if there exists constants A, B and C > 0, such that ∥g(r2, γ2) −g(r1, γ1)∥≤(A + B|γ2 −γ1|)∥r2 −r1∥+ C √ N|γ2 −γ1|, (6) for any r1, r2, γ1, γ2 and N. Definition 2. The sequence of random vectors u and estimators g(·) are said to be convergent under Gaussian noise if the following condition holds: Let z1, z2 ∈RN be two sequences where (z1n, z2n) are i.i.d. with (z1n, z2n) = N(0, S) for some positive definite covariance S ∈R2×2. Then, all the following limits exist almost surely: lim N→∞ 1 N g(u + z1, γ1)Tg(u + z2, γ2), lim N→∞ 1 N g(u + z1, γ1)Tu, (7a) lim N→∞ 1 N uTz1, lim N→∞ 1 N ∥u∥2 (7b) lim N→∞⟨∇g(u + z1, γ1)⟩= 1 NS12 g(u + z1, γ1)Tz2, (7c) 3 for all γ1, γ2 and covariance matrices S. Moreover, the values of the limits are continuous in S, γ1 and γ2. With these definitions, we make the following key assumption on the denoiser. Assumption 1. For each N, suppose that we have a “true" random vector x0 ∈RN and a denoiser g1(r1, γ1) acting on signals r1 ∈RN. Following Definition 1, we assume the sequence of denoiser functions indexed by N, is uniformly Lipschitz continuous. In addition, the sequence of true vectors x0 and denoiser functions are convergent under Gaussian noise following Definition 2. The first part of Assumption 1 is relatively standard: Lipschitz and uniform Lipschitz continuity of the denoiser is assumed several AMP-type analyses including [6, 28, 24] What is new is the assumption in Definition 2. This assumption relates to the behavior of the denoiser g1(r1, γ1) in the case when the input is of the form, r1 = x0 + z. That is, the input is the true signal with a Gaussian noise perturbation. In this setting, we will be requiring that certain correlations converge. Before continuing our analysis, we briefly show that separable denoisers as well as several interesting nonseparable denoisers satisfy these conditions. Separable Denoisers. We first show that the class of denoisers satisfying Assumption 1 includes the separable Lipschitz denoisers studied in most AMP analyses such as [6]. Specifically, suppose that the true vector x0 has i.i.d. components with bounded second moments and the denoiser g1(·) is separable in that it is of the form (5). Under a certain uniform Lipschitz condition, it is shown in the extended version of this paper [27] that the denoiser satisfies Assumption 1. Group-Based Denoisers. As a first non-separable example, let us suppose that the vector x0 can be represented as an L × K matrix. Let x0 ℓ∈RK denote the ℓ-th row and assume that the rows are i.i.d. Each row can represent a group. Suppose that the denoiser g1(·) is groupwise separable. That is, if we denote by g1ℓ(r, ℓ) the ℓ-th row of the output of the denoiser, we assume that g1ℓ(r, γ) = φ(rℓ, γ) ∈RK, (8) for a vector-valued function φ(·) that is the same for all rows. Thus, the ℓ-th row output gℓ(·) depends only on the ℓ-th row input. Such groupwise denoisers have been used in AMP and EP-type methods for group LASSO and other structured estimation problems [29, 30, 31]. Now, consider the limit where the group size K is fixed, and the number of groups L →∞. Then, under suitable Lipschitz continuity conditions, the extended version of this paper [27] shows that groupwise separable denoiser also satisfies Assumption 1. Convolutional Denoisers. As another non-separable denoiser, suppose that, for each N, x0 is an N sample segment of a stationary, ergodic process with bounded second moments. Suppose that the denoiser is given by a linear convolution, g1(r1) := TN(h ∗r1), (9) where h is a finite length filter and TN(·) truncates the signal to its first N samples. For simplicity, we assume there is no dependence on γ1. Convolutional denoising arises in many standard linear estimation operations on wide sense stationary processes such as Weiner filtering and smoothing [32]. If we assume that h remains constant and N →∞, the extended version of this paper [27] shows that the sequence of random vectors x0 and convolutional denoisers g1(·) satisfies Assumption 1. Convolutional Neural Networks. In recent years, there has been considerable interest in using trained deep convolutional neural networks for image denoising [33, 34]. As a simple model for such a denoiser, suppose that the denoiser is a composition of maps, g1(r1) = (FL ◦FL−1 ◦· · · ◦F1)(r1), (10) where Fℓ(·) is a sequence of layer maps where each layer is either a multi-channel convolutional operator or Lipschitz separable activation function, such as sigmoid or ReLU. Under mild assumptions on the maps, it is shown in the extended version of this paper [27] that the estimator sequence g1(·) can also satisfy Assumption 1. 4 Singular-Value Thresholding (SVT) Denoiser. Consider the estimation of a low-rank matrix X0 from linear measurements y = A(X0), where A is some linear operator [35]. Writing the SVD of R as R = P i σiuivT i , the SVT denoiser is defined as g1(R, γ) := X i (σi −γ)+uivT i , (11) where (x)+ := max{0, x}. In the extended version of this paper [27], we show that g1(·) satisfies Assumption 1. 4 Large System Limit Analysis 4.1 System Model Our main theoretical contribution is to show that the SE analysis of VAMP in [19] can be extended to the non-separable case. We consider a sequence of problems indexed by the vector dimension N. For each N, we assume that there is a “true" random vector x0 ∈RN observed through measurements y ∈RM of the form in (1) where w ∼N(0, γ−1 w0I). We use γw0 to denote the “true" noise precision to distinguish this from the postulated precision, γw, used in the LMMSE estimator (4). Without loss of generality (see below), we assume that M = N. We assume that A has an SVD, A = USVT, S = diag(s), s = (s1, . . . , sN), (12) where U and V are orthogonal and S is non-negative and diagonal. The matrix U is arbitrary, s is an i.i.d. random vector with components si ∈[0, smax] almost surely. Importantly, we assume that V is Haar distributed, meaning that it is uniform on the N × N orthogonal matrices. This implies that A is right rotationally invariant meaning that A d= AV0 for any orthogonal matrix V0. We also assume that w, x0, s and V are all independent. As in [19], we can handle the case of rectangular V by zero padding s. These assumptions are similar to those in [19]. The key new assumption is Assumption 1. Given such a denoiser and postulated variance γw, we run the VAMP algorithm, Algorithm 1. We assume that the initial condition is given by, r = x0 + N(0, τ10I), (13) for some initial error variance τ10. In addition, we assume lim N→∞γ10 = γ10, (14) almost surely for some γ10 ≥0. Analogous to [24], we define two key functions: error functions and sensitivity functions. The error functions characterize the MSEs of the denoiser and LMMSE estimator under AWGN measurements. For the denoiser g1(·, γ1), we define the error function as E1(γ1, τ1) := lim N→∞ 1 N ∥g1(x0 + z, γ1) −x0∥2, z ∼N(0, τ1I), (15) and, for the LMMSE estimator, as E2(γ2, τ2) := lim N→∞ 1 N E∥g2(r2, γ2) −x0∥2, r2 = x0 + N(0, τ2I), y = Ax0 + N(0, γ−1 w0I). (16) The limit (15) exists almost surely due to the assumption of g1(·) being convergent under Gaussian noise. Although E2(γ2, τ2) implicitly depends on the precisions γw0 and γw, we omit this dependence to simplify the notation. We also define the sensitivity functions as Ai(γi, τi) := lim N→∞⟨∇gi(x0 + zi, γi)⟩, zi ∼N(0, τiI). (17) 5 4.2 State Evolution of VAMP We now show that the VAMP algorithm with a non-separable denoiser follows the identical state evolution equations as the separable case given in [19]. Define the error vectors, pk := r1k −x0, qk := VT(r2k −x0). (18) Thus, pk represents the error between the partial estimate r1k and the true vector x0. The error vector qk represents the transformed error r2k −x0. The SE analysis will show that these errors are asymptotically Gaussian. In addition, the analysis will exactly predict the variance on the partial estimate errors (18) and estimate errors, bxi −x0. These variances are computed recursively through what we will call the state evolution equations: α1k = A1(γ1k, τ1k), η1k = γ1k α1k , γ2k = η1k −γ1k (19a) τ2k = 1 (1 −α1k)2  E1(γ1k, τ1k) −α2 1kτ1k  , (19b) α2k = A2(γ2k, τ2k), η2k = γ2k α2k , γ1,k+1 = η2k −γ2k (19c) τ1,k+1 = 1 (1 −α2k)2  E2(γ2k, τ2k) −α2 2kτ2k  , (19d) which are initialized with k = 0, τ10 in (13) and γ10 defined from the limit (14). The SE equations in (19) are identical to those in [19] with the new error and sensitivity functions for the non-separable denoisers. We can now state our main result, which is proven in the extended version of this paper [27]. Theorem 1. Under the above assumptions and definitions, assume that the sequence of true random vectors x0 and denoisers g1(r1, γ1) satisfy Assumption 1. Assume additionally that, for all iterations k, the solution α1k from the SE equations (19) satisfies α1k ∈(0, 1) and γik > 0. Then, (a) For any k, the error vectors on the partial estimates, pk and qk in (18) can be written as, pk = epk + O( 1 √ N ), qk = eqk + O( 1 √ N ), (20) where, epk and eqk ∈RN are each i.i.d. Gaussian random vectors with zero mean and per component variance τ1k and τ2k, respectively. (b) For any fixed iteration k ≥0, and i = 1, 2, we have, almost surely lim N→∞ 1 N ∥bxi −x0∥2 = 1 ηik , lim N→∞(αik, ηik, γik) = (αik, ηik, γik). (21) In (20), we have used the notation, that when u, eu ∈RN are sequences of random vectors, u = eu + O( 1 √ N ) means limN→∞1 N ∥u −eu∥2 = 0 almost surely. Part (a) of Theorem 1 thus shows that the error vectors pk and qk in (18) are approximately i.i.d. Gaussian. The result is a natural extension to the main result on separable denoisers in [19]. Moreover, the variance on the variance on the errors, along with the mean squared error (MSE) of the estimates bxik can be exactly predicted by the same SE equations as the separable case. The result thus provides an asymptotically exact analysis of VAMP extended to non-separable denoisers. 5 Numerical Experiments 5.1 Compressive Image Recovery We first consider the problem of compressive image recovery, where the goal is to recover an image x0 ∈RN from measurements y ∈RM of the form (1) with M ≪N. This problem arises in many imaging applications, such as magnetic resonance imaging, radar imaging, computed tomography, etc., although the details of A and x0 change in each case. One of the most popular approaches to image recovery is to exploit sparsity in the wavelet transform coefficients c := Ψx0, where Ψ is a suitable orthonormal wavelet transform. Rewriting (1) as 6 0.1 0.2 0.3 0.4 0.5 15 20 25 30 35 40 45 DnCNN-VAMP DnCNN-AMP LASSO-VAMP LASSO-AMP 0.1 0.2 0.3 0.4 0.5 10-2 10-1 100 DnCNN-VAMP DnCNN-AMP LASSO-VAMP LASSO-AMP sampling ratio M/N sampling ratio M/N PSNR runtime (sec) (a) Average PSNR and runtime with vs. M/N with well-conditioned A and no noise after 12 iterations. hfill 100 102 104 0 5 10 15 20 25 30 35 DnCNN-VAMP DnCNN-AMP LASSO-VAMP LASSO-AMP 100 102 104 10-2 10-1 100 DnCNN-VAMP DnCNN-AMP LASSO-VAMP LASSO-AMP cond(A) cond(A) PSNR runtime (sec) (b) Average PSNR and runtime versus cond(A) at M/N = 0.2 and no noise after 10 iterations. Figure 1: Compressive image recovery: PSNR and runtime vs. rate M/N and cond(A) y = AΨc + w, the idea is to first estimate c from y (e.g., using LASSO) and then form the image estimate via bx = ΨTbc. Although many algorithms exist to solve the LASSO problem, the AMP algorithms are among the fastest (see, e.g., [36, Fig.1]). As an alternative to the sparsity-based approach, it was recently suggested in [11] to recover x0 directly using AMP (2) by choosing the estimation function g as a sophisticated image-denoising algorithm like BM3D [9] or DnCNN [10]. Figure 1a compares the LASSO- and DnCNN-based versions of AMP and VAMP for 128×128 image recovery under well-conditioned A and no noise. Here, A = JPHD, where D is a diagonal matrix with random ±1 entries, H is a discrete Hadamard transform (DHT), P is a random permutation matrix, and J contains the first M rows of IN. The results average over the well-known lena, barbara, boat, house, and peppers images using 10 random draws of A for each. The figure shows that AMP and VAMP have very similar runtimes and PSNRs when A is well-conditioned, and that the DnCNN approach is about 10 dB more accurate, but 10× as slow, as the LASSO approach. Figure 2 shows the state-evolution prediction of VAMP’s PSNR on the barbara image at M/N = 0.5, averaged over 50 draws of A. The state-evolution accurately predicts the PSNR of VAMP. To test the robustness to the condition number of A, we repeated the experiment from Fig. 1a using A = JDiag(s)PHD, where Diag(s) is a diagonal matrix of singular values. The singular values were geometrically spaced, i.e., sm/sm−1 = ρ ∀m, with ρ chosen to achieve a desired cond(A) := s1/sM. The sampling rate was fixed at M/N = 0.2, and the measurements were noiseless, as before. The results, shown in Fig. 1b, show that AMP diverged when cond(A) ≥10, while VAMP exhibited only a mild PSNR degradation due to ill-conditioned A. The original images and example image recoveries are included in the extended version of this paper. 5.2 Bilinear Estimation via Lifting We now use the structured linear estimation model (1) to tackle problems in bilinear estimation through a technique known as “lifting” [37, 38, 39, 40]. In doing so, we are motivated by applications like blind deconvolution [41], self-calibration [39], compressed sensing (CS) with matrix uncertainty [42], and joint channel-symbol estimation [43]. All cases yield measurements y of the form y = PL l=1 blΦl  c + w ∈RM, (22) where {Φl}L l=1 are known, w ∼N(0, I/γw), and the objective is to recover both b := [b1, . . . , bL]T and c ∈RP . This bilinear problem can be “lifted” into a linear problem of the form (1) by setting A = [Φ1 Φ2 · · · ΦL] ∈RM×LP and x = vec(cbT) ∈RLP , (23) where vec(X) vectorizes X by concatenating its columns. When b and c are i.i.d. with known priors, the MMSE denoiser g(r, γ) = E(x|r = x + N(0, I/γ)) can be implemented near-optimally by the rank-one AMP algorithm from [44] (see also [45, 46, 47]), with divergence estimated as in [11]. We first consider CS with matrix uncertainty [42], where b1 is known. For these experiments, we generated the unknown {bl}L l=2 as i.i.d. N(0, 1) and the unknown c ∈RP as K-sparse with N(0, 1) nonzero entries. Fig. 2 shows that the MSE on x of lifted VAMP is very close to its SE prediction when K = 12. We then compared lifted VAMP to PBiGAMP from [48], which applies AMP directly to the (non-lifted) bilinear problem, and to WSS-TLS from [42], which uses non-convex optimization. We also compared to MMSE estimation of b under oracle knowledge of c, and MMSE 7 0 5 10 15 15 20 25 30 35 40 45 VAMP SE iteration PSNR in dB image recovery 0 5 10 15 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 VAMP SE iteration NMSE in dB CS with matrix uncertainty Figure 2: SE prediction & VAMP for image recovery and CS with matrix uncertainty 5 10 15 20 25 30 35 40 10 9 8 7 6 5 4 3 2 1 0 0.2 0.4 0.6 0.8 1 5 10 15 20 25 30 35 40 10 9 8 7 6 5 4 3 2 1 0 0.2 0.4 0.6 0.8 1 subspace dimension L subspace dimension L sparsity K sparsity K Lifted VAMP SparseLift Figure 3: Self-calibration: Success rate vs. sparsity K and subspace dimension L 0 0.2 0.4 0.6 0.8 1 -55 -50 -45 -40 -35 -30 -25 -20 -15 P-BiG-AMP VAMP-Lift WSS-TLS oracle 0 0.2 0.4 0.6 0.8 1 -60 -55 -50 -45 -40 -35 -30 -25 -20 -15 sampling ratio M/P sampling ratio M/P NMSE(b) in dB NMSE(c) in dB (a) NMSE vs. M/P with i.i.d. N(0, 1) A. 10 0 10 1 10 2 -60 -50 -40 -30 -20 -10 0 10 P-BiG-AMP VAMP-Lift WSS-TLS oracle 10 0 10 1 10 2 -60 -50 -40 -30 -20 -10 0 10 cond(A) cond(A) NMSE(b) in dB NMSE(c) in dB (b) NMSE vs. cond(A) at M/P = 0.6. Figure 4: Compressive sensing with matrix uncertainty estimation of c under oracle knowledge of support(c) and b. For b1 = √ 20, L = 11, P = 256, K = 10, i.i.d. N(0, 1) matrix A, and SNR = 40 dB, Fig. 4a shows the normalized MSE on b (i.e., NMSE(b) := E∥bb −b0∥2/E∥b0∥2) and c versus sampling ratio M/P. This figure demonstrates that lifted VAMP and PBiGAMP perform close to the oracles and much better than WSS-TLS. Although lifted VAMP performs similarly to PBiGAMP in Fig. 4a, its advantage over PBiGAMP becomes apparent with non-i.i.d. A. For illustration, we repeated the previous experiment, but with A constructed using the SVD A = UDiag(s)VT with Haar distributed U and V and geometrically spaced s. Also, to make the problem more difficult, we set b1 = 1. Figure 4b shows the normalized MSE on b and c versus cond(A) at M/P = 0.6. There it can be seen that lifted VAMP is much more robust than PBiGAMP to the conditioning of A. We next consider the self-calibration problem [39], where the measurements take the form y = Diag(Hb)Ψc + w ∈RM. (24) Here the matrices H ∈RM×L and Ψ ∈RM×P are known and the objective is to recover the unknown vectors b and c. Physically, the vector Hb represents unknown calibration gains that lie in a known subspace, specified by H. Note that (24) is an instance of (22) with Φl = Diag(hl)Ψ, where hl denotes the lth column of H. Different from “CS with matrix uncertainty,” all elements in b are now unknown, and so WSS-TLS [42] cannot be applied. Instead, we compare lifted VAMP to the SparseLift approach from [39], which is based on convex relaxation and has provable guarantees. For our experiment, we generated Ψ and b ∈RL as i.i.d. N(0, 1); c as K-sparse with N(0, 1) nonzero entries; H as randomly chosen columns of a Hadamard matrix; and w = 0. Figure 3 plots the success rate versus L and K, where “success” is defined as E∥bcbbT −c0(b0)T∥2 F /E∥c0(b0)T∥2 F < −60 dB. The figure shows that, relative to SparseLift, lifted VAMP gives successful recoveries for a wider range of L and K. 6 Conclusions We have extended the analysis of the method in [24] to a class of non-separable denoisers. The method provides a computational efficient method for reconstruction where structural information and constraints on the unknown vector can be incorporated in a modular manner. Importantly, the method admits a rigorous analysis that can provide precise predictions on the performance in highdimensional random settings. 8 Acknowledgments A. K. Fletcher and P. Pandit were supported in part by the National Science Foundation under Grants 1738285 and 1738286 and the Office of Naval Research under Grant N00014-15-1-2677. S. Rangan was supported in part by the National Science Foundation under Grants 1116589, 1302336, and 1547332, and the industrial affiliates of NYU WIRELESS. The work of P. Schniter was supported in part by the National Science Foundation under Grant CCF-1527162. References [1] D. L. Donoho, A. Maleki, and A. Montanari, “Message-passing algorithms for compressed sensing,” Proc. Nat. Acad. Sci., vol. 106, no. 45, pp. 18 914–18 919, Nov. 2009. [2] S. Rangan, “Generalized approximate message passing for estimation with random linear mixing,” in Proc. IEEE ISIT, 2011, pp. 2174–2178. [3] S. Rangan, P. Schniter, E. Riegler, A. Fletcher, and V. Cevher, “Fixed points of generalized approximate message passing with arbitrary matrices,” in Proc. IEEE ISIT, Jul. 2013, pp. 664–668. [4] S. Rangan, P. Schniter, and A. K. Fletcher, “On the convergence of approximate message passing with arbitrary matrices,” in Proc. IEEE ISIT, Jul. 2014, pp. 236–240. [5] R. Tibshirani, “Regression shrinkage and selection via the lasso,” J. Royal Stat. Soc., Ser. B, vol. 58, no. 1, pp. 267–288, 1996. [6] M. Bayati and A. Montanari, “The dynamics of message passing on dense graphs, with applications to compressed sensing,” IEEE Trans. Inform. Theory, vol. 57, no. 2, pp. 764–785, Feb. 2011. [7] A. Javanmard and A. Montanari, “State evolution for general approximate message passing algorithms, with applications to spatial coupling,” Information and Inference, vol. 2, no. 2, pp. 115–144, 2013. [8] R. Berthier, A. Montanari, and P.-M. Nguyen, “State evolution for approximate message passing with non-separable functions,” arXiv preprint arXiv:1708.03950, 2017. [9] K. Dabov, A. Foi, V. Katkovnik, and K. Egiazarian, “Image denoising by sparse 3-D transform-domain collaborative filtering,” IEEE Trans. Image Process., vol. 16, no. 8, pp. 2080–2095, 2007. [10] K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang, “Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising,” IEEE Trans. Image Process., vol. 26, no. 7, pp. 3142–3155, 2017. [11] C. A. Metzler, A. Maleki, and R. G. Baraniuk, “From denoising to compressed sensing,” IEEE Trans. Info. Thy., vol. 62, no. 9, pp. 5117–5144, 2016. [12] D. Donoho, I. Johnstone, and A. Montanari, “Accurate prediction of phase transitions in compressed sensing via a connection to minimax denoising,” IEEE Trans. Info. Thy., vol. 59, no. 6, pp. 3396–3433, 2013. [13] Y. Ma, C. Rush, and D. Baron, “Analysis of approximate message passing with a class of non-separable denoisers,” in Proc. ISIT, 2017, pp. 231–235. [14] S. V. Venkatakrishnan, C. A. Bouman, and B. Wohlberg, “Plug-and-play priors for model based reconstruction,” in Proc. IEEE Global Conference on Signal and Information Processing (GlobalSIP), 2013, pp. 945–948. [15] S. Chen, C. Luo, B. Deng, Y. Qin, H. Wang, and Z. Zhuang, “BM3D vector approximate message passing for radar coded-aperture imaging,” in PIERS-FALL, 2017, pp. 2035–2038. [16] X. Wang and S. H. Chan, “Parameter-free plug-and-play ADMM for image restoration,” in Proc. IEEE Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2017, pp. 1323–1327. [17] F. Caltagirone, L. Zdeborová, and F. Krzakala, “On convergence of approximate message passing,” in Proc. IEEE ISIT, Jul. 2014, pp. 1812–1816. [18] J. Vila, P. Schniter, S. Rangan, F. Krzakala, and L. Zdeborová, “Adaptive damping and mean removal for the generalized approximate message passing algorithm,” in Proc. IEEE ICASSP, 2015, pp. 2021–2025. [19] S. Rangan, P. Schniter, and A. K. Fletcher, “Vector approximate message passing,” in Proc. IEEE ISIT, 2017, pp. 1588–1592. [20] M. Opper and O. Winther, “Expectation consistent approximate inference,” J. Mach. Learning Res., vol. 1, pp. 2177–2204, 2005. [21] A. K. Fletcher, M. Sahraee-Ardakan, S. Rangan, and P. Schniter, “Expectation consistent approximate inference: Generalizations and convergence,” in Proc. IEEE ISIT, 2016, pp. 190–194. [22] J. Ma and L. Ping, “Orthogonal AMP,” IEEE Access, vol. 5, pp. 2020–2033, 2017. 9 [23] K. Takeuchi, “Rigorous dynamics of expectation-propagation-based signal recovery from unitarily invariant measurements,” in Proc. ISIT, 2017, pp. 501–505. [24] S. Rangan, P. Schniter, and A. K. Fletcher, “Vector approximate message passing,” arXiv:1610.03082, 2016. [25] A. K. Fletcher, M. Sahraee-Ardakan, S. Rangan, and P. Schniter, “Rigorous dynamics and consistent estimation in arbitrarily conditioned linear systems,” in Proc. NIPS, 2017, pp. 2542–2551. [26] P. Schniter, A. K. Fletcher, and S. Rangan, “Denoising-based vector AMP,” in Proc. Intl. Biomedical and Astronomical Signal Process. (BASP) Workshop, 2017, p. 77. [27] A. K. Fletcher, P. Pandit, S. Rangan, S. Sarkar, and P. Schniter, “Plug-in estimation in high-dimensional linear inverse problems: A rigorous analysis,” arxiv preprint 1806.10466, 2018. [28] U. S. Kamilov, S. Rangan, A. K. Fletcher, and M. Unser, “Approximate message passing with consistent parameter estimation and applications to sparse learning,” IEEE Trans. Info. Theory, vol. 60, no. 5, pp. 2969–2985, Apr. 2014. [29] A. Taeb, A. Maleki, C. Studer, and R. Baraniuk, “Maximin analysis of message passing algorithms for recovering block sparse signals,” arXiv preprint arXiv:1303.2389, 2013. [30] M. R. Andersen, O. Winther, and L. K. Hansen, “Bayesian inference for structured spike and slab priors,” in Advances in Neural Information Processing Systems, 2014, pp. 1745–1753. [31] S. Rangan, A. K. Fletcher, V. K. Goyal, E. Byrne, and P. Schniter, “Hybrid approximate message passing,” IEEE Transactions on Signal Processing, vol. 65, no. 17, pp. 4577–4592, Sept 2017. [32] L. L. Scharf and C. Demeure, Statistical Signal Processing: Detection, Estimation, and Time Series Analysis. Addison-Wesley Reading, MA, 1991, vol. 63. [33] J. Xie, L. Xu, and E. Chen, “Image denoising and inpainting with deep neural networks,” in Advances in Neural Information Processing Systems, 2012, pp. 341–349. [34] L. Xu, J. S. Ren, C. Liu, and J. Jia, “Deep convolutional neural network for image deconvolution,” in Advances in Neural Information Processing Systems, 2014, pp. 1790–1798. [35] J.-F. Cai, E. J. Candès, and Z. Shen, “A singular value thresholding algorithm for matrix completion,” SIAM J. Optim., vol. 20, no. 4, pp. 1956–1982, 2010. [36] M. Borgerding, P. Schniter, and S. Rangan, “AMP-inspired deep networks for sparse linear inverse problems,” IEEE Trans. Signal Process., vol. 65, no. 16, pp. 4293–4308, 2017. [37] E. J. Candès, T. Strohmer, and V. Voroninski, “PhaseLift: Exact and stable signal recovery from magnitude measurements via convex programming,” Commun. Pure Appl. Math., vol. 66, no. 8, pp. 1241–1274, 2013. [38] A. Ahmed, B. Recht, and J. Romberg, “Blind deconvolution using convex programming,” IEEE Trans. Inform. Theory, vol. 60, no. 3, pp. 1711–1732, 2014. [39] S. Ling and T. Strohmer, “Self-calibration and biconvex compressive sensing,” Inverse Problems, vol. 31, no. 11, p. 115002, 2015. [40] M. A. Davenport and J. Romberg, “An overview of low-rank matrix recovery from incomplete observations,” IEEE J. Sel. Topics Signal Process., vol. 10, no. 4, pp. 608–622, 2016. [41] S. S. Haykin, Ed., Blind Deconvolution. Upper Saddle River, NJ: Prentice-Hall, 1994. [42] H. Zhu, G. Leus, and G. B. Giannakis, “Sparsity-cognizant total least-squares for perturbed compressive sampling,” IEEE Trans. Signal Process., vol. 59, no. 5, pp. 2002–2016, 2011. [43] P. Sun, Z. Wang, and P. Schniter, “Joint channel-estimation and equalization of single-carrier systems via bilinear AMP,” IEEE Trans. Signal Process., vol. 66, no. 10, pp. 2772–2785, 2018. [44] S. Rangan and A. K. Fletcher, “Iterative estimation of constrained rank-one matrices in noise,” in Proc. IEEE ISIT, Cambridge, MA, Jul. 2012, pp. 1246–1250. [45] Y. Deshpande and A. Montanari, “Information-theoretically optimal sparse PCA,” in Proc. ISIT, 2014, pp. 2197–2201. [46] R. Matsushita and T. Tanaka, “Low-rank matrix reconstruction and clustering via approximate message passing,” in Proc. NIPS, 2013, pp. 917–925. [47] T. Lesieur, F. Krzakala, and L. Zdeborova, “Phase transitions in sparse PCA,” in Proc. IEEE ISIT, 2015, pp. 1635–1639. [48] J. Parker and P. Schniter, “Parametric bilinear generalized approximate message passing,” IEEE J. Sel. Topics Signal Proc., vol. 10, no. 4, pp. 795–808, 2016. 10
2018
189
7,351
Unsupervised Adversarial Invariance Ayush Jaiswal, Yue Wu, Wael AbdAlmageed, Premkumar Natarajan USC Information Sciences Institute Marina del Rey, CA, USA {ajaiswal, yue_wu, wamageed, pnataraj}@isi.edu Abstract Data representations that contain all the information about target variables but are invariant to nuisance factors benefit supervised learning algorithms by preventing them from learning associations between these factors and the targets, thus reducing overfitting. We present a novel unsupervised invariance induction framework for neural networks that learns a split representation of data through competitive training between the prediction task and a reconstruction task coupled with disentanglement, without needing any labeled information about nuisance factors or domain knowledge. We describe an adversarial instantiation of this framework and provide analysis of its working. Our unsupervised model outperforms state-of-the-art methods, which are supervised, at inducing invariance to inherent nuisance factors, effectively using synthetic data augmentation to learn invariance, and domain adaptation. Our method can be applied to any prediction task, eg., binary/multi-class classification or regression, without loss of generality. 1 Introduction Supervised learning, arguably the most popular branch of machine learning, involves estimating a mapping from data samples (x) to target variables (y). A common formulation of this task is the estimation of the conditional probability p(y∣x) from data through learning associations between y and underlying factors of variation of x. However, data often contains nuisance factors (z) that are irrelevant to the prediction of y from x and estimation of p(y∣x) in such cases leads to overfitting when the model incorrectly learns to associate some z with y. Thus, when applied to new data containing unseen variations of z, trained models perform poorly. For example, a nuisance factor in the case of face recognition in images is the lighting condition the photograph was captured in, and a recognition model that associates lighting with subject identity is expected to perform poorly. Developing machine learning methods that are invariant to nuisance factors has been a long-standing problem in machine learning; studied under various names such as “feature selection”, “robustness through data augmentation” and “invariance induction”. While deep neural networks (DNNs) have outperformed traditional methods at highly sophisticated and challenging supervised learning tasks, providing better estimates of p(y∣x), they are prone to the same problem of incorrectly learning associations between z and y. An architectural solution to this problem is the development of neural network units that capture specific forms of information, and thus are inherently invariant to certain nuisance factors [3, 19]. For example, convolutional operations coupled with pooling strategies capture shift-invariant spatial information while recurrent operations robustly capture high-level trends in sequential data. However, this approach requires significant effort for engineering custom network modules and layers to achieve invariance to specific nuisance factors, making it inflexible [19]. A different but popularly adopted solution to the problem of nuisance factors is the use of data augmentation where synthetic versions of real data samples are generated, during training, with specific forms of variation [3]. For example, rotation, translation and additive noise are typical methods of augmentation used in computer vision, especially for 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. classification and detection tasks. However, models trained naïvely on the augmented dataset become robust to limited forms of nuisance by learning to associate every seen variation of such factors to the target variables. Consequently, such models perform poorly when applied to data exhibiting unseen nuisance variations, such as face images at previously unseen pose angles. A related but more systematic solution to this problem is the approach of invariance-induction by guiding neural networks through specialized training mechanisms to discard known nuisance factors from the learned latent representation of data that is used for prediction. Models trained in this fashion become robust by exclusion rather than inclusion and are, therefore, expected to perform well even on data containing variations of specific nuisance factors that were not seen during training. For example, a face recognition model trained explicitly to not associate lighting conditions with the identity of the person is expected to be more robust to lighting conditions than a similar model trained naïvely on images of subjects under certain different lighting conditions [19]. This research area has, therefore, garnered tremendous interest recently [6, 13, 14, 19]. However, a shortcoming of this approach, is the requirement of domain knowledge of possible nuisance factors and their variations, which is often hard to find [3]. Additionally, this solution to invariance applies only to cases where annotated data is available for each nuisance factor, such as labeled information about the lighting condition of each image in the face recognition example, which is often not the case. We present a novel unsupervised framework for invariance induction that overcomes the drawbacks of previous methods. Our framework promotes invariance through separating the underlying factors of variation of x into two latent embeddings: e1, which contains all the information required for predicting y, and e2, which contains other information irrelevant to the prediction task. While e1 is used for predicting y, a noisy version of e1, denoted as ˜e1, and e2 are used to reconstruct x. This creates a competitive scenario where the reconstruction module tries to pull information into e2 (because ˜e1 is unreliable) while the prediction module tries to pull information into e1. The training objective is augmented with a disentanglement term that ensures that e1 and e2 do not contain redundant information. In our adversarial instantiation of this generalized framework, disentanglement is achieved between e1 and e2 in a novel way through two adversarial disentanglers — one that aims to predict e2 from e1 and another that does the inverse. The parameters of the combined model are learned through adversarial training between (a) the encoder, the predictor and the decoder, and (b) the disentanglers. The framework makes no assumptions about the data, so it can be applied to any prediction task without loss of generality, be it binary/multi-class classification or regression. Unlike existing methods, the proposed method does not require annotation of nuisance factors or specialized domain knowledge. We provide results on three tasks involving a diverse collection of datasets — (1) invariance to inherent nuisance factors, (2) effective use of synthetic data augmentation for learning invariance and (3) domain adaptation. Our unsupervised framework outperforms existing approaches for invariance induction, which are supervised, on all of them. 2 Related Work Methods for preventing supervised learning algorithms from learning false associations between target variables and nuisance factors have been studied from various perspectives including “feature selection” [16], “robustness through data augmentation” [10, 11] and “invariance induction” [3, 14, 19]. Feature selection has typically been employed when data is available as a set of conceptual features, some of which are irrelevant to the prediction tasks. Our approach can be interpreted as an implicit feature selection mechanism for neural networks, which can work on both raw data (such as images) and feature-sets (e.g., frequency features computed from raw text). Popular feature selection methods [16] incorporate information-theoretic measures or use supervised methods to score features with their importance for the prediction task and prune the low-scoring ones. Our framework performs this task implicitly on latent features that the model learns by itself from the provided data. Deep neural networks (DNNs) have outperformed traditional methods at several supervised learning tasks. However, they have a large number of parameters that need to be estimated from data, which makes them especially vulnerable to learning relationships between target variables and nuisance factors and, thus, overfitting. The most popular approach to expand the data size and prevent overfitting in deep learning has been synthetic data augmentation [3, 5, 9–11], where multiple copies of data samples are created by altering variations of certain known nuisance factors. DNNs trained with data augmentation have been shown to generalize better and be more robust compared to those trained without in many domains including vision, speech and natural language. This approach 2 works on the principle of inclusion. More specifically, the model learns to associate multiple seen variations of those nuisance factors to each target value. In contrast, our method encourages exclusion of information about nuisance factors from latent features used for predicting the target, thus creating more robust features. Furthermore, combining our method with data augmentation further helps our framework remove information about nuisance factors used to synthesize additional data, without the need to explicitly quantify or annotate the generated variations. This is especially helpful in cases where augmentation is performed using sophisticated analytical or composite techniques. Several supervised methods for invariance induction and invariant feature learning have been developed recently, such as Controllable Adversarial Invariance (CAI) [19], Variational Fair Autoencoder (VFAE) [14], and a maximum mean discrepancy based model (NN+MMD) [13]. These methods use annotated information about variations of specific nuisance factors to force their exclusion from the learned latent representation. They have also been applied to learn “fair” representations based on domain knowledge, such as making predictions about the savings of a person invariant to age, where making the prediction task invariant to such factors is of higher priority than the prediction performance itself [19]. Our method induces invariance to nuisance factors with respect to a supervised task in an unsupervised way. However, it is not guaranteed to work in “fairness” settings because it does not incorporate any external knowledge about factors to induce invariance to. Disentangled representation learning is closely related to our work since disentanglement is one of the pillars of invariance induction in our framework as the model learns two embeddings (for any given data sample) that are expected to be uncorrelated to each other. Our method shares some properties with multi-task learning (MTL) [17] in the sense that the model is trained with multiple objectives. However, a fundamental difference between our framework and MTL is that the latter promotes a shared representation across tasks whereas the only information shared loosely between the tasks of predicting y and reconstructing x in our framework is a noisy version of e1 to help reconstruct x when combined with a separate encoding e2, where e1 itself is used directly to predict y. 3 Unsupervised Adversarial Invariance In this section, we describe a generalized framework for unsupervised induction of invariance to nuisance factors by disentangling information required for predicting y from other unrelated information contained in x through the incorporation of data reconstruction as a competing task for the primary prediction task and a disentanglement term in the training objective. This is achieved by learning a split representation of data as e = [e1 e2], such that information essential for the prediction task is pulled into e1 while all other information about x migrates to e2. We present an adversarial instantiation of this framework, which we call Unsupervised Adversarial Invariance. 3.1 Unsupervised Invariance Induction Data samples (x) can be abstractly represented as a set of underlying factors of variation F = {fi}. This can be as simple as a collection of numbers denoting the position of a point in space or as complicated as information pertaining to various facial attributes that combine non-trivially to form the image of someone’s face. Understanding and modeling the interactions between factors of variation of data is an open problem. However, supervised learning of the mapping of x to target (y) involves a relatively simpler (yet challenging) problem of finding those factors of variation (Fy) that contain all the information required for predicting y and discarding all the others (F y). Thus, Fy and F y form a partition of F, where we are more interested in the former than the latter. Since y is independent of F y, i.e., y ⊥F y, we get p(y∣x) = p(y∣Fy). Estimating p(y∣x) as q(y∣Fy) from data is beneficial because the nuisance factors, which comprise F y, are never presented to the estimator, thus avoiding inaccurate learning of associations between nuisance factors and y. This forms the basis for “feature selection”, a research area that has been well-studied. We incorporate the idea of splitting F into Fy and F y in our framework in a more relaxed sense as learning a disentangled latent representation of x in the form of e = [e1 e2], where e1 aims to capture all the information in Fy and e2 that in F y. Once trained, the model can be used to infer e1 from x followed by y from e1. More formally, our general framework for unsupervised invariance induction comprises four core modules: (1) an encoder Enc that embeds x into e = [e1 e2], (2) a predictor Pred that infers y from e1, (3) a noisy-transformer ψ that converts e1 into its noisy version ˜e1, and 3 (a) (b) Figure 1: (a) Unsupervised Invariance Induction Framework and (b) Adversarial Model Design (4) a decoder Dec that reconstructs x from ˜e1 and e2. Additionally, the training objective contains a loss-term that enforces disentanglement between Enc(x)1 = e1 and Enc(x)2 = e2. Figure 1a shows our generalized framework. The training objective for this system can be written as Equation 1. L = αLpred(y,Pred(e1)) + βLdec(x,Dec(ψ(e1),e2)) + γLdis((e1,e2)) = αLpred(y,Pred(Enc(x)1)) + βLdec(x,Dec(ψ(Enc(x)1),Enc(x)2)) + γLdis(Enc(x)) (1) The predictor and the decoder are designed to enter into a competition, where Pred tries to pull information relevant to y into e1 while Dec tries to extract all the information about x into e2. This is made possible by ψ, which makes ˜e1 an unreliable source of information for reconstructing x. Moreover, a version of this framework without ψ can converge to a degenerate solution where e1 contains all the information about x and e2 contains nothing (noise), because absence of ψ allows e1 to be readily available to Dec. The competitive pulling of information into e1 and e2 induces information separation such that e1 tends to contain more information relevant for predicting y and e2 more information irrelevant to the prediction task. However, this competition is not sufficient to completely partition information of x into e1 and e2. Without the disentanglement term (Ldis) in the objective, e1 and e2 can contain redundant information such that e2 has information relevant to y and, more importantly, e1 contains nuisance factors. The disentanglement term in the training objective encourages the desired clean partition. Thus, essential factors required for predicting y concentrate into e1 and all other factors migrate to e2. 3.2 Adversarial Model Design and Optimization While there are numerous ways to implement the proposed unsupervised invariance induction framework, we adopt an adversarial model design, introducing a novel approach to disentanglement in the process. Enc, Pred and Dec are modeled as neural networks. ψ can be modeled as a parametric noisy-channel, where the parameters of ψ can also be learned during training. However, we model ψ as dropout [18] (multiplicative Bernoulli noise) because it provides an easy and straightforward method for noisy-transformation of e1 into ˜e1 without complicating the training process. We augment these core modules with two adversarial disentanglers Dis1 and Dis2. While Dis1 aims to predict e2 from e1, Dis2 aims to do the inverse. Hence, their objectives are in direct opposition to the desired disentanglement, forming the basis for adversarial minimax optimization. Thus, Enc, Pred and Dec can be thought of as a composite model (M1) that is pit against another composite model (M2) containing Dis1 and Dis2. Figure 1b shows our complete model design with M1 represented by the color blue and M2 with orange. The model is trained end-to-end through backpropagation by playing the minimax game described in Equation 2. min Enc,P red,Dec max Dis1,Dis2 J(Enc,Pred,Dec,Dis1,Dis2); where: J(Enc,Pred,Dec,Dis1,Dis2) = αLpred(y,Pred(e1)) + βLdec(x,Dec(ψ(e1),e2)) + γ ˜Ldis((e1,e2)) = αLpred(y,Pred(Enc(x)1)) + βLdec(x,Dec(ψ(Enc(x)1)),Enc(x)2))) + γ{˜Ldis1(Enc(x)2,Dis1(Enc(x)1)) + ˜Ldis2(Enc(x)1,Dis2(Enc(x)2))} (2) We use mean squared error for the disentanglement losses ˜Ldis1 and ˜Ldis2. We optimize the proposed adversarial model using a scheduled update scheme where we freeze the weights of a composite 4 Metric NN + MMD [13] VFAE [14] CAI [19] Ours Accuracy of predicting y from e1 (Ay) 0.82 0.85 0.89 0.95 Accuracy of predicting z from e1 (Az) 0.57 0.57 0.24 Table 1: Results on Extended Yale-B dataset player model (M1 or M2) when we update the weights of the other. M2 should ideally be trained to convergence before updating M1 in each training epoch to backpropagate accurate and stable disentanglement-inducing gradients to Enc. However, this is not scalable in practice. We update M1 and M2 in the frequency ratio of 1 ∶k. We found k = 5 to perform well in our experiments. 4 Analysis Competition between prediction and reconstruction. The prediction and reconstruction tasks in our framework are designed to compete with each other. Thus, η = α β influences which task has higher priority in the overall objective. We analyze the affect of η on the behavior of our framework at optimality, considering perfect disentanglement of e1 and e2. There are two asymptotic scenarios with respect to η: (1) η →∞and (2) η →0. In case (1), our framework reduces to a predictor model, where the reconstruction task is completely disregarded. Only the branch x ⇢e1 ⇢y remains functional. Consequently, e1 contains all f ∈F ′ at optimality, where Fy ⊆F ′ ⊆F. In contrast, case (2) reduces the framework to an autoencoder, where the prediction task is completely disregarded, and only the branch x ⇢e2 ⇢x′ remains functional because the other input to Dec, ψ(e1), is noisy. Thus, e2 contains all f ∈F and e1 contains nothing at optimality, under perfect disentanglement. In transition from case (1) to case (2), by keeping α fixed and increasing β, the reconstruction loss starts contributing more to the overall objective, thus inducing more competition between the two tasks. As η is gradually decreased, f ∈(F ′ ∖Fy) ⊆F y migrate from e1 to e2 because f ∈F y are irrelevant to the prediction task but can improve reconstruction by being more readily available to Dec through e2 instead of ψ(e1). After a point, further decreasing η is, however, detrimental to the prediction task as the reconstruction task starts dominating the overall objective and pulling f ∈Fy from e1 to e2. Equilibrium analysis of adversarial instantiation. The disentanglement and prediction objectives in our adversarial model design can simultaneously reach an optimum where e1 contains Fy and e2 contains F y. Hence, the minimax objective in our method has a win-win equilibrium. Selecting loss weights. Using the above analyses, any γ that successfully disentangles e1 and e2 should be sufficient. On the other hand, α and β can be selected by starting with α ≫β and gradually increasing β as long as the performance of the prediction task improves. We found α = 100, β = 0.1 and γ = 1 to work well for all datasets on which we evaluated the proposed model. 5 Experimental Evaluation We provide experimental results on three tasks relevant to invariant feature learning for improved prediction of target variables: (1) invariance to inherent nuisance factors, (2) effective use of synthetic data augmentation for learning invariance, and (3) domain adaptation through learning invariance to “domain” information. We evaluate the performance of our model and prior works on two metrics – accuracy of predicting y from e1 (Ay) and accuracy of predicting z from e1 (Az). The goal of the model is to achieve high Ay and Az close to random chance. 5.1 Invariance to inherent nuisance factors We provide results of our framework at the task of learning invariance to inherent nuisance factors on two datasets – Extended Yale-B [7] and Chairs [2]. Extended Yale-B. This dataset contains face-images of 38 subjects under various lighting conditions. The target y is the subject identity whereas the inherent nuisance factor z is the lighting condition. We compare our framework to existing state-of-the-art supervised invariance induction methods, CAI [19], VFAE [14], and NN+MMD [13]. We use the prior works’ version of the dataset, which has lighting conditions classified into five groups – front, upper-left, upper-right, lower-left 5 (a) (b) (c) (d) Figure 2: Extended Yale-B – t-SNE visualization of (a) raw data, (b) e2 labeled by lighting condition, (c) e1 labeled by lighting condition, and (d) e1 labeled by subject-ID (numerical markers, not colors). (a) (b) Figure 3: Reconstruction from e1 and e2 for (a) Extended Yale B and (b) Chairs. Columns in each block reflect (left to right): real, reconstruction from e1 and that from e2. 6 and lower-right, with the same split as 38 × 5 = 190 samples used for training and the rest used for testing [13, 14, 19]. We use the same architecture for the predictor and the encoder as CAI (as presented in [19]), i.e., single-layer neural networks, except that our encoder produces two encodings instead of one. We also model the decoder and the disentanglers as single-layer neural networks. Table 1 summarizes the results. The proposed unsupervised method outperforms existing state-of-theart (supervised) invariance induction methods on both Ay and Az metrics, providing a significant boost on Ay and complete removal of lighting information from e1 reflected by Az. Furthermore, the accuracy of predicting z from e2 is 0.89, which validates its automatic migration to e2. Figure 2 shows t-SNE [15] visualization of raw data and embeddings e1 and e2 for our model. While raw data is clustered by lighting conditions z, e1 exhibits clustering by y with no grouping based on z, and e2 exhibits near-perfect clustering by z. Figure 3a shows reconstructions from e1 and e2. Dedicated decoder networks were trained (with weights of Enc frozen) to generate these visualizations. As evident, e1 captures identity-related information but not lighting while e2 captures the inverse. (a) (b) Figure 4: MNIST-ROT – t-SNE visualization of (a) raw data and (b) e1 Metric CAI Ours Ay 0.68 0.74 Az 0.69 0.34 Table 2: Results on Chairs. High Ay and low Az are desired. (a) (b) (c) (d) Figure 5: t-SNE visualization of MNIST-ROT e1 embedding for the proposed Unsupervised Adversarial Invariance model (a) & (c), and baseline model B0 (b) & (d). Models trained on Θ = {0,±22.5,±45}. Visualization generated for Θ = {±55}. Chairs. This dataset consists of 1393 different chair types rendered at 31 yaw angles and two pitch angles using a computer aided design model. We treat the chair identity as the target y and the yaw angle θ as z. We split the data into training and testing sets by picking alternate yaw angles. Therefore, there is no overlap of θ between the two sets. We compare the performance of our model to CAI. In order to train the CAI model, we group θ into four categories – front, left, right and back, and provide it this information as a one-hot encoded vector. We model the encoder and the predictor as two-layer neural networks for both CAI and our model. We also model the decoder as a two-layer network and the disentanglers as single-layer networks. Table 2 summarizes the results, showing that our model outperforms CAI on both Ay and Az. Moreover, the accuracy of predicting θ from e2 is 0.73, which shows that this information migrates to e2. Figure 3b shows results of reconstructing x from e1 and e2 generated in the same way as for Extended Yale-B above. The figure shows that e1 contains identity information but nothing about θ while e2 contains θ with limited identity information. 5.2 Effective use of synthetic data augmentation for learning invariance Data is often not available for all possible variations of nuisance factors. A popular approach to learn models robust to such expected yet unobserved or infrequently seen (during training) variations is data augmentation through synthetic generation using methods ranging from simple operations [10] like rotation and translation to Generative Adversarial Networks [1, 8] for synthesis of more realistic 7 Metric Angle CAI Ours B0 B1 Ay Θ 0.958 0.977 0.974 0.972 ±55° 0.826 0.856 0.826 0.829 ±65° 0.662 0.696 0.674 0.682 Az 0.384 0.338 0.586 0.409 Table 3: Results on MNIST-ROT. Θ = {0,±22.5°,±45°} was used for training. High Ay and low Az are desired. k CAI Ours B0 B1 -2 0.816 0.880 0.872 0.870 2 0.933 0.958 0.942 0.940 3 0.795 0.874 0.847 0.853 4 0.519 0.606 0.534 0.550 Table 4: MNIST-DIL – Accuracy of predicting y (Ay). k = −2 represents erosion with kernel-size of 2. Figure 6: MNIST-ROT – reconstruction from e1 and e2, (c) e. Columns in each block reflect (left to right): real, reconstruction from e1 and that from e2. variations. The prediction model is then trained on the expanded dataset. The resulting model, thus, becomes robust to specific forms of variations of certain nuisance factors that it has seen during training. Invariance induction, on the other hand, aims to completely prevent prediction models from using information about nuisance factors. Data augmentation methods can be more effectively used for improving the prediction of y by using the expanded dataset for inducing invariance by exclusion rather than inclusion. We use two variants of the MNIST [12] dataset of handwritten digits to (1) show the advantage of unsupervised invariance induction at this task over its supervised variant through comparison with CAI, and (2) perform ablation experiments for our model to justify our framework design. We use the same two-layer architectures for the encoder and the predictor in both our model and CAI, except that our encoder generates two encodings instead of one. We model the decoder as a three-layer neural network and the disentanglers as single-layer neural networks. We train two baseline versions of our model for our ablation experiments – B0 composed of Enc and Pred, i.e., a single feed-forward network x ⇢h ⇢y and B1, which is the same as the composite model M1, i.e., the proposed model trained non-adversarially without the disentanglers. B0 is used to validate the phenomenon that invariance by exclusion is a better approach than robustness through inclusion whereas B1 helps evaluate the importance of disentanglement in our framework. MNIST-ROT. We create this variant of the MNIST dataset by randomly rotating each image by an angle θ ∈{−45°,−22.5°,0°,22.5°,45°} about the Y-axis. We denote this set of angles as Θ. The angle information is used as a one-hot encoding while training the CAI model. We evaluate all the models on the same metrics Ay and Az we previously used. We additionally test all the models on θ /∈Θ to gauge the performance of these models on unseen variations of the rotation nuisance factor. Table 3 summarizes the results, showing that our unsupervised adversarial model not only performs better than the baseline ablation versions but also outperforms CAI, which uses supervised information about the rotation angle. The difference in Ay is especially notable for the cases where θ /∈Θ. Results on Az show that our model discards more information about θ than CAI even though CAI uses θ information during training. The information about θ migrates to e2, indicated by the accuracy of predicting it from e2 being 0.77. Figure 4 shows t-SNE visualization of raw MNIST-ROT images and e1 learned by our model. While raw data tends to cluster by the rotation angle, e1 shows near-perfect grouping based on the digit-class. We further visualize the e1 embedding learned by the proposed model and the baseline B0, which models the classifier x ⇢h ⇢y, to investigate the effectiveness of invariance induction by exclusion versus inclusion, respectively. Both the models were trained on digits rotated by θ ∈Θ and t-SNE visualizations were generated for θ ∈{±55}. Figure 5 shows the results. As evident, e1 learned by the proposed model shows no clustering by the rotation angle, while that learned by B0 does, with encodings of some digit classes forming multiple clusters corresponding to rotation angles. Figure 6 shows results of reconstructing x from e1 and e2 generated in the same way as Extended Yale-B above. The figures show that reconstructions from e1 reflect the digit class but contain no information about θ, while those from e2 exhibit the inverse. MNIST-DIL. We create this variant of MNIST by eroding or dilating MNIST digits using various kernel-sizes (k). We use models trained on MNIST-ROT to report evaluation results on this dataset, to show the advantage of unsupervised invariance induction in cases where certain z are not annotated 8 Source - Target DANN [6] VFAE [14] Ours books - dvd 0.784 0.799 0.820 books - electronics 0.733 0.792 0.764 books - kitchen 0.779 0.816 0.791 dvd - books 0.723 0.755 0.798 dvd - electronics 0.754 0.786 0.790 dvd - kitchen 0.783 0.822 0.826 electronics - books 0.713 0.727 0.734 electronics - dvd 0.738 0.765 0.740 electronics - kitchen 0.854 0.850 0.890 kitchen - books 0.709 0.720 0.724 kitchen - dvd 0.740 0.733 0.745 kitchen - electronics 0.843 0.838 0.859 Table 5: Results on Amazon Reviews dataset – Accuracy of predicting y from e1 (Ay) in the training data. Thus, information about these z cannot be used to train supervised invariance induction models. We also provide ablation results on this dataset using the same baselines B0 and B1. Table 4 summarizes the results of this experiment. The results show significantly better performance of our model compared to CAI and the baselines. More notably, CAI performs significantly worse than our baseline models, indicating that the supervised approach of invariance induction can worsen performance with respect to nuisance factors not accounted for during training. 5.3 Domain Adaptation Domain adaptation has been treated as an invariance induction task in recent literature [6, 14] where the goal is to make the prediction task invariant to the “domain” information. We evaluate the performance of our model at domain adaptation on the Amazon Reviews dataset [4] using the same preprocessing as [14]. The dataset contains text reviews on products in four domains – “books”, “dvd”, “electronics”, and “kitchen”. Each review is represented as a feature vector of unigram and bigram counts. The target y is the sentiment of the review – either positive or negative. We use the same experimental setup as [6, 14] where the model is trained on one domain and tested on another, thus creating 12 source-target combinations. We design the architectures of the encoder and the decoder in our model to be similar to those of VFAE, as presented in [14]. Table 5 shows the results of the proposed unsupervised adversarial model and supervised state-of-the-art methods VFAE and Domain Adversarial Neural Network (DANN) [6]. The results of the prior works are quoted directly from [14]. The results show that our model outperforms both VFAE and DANN at nine out of the twelve tasks. Thus, our model can also be used effectively for domain adaptation. 6 Conclusion And Future Work In this paper, we have presented a novel unsupervised framework for invariance induction in neural networks. Our method models invariance as an information separation task achieved by competitive training between a predictor and a decoder coupled with disentanglement. We described an adversarial instantiation of this framework and provided analysis of its working. Experimental evaluation shows that our unsupervised adversarial invariance induction model outperforms state-of-the-art methods, which are supervised, on learning invariance to inherent nuisance factors, effectively using synthetic data augmentation for learning invariance, and domain adaptation. Furthermore, the fact that our framework requires no annotations for variations of nuisance factors, or even knowledge of such factors, shows the conceptual superiority of our approach compared to previous methods. Since our model does not make any assumptions about the data, it can be applied to any supervised learning task, eg., binary/multi-class classification or regression, without loss of generality. The proposed approach is not designed to learn “fair representations” of data, e.g., making predictions about the savings of a person invariant to age, when such bias exists in data and making the prediction task invariant to such biasing factors is of higher priority than the prediction performance [19]. In future work, we will augment our model with the capability to additionally use supervised information (when available) about known nuisance factors for learning invariance to them, which will, consequently, help our model learn fair representations. 9 Acknowledgements This work is based on research sponsored by the Defense Advanced Research Projects Agency under agreement number FA8750-16-2-0204. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright notation thereon. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the Defense Advanced Research Projects Agency or the U.S. Government. References [1] Antreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. arXiv preprint arXiv:1711.04340, 2017. [2] Mathieu Aubry, Daniel Maturana, Alexei Efros, Bryan C. Russell, and Josef Sivic. Seeing 3d chairs: Exemplar part-based 2d-3d alignment using a large dataset of cad models. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 06 2014. [3] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013. [4] Minmin Chen, Zhixiang Xu, Kilian Q. Weinberger, and Fei Sha. Marginalized denoising autoencoders for domain adaptation. In Proceedings of the 29th International Conference on Machine Learning, ICML’12, pages 1627–1634, USA, 2012. Omnipress. [5] Iacopo Masi et al. Learning pose-aware models for pose-invariant face recognition in the wild. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. [6] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The Journal of Machine Learning Research, 17(1):2096–2030, 2016. [7] A. S. Georghiades, P. N. Belhumeur, and D. J. Kriegman. From few to many: illumination cone models for face recognition under variable lighting and pose. IEEE Transactions on Pattern Analysis and Machine Intelligence, 23(6):643–660, Jun 2001. [8] 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. [9] Ayush Jaiswal, Dong Guo, Cauligi S Raghavendra, and Paul Thompson. Large-scale unsupervised deep representation learning for brain structure. arXiv preprint arXiv:1805.01049, 2018. [10] Tom Ko, Vijayaditya Peddinti, Daniel Povey, and Sanjeev Khudanpur. Audio augmentation for speech recognition. In Sixteenth Annual Conference of the International Speech Communication Association, 2015. [11] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [12] 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. [13] Yujia Li, Kevin Swersky, and Richard Zemel. Learning unbiased features. arXiv preprint arXiv:1412.5244, 2014. [14] Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zeme. The variational fair autoencoder. In Proceedings of International Conference on Learning Representations, 2016. [15] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008. [16] Jianyu Miao and Lingfeng Niu. A survey on feature selection. Procedia Computer Science, 91:919 – 926, 2016. Promoting Business Analytics and Quantitative Management of Technology: 4th International Conference on Information Technology and Quantitative Management (ITQM 2016). [17] Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017. 10 [18] 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. [19] Qizhe Xie, Zihang Dai, Yulun Du, Eduard Hovy, and Graham Neubig. Controllable invariance through adversarial feature learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 585–596. Curran Associates, Inc., 2017. 11
2018
19
7,352
Multitask Boosting for Survival Analysis with Competing Risks Alexis Bellot University of Oxford Oxford, United Kingdom alexis.bellot@eng.ox.ac.uk Mihaela van der Schaar University of Oxford and The Alan Turing Institute London, United Kingdom mschaar@turing.ac.uk Abstract The co-occurrence of multiple diseases among the general population is an important problem as those patients have more risk of complications and represent a large share of health care expenditure. Learning to predict time-to-event probabilities for these patients is a challenging problem because the risks of events are correlated (there are competing risks) with often only few patients experiencing individual events of interest, and of those only a fraction are actually observed in the data. We introduce in this paper a survival model with the flexibility to leverage a common representation of related events that is designed to correct for the strong imbalance in observed outcomes. The procedure is sequential: outcome-specific survival distributions form the components of nonparametric multivariate estimators which we combine into an ensemble in such a way as to ensure accurate predictions on all outcome types simultaneously. Our algorithm is general and represents the first boosting-like method for time-to-event data with multiple outcomes. We demonstrate the performance of our algorithm on synthetic and real data. 1 Introduction There is now significant evidence that the progressions of many diseases interact with one another such that the prediction of events of interest, for example death due to breast cancer in a population of women, will be influenced by their simultaneous risks of developing related diseases, such as cardiovascular or pulmonary diseases [19, 20]. A central problem in survival analysis is to predict the relationship between variables and survival, which is especially challenging when a number of different correlated events might occur - i.e., there are competing risks. Current approaches jointly model competing risks in an attempt to capture shared latent biological traits or common risk factors. In the presence of multiple events however, jointly modelling these conditions leads to predictive models that neglect individual diseases with lower incidence. Clinical prognosis tools may result in high overall accurate predictions rates while also having unacceptably low performance with respect to an underrepresented disease outcome, which strongly reduces their explanatory power for practical purposes. The design of therapies and medical planning relies on survival estimates of predictive models. Examples of similar settings can be found in many fields beyond medicine including failure analysis in engineering and prediction of multiple economic events in economics. The focus of this work is to provide a new interpretation of boosting algorithms [11] in a multitask learning framework [8] that extends this family to time-to-event data with multiple competing outcomes. Motivated by the ideas discussed above, we specifically intend to leverage the heterogeneity present in large modern data sets, the complexity in underlying relationships between events/tasks and the strong imbalance often observed between events/tasks. The aim is a flexible simultaneous description of the likelihood of different events over time that we achieve by estimating full probability distributions, in contrast to single time prediction problems such as regression or classification. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Figure 1: Boosting in the Toy Example. We develop a boosting algorithm in which each task-specific time-to-event distribution is a component of a multi-output function. A distinctive feature is that each weak estimator (whose performance is sub-optimal) learns a shared representation between tasks by recursively partitioning the observed data (analogous to the construction of trees) from all related tasks using a measure of similarity between instances that involves all related tasks. This means that we learn a shared representation directly from selecting appropriate subsets of patients, which may experience different events, but which have a common time-to-event trajectory. Since this partitioning scheme is applied recursively, learned relationships (and predictions) are adaptive to the complexity of the problem and, in addition, no assumptions on the data generating process, such as accelerated failure times or proportional hazards (common in most survival models [22, 17]) have to be posed. We construct an ensemble by weighting the sample data such as to bias the next weak multivariate estimator towards mis-predicted instances. What distinguishes our weighting scheme from existing boosting methods is that while the output of each weak estimator is a multivariate probability distribution, the data only provides the specific event that occurred and the time of occurrence and thus we introduce new notions of "prediction correctness" that apply in our setting. Why is boosting useful for competing risks? A toy example we show in Figure 1 may help to illustrate our method. We consider a population that experiences one of two events, death due to cardiovascular diseases (CVD) or breast cancer. (For simplicity we ignore censoring). Each patient is characterized by its body mass index (BMI), cholesterol level and age at menarche. The medical fact is that increased BMI increases the risk of both breast cancer and CVD; increased cholesterol increases the risk of CVD but is irrelevant for breast cancer; increased age at menarche decreases the risk of breast cancer but is irrelevant for CVD. (Note that the same patients are represented in all panels of Figure 1 - the vertical position remains the same while their horizontal position changes due to different features being considered). The panels show three iterations of boosting using a stump as a weak predictor; the best partition of the data in each case is shown with the yellow threshold. The first stump recognizes BMI as best separating event times (on average), but mispredicts survival of patient (a) (that has high survival despite having high BMI) and (b) for which the contrary is true. Iteration 2, encouraged by the higher weight of (a), considers a split along the cholesterol level and is able to better describe (a)’s survival (its high survival is due to a low cholesterol level). Iteration 3, after repeatedly mispredicting (b) in iteration 1 and 2, splits based on age at menarche which explains (b)’s low survival. Survival data in the presence of competing risks is often highly heterogeneous, the process of boosting is effective for identifying patients that do not conform to a general pattern; a fact further exacerbated when only few examples are available from each type or if imbalance is large. 2 Problem Formulation The set up we consider is best defined within the context of medical patients at risk of mutually exclusive outcomes, such as causes of death, referred more generally as tasks in other domains. In this context the goal of multitask learning is to estimate cumulative incidence functions (CIFs): F1, ..., FK : X × T →[0, 1] (1) 2 Fk represents the probability of a specific event of type k happening before time t, Fk(t|X) = p(T ≤ t, Z = k|X)1. This relationship is estimated from an observational sample of the random tuple {X, T, Z} where the input space X describes patient characteristics - typically Rd -, T ∈R+ defines the time to event and Z is the type of event observed Z ∈{∅, 1, ..., K}. A particularity of time-toevent data is that often the outcome will not be observed for every patient (e.g. a patient follow-up might be interrupted) however event-free survival is known up to a censoring time independent of (X, T) (a common assumption in the survival literature that ensures consistency of our estimates). This is the defining property of survival data and makes our setting distinct from classical supervised problems. We write zi = ∅for a right censored observation and zi = 1, ..., K to denote the occurrence of one of K competing events. The key idea is to exploit the shared structure of F1, ..., FK by estimating them jointly, rather than independently, in the hope of improving prediction performance for all tasks. We aim to learn prognostic models ˆFk such as to minimize the discrepancy between predicted and actual survival status, Lk( ˆF) := E1 τ Z τ 0  I(T ≤t, Z = k) −ˆFk(t|X) 2 dt, L( ˆF) = 1 K X k Lk( ˆF) (2) which is extended on the right hand side to consider multiple tasks simultaneously by averaging over k. In addition, we define the cause-specific hazard function, or subdistribution hazard, λk(t|X) = lim dt→0 p(t ≤T ≤t + dt, Z = k|T ≥t, X)/dt (3) It represents the instantaneous risk of experiencing an end-point related to cause k and indicates the rate at which mortality with respect to that cause progresses with time. The cumulative cause specific hazard is Λk(t) = R t 0 λk(s)ds. 3 Model Description In this section we present our main contribution: a nonparametric boosting algorithm for jointly estimating survival distributions for multiple tasks we call Survival Multitask Boosting (SMTBoost). Boosting algorithms iteratively train simple predictive models on weighted samples of the data such as to encourage improvement on those data points that are mis-predicted in previous iterations. The following subsections will detail first the training procedure of weak predictors and then will provide the ensemble approach that results in flexible task-specific time-to-event distributions. 3.1 Weak predictors Weak predictors are trees composed of leaves and nodes. Leafs define a partition for the data and are responsible for making predictions and nodes guide examples towards appropriate leaves using binary splits based on boolean-valued rules. We seek a binary recursive partitioning scheme -rules that partition the data at each node- resulting in the greatest difference of task-specific and overall time-to-event distributions. 3.1.1 Splitting rule The key in growing trees lies in the split rule used to recursively separate the population in homogeneous nodes. In the context of competing risks homogeneity of time-to-event outcomes otherwise measured with the log-rank test statistic and model deviance in single event survival settings are not applicable. We opt instead for a modified version of Gray’s test statistic [14, 16] that explicitly compares CIFs Fk between two populations. Gray proposed a non-parametric log-rank test statistic defined as a weighted sum of differences in estimates of the sub-distribution hazards λk, that effectively generalizes the log-rank test to competing risks. In order to measure similarity with respect to all causes simultaneously, we combine the task-specific splitting rules across the event types k and optimize for a weighted sum of Gray’s statistic over all tasks (weighted by an asymptotic estimate of 1Also called subdistribution function because it does not converge to 1 as t →∞, but to p(Z = k), the expected proportion of task k events. However, the CIFs for all possible event types will always add up to the distribution function of T. 3 Figure 2: An example of partition of node C0 into C1 and C2 based on Gray’s test statistic for two tasks. The estimated CIFs get updated based on the resulting partition (defined by x = δ) that maximizes Gray’s test statistic, a composite measure of the difference between the CIFs in each subset. the variance of each statistic, see [14] for details). Figure 2 illustrates this procedure for a single split. For conventional survival analysis, when a single event is analyzed in isolation, Gray’s test statistic reduces to a log-rank test statistic commonly used in survival trees. 3.1.2 Leaf node predictions Leaf nodes are responsible for predictions. Based on the final partition we compute task specific distributions with nonparametric estimators from the theory of counting processes. Let Cj denote the index set of training examples with leaf node membership j. Let Nk(t) and N(t) denote the number of events of type k and of any type recorded before time t respectively, Y (t) the number of individuals at risk at time t and t(0) < t(1) < ... < t(m) the ordered distinct event times (these quantities refer to leaf node j only, we omit the subscript j for readability). We compute task-specific survival at leaf node j with the nonparametric Aalen-Johansen estimator [1], ˆFk(τ) = Z τ 0 ˆS(t)dˆΛk(t) (4) where probability of event-free survival ˆS is estimated with the Kaplan Meier estimator and the cumulative hazard function ˆΛk is estimated with the Nelson-Aalen estimator, ˆS(t) = Y i:t(i)≤t  1 −N(t(i)) −N(t(i−1)) Y (t(i))  , ˆΛk(t) = X i:t(i)<t Nk(t(i)) −Nk(t(i−1)) Y (t(i)) (5) The leaf nodes partition the sample space so the above construction defines the task-specific and overall cumulative incidence functions for the tree, ˆFk(t; xi) = X j I(i ∈Cj) ˆFk,j(t), ˆF(t; xi) = X k ˆFk(t; xi) (6) where the subscript j refers to CIFs estimated based on each leaf of the resulting tree. This process allows to obtain completely nonparametric estimates of survival. In complex problems, and particularly from a medical perspective, this is important because subtle signals in heterogeneous populations are often unknown a priori and need to be discovered from relationships in the data. 3.2 Ensemble approach by boosting In the traditional boosting framework, misclassified examples are up-weighted to bias the next weak predictor to improve previous predictions. The contrast with time-to-event settings is that model outputs are probability distributions over time and hence notions of correctness of model predictions need to be accommodated. We use the extended loss function introduced in (2), that captures the joint performance over all tasks and gives a measure of the individual empirical error: ei = 1 Kτ X k Z τ 0 ˆWi(t)  I(Ti ≤t, Zi = k) −ˆF(t; xi) 2 dt (7) where ˆWi(t) are estimated inverse probability of censoring weights. 4 Each iteration m of the boosting procedure grows a tree F (m) on a weighted random fraction s of the training data. A decomposition of the error suggests improved performance with uncorrelated weak predictors (see the supplementary material), which we encourage by randomly sub-sampling the data; empirically we have found this to impact performance favourably. The algorithm proceeds by re-weighting all samples in our training data as a function of the individual prediction error e(m) i with (7) and a measure of overall confidence in predictions of the mth tree, β(m). Those examples with poor event predictions get increased updated weights where β(m) is set to control the magnitude of this update: more confident trees leading to larger updates. β(m) is adjusted to lie in the interval (0, 1); note that random guessing of survival probabilities results in an average error ϵ(m) of 1/3 which any weak predictor F (m) is assumed to improve upon. Final time-to-event distributions for each task are computed from a weighted average of all weak predictors, weighted proportional to their confidence β(m). In contrast to existing boosting methods [9, 25, 11, 13], the output is not in the form of a discrete class label or a real valued number, but a set of distribution functions. One of the main contributions of this paper is to explicitly extend discrete label boosting to nonparametric multivariate density estimation. We present all algorithmic details in Algorithm 1. Algorithm 1 Multitask Boosting Input: time-to-event data with multiple tasks D = {(Xi, Ti, Zi)}i of size n, number of iterations M, initial weights w(1) i ∝1, sampling fraction s. for m = 1 to M do 1. Let D∗be a randomly sampled fraction s of training data D with distribution w(m). 2. Learn weak model F (m) : X × T →[0, 1]K on D∗. 3. Calculate prediction error e(m) i for each instance i with equation (7). 4. Calculate adjusted error of F (m), ϵ(m) = P i e(m) i w(m) i . 5. Calculate confidence in individual weak models β(m) = ϵ(m) 2/3−ϵ(m) : 6. Update data distribution w(m+1) i ∝w(m) i (β(m))1−e(m) i . end for Output: Final predictions Ff, the weighted average of F (m) for 1 ≤m ≤M using log(1/β(m)) as the weight of model F (m). 3.3 Variable importance Understanding the influence of variables on each specific task is of crucial importance in medicine and other domains. The approach we use is based on a comparison of the prediction error (2) when a variable is randomly shuffled (such that the dependence between the response and the variable in broken) in comparison to the original best fit, similarly to [26] who have shown similar procedures to be effective in many practical settings. The randomization effectively voids the effect of a variable. The intuition is that variables used as splitting rules in many tree configurations will significantly alter individual predictions (when the variable value is shuffled in each patient) suggesting high predictive power relative to other variables. Let e∗ m,j denote the error of tree m over the training data with variable j randomly shuffled and em the error without shuffling. We define the importance of variable j, as the weighted average of prediction error differences, P m log(1/β(m))|em −e∗ j,m| P m log(1/β(m)) (8) Task-specific variable importance measures can be computed by considering the error only over the task specific component (i.e. using Lk instead of L in equation 2). 4 Related Work Survival analysis under competing risks departs from more common supervised learning problems by asking both what event will occur and when that event will occur. A number of recent papers [22, 17, 5, 3, 4] only consider a single event of interest and are thus not directly applicable to 5 our context. We focus instead on contrasting with approaches which, like the present paper, treat competing risks. Parametric models The most common techniques for the analysis of such data model explicitly some form of a cause-specific hazard (presented in (3)) as a parametric function of descriptive variables. [21] and later [10] are familiar examples of this approach. Applications of boosting [23, 15, 6], albeit in a gradient boosting framework which is very different to ours, have been proposed to improve parameter optimization by pursuing parameter updates that result in the steepest ascent of Cox’s partial likelihood. With the exception of [6] all other works only consider one event types. A major downside of all the above is their dependence on proportional hazards - hazard rates between any two patients need to be in constant proportion over time - and their need to specify covariate interactions beforehand. By contrast, our work makes no such assumptions. Tree-based models Closer to our work are tree-based approaches to competing risks. [16] extended Random Forests [7] to time to event estimation under competing risks. They propose a parallel ensemble in which fully grown trees are built independently on a bootstrapped sample of the data. As was empirically observed in classification problems in [24], the performance on important subsets of the population is undermined by the small contribution of underrepresented tasks to the construction of each tree. For this reason several authors [12] have suggested modifications that re-balance the data by over/under sampling subsets of the data. However our experiments using this approach, reported in section 5 produced only mixed results. By boosting, our model implicitly corrects for this imbalance by encouraging successive trees to improve performance on underrepresented tasks when they are mis-predicted. [5] use multivariate random forests within a parametric Bayesian mixture model in which the components of the mixture describe each task individually. Other Machine Learning models The approach to competing risks in terms of a multi-tasking learning problem is not new to the present work. For example, [2] builds a model that couples this point of view with a representation in terms of deep multi-task Gaussian Processes with vector-valued kernels. However, the objective in [2] is to predict fixed time risk (e.g. 1 year mortality) rather than to predict full survival curves, which is our objective here. [18] is closer to the present work in that it shares the objective of predicting cause-specific survival probabilities, but the methodology is quite different, exploiting a deep learning architecture with shared and task specific layers. 5 Experiments 5.1 Evaluation Protocol We measure performance with a common metric used in the literature: the cause-specific concordance index (C-index). Formally, we define the (time-dependent) concordance index (C-index) for a cause k as follows [27]: Ck(t) := P( ˆFk(t; Xi) > ˆFk(t; Xj)|{zi = k} ∧{Ti ≤t} ∧{Ti < Tj ∨δj ̸= k}) (9) where ˆFk(t; Xi) is the predicted CIF for a test patient i. The time-dependent C-index as defined above corresponds to the probability that predicted cause-specific survival probabilities are ranked in accordance to the actual observed survival times given the occurrence of an event and corresponding cause. The C-index thus serves as a measure of the discriminative power for a cause of interest of a model and can be interpreted as an extension of the AUROC for censored data. Random guessing corresponds to a C-index of 0.5 and perfect prediction to a C-index of 1. Baseline Algorithms We compare our model with 9 baseline algorithms described in section 4. We consider the proportional hazards model on the cause specific hazard (Cox) [21], the proportional hazards model on the subdistribution hazard (Fine-Gray) by [10] and the boosting approach to parameter optimization from [6]. These three baselines encode a linear effect of variables on survival and do not require hyper-parameter tuning except [6] for which the number of boosting iterations is optimized by cross-validation. As nonparametric alternatives we consider Random Forests for survival data under competing risks (RSF) [16] and also a weighted version (Weighted RSF) that attempts to mitigate task imbalance by sampling low incidence instances with higher probability such as to achieve balanced tasks in each bootstrapped sample. The size of the ensembles was optimized by cross-validation while the remaining hyper-parameters were set to default values. We compare with the Gaussian process model (DMGP) [2] with the suggested hyperparameters configurations and the 6 Deep Learning architecture (DeepHit) [18] with hyperparameters optimized with a validation set. We have in addition evaluated SMTBoost on each cause separately, denoted SMTBoost (sep.), by using the logrank test statistic instead of Gray’s test (see section 3.1.1) and the deep neural network for survival prediction (DeepSurv) [17] - also evaluated on each cause separately as it does not consider competing risks - to understand the benefit of considering all causes jointly. On all experiments we train SMTBoost with a tree-depth of 3 and 250 boosting iterations, our default parameter settings. 5.2 Synthetic Studies This section explores the ability of SMTBoost to recover complex survival patterns. 5.2.1 High Dimensional and Heterogeneous data X ∼U(0, 1), T 1 ∼exp(X2 1+sin(X2+X3)+2X4+2X5), T 2 ∼exp(X1+X2+X3+2X6+2X7) This challenging setting mimics data that might be expected in genetic studies or medical data from electronic health records in which the two tasks reflect heterogeneous interactions between patient variables. We generate 1000 event times T, each with probability 0.5 from tasks 1 or 2, based on 100 variables drawn from a uniform distribution. A random subset of 20% of generated times are censored by transforming their event time: C ←U(0, T). Only a very small number of variables, 7 out of 100, are set to influence time to event. The first 3 generated variables are shared between tasks, while variables 4 and 5 influence task 1 only, and variables 6 and 7 influence task 2 only. All remaining variables are introduced as noise. Figure 3: Variable importance in high dimensional setting. As a first experiment we aim to evaluate and demonstrate the validity of our task specific variable importance procedure introduced in section 3.3. Results (normalized) are shown in Figure 3. For each variable two estimates are presented: one deriving from the error on task 1 predictions only, and one considering the error on task 2 only. We note first that even in high dimensional settings with a lot of noise, SMTBoost is able to distinguish between influential and noise variables. In addition SMTBoost captures the larger effect of task-specific variables but, due to the presence of censoring, also overestimates the importance of variables that are present in only one of the two tasks. In a second experiment we evaluate model task-specific predictions in comparison to baseline algorithms introduced in section 5.1 with the C-index averaged over all time horizons t. We present these results on the two last columns of Table 1. Performance on task 1 demonstrates the representation ability of the more flexible approaches (tree based, deep learning and gaussian process) but outperform only marginally for task 2 which has linear covariate influence. The performance of the tree-based approaches on both tasks suggests that these are more efficient in high-dimensional settings. In comparison to SMTBoost we believe that it is the stronger focus (by boosting) on divergent instances that leads to the gain in performance with respect to RSF and weighted RSF because the exponential transformation of covariate interactions for both tasks leads to highly divergent event times even between observations that have similar covariate values. 5.3 Real data studies: SEER We investigate a patient population extracted from the Surveillance, Epidemiology, and End Results (SEER) repository similarly to [2]. The data contains 72, 809 patients of which 14.4% died due to Breast cancer, 1.7% due to cardiovascular diseases (CVD) and 6.1% due to other causes. The remaining patients were censored. We give a more detailed description in the Supplementary material. Performance is evaluated with the cause-specific C-index (section 5.1), averaged over equally spaced times of 10 months from registration to the last observed event. Table 1 gives all performance results; these are averages over 4 fold cross-validation estimates and confidence bands are standard deviations. 7 Models Breast Cancer CVD Other Synthetic T 1 Synthetic T 2 Cox 0.773 ± 0.02 0.639 ± 0.03 0.688 ± 0.02 0.612 ± 0.01 0.705 ± 0.01 CoxBoost 0.774 ± 0.02 0.642 ± 0.03 0.678 ± 0.02 0.613 ± 0.01 0.705 ± 0.01 Fine-Gray 0.777 ± 0.02 0.636 ± 0.03 0.682 ± 0.02 0.613 ± 0.01 0.706 ± 0.01 RSF 0.789 ± 0.03 0.722 ± 0.03 0.643 ± 0.02 0.654 ± 0.01 0.720 ± 0.01 Weighted RSF 0.778 ± 0.03 0.730 ± 0.03 0.645 ± 0.02 0.645 ± 0.01 0.717 ± 0.01 DeepHit [18] 0.800 ± 0.01 0.662 ± 0.01 0.684 ± 0.01 0.652 ± 0.01 0.720 ± 0.01 DMGP [2] 0.801 ± 0.02 0.732 ± 0.03 0.646 ± 0.02 0.651 ± 0.01 0.718 ± 0.01 DeepSurv [17] 0.781 ± 0.02 0.659 ± 0.03 0.685 ± 0.03 0.629 ± 0.01 0.710 ± 0.01 SMTBoost (sep.) 0.795 ± 0.02 0.721 ± 0.04 0.660 ± 0.03 0.631 ± 0.01 0.710 ± 0.01 SMTBoost 0.819 ± 0.02 0.766 ± 0.03 0.688 ± 0.02 0.664 ± 0.01 0.721 ± 0.01 Table 1: C-index figures (higher better) and standard deviations on the SEER and synthetic dataset. Source of gain Patients suffering from chronic diseases tend to be very heterogeneous, mortality rates can be highly divergent even within narrow phenotypes. The limitations imposed by proportional hazard models to model this kind of data are evident from the performance results on both Breast Cancer and CVD outcomes. Predictions of other causes tend to benefit from simpler modelling approaches as SEER predominantly records patient information related to Cancer (see Supplement) which suggests that few predictive variables are available for other causes. Performance gains of SMTBoost are largest with respect CVD outcomes which illustrates its ability to handle low incidence tasks (only 1.7% of events relate to CVD). Both DeepHit and DMGP are competitive as they leverage the influence of shared risk factors but underperform SMTBoost. The results suggest that boosting to handle imbalance is crucial to improve predictions. Figure 4: Mean C-index results (higher better). 5.3.1 Further exploring imbalanced heterogeneous data We constructed an additional more general synthetic experiment designed to express complex and heterogeneous survival patterns between 2 tasks to further understand performance in imbalanced data sets. Consider the following data generation process, X ∼U(0, 1), T 1 ∼exp(log(αT 1 X) + αT 2 X2), T 2 ∼exp(αT 3 X) Variables X and parameters α1, α2, α3 are each of dimension 5 whose components are drawn at random from a uniform distribution. For each task we investigate predictive performance as a function of task prevalence by analyzing 4 scenarios with different task proportions in the resulting data. For instance a first balanced scenario for task 1 would involve a split: 50% censored, 25% task 1, 25% task 2. We generate 5 data sets (by sampling variables and parameters randomly) of 1000 instances for each individual scenario and set a random 50% of the population to be uniformly censored. We show performance results in Figure 4, as a function of task 1 and task 2 occurrence in the data. As expected, all models have their performance deteriorate the fewer samples available but we observe increasing relative performance gains for both SMTBoost and weighted RSF, the only two approaches that attempt to correct for the imbalance. 8 6 Conclusion We have introduced a boosting-based algorithm for survival analysis with multiple outcomes, designed to handle the heterogeneity present in modern medical data sets, including highly imbalanced data and high dimensional feature spaces. Our experiments on synthetic and real medical data have demonstrated large performance improvements over current techniques and show the advantage of a boosting framework, already observed in classification and regression problems, in the field of time-to-event analysis. From a medical perspective our model contributes towards the field of “individualized medicine”. Our hope is that based on our model clinicians can improve long term prognosis and more accurately weight the benefits of a treatment for each individual patient whose characteristics may lead her to behave differently than the average. References [1] Odd Aalen. A model for nonparametric regression analysis of counting processes. In Mathematical statistics and probability theory, pages 1–25. Springer, 1980. [2] Ahmed Alaa and Mihaela van der Schaar. Deep multi-task gaussian processes for survival analysis with competing risks. In Advances in Neural Information Processing Systems, 2017. [3] Ahmed M Alaa and Mihaela van der Schaar. Autoprognosis: Automated clinical prognostic modeling via bayesian optimization with structured kernel learning. In International Conference on Machine Learning, 2018. [4] Alexis Bellot and Mihaela Van der Schaar. A hierarchical bayesian model for personalized survival predictions. IEEE Journal of Biomedical and Health Informatics, 2018. [5] Alexis Bellot and Mihaela van der Schaar. Tree-based bayesian mixture model for competing risks. In International Conference on Artificial Intelligence and Statistics, pages 910–918, 2018. [6] Harald Binder, Arthur Allignol, Martin Schumacher, and Jan Beyersmann. Boosting for high-dimensional time-to-event data with competing risks. Bioinformatics, 25(7):890–896, 2009. [7] Leo Breiman. Random forests. Machine learning, 45(1):5–32, 2001. [8] R Caruana. Multitask learning: A knowledge-based source of inductive bias. In International Conference on Machine Learning, pages 41–48, 1993. [9] Harris Drucker. Improving regressors using boosting techniques. In International Conference on Machine Learning, pages 107–115, 1997. [10] Jason P Fine and Robert J Gray. A proportional hazards model for the subdistribution of a competing risk. Journal of the American statistical association, 94(446):496–509, 1999. [11] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119–139, 1997. [12] Mikel Galar, Alberto Fernandez, Edurne Barrenechea, Humberto Bustince, and Francisco Herrera. A review on ensembles for the class imbalance problem: bagging-, boosting-, and hybrid-based approaches. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 42(4):463–484, 2012. [13] Nico Görnitz, Christian Widmer, Georg Zeller, André Kahles, Gunnar Rätsch, and Sören Sonnenburg. Hierarchical multitask structured output learning for large-scale sequence segmentation. In Advances in Neural Information Processing Systems, pages 2690–2698, 2011. [14] Robert J Gray. A class of k-sample tests for comparing the cumulative incidence of a competing risk. The Annals of statistics, pages 1141–1154, 1988. [15] Kevin He, Yanming Li, Ji Zhu, Hongliang Liu, Jeffrey E Lee, Christopher I Amos, Terry Hyslop, Jiashun Jin, Huazhen Lin, Qinyi Wei, et al. Component-wise gradient boosting and false discovery control in survival analysis with high-dimensional covariates. Bioinformatics, 32(1):50–57, 2015. [16] Hemant Ishwaran, Thomas A Gerds, Udaya B Kogalur, Richard D Moore, Stephen J Gange, and Bryan M Lau. Random survival forests for competing risks. Biostatistics, 15(4):757–773, 2014. 9 [17] Jared Katzman, Uri Shaham, Jonathan Bates, Alexander Cloninger, Tingting Jiang, and Yuval Kluger. Deep survival: A deep cox proportional hazards network. arXiv preprint arXiv:1606.00931, 2016. [18] Changhee Lee, William R Zame, Jinsung Yoon, and Mihaela van der Schaar. Deephit: A deep learning approach to survival analysis with competing risks. AAAI, 2018. [19] Stewart Mercer, Chris Salisbury, and Martin Fortin. ABC of Multimorbidity. John Wiley & Sons, 2014. [20] Deborah Morrison, Karolina Agur, Stewart Mercer, Andreia Eiras, Juan I González-Montalvo, and Kevin Gruffydd-Jones. Managing multimorbidity in primary care in patients with chronic respiratory conditions. NPJ primary care respiratory medicine, 26:16043, 2016. [21] Ross L Prentice, John D Kalbfleisch, Arthur V Peterson Jr, Nancy Flournoy, Vern T Farewell, and Norman E Breslow. The analysis of failure times in the presence of competing risks. Biometrics, pages 541–554, 1978. [22] Rajesh Ranganath, Adler Perotte, Noémie Elhadad, and David Blei. Deep survival analysis. In Machine Learning for Healthcare Conference, pages 101–114, 2016. [23] Greg Ridgeway. The state of boosting. Computing Science and Statistics, pages 172–181, 1999. [24] Chris Seiffert, Taghi M Khoshgoftaar, Jason Van Hulse, and Amri Napolitano. Building useful models from imbalanced data with sampling and boosting. In FLAIRS conference, pages 306–311, 2008. [25] Dimitri P Solomatine and Durga L Shrestha. Adaboost.rt: a boosting algorithm for regression problems. In Neural Networks, 2004. Proceedings. 2004 IEEE International Joint Conference on, volume 2, pages 1163–1168. IEEE, 2004. [26] Carolin Strobl, Anne-Laure Boulesteix, Thomas Kneib, Thomas Augustin, and Achim Zeileis. Conditional variable importance for random forests. BMC bioinformatics, 9(1):307, 2008. [27] Marcel Wolbers, Paul Blanche, Michael T Koller, Jacqueline CM Witteman, and Thomas A Gerds. Concordance for prognostic models with competing risks. Biostatistics, 15(3):526–539, 2014. 10
2018
190
7,353
Deep Dynamical Modeling and Control of Unsteady Fluid Flows Jeremy Morton∗ jmorton2@stanford.edu Freddie D. Witherden∗ fdw@stanford.edu Antony Jameson † antony.jameson@tamu.edu Mykel J. Kochenderfer∗ mykel@stanford.edu Abstract The design of flow control systems remains a challenge due to the nonlinear nature of the equations that govern fluid flow. However, recent advances in computational fluid dynamics (CFD) have enabled the simulation of complex fluid flows with high accuracy, opening the possibility of using learning-based approaches to facilitate controller design. We present a method for learning the forced and unforced dynamics of airflow over a cylinder directly from CFD data. The proposed approach, grounded in Koopman theory, is shown to produce stable dynamical models that can predict the time evolution of the cylinder system over extended time horizons. Finally, by performing model predictive control with the learned dynamical models, we are able to find a straightforward, interpretable control law for suppressing vortex shedding in the wake of the cylinder. 1 Introduction Fluid flow control represents a significant challenge, with the potential for high impact in a variety of sectors, most notably the automotive and aerospace industries. While the time evolution of fluid flows can be described by the Navier-Stokes equations, their nonlinear nature means that many control techniques, largely derived for linear systems, prove ineffective when applied to fluid flows. An illuminating test case is the canonical problem of suppressing vortex shedding in the wake of airflow over a cylinder. This problem has been studied extensively experimentally and computationally, with the earliest experiments dating back to the 1960s [1]–[6]. These studies have shown that controller design can prove surprisingly difficult, as controller effectiveness is highly sensitive to flow conditions, measurement configuration, and feedback gains [3], [5]. Nonetheless, at certain flow conditions vortex suppression can be achieved with a simple proportional control law based on a single sensor measurement in the cylinder wake. Thus, while the design of flow controllers may present considerable challenges, effective controllers may in fact prove relatively easy to implement. Recent advances in computational fluid dynamics (CFD) have enabled the numerical simulation of previously intractable flow problems for complex geometries [7]–[11]. Such simulations are generally run at great computational expense, and generate vast quantities of data. In response, the field of reduced-order modeling (ROM) has attracted great interest, with the aim of learning efficient dynamical models from the generated data. This research has yielded a wide array of techniques for learning data-driven dynamical models, including balanced truncation, proper orthogonal decomposition, and dynamic mode decomposition [12]. Recent work has sought to incorporate reduced-order models with robust- and optimal-control techniques to devise controllers for nonlinear systems [6], [13], [14]. In parallel, the machine learning community has devoted significant attention to learning-based control of complex systems. Model-free control approaches attempt to learn control policies without ∗Department of Aeronautics and Astronautics, Stanford University †Department of Aerospace Engineering, Texas A&M University 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. constructing explicit models for the environment dynamics, and have achieved impressive success in a variety of domains [15], [16]. However, model-free methods require many interactions with an environment to learn effective policies, which may render them infeasible for many flow control applications where simulations are computationally expensive. In contrast, model-based control approaches have the potential to learn effective controllers with far less data by first modeling the environment dynamics. Model-based methods have been successful in some domains [17], [18], but such success hinges on the need to construct accurate dynamical models. In this work, we apply recent advances in the fields of reduced-order modeling and machine learning to the task of designing flow controllers. In particular, we extend an algorithm recently proposed by Takeishi et al. [19], leveraging Koopman theory to learn models for the forced and unforced dynamics of fluid flow. We show that this approach is capable of stably modeling two-dimensional airflow over a cylinder for significant prediction horizons. We furthermore show that the learned dynamical models can be incorporated into a model predictive control framework to suppress vortex shedding. Finally, we discuss how the actions selected by this controller shed insight on a simple and easy-to-implement control law that is similarly effective.While applied to fluid flow in this work, we note that the proposed approach is general enough to be applied to other applications that require modeling and control of high-dimensional dynamical systems. 2 Modeling unforced dynamics Let xt ∈Rn be a state vector containing all data from a single time snapshot of an unforced fluid flow simulation. Our goal is to discover a model of the form xt+1 = F(xt) that describes how the state will evolve in time. The function F can take many forms; one possibility is that the system dynamics are linear, in which case the state updates will obey xt+1 = Kxt, with K ∈Rn×n. If we observe a sequence of time snapshots x1:T +1, we can construct the matrices X = [x1, x2, . . . , xT ] and Y = [x2, x3, . . . , xT +1] (1) and subsequently find the matrix A = Y X†, where X† is the Moore-Penrose pseudoinverse of X. As T increases, A will asymptotically approach K [19], and hence approximate the true system dynamics. Such an approximation will in general only be accurate for systems with linear dynamics; in the following section we discuss how a similar approximation can be formed for nonlinear systems. 2.1 The Koopman operator Consider a nonlinear discrete-time dynamical system described by xt+1 = F(xt). Furthermore, let the Koopman operator K be an infinite-dimensional linear operator that acts on all observable functions g : Rn →C. Koopman theory asserts that a nonlinear discrete-time system can be mapped to a linear discrete-time system, where the Koopman operator advances observations of the state forward in time [20]: Kg(xt) = g(F(xt)) = g(xt+1). (2) While Koopman theory provides a lens under which nonlinear systems can be viewed as linear, its applicability is limited by the fact that the Koopman operator is infinite-dimensional. However, if there exist a finite number of observable functions {g1, . . . , gm} that span a subspace G such that Kg ∈G for any g ∈G, then G is considered to be an invariant subspace and the Koopman operator becomes a finite-dimensional operator K. We abuse notation by defining the vector-valued observable g = [g1, . . . , gm]⊺, and furthermore define the matrices ˜X = [g(x1), g(x2), . . . , g(xT )] and ˜Y = [g(x2), g(x3), . . . , g(xT +1)] . (3) The matrix A = ˜Y ˜X† will asymptotically approach the Koopman operator K with increasing T. Takeishi et al. showed that the task of finding a set of observables that span an invariant subspace reduces to finding a state mapping g(xt) under which linear least-squares regression performs well (i.e. the loss ∥˜Y −  ˜Y ˜X† ˜X∥2 F is minimized), and proposed learning such a mapping with deep neural networks [19]. In experiments, their proposed algorithm was shown to perform well in analysis and prediction on a number of low-dimensional dynamical systems. 2 [x1, x2, . . . , xT] [x2, x3, . . . , xT+1] X Y Encoder [g(x1), g(x2), . . . , g(xT)] [g(x2), g(x3), . . . , g(xT+1)] ˜X ˜Y A  Ag(x1), A2g(x1), . . . , ATg(x1)  Least Squares ˜Ypred Decoder [ˆx1, ˆx2, . . . , ˆxT] [ˆx2, ˆx3, . . . , ˆxT+1] ˆX ˆY = g−1  ˜Ypred  Figure 1: Illustration of procedure used to train Deep Koopman dynamical models. 2.2 Deep Koopman dynamical model We now present the Deep Koopman model, which employs a modified form of the training algorithm proposed by Takeishi et al. to learn state mappings that approximately span a Koopman invariant subspace. The training algorithm is depicted in Fig. 1. First, a sequence of time snapshots x1:T +1 is used to construct the matrices X and Y defined in Eq. (1). These matrices are fed into an encoder neural network, which serves as the mapping g(xt) and produces the matrices ˜X and ˜Y defined in Eq. (3). Subsequently, a linear least-squares fit is performed to find an A-matrix that can propagate the state mappings forward in time. Finally, ˜X and the propagated state mappings are fed into a decoder that functions as g−1 to yield the matrices ˆX and ˆY , approximations to X and Y . The Deep Koopman model is trained to minimize L = ∥X −ˆX∥2 F +∥Y −ˆY ∥2 F , where ˆY is obtained by running ˜Ypred through the decoder. Minimizing the error between X and ˆX enforces that the mapping g(xt) is invertible, while minimizing the error between Y and ˆY enforces that the derived dynamical model can accurately simulate the time evolution of the system. One main difference between our algorithm and that proposed by Takeishi et al. is that we force the model to simulate the time evolution of the system during training in a manner that mirrors how the model will be deployed at test time. In particular, we apply the derived A-matrix recursively to state mapping g(x1) to produce the matrix ˜Ypred defined in Fig. 1, which is then mapped to ˆY through the decoder. To better clarify another new feature of our proposed algorithm, it is worth drawing a distinction between reconstruction and prediction. If a dynamical model is constructed based on a sequence of states x1:N, then simulations generated by the dynamical model would be reconstructing the already observed time evolution of the system for all time steps t ≤N, and predicting the time evolution of the system for all time steps t > N. We would like to train a dynamical model that we can ultimately use to predict the future time evolution of a given system. Thus, during training we generate the A-matrix based on only the first T/2 entries of ˜X and ˜Y , thereby enforcing that the last T/2 entries of ˜Ypred are purely predictions for how the system will evolve in time. One of the advantages of this approach is its relative simplicity, as the neural network architecture is equivalent to that of a standard autoencoder. The dynamics matrix A does not need to be modeled directly; rather, it is derived by performing least squares on the learned state mappings. In our implementation, the encoder consists of ResNet convolutional layers [21] with ReLU activations followed by fully connected layers, while the decoder inverts all operations performed by the encoder. We applied L2 regularization to the weights in the encoder and decoder. The gradients for all operations are defined in Tensorflow [22], and the entire model can be trained end-to-end to learn suitable state mappings g(xt). 2.3 Experiments We now provide a description for how we train and evaluate the Deep Koopman models. We first describe the test case under study, then quantify the ability of the Deep Koopman model to learn the system dynamics. 2.3.1 Test case The system under consideration is a two dimensional circular cylinder at Reynolds number 50 and an effectively incompressible Mach number of 0.2. This is a well-studied test case [23], [24] which 3 (a) Density (b) x-Momentum (c) y-Momentum (d) Energy Figure 2: Format of inputs to neural network. Different physical quantities are treated as different channels in the input. has been used extensively both for validation purposes and as a legitimate research case in its own right. The chosen Reynolds number is just above the cut-off for laminar flow and thus results in the formation of a von Karman vortex street, where vortices are shed from the upper and lower surface of the cylinder in a periodic fashion. Vortex shedding gives rise to strong transverse forces, and is associated with higher drag and unsteady lift forces [2], [6]. To perform the fluid flow simulations, we use a variation of the high-order accurate PyFR solver [25].The surface of the cylinder is modeled as a no-slip isothermal wall boundary condition, and Riemann invariant boundary conditions are applied at the far-field. The domain is meshed using 5672 unstructured, quadratically curved quadrilateral elements. All simulations are run using quadratic solution polynomials and an explicit fourth order Runge–Kutta time stepping scheme. A training dataset is constructed by saving time snapshots of the system every 1500 solver steps. To make the simulation data suitable for incorporation into a training algorithm, the data is formatted into image-like inputs before storage. Solution quantities are sampled from a 128 × 256 grid of roughly equispaced points in the neighborhood of the cylinder. Each grid point contains four channels corresponding to four physical quantities in the flow at that point: density, x-momentum, y-momentum, and energy. An example snapshot can be found in Fig. 2, illustrating the qualitative differences between the four distinct input channels. 2.3.2 Deep Variational Bayes Filter We compare the Deep Koopman model with the Deep Variational Bayes Filter (VBF) [26] to baseline performance. The Variational Bayes Filter can be viewed as a form of state space model, which seeks to map high-dimensional inputs xt to lower-dimensional latent states zt that can be evolved forward in time. The VBF is a recently proposed approach that improves upon previous state space models (e.g. Embed to Control [17]) and evolves latent states forward linearly in time, and thus serves as a suitable performance benchmark for the Deep Koopman model. We use the same autoencoder architecture employed by the Deep Koopman model to perform the forward and inverse mappings between the inputs xt and the latent states zt. As with the Deep Koopman model, the inputs are time snapshots from CFD simulations. The time evolution of the latent states is described by zt+1 = Atzt + Btut + Ctwt, where ut is the control input at time t and wt represents process noise. The matrices At, Bt, and Ct are assumed to comprise a locally linear dynamical model, and are determined at each time step as a function of the current latent state and control input. Since we seek to model the unforced dynamics of the fluid flow, we ignore the effect of control inputs in our implementation of the Deep VBF. 2.3.3 Results In addition to the Deep VBF, we also benchmark the Deep Koopman model against a model trained using the procedure proposed by Takeishi et al., which sets ˜Ypred = A ˜X rather than calculating ˜Ypred by applying A recursively to g(x1). Each model is trained on 32-step sequences of data extracted from two-dimensional cylinder simulations. We then use the trained models to recreate the time evolution of the system observed during 20 test sequences and extract the error over time. For a fair comparison, g(xt) and zt are defined to be 32-dimensional vectors. The Koopman method construct its dynamical model based on state mappings from the first 16 time steps, then simulates the system for all time steps using the derived A-matrix. The Takeishi baseline derives its A-matrix based on state mappings from the first 32 time steps. The VBF constructs a new locally linear dynamical model at each time step, but relies on information from the first 32 time steps to sample the initial value of the process noise w0. 4 0 10 20 30 0 0.5 1 1.5 ·10−3 Time Step Relative Error Koopman Takeishi VBF (a) 32-step predictions 0 20 40 60 0 1 2 3 ·10−2 Time Step Relative Error Koopman Takeishi VBF (b) 64-step predictions Figure 3: Average prediction errors over time for Deep Koopman and Deep Variational Bayes Filter models. Solid lines represent the mean prediction error across 20 sequences, while the shaded regions correspond to one standard deviation about the mean. The results of these experiments can be found in Fig. 3a and Fig. 3b, where the error metric is the relative error, defined as the L1-norm of the prediction error normalized by the L1-norm of the ground-truth solution. We can see in Fig. 3a that the error for the Takeshi baseline initially grows more rapidly than the error for the other models. This illustrates the importance of training models to generate recursive predictions, since models trained to make single-step predictions tend to generate poor multi-step predictions due to prediction errors compounding over time [27]. Over a 32-step horizon the Deep Koopman and VBF models perform comparably, with the error for the Koopman model rising slightly at later time steps as it begins generating predictions for states that it did not have access to in constructing its dynamical model. A much starker contrast in model performance can be observed in Fig. 3b, where the Variational Bayes Filter begins to rapidly accumulate error once it surpasses the 32-step time horizon. For the results shown in Fig. 3b, the Variational Bayes Filter is performing reconstruction for 32 steps and prediction for 32 steps. Hence, we see that the VBF is effective at reconstruction, but is unable to function stably in prediction. In contrast, we see that the Deep Koopman model, aided by its ability to construct state mappings that approximately span an invariant subspace, is able to generate stable predictions for much longer time horizons. In fact, while the prediction error of the Koopman model does grow with time, its mean prediction error remains less than 0.2% over a horizon of 128 time steps, corresponding to approximately eight periods of vortex shedding. Since we ultimately want a predictive dynamical model that can be incorporated into a control framework, we conclude that the Deep Koopman model is well suited for the task. 3 Modeling forced dynamics We now explain how the proposed Deep Koopman algorithm can be extended to account for the effect that control inputs have on the time evolution of dynamical systems. 3.1 Deep Koopman model with control We have already demonstrated how the Deep Koopman algorithm can learn state mappings that are suitable for modeling unforced dynamics. In accounting for control inputs, we now aim to construct a linear dynamical model of the form g(xt+1) = Ag(xt) + But, where ut ∈Rm and B ∈Rn×m. Defining the matrix Γ = [u1, . . . , uT ], we would like to find a dynamical model (A, B) that satisfies ˜Y = A ˜X + BΓ. Proctor et al. presented several methods for estimating A and B given matrices ˜X and ˜Y [28]. In this work, we choose to treat B as a known quantity, which means that A can be estimated through a linear least-squares fit A = ( ˜Y −BΓ) ˜X†. (4) Thus, the Deep Koopman training algorithm presented in Section 2.2 can be modified such that A is generated through Eq. (4). While we treat B as a known quantity, in reality it is another parameter that we must estimate. We account for this by defining a global B-matrix, whose paramaters are optimized by gradient descent during training along with the neural network parameters. 5 3.2 Modified test case With the ability to train Koopman models that account for control inputs, we now consider a modified version the two-dimensional cylinder test case that allows for a scalar control input to affect the fluid flow. In particular, the simulation is modified so that the cylinder can rotate with a prescribed angular velocity. Cylinder rotation is modeled by applying a spatially varying velocity to the surface of the wall, thus enabling the grid to remain static. The angular velocity is allowed to vary every 1500 solver steps, with the value held constant during all intervening steps. 3.3 Training process We train Koopman models on data from the modified test case to construct models of the forced dynamics. A training dataset is collected by simulating the two-dimensional cylinder system with time-varying angular velocity. Every 1500 solver steps, a time snapshot xt is stored and the control input ut is altered. In total, the training set contains 4238 snapshots of the system. We then divide these snapshots into 1600 staggered 32-step sequences for training the Deep Koopman model. As in the case of unforced dynamics, during training dynamical models are constructed based on information from the first 16 time steps, but the system is simulated for 32 time steps. Training a single model takes approximately 12 hours on a Titan X GPU. The form of control inputs applied to the system in generating the training data has a strong effect on the quality of learned models. Analogous to frequency sweeps in system identification [29], we subject the system to sinusoidal inputs with a frequency that increases linearly with time. These sinusoidal inputs are interspersed with periods with no control inputs to allow the model to learn the unforced system dynamics from different initial conditions. 4 Model predictive control We evaluate the quality of the learned Deep Koopman models by studying their ability to enable effective control of the modeled system. In particular, we incorporate the learned dynamical models into a model predictive control (MPC) framework with the aim of suppressing vortex shedding. At each time step in MPC, we seek to find a sequence of inputs that minimizes the finite-horizon cost: JT = T X t=1 (ct −cgoal)⊺Q(ct −cgoal) + T −1 X t=1 Ru2 t, (5) where ct = g(xt) represents the observable of state xt, cgoal = g(xgoal) represents the observable of goal state xgoal, Q is a positive definite matrix penalizing deviation from the goal state, and R is a nonnegative scalar penalizing nonzero control inputs. We can furthermore apply the constraints |ut| < umax ∀t, c1 = g(x1), and ct+1 = Act + But for t = 2, . . . , T, where A and B are generated by the Deep Koopman model. As formulated this optimization problem is a quadratic program, which can be solved efficiently with the CVXPY software [30]. For xgoal we use a snapshot of the steady flow observed when the cylinder system is simulated at a Reynolds number of 45, which is a sufficiently low Reynolds number that vortex shedding does not occur. While the flow at this lower Reynolds number is qualitatively different from the flow at a Reynolds number of 50, we find that formulating the problem in this way leads to a reliable estimate of the cost, as demonstrated in the next section. We use an MPC horizon of T = 16 time steps. This aligns with the Deep Koopman model training process, where the neural network generates predictions for 16 time steps beyond what it uses to construct its dynamical model. At each time step, we find state mappings for the previous 16 time steps, and use those mappings in conjunction with the global B-matrix to find a suitable A-matrix for propagating the state mappings forward in time. We then solve the optimization problem described by Eq. (5) to find u∗ 1:T , the optimal sequence of control inputs. We set Q = I, the identity matrix, and R ∼105, which accounts for the fact that ∥ct −cgoal∥2 is typically orders of magnitude larger than |ut| and discourages actions that are too extreme for the dynamical model to handle accurately. The first input, u∗ 1, is passed to the CFD solver, which advances the simulation forward in time. 4.1 MPC results We now present the results of performing model predictive control on the two-dimensional cylinder problem. To evaluate the effectiveness of the derived controller, we require a measure of closeness 6 (a) t = 0 (b) t = 100 (c) t = 400 (d) t = 700 Figure 4: Snapshots of x-momentum over time as the MPC algorithm attempts to suppress vortex shedding. 0 100 200 300 400 500 600 700 0 0.2 0.4 0.6 Time Step Value Residual Scaled Cost 0 100 200 300 400 500 600 700 −1 0 1 ·10−2 Time Step Value MPC input 0.4 · v Figure 5: Above: scaled residuals plotted alongside estimated cost used for MPC action selection. Below: control inputs selected by MPC plotted along with scaled y-velocity measurements. to the desired outcome; in this case, this desired outcome is to achieve a steady laminar flow devoid of vortex shedding. The Navier–Stokes equations are a conservation law, taking the form of ∂q ∂t = −∇·f(q, ∇q), where q = [ρ, ρu, ρv, E] is a vector of the density, x-momentum, y-momentum, and energy fields respectively, and f(q, ∇q) is a suitably defined flux function. In the process of running CFD simulations, PyFR evaluates the right-hand side of this equation by calculating residuals. Note that if a steady flow is achieved, the time derivative will be zero and in turn the residuals will be zero. Thus, we use residual values as a measure of closeness to the desired steady flow. In particular, we extract the norm of the residuals for x- and y-momentum over time. Results from the model predictive control experiments can be found in Fig. 4 and Fig. 5. In Fig. 4, we get a qualitative picture for the effectiveness of the applied control, as the cylinder wake exhibits a curved region of low x-momentum characteristic of vortex shedding at early time steps, then flattens out to a profile more characteristic of laminar flow over time. In the upper plot of Fig. 5, we get a quantitative picture of the controller performance, showing that the controller brings about a monotonic decrease in the residuals over time. Additionally, we plot a scaled version of ∥g(xt) −g(xgoal)∥2. Interestingly, we note that there is a strong correspondence between a decrease in the residuals and a decrease in the cost that model predictive control is attempting to minimize. This provides confidence that using this measure of cost in MPC is sensible for this problem. The lower plot in Fig. 5 shows the control inputs applied to the system over time. A dynamical model cannot be constructed until 16 states have been observed, so the control inputs are initially set to zero. Subsequently, the inputs appear to vary sinusoidally and decrease in amplitude over time. Remarkably, it is possible to find a location in the wake of the cylinder, at a location denoted by d∗, where the variations in y-velocity are in phase with the selected control inputs. When scaled by a constant value of 0.4, we see a strong overlap between the control inputs and velocity values. Viewed in this light, we note that the controller obtained through MPC is quite interpretable, and is functionally similar to a proportional controller performing feedback based on y-velocity measurements with a gain of 0.4. 4.2 Proportional control With the insights gained in the previous section, we now test the effectiveness of a simple proportional control scheme in suppressing vortex shedding. Rather than selecting inputs with MPC, we set the angular velocity of the cylinder by applying a gain of 0.4 to measurements of y-velocity at point d∗. 7 d∗ 1 2d∗ 2d∗ d∗ Figure 6: Schematic of measurement points for performing proportional control. 0 50 100 150 200 250 300 350 400 450 500 550 600 0 0.2 0.4 0.6 Time Step Residual d∗ 1 2d∗ 2d∗ Figure 7: Calculated residuals over time for different measurement locations. While easy to implement, we perform additional experiments to illustrate that such a control law is not easy to find. In these experiments, we attempt to perform proportional control with the same gain based on measurements at two additional locations, 1 2d∗and 2d∗, as illustrated in Fig. 6. The results of these experiments, summarized in Fig. 7, demonstrate that proportional control based on measurements at d∗is effective at suppressing vortex shedding. Meanwhile, proportional control laws based on measurements at the other locations are unable to drive the system closer to the desired steady, laminar flow. These results are in agreement with previous studies [3], which showed that the effectiveness of proportional control is highly dependent upon the measurement location. 5 Related work While originally introduced in the 1930s [31], the Koopman operator has attracted renewed interest over the last decade within the reduced-order modeling community due to its connection to the dynamic mode decomposition (DMD) algorithm [20], [32]. DMD finds approximations to the Koopman operator under the assumption that the state variables x span an invariant subspace. However, they will not span an invariant subspace if the underlying dynamics are nonlinear. Extended DMD (eDMD) approaches build upon DMD by employing a richer set of observables g(x), which typically need to be specified manually [33]. A number of recent works have studied whether deep learning can be used to learn this set of observables automatically, thereby circumventing the need to hand-specify a dictionary of functions [19], [34]–[36]. In the machine learning community, recent work focused on learning deep dynamical models from data has showed that these models can enable more sample-efficient learning of effective controllers [37]–[39]. Our work most closely parallels work in state representation learning (SRL) [40], which focuses on learning low-dimensional features that are useful for modeling the time evolution of high-dimensional systems. Recent studies have worked toward learning state space models from image inputs for a variety of tasks, and have been designed to accommodate stochasticity in the dynamics and measurement noise [17], [26], [41]. Given that both Koopman-centric approaches and SRL attempt to discover state mappings that are useful for describing the time evolution of high-dimensional systems, an opportunity likely exists to bridge the gap between these fields. 6 Conclusions We introduced a method for training Deep Koopman models, demonstrating that the learned models were capable of stably simulating airflow over a cylinder for significant prediction horizons. Furthermore, we detailed how the Koopman models could be modified to account for control inputs and thereby leveraged for flow control in order to suppress vortex shedding. Learning sufficiently accurate dynamical models from approximately 4000 training examples, the method is very sample efficient, which is of high importance due to the large computational cost associated with CFD simulations. Most importantly, by incorporating the Deep Koopman model into an MPC framework, we showed that the resulting control law was both interpretable and sensible, aligning with well studied flow control approaches from the literature. Future work will focus on applying the proposed approach to flows at higher Reynolds numbers to see how its effectiveness scales to increasingly complex flows. Furthermore, we hope to apply the proposed approach to other flow control problems, studying whether it can provide similar insight into how to design controllers for other applications. The code associated with this work can be found at https://github.com/sisl/deep_flow_control. 8 Acknowledgments The authors would like to thank the reviewers for their insightful feedback. This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE- 114747. The authors would like to thank the Air Force Office of Scientific Research for their support via grant FA9550-14-1-0186. References [1] E. Berger, “Suppression of vortex shedding and turbulence behind oscillating cylinders,” The Physics of Fluids, vol. 10, no. 9, S191–S193, 1967. [2] K. Roussopoulos, “Feedback control of vortex shedding at low Reynolds numbers,” Journal of Fluid Mechanics, vol. 248, pp. 267–296, 1993. [3] D. S. Park, D. M. Ladd, and E. W. Hendricks, “Feedback control of von Kármán vortex shedding behind a circular cylinder at low reynolds numbers,” Physics of Fluids, vol. 6, no. 7, pp. 2390–2405, 1994. [4] M. D. Gunzburger and H. C. Lee, “Feedback control of karman vortex shedding,” Journal of Applied Mechanics, vol. 63, no. 3, pp. 828–835, 1996. [5] S. J. Illingworth, H. Naito, and K. Fukagata, “Active control of vortex shedding: An explanation of the gain window,” Phys. Rev. E, vol. 90, no. 4, p. 043 014, 2014. [6] S. J. Illingworth, “Model-based control of vortex shedding at low reynolds numbers,” Theoretical and Computational Fluid Dynamics, vol. 30, no. 5, pp. 429–448, 2016. [7] H. T. Huynh, “A flux reconstruction approach to high-order schemes including discontinuous galerkin methods,” in 18th AIAA Computational Fluid Dynamics Conference, 2007, p. 4079. [8] P. E. Vincent, P. Castonguay, and A. Jameson, “A new class of high-order energy stable flux reconstruction schemes,” Journal of Scientific Computing, vol. 47, no. 1, pp. 50–72, 2011. [9] P. Castonguay, P. E. Vincent, and A. Jameson, “A new class of high-order energy stable flux reconstruction schemes for triangular elements,” Journal of Scientific Computing, vol. 51, no. 1, pp. 224–256, 2012. [10] D. Williams and A. Jameson, “Energy stable flux reconstruction schemes for advection– diffusion problems on tetrahedra,” Journal of Scientific Computing, vol. 59, no. 3, pp. 721–759, 2014. [11] A. Jameson, P. E. Vincent, and P. Castonguay, “On the non-linear stability of flux reconstruction schemes,” Journal of Scientific Computing, vol. 50, no. 2, pp. 434–445, 2012. [12] C. W. Rowley and S. T. Dawson, “Model reduction for flow analysis and control,” Annual Review of Fluid Mechanics, vol. 49, no. 1, pp. 387–417, 2017. [13] E. Kaiser, J. N. Kutz, and S. L. Brunton, “Data-driven discovery of Koopman eigenfunctions for control,” arXiv preprint arXiv:1707.01146, 2017. [14] M. Korda and I. Mezi´c, “Linear predictors for nonlinear dynamical systems: Koopman operator meets model predictive control,” arXiv preprint arXiv: 1611.03537, 2016. [15] M. Hessel, J. Modayil, H. van Hasselt, T. Schaul, G. Ostrovski, W. Dabney, D. Horgan, B. Piot, M. G. Azar, and D. Silver, “Rainbow: Combining improvements in deep reinforcement learning,” arXiv preprint arXiv:1710.02298, 2017. [16] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, “Proximal policy optimization algorithms,” arXiv preprint arXiv:1707.06347, 2017. [17] M. Watter, J. Springenberg, J. Boedecker, and M. Riedmiller, “Embed to control: A locally linear latent dynamics model for control from raw images,” in Advances in Neural Information Processing Systems (NIPS), 2015. [18] M. Deisenroth and C. Rasmussen, “PILCO: A model-based and data-efficient approach to policy search,” in International Conference on Machine Learning (ICML), 2011. [19] N. Takeishi, Y. Kawahara, and T. Yairi, “Learning Koopman invariant subspaces for dynamic mode decomposition,” in Advances in Neural Information Processing Systems (NIPS), 2017. [20] J. Kutz, S. Brunton, B. Brunton, and J. Proctor, Dynamic Mode Decomposition: Data-Driven Modeling of Complex Systems. Society for Industrial and Applied Mathematics, 2016. 9 [21] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), 2016. [22] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng, TensorFlow: Large-scale machine learning on heterogeneous systems, Software available from tensorflow.org, 2015. [23] A. Roshko, “On the wake and drag of bluff bodies,” Journal of the Aeronautical Sciences, vol. 22, no. 2, pp. 124–132, 1955. [24] C. H. K. Williamson, “Vortex dynamics in the cylinder wake,” Annual Review of Fluid Mechanics, vol. 28, no. 1, pp. 477–539, 1996. [25] F. D. Witherden, A. M. Farrington, and P. E. Vincent, “PyFR: An open source framework for solving advection–diffusion type problems on streaming architectures using the flux reconstruction approach,” Computer Physics Communications, vol. 185, no. 11, pp. 3028– 3040, 2014. [26] M. Karl, M. Soelch, J. Bayer, and P. van der Smagt, “Deep variational Bayes filters: Unsupervised learning of state space models from raw data,” in International Conference on Learning Representations (ICLR), 2017. [27] A. Venkatraman, M. Hebert, and J. A. Bagnell, “Improving multi-step prediction of learned time series models,” in AAAI Conference on Artificial Intelligence, 2015. [28] J. L. Proctor, S. L. Brunton, and J. N. Kutz, “Dynamic mode decomposition with control,” SIAM Journal on Applied Dynamical Systems, vol. 15, no. 1, pp. 142–161, 2016. [29] B. Mettler, M. Tischler, and T. Kanade, “System identification of small-size unmanned helicopter dynamics,” Annual Forum Proceedings - American Helicopter Society, vol. 2, pp. 1706– 1717, 1999. [30] S. Diamond and S. Boyd, “CVXPY: A Python-embedded modeling language for convex optimization,” Journal of Machine Learning Research, vol. 17, no. 83, pp. 1–5, 2016. [31] B. O. Koopman, “Hamiltonian systems and transformation in Hilbert space,” Proceedings of the National Academy of Sciences, vol. 17, no. 5, pp. 315–318, 1931. [32] C. W. Rowley, I. Mezic, S. Bagheri, P. Schlatter, and D. S. Henningson, “Spectral analysis of nonlinear flows,” Journal of Fluid Mechanics, vol. 641, 115–127, 2009. [33] M. O. Williams, I. G. Kevrekidis, and C. W Rowley, “A data-driven approximation of the Koopman operator: Extending dynamic mode decomposition,” Journal of Nonlinear Science, vol. 8, no. 1, pp. 1–40, 2015. [34] B. Lusch, J. N. Kutz, and S. L. Brunton, “Deep learning for universal linear embeddings of nonlinear dynamics,” arXiv preprint arXiv: 1712.09707, 2018. [35] Q. Li, F. Dietrich, E. M. Bollt, and I. G. Kevrekidis, “Extended dynamic mode decomposition with dictionary learning: A data-driven adaptive spectral decomposition of the Koopman operator,” Chaos: An Interdisciplinary Journal of Nonlinear Science, vol. 27, no. 10, p. 103 111, 2017. [36] E. Yeung, S. Kundu, and N. Hodas, “Learning deep neural network representations for Koopman operators of nonlinear dynamical systems,” arXiv preprint arXiv: 1708.06850, 2017. [37] N. Mishra, P. Abbeel, and I. Mordatch, “Prediction and control with temporal segment models,” arXiv preprint arXiv: 1703.04070, 2017. [38] A. Nagabandi, G. Kahn, R. S. Fearing, and S. Levine, “Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning,” arXiv preprint arXiv: 1708.02596, 2017. [39] A. Nagabandi, G. Yang, T. Asmar, R. Pandya, G. Kahn, S. Levine, and R. S. Fearing, “Learning image-conditioned dynamics models for control of under-actuated legged millirobots,” arXiv preprint arXiv: 1711.05253, 2017. [40] T. Lesort, N. Díaz-Rodríguez, J.-F. Goudou, and D. Filliat, “State representation learning for control: An overview,” arXiv preprint arXiv: 1802.04181, 2018. 10 [41] M. Fraccaro, S. Kamronn, U. Paquet, and O. Winther, “A disentangled recognition and nonlinear dynamics model for unsupervised learning,” in Advances in Neural Information Processing Systems (NIPS), 2017. 11
2018
191
7,354
Learning Deep Disentangled Embeddings With the F-Statistic Loss Karl Ridgeway Department of Computer Science University of Colorado and Sensory, Inc. Boulder, Colorado karl.ridgeway@colorado.edu Michael C. Mozer Department of Computer Science University of Colorado Boulder, Colorado mozer@colorado.edu Abstract Deep-embedding methods aim to discover representations of a domain that make explicit the domain’s class structure and thereby support few-shot learning. Disentangling methods aim to make explicit compositional or factorial structure. We combine these two active but independent lines of research and propose a new paradigm suitable for both goals. We propose and evaluate a novel loss function based on the F statistic, which describes the separation of two or more distributions. By ensuring that distinct classes are well separated on a subset of embedding dimensions, we obtain embeddings that are useful for few-shot learning. By not requiring separation on all dimensions, we encourage the discovery of disentangled representations. Our embedding method matches or beats state-of-the-art, as evaluated by performance on recall@k and few-shot learning tasks. Our method also obtains performance superior to a variety of alternatives on disentangling, as evaluated by two key properties of a disentangled representation: modularity and explicitness. The goal of our work is to obtain more interpretable, manipulable, and generalizable deep representations of concepts and categories. The literature on deep embeddings (Chopra et al., 2005; Yi et al., 2014a; Schroff et al., 2015; Ustinova & Lempitsky, 2016; Song et al., 2016; Vinyals et al., 2016; Snell et al., 2017) addresses the problem of discovering representations of a domain that make explicit a particular property of the domain instances. We refer to this property as class or category or identity. For example, a set of animal images might be embedded such that animals of the same species lie closer to one another in the embedding space than to animals of a different species. Deep-embedding methods are trained using a class-aware oracle which can be queried to indicate whether two instances are of the same or different class. Because this paradigm can handle an arbitrary number of classes, and because the complete set of classes does not have to be specified in advance—as they would be in an ordinary classifier—deep embeddings are useful for few-shot learning. A small set of examples of novel classes can be projected into the embedding space, and an unknown instance can be classified by its proximity to the embeddings of the labeled examples. Similar to deep embeddings, the literature on disentangling attempts to discover representations of a set of instances, but rather than making explicit a single property of the instances (class), the goal is to make explicit multiple, independent properties, which we refer to as factors. For example, a disentangled representation of animals might include factors indicating its size, length of its ears, and whether it has feet or fins. We will later be more rigorous in defining a disentangled representation, but for now we operate with the informal notion that the factors form a compositional or distributed representation such that with relatively few factors and relatively few values of each factor, the factor values can be recombined to span the set of instances. Disentangling has been explored using either a fully unsupervised procedure (Chen et al., 2016; Higgins et al., 2017) or a semi-supervised 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. procedure in which a factor-aware oracle can be queried to specify a factor along with sets of instances partitioned by factor value (Reed et al., 2014; Kingma et al., 2014; Kulkarni et al., 2015; Karaletsos et al., 2015; Reed et al., 2015). Despite their overlapping and related goals, surprisingly little effort has been made to connect research in deep embeddings and disentangling. There are two obvious ways to make the connection. First, a factor-aware oracle might be used to train deep embeddings (instead of a class-aware oracle), and hopefully disentangled representations would emerge. Second, a class-aware oracle might be used to train disentangled representations (instead of a factor-aware oracle), and hopefully an embedding suitable for few-shot learning would emerge. We primarily pursue the former approach, but briefly explore the latter as well. In the next section, we propose a deep-embedding method that is suitable for both few-shot learning of novel classes and for disentangling factors. After describing the algorithm and showing that it obtains state-of-the-art results on the recall@k task that is ordinarily used to evaluate embeddings, we turn to analyzing how well the algorithm disentangles the factors that contribute to class identity. To perform a rigorous evaluation, we put forth formal, quantifiable criteria for disentanglement, and we show that our algorithm outperforms other state-of-the-art deep-embedding methods and disentanglement methods in achieving these criteria. 1 Using the F statistic to separate classes Deep-embedding methods attempt to discover a nonlinear projection such that instances of the same class lie close together in the embedding space and instances of different classes lie far apart. The algorithms mostly have heuristic criteria for determining how close is close and how far is far, and they terminate learning once a solution meets the criterion. The criterion can be specified by a user-adjustable margin parameter (Schroff et al., 2015; Chopra et al., 2005) or by ensuring that every within-class pair is closer together than any of the between-class pairs (Ustinova & Lempitsky, 2016). We propose a method that determines when to terminate using the currency of probability and statistical hypothesis testing. It also aligns dimensions of the embedding space with the underlying generative factors—categorical and semantic features—and thereby facilitates the disentangling of representations. For expository purposes, consider two classes, C = {1, 2}, having n1 and n2 instances, which are mapped to a one-dimensional embedding. The embedding coordinate of instance j of class i is denoted zij. The goal of any embedding procedure is to separate the coordinates of the two classes. In our approach, we quantify the separation via the probability that the true class means in the underlying environment, µ1 and µ2, are different from one another. Our training goal can thus be formulated as minimizing Pr (µ1 = µ2 | s(z), n1, n2), where s(z) denotes summary statistics of the labeled embedding points. This posterior is intractable, so instead we operate on the likelihood Pr (s(z) | µ1 = µ2, n1, n2) as a proxy. We borrow a particular statistic from analysis of variance (ANOVA) hypothesis testing for equality of means. The statistic is a ratio of between-class variability to within-class variability: s = ˜n P i ni(¯zi −¯¯z)2 P i,j(zij −¯zi)2 where ¯zi = ⟨zij⟩and ¯¯z = ⟨¯zi⟩are expectations and ˜n = n1 + n2 −2. Under the null hypothesis µ1 = µ2 and an additional normality assumption, zij ∼N(µ, σ2), our statistic s is a draw from a Fisher-Snedecor (or F) distribution with degrees of freedom 1 and ˜n, S ∼F1,˜n. Large s indicate that embeddings from the two different classes are well separated relative to two embeddings from the same class, which is unlikely under F1,˜n. Thus, the CDF of the F distribution offers a measure of the separation between classes: Pr (S < s| µ1 = µ2, ˜n) = I  s s + ˜n, 1 2, ˜n 2  (1) where I is the regularized incomplete beta function, which is differentiable and thus can be incorporated into an objective function for gradient-based training. 2 Several comments on this approach. First, although it assumes the two classes have equal variance, the likelihood in Equation 1 is fairly robust against inequality of the variances as long as n1 ≈n2.1 Second, the F statistic can be computed for an arbitrary number of classes; the generalization of the likelihood in Equation 1 is conditioned on all class instances being drawn from the same distribution. Because this likelihood is a very weak indicator of class separation, we restrict our use of the F statistic to class pairs. Third, this approach is based entirely on statistics of the training set, whereas every other deep-embedding method of which we are aware uses training criteria that are based on individual instances. For example, the triplet loss (Schroff et al., 2015) attempts to ensure that for specific triplets {z11, z12, z21}, z11 is closer to z12 than to z21. Objectives based on specific instances will be more susceptible to noise in the data set and may be more prone to overfitting. 1.1 From one to many dimensions Our example in the previous section assumed one-dimensional embeddings. We have explored two extensions of the approach to many-dimensional embeddings. First, if we assume that the Euclidean distances between embedded points are gamma distributed—which turns out to be a good empirical approximation at any stage of training—then we can represent the numerator and denominator in the F statistic as sums of gamma random variables, and a variant of the unidimensional separation measure (Equation 1) can be used to assess separation based on Euclidean distances. Second, we can apply the unidimensional separation measure for multiple dimensions of the many-dimensional embedding space. We adopt the latter approach because—as we explain shortly—it facilitates disentangling. For a given class pair (α, β), we compute Φ(α, β, k) ≡Pr (S < s | µαk = µβk, nα + nβ −2) for each dimension k of the embedding space. We select a set, Dα,β, of the d dimensions with largest Φ(α, β, k), i.e., the dimensions that are best separated already. Although it is important to separate classes, they needn’t be separated on all dimensions because the pair may have semantic similarity or equivalence along some dimensions. The pair is separated if they can be distinguished reliably on a subset of dimensions. For a training set or a mini-batch with multiple instances of a set of classes C, our embedding objective is to maximize the joint probability of separation for all class pairs (α, β) on all relevant dimensions, Dα,β. Framed as a loss, we minimize the log probability: LF = −P {α,β}∈C P k∈Dα,β ln Φ(α, β, k) Figure 1.1 shows an illustration of the algorithm’s behavior. We sample instances xα1..N, xβ1..M from classes α and β, and choose N and M such that N ≈M. The neural net encodes these instances as embeddings zα1..N and zβ1..M, with dimensions k = 1..D. The variable φ(α, β) indicates the degree of separation for each dimension, where high values (darker) indicate better separation. In this case, dimension 2 has the best separation, with low within-class and high between-class variance. The algorithm maximizes the d largest values of φ(α, β), and sets the loss for all other dimensions equal to zero. This F-statistic loss has four desirable properties. First, the gradient rapidly drops to zero once classes become reliably separated on at least d dimensions, leading to a natural stopping criterion; the degree of separation obtained is related to the number of samples per class. Second, in contrast to other losses, the F-statistic loss is not invariant to rotations in the embedding space; this focus on separating along specific dimensions tends to yield disentangled features when the class structure is factorial or compositional. Third, embeddings obtained are relatively insensitive to the one free parameter, d. Fourth, because the loss is expressed in the currency of probability it can readily be combined with additional losses expressed similarly (e.g., a reconstruction loss framed as a likelihood). The following sections demonstrate the advantages of the F-statistic loss for classification and for disentangling attributes related to class identity. 1For two classes, the F-statistic is equivalent to the square of a t-statistic. To address the potential issue of unequal variances, we explored replacing the F statistic with the Welch correction for a t statistic, but we found no improvement in model performance, and we prefer formulating the loss in terms of an F statistic due to its greater generality. 3 !"# !"$ !"% !&# !&$ !&% '(), +) k = 1 2 3 4 -"# -"$ -"% -&# -&$ -&% ) + Neural net sample sample Figure 1: Illustration of the behavior of the F-statistic loss for a pair of classes in a minibatch. We sample instances xα1..N, xβ1..M from classes α and β. The neural net encodes these instances as embeddings zα1..N and zβ1..M, with dimensions k = 1..D. The activations are indicated by the intensity of the blue color. The variable φ(α, β) indicates the degree of separation for each dimension, where high values (darker circle) indicate better separation. In this case, dimension 2 has the best separation, with low within-class and high between-class variance. The algorithm maximizes the d largest values of φ(α, β), and sets the loss for all other dimensions equal to zero. 2 Identity classification In this section, we demonstrate the performance of the F-statistic loss compared to state-of-the-art deep-embedding losses on identity classification. The first task involves matching a person from a wide-angle, full-body photograph, taken at various angles and poses. For this task, we evaluate using two datasets—CUHK03 (Li et al., 2014) and Market-1501 (Zheng et al., 2015)—following the methodology of Ustinova & Lempitsky (2016). The second task involves matching a bird from a wide angle photograph; we evaluate performance on the CUB-200-2011 birds dataset (Wah et al., 2011). Five-fold cross validation is performed in every case. The first split is used to tune model hyper-parameters, and we report accuracy on the final four splits. This same procedure was used to evaluate the F-statistic loss and four competitors. 2.1 Training details For CUHK03 and Market-1501, we use the Deep Metric Learning (Yi et al., 2014b) architecture, following Ustinova & Lempitsky (2016). For CUB-200-2011, we use an inception v3 (Szegedy et al., 2016) network pretrained on ImageNet, and extract the 2048-dimensional features from the final pooling layer. We treat these features as constants, and optimize a fully connected net, with 1024 hidden ReLU units. For every dataset, we use a 500-dimensional embedding. All nets were trained using the ADAM (Kingma & Ba, 2014) optimizer, with a learning rate of 10−4 for all losses, except the F-statistic loss, which we found benefitted from a slightly higher learning rate (2 × 10−4). For each split, a validation set was withheld from the training set, and used for early stopping. To construct a mini-batch for training, we randomly select 12 identities, with up to 10 samples of each identity, as in Ustinova & Lempitsky (2016). In addition to the F-statistic loss, we evaluated histogram (Ustinova & Lempitsky, 2016), triplet (Schroff et al., 2015), binomial deviance (Yi et al., 2014a), and lifted structured similarity softmax (LSSS) (Song et al., 2016) losses. For the triplet loss, we use all triplets in the minibatch. For the histogram loss and binomial deviance losses, we use all pairs. For the F-statistic loss, we use all class pairs. The triplet loss is trained and evaluated using L2 distances. The F-statistic loss is evaluated using L2 distances. As in Ustinova & Lempitsky (2016), embeddings obtained discovered by the histogram and binomial-deviance losses are constrained to lie on the unit hypersphere; cosine distance is used for training and evaluation. For the F-statistic loss, we determined the best value of d, the number of dimensions to separate, using the validation set of the first split. Performance is relatively insensitive to d for 2 < d < 100. For CUHK03 we chose d = 70, for Market-1501 d = 63, and for CUB-200 d = 3. For the triplet loss we found that a margin of 0.1 worked well for all datasets. For binomial deviance and LSSS losses, we used the best settings for each dataset as determined in Ustinova & Lempitsky (2016). Code for all models is available at https://github.com/kridgeway/f-statistic-loss-nips-2018 2.2 Results Embedding procedures are typically evaluated with either recall@k or with a few-shot learning paradigm. The two evaluations are similar: using held-out classes, q instances of each class are projected to the embedding space (the references) and performance is judged by the proximity of a query instance to references in the embedding space. We evaluate with recall@1 or 1-nearest neighbor, which judges the query instance as correctly classified if the closest reference is of the 4 Loss CUHK03 Market-1501 CUB-200-2011 F-Statistic 90.17% ± 0.44% 84.21% ± 0.44% 55.22% ± 0.75% Histogram 86.07% ± 0.73% 84.46% ± 0.23% 58.89% ± 0.89% Triplet 81.18% ± 0.61% 80.59% ± 0.64% 45.09% ± 0.80% Binomial Deviance 85.37% ± 0.45% 84.12% ± 0.27% 59.05% ± 0.73% LSSS 85.75% ± 0.62% 83.46% ± 0.48% 54.68% ± 0.49% Figure 2: Recall@1 results for our F-statistic loss and four competitors across three data sets. Shown is the percentage correct classification and the standard error of the mean. The best algorithm(s) on a given data set are highlighted. same class. This is equivalent to a q-shot learning evaluation; for our data sets, q ranged from 3 to 10. (For readers familiar with recall@k curves, we note that relative performance of algorithms generally does not vary with k, and k = 1 shows the largest differences.) Table 2 reports recall@1 accuracy. Overall, the F-statistic loss achieves accuracy comparable to the best of its competitors, histogram and binomial deviance losses. It obtains the best result on CUHK03, ties on Market-1501, and is a tier below the best on CUB-200. In earlier work (Anonymized Citation, 2018), we conducted a battery of empirical tests comparing deep metric learning and few-shot learning methods, and the histogram loss appears to be the most robust. Here, we have demonstrated that our F-statistic loss matches this state-of-the-art in terms of producing domain embeddings that cluster instances by class. In the remainder of the paper, we argue that the F-statistic loss obtains superior disentangled embeddings. 3 Quantifying disentanglement Disentangling is based on the premise that a set of underlying factors are responsible for generating observed instances. The instances are typically high dimensional, redundant, and noisy, and each vector element depends on the value of multiple factors. The goal of a disentangling procedure is to recover the causal factors of an instance in a code vector. The term code is synonymous with embedding, but we prefer ‘code’ in this section to emphasize our focus on disentangling. The notion of what constitutes an ideal code is somewhat up for debate, with most authors preferring to avoid explicit definitions, and others having conflicting notions (Higgins et al., 2017; Kim & Mnih, 2017). The most explicit and comprehensive definition of disentangling (Eastwood & Williams, 2018) is based on three criteria, which we refer to—using a slight variant of their terminology—as modularity, compactness, and explicitness.2 In a modular representation, each dimension of the code conveys information about at most one factor. In a compact representation, a given factor is associated with only one or a few code dimensions. In an explicit representation, there is a simple (e.g., linear) mapping from the code to the value of a factor. (See Supplementary Materials for further detail.) Researchers who have previously attempted to quantify disentangling have considered different subsets of the modularity, compactness, and explicitness criteria. In Eastwood & Williams (2018), all three are included; in Kim & Mnih (2017), modularity and compactness are included, but not explicitness; and in Higgins et al. (2017), modularity is included, but not compactness or explicitness. We argue that modularity and explicitness should be considered as defining features of disentangled representations, but not compactness. Although compactness facilitates interpretation of the representations, it has two significant drawbacks. First, forcing compactness can affect the representation’s utility. Consider a factor θ ∈[0◦, 360◦] that determines the orientation of an object in an image. Encoding the orientation in two dimensions as (sin θ, cos θ) captures the natural similarity structure of orientations, yet it is not compact relative to using θ as the code. Second, forcing a neural network to discover a minimal (compact) code may lead to local optima in training because the solution space is highly constrained; allowing redundancy in the code enables many equivalent solutions. 2We developed our disentangling criteria and terminology in parallel with and independently of Eastwood & Williams (2018). We prefer our nomenclature and also our quantification of the criteria because their quantification requires determination of two hyperparameters (an L1 regularization penalty and a tree depth for a random forest). Nonetheless, it is encouraging that multiple research groups are converging on essentially the same criteria. 5 In order to evaluate disentangling performance of a deep-embedding procedure, we quantify modularity and explicitness. For modularity, we start by estimating the mutual information between each code dimension and each factor.3 If code dimension i is ideally modular, it will have high mutual information with a single factor and zero mutual information with all other factors. We use the deviation from this idealized case to compute a modularity score. Given a single code dimension i and a factor f, we denote the mutual information between the code and factor by mif, mif ≥0. We create a “template” vector ti of the same size as mi, which represents the best-matching case of ideal modularity for code dimension i: tif = θi if f = arg maxg(mig) 0 otherwise, where θi = maxg(mig). The observed deviation from the template is given by δi = P f(mif −tif)2 θ2 i (N −1) , (2) where N is the number of factors. A deviation of 0 indicates that we have achieved perfect modularity and 1 indicates that this dimension has equal mutual information with every factor. Thus, we use 1 −δi as a modularity score for code dimension i and the mean of 1 −δi over i as the modularity score for the overall code. Note that this expectation does not tell us if each factor is well represented in the code. To ascertain the coverage of the code, the explicitness measure is needed. Under the assumption that factors have discrete values, we can compute an explicitness score for each value of each factor. In an explicit representation, recovering factor values from the code should be possible with a simple classifier. We have experimented with both RBF networks and logistic regression as recovery models, and have found logistic regression, with its implied linear separability, is a more robust procedure. We thus fit a one-versus-rest logistic-regression classifier that takes the entire code as input. We record the ROC area-under-the-curve (AUC) of that classifier. We quantify the explicitness of a code using the mean of AUCjk over j, a factor index, and k, an index on values of factor j. In the next section, we use this quantification of modularity and explicitness to evaluate our F-statistic loss against other disentangling and deep-embedding methods. 4 A weakly supervised approach to disentanglement Previously proposed disentangling procedures lie at one of two extremes of supervision: either entirely unsupervised (Chen et al., 2016; Higgins et al., 2017), or requiring factor-aware oracles—oracles that name a particular factor and provide sets of instances that either differ on all factors except the named factor (Kulkarni et al., 2015) or are ordered by factor-specific similarity (Karaletsos et al., 2015; Veit et al., 2016). The unsupervised procedures suffer from being underconstrained; the oracle-based procedures require strong supervision. We propose an oracle-based training procedure with an intermediate degree of supervision, inspired by the deep-embedding literature. We consider an oracle which chooses a factor and a set of instances, then sorts the instances by their similarity on that factor, or into two groups—identical and nonidentical. The oracle conveys the similarities but not the name of the factor itself. This scenario is like the Sesame Street (children’s TV show) game in which a set of objects are presented and one is not like the other, and the child needs to determine along what dimension it differs. Sets of instances segmented in this manner are easy to obtain via crowdsourcing: a worker is given a set of instances and simply told to sort them into two groups by similarity to one another, or to sort them by similarity to a reference. In either case, the sorting dimension is never explicitly specified, and any nontrivial domain will have many dimensions (factors) from which to choose. Our unnamed-factor oracle is a generalization of the procedure used for training deep embeddings, where the oracle judges similarity of instances by class label, without reference to the specific class label. Instead, our unnamed-factor oracle operates by choosing a factor randomly and specifying similarity of instances by factor label, without reference to the specific factor. 3In this work, we focus on the case of factors with discrete values and codes with continuous values. We discretize the code by constructing a 20-bin histogram of the code values with equal width bins, and then computing discrete mutual information between the factor-values and the code histogram. 6 We explore two datasets in which each instance is tagged with values for several statistically independent factors. Some of the factors are treated as class-related, and some as noise. First, we train on a data set of video game sprites—60 × 60 pixel color images of game characters viewed from various angles and in a variety of poses (Reed et al., 2015). The identity of the game characters is composed of 7 factors—body, arms, hair, gender, armor, greaves, and weapon—each with 2–5 distinct values, leading to 672 total unique identities which can be instantiated in various viewing angles and poses. We also explore the small NORB dataset (LeCun et al., 2004). This dataset is composed of 96 × 96 pixel grayscale images of toys in various poses and lighting conditions. There are 5 superordinate categories, each with 10 subordinate categories, a total of 50 types of toys. Each toy is imaged from 9 camera elevations and 18 azimuths, and under 6 lighting conditions. For our experiments, we define factors for toy type, elevation, and azimuth, and we treat lighting condition as a noise variable. For simplicity of evaluation, we partition the values of elevation and azimuth to create binary factors: grouping elevation into low (0 through 4) and high (5 through 8) buckets and azimuth values into right- (0 through 16) and left-(18 through 34) facing buckets, leading to a total of 200 unique identities. 4.1 Training Details For the sprites dataset, we used the encoder architecture of Reed et al. (2015) as well as their embedding dimensionality of 22. For small NORB, we use a convolutional network with 3 convolutional layers and a final fully connected layer with an embedding dimensionality of 20. For the convolutional layers, the filter sizes are (7 × 7, 3 × 3, 3 × 3), the filter counts are (48, 64, 72), and all use a stride of 2 and ReLU activation. For the F-statistic loss, we set the number of training dimensions d = 2. Again, all nets were trained using the ADAM optimizer, with the same learning rates as used for the classification datasets. We construct minibatches in a manner analogous to how we did for deep embeddings with class-based training (Section 3). For factor-based training, we select instances with similarity determined by a single factor to construct a minibatch. For each epoch, we iterate through the factors until we have trained on every instance with respect to every factor. Each minibatch is composed of up to 12 factor-values. For example, a minibatch focusing on the hair color factor of the sprites dataset will include samples of up to 12 hair colors, with multiple instances within each hair color. We train with up to 10 instances per factor-value for triplet and histogram. For the F-statistic loss, we found that training with up to 5 instances per factor-value helps avoid underfitting. For both datasets, we evaluated with five-fold cross validation, using the conjunction of factors to split: the 7 factors for sprites and 3 (toy type, azimuth, and elevation) for norb. For each split, the validation set was used to determine when to stop training, based on mean factor explicitness. The first split was used to tune hyper-parameters, and the test sets of the remaining four splits are used to report results. For these experiments, we compare the F-statistic loss to the triplet and histogram losses; other losses using Lp norm or cosine distances should yield similar results. We also compare to the β-variational auto-encoder, or β-VAE (Higgins et al., 2017), an unsupervised disentangling method that has been shown to outperform other unsupervised methods such as InfoGAN (Chen et al., 2016). The generator net in the β-VAE has the same number of layers as the encoder. The number of filters and the size of the receptive field in the generator are mirror values of the encoder, such that the first layer in the encoder has the same number of output filters that the last layer in the generator has as input. For the β-VAE, training proceeds until the reconstruction likelihood on the held-out validation set stops improving. 4.2 Results Figure 3 shows the modularity and explicitness scores for representations learned on the sprites and small NORB datasets (first and second rows, respectively) using triplet, histogram, and F-statistic losses. Modularity scores appear in the first column; for modularity, we report the mean across validation splits and embedding dimensions. Explicitness scores appear in the second column; for explicitness, we report the mean across validation splits and factor-values. (The sprites dataset has 7 factors and 22 total factor-values. The small NORB has a total of 3 factors and 54-factor values.) The F-statistic loss achieves the best modularity on both datasets, and the best explicitness on the small NORB dataset. On the Sprites dataset, all of the methods achieve good explicitness. Figure 4 compares modularity and explicitness of representations for the F-statistic and β-VAE, for various settings of β. The default setting of β=1 corresponds to the original VAE (Kingma & Welling, 7 0.75 0.80 0.85 0.90 0.95 1.00 Modularity Triplet Histogram F-statistic 0.90 0.92 0.94 0.96 0.98 1.00 Explicitness 0.75 0.80 0.85 0.90 0.95 1.00 Modularity 0.90 0.92 0.94 0.96 0.98 1.00 Explicitness Sprites Small NORB Modularity Explicitness Sprites Small NORB Modularity Explicitness Sprites Small NORB Modularity Explicitness Figure 3: Mean modularity and explicitness scores for the triplet, histogram, and F-statistic losses on the small NORB and Sprites datasets. The F-statistic loss dominates the other methods in three of the comparisons, and although the F-statistic loss has a slight numerical advantage in Sprites explicitness, the advantage is not statistically reliable (comparing histogram to F-statistic with a paired t-test, p>.20). Essentially, all methods are at ceiling in Sprites explicitness. Black bars indicate ± one standard error of the mean. F-statistic (factor) F-statistic (class) -VAE, =1 -VAE, =2 -VAE, =4 -VAE, =8 0.7 0.8 0.9 1.0 Explicitness Explicitness F-statistic (factor) F-statistic (class) -VAE, =1 -VAE, =2 -VAE, =4 -VAE, =8 0.85 0.90 0.95 1.00 Modularity Modularity Figure 4: Mean modularity and explicitness scores for the F-statistic loss and β-VAE on the Sprites dataset. Black bars indicate ± one standard error of the mean. The light and dark green bars correspond to the F-statistic loss trained with an unnamed-factor oracle and a class-aware oracle, respectively. See text for details. 2013). As β increases, modularity improves but explicitness worsens. This trade off has not been previously reported and points to a limitation of the method. The first bar of each figure corresponds to the F-statistic loss trained with the unnamed-factor oracle, and the second bar corresponds to the F-statistic loss trained with a class-aware oracle. The class-aware oracle defines a class as a unique conjunction of the component factors (e.g., for small NORB the conjunction of object identity, azimuth, and elevation). It is thus a weaker form of supervision than the unnamed-factor oracle provides, and is analogous to the type of training performed with deep-embedding procedures, where the oracle indicates whether or not instances match on class without naming the class or its component factors. Both F-statistic representations are superior to all variants of the β-VAE. The comparison is not exactly fair because the β-VAE is unsupervised whereas the F-statistic loss is weakly supervised. Nonetheless, the β-VAE is considered as a critical model for comparison, and we would have been remiss not to do so. 5 Discussion and future work The F-statistic loss is motivated by the goal of unifying the deep-embedding and disentangling literatures. We have shown that it achieves state-of-the-art performance in the recall@1 task used to evaluate deep embeddings when trained with a class-aware oracle, and achieves state-of-the-art performance in disentangling when trained with an unnamed-factor oracle. The ultimate goal of research in disentangling is to develop methods that work in a purely unsupervised fashion. The β-VAE is the leading contender in this regard, but we have shown a troubling trade off obtained with the β-VAE through our quantification of modularity and explicitness (Figure 4), and we have shown that unsupervised training cannot at present compete with even weakly supervised training (not a surprise to anyone). Another contribution of our work to disentangling is the notion of training with an unnamed-factor oracle or a class-aware oracle; in previous research with supervised disentangling, the stronger factor-aware oracle was used which would indicate a factor name as well as judging similarity in terms of that factor. Our goal is to explore increasingly weaker forms of supervision. We have taken the largest step so far in this regard through our examination of disentangling with a class-aware oracle (Figure 4), which should serve as a reference for others interested in disentangling. Our current research focuses on methods for adaptively estimating d, the hyper-parameter governing the number of dimensions trained on any trial. Presently, d determines the loss behavior for all pairs 8 of classes, and must be tuned for each data set. Our hope is that we can adaptively estimate d for each pair of identities on the fly. 6 Acknowledgements This research was supported by the National Science Foundation awards EHR-1631428 and SES1461535. References Chen, Xi, Duan, Yan, Houthooft, Rein, Schulman, John, Sutskever, Ilya, and Abbeel, Pieter. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pp. 2172–2180, 2016. Chopra, S, Hadsell, R, and Y., LeCun. Learning a similiarty metric discriminatively, with application to face verification. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, pp. 349–356, 2005. Eastwood, Cian and Williams, Chris. A framework for the quantitative evaluation of disentangled representations. ICLR, 2018. Higgins, Irina, Matthey, Loic, Pal, Arka, Burgess, Christopher, Glorot, Xavier, Botvinick, Matthew, Mohamed, Shakir, and Lerchner, Alexander. beta-vae: Learning basic visual concepts with a constrained variational framework. ICLR, 2017. Karaletsos, Theofanis, Belongie, Serge, and Rätsch, Gunnar. Bayesian representation learning with oracle constraints. ICLR, pp. 1–9, 2015. URL http://arxiv.org/abs/1506.05011. Kim, Hyunjik and Mnih, Andriy. Disentangling by factorising. In Learning Disentangled Representations: From Perception to Control Workshop, NIPS, 2017. Kingma, Diederik and Ba, Jimmy. Adam: A method for stochastic optimization. arXiv preprint, 2014. URL http://arxiv.org/abs/1412.6980. Kingma, Diederik P and Welling, Max. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Kingma, Diederik P, Mohamed, Shakir, Rezende, Danilo Jimenez, and Welling, Max. Semisupervised learning with deep generative models. In Advances in Neural Information Processing Systems, pp. 3581–3589, 2014. Kulkarni, Tejas D, Whitney, William F, Kohli, Pushmeet, and Tenenbaum, Josh. Deep convolutional inverse graphics network. In Advances in Neural Information Processing Systems, pp. 2539–2547, 2015. LeCun, Yann, Huang, Fu Jie, and Bottou, Leon. Learning methods for generic object recognition with invariance to pose and lighting. In Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, volume 2, pp. II–104. IEEE, 2004. Li, Wei, Zhao, Rui, Xiao, Tong, and Wang, Xiaogang. Deepreid: Deep filter pairing neural network for person re-identification. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 152–159, 2014. Reed, Scott, Sohn, Kihyuk, Zhang, Yuting, and Lee, Honglak. Learning to disentangle factors of variation with manifold interaction. Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1431–1439, 2014. Reed, Scott E., Zhang, Yi, Zhang, Yuting, and Lee, Honglak. Deep visual analogy-making. Advances in Neural Information Processing Systems, pp. 1252–1260, 2015. ISSN 10495258. URL http: //papers.nips.cc/paper/5845-deep-visual-analogy-making. 9 Schroff, Florian, Kalenichenko, Dmitry, and Philbin, James. Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 815–823, 2015. Snell, Jake, Swersky, Kevin, and Zemel, Richard. Prototypical networks for few-shot learning. In Luxburg, U. V., Guyon, I., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S. V. N., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 30, pp. xxx–xxx. Curran Associates, Inc., 2017. Song, Hyun Oh, Jegelka, Stefanie, and Savarese, Silvio. Deep metric learning via lifted structured feature embedding query retrieval. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4004–4012, 2016. Szegedy, Christian, Vanhoucke, Vincent, Ioffe, Sergey, Shlens, Jon, and Wojna, Zbigniew. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2818–2826, 2016. Ustinova, Evgeniya and Lempitsky, Victor. Learning deep embeddings with histogram loss. Advances in Neural Information Processing Systems, pp. 4170–4178, 2016. Veit, Andreas, Belongie, Serge, and Karaletsos, Theofanis. Disentangling Nonlinear Perceptual Embeddings With Multi-Query Triplet Networks. arXiv preprint, 2016. URL http://arxiv. org/abs/1603.07810. Vinyals, Oriol, Blundell, Charles, Lillicrap, Tim, Wierstra, Daan, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016. Wah, C., Branson, S., Welinder, P., Perona, P., and Belongie, S. The Caltech-UCSD Birds-200-2011 Dataset. Technical Report CNS-TR-2011-001, California Institute of Technology, 2011. Yi, Dong, Lei, Zhen, and Li, Stan Z. Deep metric learning for practical person re-identification. ICPR, 11(4):1–11, 2014a. ISSN 10514651. doi: 10.1109/ICPR.2014.16. URL http://arxiv. org/abs/1407.4979. Yi, Dong, Lei, Zhen, Liao, Shengcai, and Li, Stan Z. Deep metric learning for person re-identification. In Pattern Recognition (ICPR), 2014 22nd International Conference on, pp. 34–39. IEEE, 2014b. Zheng, Liang, Shen, Liyue, Tian, Lu, Wang, Shengjin, Wang, Jingdong, and Tian, Qi. Scalable person re-identification: A benchmark. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1116–1124, 2015. 10
2018
192
7,355
Disconnected Manifold Learning for Generative Adversarial Networks Mahyar Khayatkhoei Department of Computer Science Rutgers University m.khayatkhoei@cs.rutgers.edu Ahmed Elgammal Department of Computer Science Rutgers University elgammal@cs.rutgers.edu Maneesh Singh Verisk Analytics maneesh.singh@verisk.com Abstract Natural images may lie on a union of disjoint manifolds rather than one globally connected manifold, and this can cause several difficulties for the training of common Generative Adversarial Networks (GANs). In this work, we first show that single generator GANs are unable to correctly model a distribution supported on a disconnected manifold, and investigate how sample quality, mode dropping and local convergence are affected by this. Next, we show how using a collection of generators can address this problem, providing new insights into the success of such multi-generator GANs. Finally, we explain the serious issues caused by considering a fixed prior over the collection of generators and propose a novel approach for learning the prior and inferring the necessary number of generators without any supervision. Our proposed modifications can be applied on top of any other GAN model to enable learning of distributions supported on disconnected manifolds. We conduct several experiments to illustrate the aforementioned shortcoming of GANs, its consequences in practice, and the effectiveness of our proposed modifications in alleviating these issues. 1 Introduction Consider two natural images, picture of a bird and picture of a cat for example, can we continuously transform the bird into the cat without ever generating a picture that is not neither bird nor cat? In other words, is there a continuous transformation between the two that never leaves the manifold of "real looking" images? It is often the case that real world data falls on a union of several disjoint manifolds and such a transformation does not exist, i.e. the real data distribution is supported on a disconnected manifold, and an effective generative model needs to be able to learn such manifolds. Generative Adversarial Networks (GANs) [10], model the problem of finding the unknown distribution of real data as a two player game where one player, called the discriminator, tries to perfectly separate real data from the data generated by a second player, called the generator, while the second player tries to generate data that can perfectly fool the first player. Under certain conditions, Goodfellow et al. [10] proved that this process will result in a generator that generates data from the real data distribution, hence finding the unknown distribution implicitly. However, later works uncovered several shortcomings of the original formulation, mostly due to violation of one or several of its assumptions in practice [1, 2, 20, 24]. Most notably, the proof only works for when optimizing in the function space of generator and discriminator (and not in the parameter space) [10], the Jensen Shannon Divergence is maxed out when the generated and real data distributions have disjoint support 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. resulting in vanishing or unstable gradient [1], and finally the mode dropping problem where the generator fails to correctly capture all the modes of the data distribution, for which to the best of our knowledge there is no definitive reason yet. One major assumption for the convergence of GANs is that the generator and discriminator both have unlimited capacity [10, 2, 24, 14], and modeling them with neural networks is then justified through the Universal Approximation Theorem. However, we should note that this theorem is only valid for continuous functions. Moreover, neural networks are far from universal approximators in practice. In fact, we often explicitly restrict neural networks through various regularizers to stabilize training and enhance generalization. Therefore, when generator and discriminator are modeled by stable regularized neural networks, they may no longer enjoy a good convergence as promised by the theory. In this work, we focus on learning distributions with disconnected support, and show how limitations of neural networks in modeling discontinuous functions can cause difficulties in learning such distributions with GANs. We study why these difficulties arise, what consequences they have in practice, and how one can address these difficulties by using a collection of generators, providing new insights into the recent success of multi-generator models. However, while all such models consider the number of generators and the prior over them as fixed hyperparameters [3, 14, 9], we propose a novel prior learning approach and show its necessity in effectively learning a distribution with disconnected support. We would like to stress that we are not trying to achieve state of the art performance in our experiments in the present work, rather we try to illustrate an important limitation of common GAN models and the effectiveness of our proposed modifications. We summarize the contributions of this work below: • We identify a shortcoming of GANs in modeling distributions with disconnected support, and investigate its consequences, namely mode dropping, worse sample quality, and worse local convergence (Section 2). • We illustrate how using a collection of generators can solve this shortcoming, providing new insights into the success of multi generator GAN models in practice (Section 3). • We show that choosing the number of generators and the probability of selecting them are important factors in correctly learning a distribution with disconnected support, and propose a novel prior learning approach to address these factors. (Section 3.1) • Our proposed model can effectively learn distributions with disconnected supports and infer the number of necessary disjoint components through prior learning. Instead of one large neural network as the generator, it uses several smaller neural networks, making it more suitable for parallel learning and less prone to bad weight initialization. Moreover, it can be easily integrated with any GAN model to enjoy their benefits as well (Section 5). 2 Difficulties of Learning Disconnected Manifolds A GAN as proposed by Goodfellow et al. [10], and most of its successors (e.g. [2, 11]) learn a continuous G : Z →X, which receives samples from some prior p(z) as input and generates real data as output. The prior p(z) is often a standard multivariate normal distribution N(0, I) or a bounded uniform distribution U(−1, 1). This means that p(z) is supported on a globally connected subspace of Z. Since a continuous function always keeps the connectedness of space intact [15], the probability distribution induced by G is also supported on a globally connected space. Thus G, a continuous function by design, can not correctly model a union of disjoint manifolds in X. We highlight this fact in Figure 1 using an illustrative example where the support of real data is {+2, −2}. We will look at some consequences of this shortcoming in the next part of this section. For the remainder of this paper, we assume the real data is supported on a manifold Sr which is a union of disjoint globally connected manifolds each denoted by Mi; we refer to each Mi as a submanifold (note that we are overloading the topological definition of submanifolds in favor of brevity): Sr = nr [ i=1 Mi ∀i ̸= j : Mi ∩Mj = ∅ Sample Quality. Since GAN’s generator tries to cover all submanifolds of real data with a single globally connected manifold, it will inevitably generate off real-manifold samples. Note that to avoid 2 +2 -2 +1 -1 𝒵 𝒳 (a) Suboptimal Continuous G +2 -2 +1 -1 𝒵 𝒳 (b) Optimal G∗ Figure 1: Illustrative example of continuous generator G(z) : Z →X with prior z ∼U(−1, 1), trying to capture real data coming from p(x) = 1 2(δ(x −2) + δ(x + 2)), a distribution supported on union of two disjoint manifolds. (a) shows an example of what a stable neural network is capable of learning for G (a continuous and smooth function), (b) shows an optimal generator G∗(z). Note that since z is uniformly sampled, G(z) is necessarily generating off manifold samples (in [−2, 2]) due to its continuity. off manifold regions, one should push the generator to learn a higher frequency function, the learning of which is explicitly avoided by stable training procedures and means of regularization. Therefore the GAN model in a stable training, in addition to real looking samples, will also generate low quality off real-manifold samples. See Figure 2 for an example of this problem. Mode Dropping. In this work, we use the term mode dropping to refer to the situation where one or several submanifolds of real data are not completely covered by the support of the generated distribution. Note that mode collapse is a special case of this definition where all but a small part of a single submanifold are dropped. When the generator can only learn a distribution with globally connected support, it has to learn a cover of the real data submanifolds, in other words, the generator can not reduce the probability density of the off real-manifold space beyond a certain value. However, the generator can try to minimize the volume of the off real-manifold space to minimize the probability of generating samples there. For example, see how in Figure 2b the learned globally connected manifold has minimum off real-manifold volume, for example it does not learn a cover that crosses the center (the same manifold is learned in 5 different runs). So, in learning the cover, there is a trade off between covering all real data submanifolds, and minimizing the volume of the off real-manifold space in the cover. This trade off means that the generator may sacrifice certain submanifolds, entirely or partially, in favor of learning a cover with less off real-manifold volume, hence mode dropping. Local Convergence. Nagarajan and Kolter [21] recently proved that the training of GANs is locally convergent when generated and real data distributions are equal near the equilibrium point, and Mescheder et al. [19] showed the necessity of this condition on a prototypical example. Therefore when the generator can not learn the correct support of the real data distribution, as is in our discussion, the resulting equilibrium may not be locally convergent. In practice, this means the generator’s support keeps oscillating near the data manifold. 3 Disconnected Manifold Learning There are two ways to achieve disconnectedness in X: making Z disconnected, or making G : Z →X discontinuous. The former needs considerations for how to make Z disconnected, for example adding discrete dimensions [6], or using a mixture of Gaussians [12]. The latter solution can be achieved by introducing a collections of independent neural networks as G. In this work, we investigate the latter solution since it is more suitable for parallel optimization and can be more robust to bad initialization. We first introduce a set of generators Gc : Z →X instead of a single one, independently constructed on a uniform prior in the shared latent space Z. Each generator can therefore potentially learn a separate connected manifold. However, we need to encourage these generators to each focus on a different submanifold of the real data, otherwise they may all learn a cover of the submanifolds and 3 (a) Real Data (b) WGAN-GP (c) DMWGAN (d) DMWGAN-PL Figure 2: Comparing Wasserstein GAN (WGAN) and its Disconnected Manifold version with and without prior learning (DMWGAN-PL, DMWGAN) on disjoint line segments dataset when ng = 10. Different colors indicate samples from different generators. Notice how WGAN-GP fails to capture the disconnected manifold of real data, learning a globally connected cover instead, and thus generating off real-manifold samples. DMWGAN also fails due to incorrect number of generators. In contrast, DMWGAN-PL is able to infer the necessary number of disjoint components without any supervision and learn the correct disconnected manifold of real data. Each figure shows 10K samples from the respective model. We train each model 5 times, the results shown are consistent across different runs. (a) WGAN-GP (b) DMWGAN (c) DMWGAN-PL Figure 3: Comparing WGAN-GP, DMWGAN and DMWGAN-PL convergence on unbalanced disjoint line segments dataset when ng = 10. The real data is the same line segments as in Figure 2, except the top right line segment has higher probability. Different colors indicate samples from different generators. Notice how DMWGAN-PL (c) has vanished the contribution of redundant generators wihtout any supervision. Each figure shows 10K samples from the respective model. We train each model 5 times, the results shown are consistent across different runs. experience the same issues of a single generator GAN. Intuitively, we want the samples generated by each generator to be perfectly unique to that generator, in other words, each sample should be a perfect indicator of which generator it came from. Naturally, we can achieve this by maximizing the mutual information I(c; x), where c is generator id and x is generated sample. As suggested by Chen et al. [6], we can implement this by maximizing a lower bound on mutual information between generator ids and generated images: I(c; x) = H(c) −H(c|x) = H(c) + Ec∼p(c),x∼pg(x|c)  Ec′∼p(c′|x) [ln p(c′|x)]  = H(c) + Ex∼pg(x) [KL(p(c|x)||q(c|x))] + Ec∼p(c),x∼pg(x|c),c′∼p(c′|x) [ln q(c′|x)] ≥H(c) + Ec∼p(c),x∼pg(x|c),c′∼p(c′|x) [ln q(c′|x)] = H(c) + Ec∼p(c),x∼pg(x|c) [ln q(c|x)] where q(c|x) is the distribution approximating p(c|x), pg(x|c) is induced by each generator Gc, KL is the Kullback Leibler divergence, and the last equality is a consequence of Lemma 5.1 in [6]. Therefore, by modeling q(c|x) with a neural network Q(x; γ), the encoder network, maximizing I(c; x) boils down to minimizing a cross entropy loss: Lc = −Ec∼p(c),x∼pg(x|c) [ln q(c|x)] (1) 4 Utilizing the Wasserstein GAN [2] objectives, discriminator (critic) and generator maximize the following, where D(x; w) : X →R is the critic function: Vd = Ex∼pr(x) [D(x; w)] −Ec∼p(c),x∼pg(x|c) [D(x; w)] (2) Vg = Ec∼p(c),x∼pg(x|c) [D(x; w)] −λLc (3) We call this model Disconnected Manifold Learning WGAN (DMWGAN) in our experiments. We can similarly apply our modifications to the original GAN [10] to construct DMGAN. We add the single sided version of penalty gradient regularizer [11] to the discriminator/critic objectives of both models and all baselines. See Appendix A for details of our algorithm and the DMGAN objectives. See Appendix F for more details and experiments on the importance of the mutual information term. The original convergence theorems of Goodfellow et al. [10] and Arjovsky et al. [2] holds for the proposed DM versions respectively, because all our modifications concern the internal structure of the generator, and can be absorbed into the unlimited capacity assumption. More concretely, all generators together can be viewed as a unified generator where p(c)pg(x|c) becomes the generator probability, and Lc can be considered as a constraint on the generator function space incorporated using a Lagrange multiplier. While most multi-generator models consider p(c) as a uniform distribution over generators, this naive choice of prior can cause certain difficulties in learning a disconnected support. We will discuss this point, and also introduce and motivate the metrics we use for evaluations, in the next two subsections. 3.1 Learning the Generator’s Prior In practice, we can not assume that the true number of submanifolds in real data is known a priori. So let us consider two cases regarding the number of generators ng, compared to the true number of submanifolds in data nr, under a fixed uniform prior p(c). If ng < nr then some generators have to cover several submanifolds of the real data, thus partially experiencing the same issues discussed in Section 2. If ng > nr, then some generators have to share one real submanifold, and since we are forcing the generators to maintain disjoint supports, this results in partially covered real submanifolds, causing mode dropping. See Figures 2c and 3b for examples of this issue. Note that an effective solution to the latter problem reduces the former problem into a trade off: the more the generators, the better the cover. We can address the latter problem by learning the prior p(c) such that it vanishes the contribution of redundant generators. Even when ng = nr, what if the distribution of data over submanifolds are not uniform? Since we are forcing each generator to learn a different submanifold, a uniform prior over the generators would result in a suboptimal distribution. This issue further shows the necessity of learning the prior over generators. We are interested in finding the best prior p(c) over generators. Notice that q(c|x) is implicitly learning the probability of x ∈X belonging to each generator Gc, hence q(c|x) is approximating the true posterior p(c|x). We can take an EM approach to learning the prior: the expected value of q(c|x) over the real data distribution gives us an approximation of p(c) (E step), which we can use to train the DMGAN model (M step). Instead of using empirical average to learn p(c) directly, we learn it with a model r(c; ζ), which is a softmax function over parameters {ζi}ng i=1 corresponding to each generator. This enables us to control the learning of p(c), the advantage of which we will discuss shortly. We train r(c) by minimizing the cross entropy as follows: H(p(c), r(c)) = −Ec∼p(c) [log r(c)] = −Ex∼pr(x),c∼p(c|x) [log r(c)] = Ex∼pr(x) [H(p(c|x), r(c))] Where H(p(c|x), r(c)) is the cross entropy between model distribution r(c) and true posterior p(c|x) which we approximate by q(c|x). However, learning the prior from the start, when the generators are still mostly random, may prevent most generators from learning by vanishing their probability too early. To avoid this problem, we add an entropy regularizer and decay its weight λ′′ with time to gradually shift the prior r(c) away from uniform distribution. Thus the final loss for training r(c) becomes: Lprior = Ex∼pr(x) [H(q(c|x), r(c))] −αtλ′′H(r(c)) (4) Where H(r(c)) is the entropy of model distribution, α is the decay rate, and t is training timestep. The model is not very sensitive to λ′′ and α, any combination that insures a smooth transition away from uniform distribution is valid. We call this augmented model Disconnected Manifold Learning GAN with Prior Learning (DMGAN-PL) in our experiments. See Figures 2 and 3 for examples showing the advantage of learning the prior. 5 3.2 Choice of Metrics We require metrics that can assess inter-mode variation, intra-mode variation and sample quality. The common metric, Inception Score [23], has several drawbacks [4, 18], most notably it is indifferent to intra-class variations and favors generators that achieve close to uniform distribution over classes of data. Instead, we consider more direct metrics together with FID score [13] for natural images. For inter mode variation, we use the Jensen Shannon Divergence (JSD) between the class distribution of a pre-trained classifier over real data and generator’s data. This can directly tell us how well the distribution over classes are captured. JSD is favorable to KL due to being bounded and symmetric. For intra mode variation, we define mean square geodesic distance (MSD): the average squared geodesic distance between pairs of samples classified into each class. To compute the geodesic distance, Euclidean distance is used in a small neighborhood of each sample to construct the Isomap graph [26] over which a shortest path distance is calculated. This shortest path distance is an approximation to the geodesic distance on the true image manifold [25]. Note that average square distance, for Euclidean distance, is equal to twice the trace of the Covariance matrix, i.e. sum of the eigenvalues of covariance matrix, and therefore can be an indicator of the variance within each class: Ex,y  ||x −y||2 = 2Ex  xT x  −2Ex [x]T Ex [x] = 2Tr(Cov(x)) In our experiments, we choose the smallest k for which the constructed k nearest neighbors graph (Isomap) is connected in order to have a better approximation of the geodesic distance (k = 18). Another concept we would like to evaluate is sample quality. Given a pretrained classifier with small test error, samples that are classified with high confidence can be reasonably considered good quality samples. We plot the ratio of samples classified with confidence greater than a threshold, versus the confidence threshold, as a measure of sample quality: the more off real-manifold samples, the lower the resulting curve. Note that the results from this plot are exclusively indicative of sample quality and should be considered in conjunction with the aforementioned metrics. What if the generative model memorizes the dataset that it is trained on? Such a model would score perfectly on all our metrics, while providing no generalization at all. First, note that a single generator GAN model can not memorize the dataset because it can not learn a distribution supported on N disjoint components as discussed in Section 2. Second, while our modifications introduces disconnnectedness to GANs, the number of generators we use in our proposed modifications are in the order of data submanifolds which is several orders of magnitude less than common dataset sizes. Note that if we were to assign one unique point of the Z space to each dataset sample, then a neural network could learn to memorize the dataset by mapping each selected z ∈Z to its corresponding real sample (we have introduced N disjoint component in Z space in this case), however this is not how GANs are modeled. Therefore, the memorization issue is not of concern for common GANs and our proposed models (note that this argument is addressing the very narrow case of dataset memorization, not over-fitting in general). 4 Related Works Several recent works have directly targeted the mode collapse problem by introducing a network F : X →Z that is trained to map back the data into the latent space prior p(z). It can therefore provide a learning signal if the generated data has collapsed. ALI [8] and BiGAN [7] consider pairs of data and corresponding latent variable (x, z), and construct their discriminator to distinguish such pairs of real and generated data. VEEGAN [24] uses the same discriminator, but also adds an explicit reconstruction loss Ez∼p(z)  ||z −Fθ(Gγ(z))||2 2  . The main advantage of these models is to prevent loss of information by the generator (mapping several z ∈Z to a single x ∈X). However, in case of distributions with disconnected support, these models do not provide much advantage over common GANs and suffer from the same issues we discussed in Section 2 due to having a single generator. Another set of recent works have proposed using multiple generators in GANs in order to improve their convergence. MIX+GAN [3] proposes using a collection of generators based on the well-known advantage of learning a mixed strategy versus a pure strategy in game theory. MGAN [14] similarly uses a collection of k generators in order to model a mixture distribution, and train them together with a k-class classifier to encourage them to each capture a different component of the real mixture distribution. MAD-GAN [9], also uses k generators, together with a k + 1-class discriminator which is trained to correctly classify samples from each generator and true data (hence a k + 1 classifier), 6 Model JSD MNIST ×10−2 JSD Face-Bed ×10−4 FID Face-Bed WGAN-GP 0.13 std 0.05 0.23 std 0.15 8.30 std 0.27 MIX+GAN 0.17 std 0.08 0.83 std 0.57 8.02 std 0.14 DMWGAN 0.23 std 0.06 0.46 std 0.25 7.96 std 0.08 DMWGAN-PL 0.06 std 0.02 0.10 std 0.05 7.67 std 0.16 Table 1: Inter-class variation measured by Jensen Shannon Divergence (JSD) with true class distribution for MNIST and Face-Bedroom dataset, and FID score for Face-Bedroom (smaller is better). We run each model 5 times with random initialization, and report average values with one standard deviation interval in order to increase the diversity of generated images. While these models provide reasons for why multiple generators can model mixture distributions and achieve more diversity, they do not address why single generator GANs fail to do so. In this work, we explain why it is the disconnectedness of the support that single generator GANs are unable to learn, not the fact that real data comes from a mixture distribution. Moreover, all of these works use a fixed number of generators and do not have any prior learning, which can cause serious problems in learning of distributions with disconnected support as we discussed in Section 3.1 (see Figures 2c and 3b for examples of this issue). Finally, several works have targeted the problem of learning the correct manifold of data. MDGAN [5], uses a two step approach to closely capture the manifold of real data. They first approximate the data manifold by learning a transformation from encoded real images into real looking images, and then train a single generator GAN to generate images similar to the transformed encoded images of previous step. However, MDGAN can not model distributions with disconnected supports. InfoGAN [6] introduces auxiliary dimensions to the latent space Z, and maximizes the mutual information between these extra dimensions and generated images in order to learn disentangled representations in the latent space. DeLiGAN [12] uses a fixed mixture of Gaussians as its latent prior, and does not have any mechanisms to encourage diversity. While InfoGAN and DeLiGAN can generate disconnected manifolds, they both assume a fixed number of discreet components equal to the number of underlying classes and have no prior learning over these components, thus suffering from the issues discussed in Section 3.1. Also, neither of these works discusses the incapability of single generator GANs to learn disconnected manifolds and its consequences. 5 Experiments In this section we present several experiments to investigate the issues and proposed solutions mentioned in Sections 2 and 3 respectively. The same network architecture is used for the discriminator and generator networks of all models under comparison, except we use 1 4 number of filters in each layer of multi-generator models compared to the single generator models, to control the effect of complexity. In all experiments, we train each model for a total of 200 epochs with a five to one update ratio between discriminator and generator. Q, the encoder network, is built on top of discriminator’s last hidden layer, and is trained simultaneously with generators. Each data batch is constructed by first selecting 32 generators according to the prior r(c; ζ), and then sampling each one using z ∼U(−1, 1). See Appendix B for details of our networks and the hyperparameters. Disjoint line segments. This dataset is constructed by sampling data with uniform distribution over four disjoint line segments to achieve a distribution supported on a union of disjoint low-dimensional manifolds. See Figure 2 for the results of experiments on this dataset. In Figure 3, an unbalanced version of this dataset is used, where 0.7 probability is placed on the top right line segment, and the other segments have 0.1 probability each. The generator and discriminator are both MLPs with two hidden layers, and 10 generators are used for multi-generator models. We choose WGAN-GP as the state of the art GAN model in these experiments (we observed similar or worse convergence with other flavors of single generator GANs). MGAN achieves similar results to DMWGAN. MNIST dataset. MNIST [16] is particularly suitable since samples with different class labels can be reasonably interpreted as lying on disjoint manifolds (with minor exceptions like certain 4s and 9s). The generator and discriminator are DCGAN like networks [22] with three convolution layers. Figure 4 shows the mean squared geodesic distance (MSD) and Table 1 reports the corresponding 7 0 1 2 3 4 5 6 7 8 9 Modes 0 1000 2000 3000 4000 5000 6000 7000 MSD Average Distance over Modes Real DMWGAN-PL WGAN-GP (a) Intra-class variation MNIST 0.0 0.2 0.4 0.6 0.8 1.0 Confidence 0.0 0.2 0.4 0.6 0.8 1.0 Sample Ratio Sample Quality Real DMWGAN-PL WGAN-GP (b) Sample quality MNIST 0.0 0.2 0.4 0.6 0.8 1.0 Confidence 0.0 0.2 0.4 0.6 0.8 1.0 Sample Ratio Sample Quality Real DMWGAN-PL DMWGAN MIXGAN WGAN-GP (c) Sample quality Face-Bed Figure 4: (a) Shows intra-class variation in MNIST. Bars show the mean square distance (MSD) within each class of the dataset. On average, DMGAN-PL outperforms WGAN-GP in capturing intra class variation, as measured by MSD, with larger significance on certain classes. (b) Shows the sample quality in MNIST experiment. (c) Shows sample quality in Face-Bed experiment. Notice how DMWGAN-PL outperforms other models due to fewer off real-manifold samples. We run each model 5 times with random initialization, and report average values with one standard deviation intervals in both figures. 10K samples are used for metric evaluations. (a) WGAN-GP (b) DMWGAN (c) DMWGAN-PL Figure 5: Samples randomly generated by GAN models trained on Face-Bed dataset. Notice how WGAN-GP generates combined face-bedroom images (red boxes) in addition to faces and bedrooms, due to learning a connected cover of the real data support. DMWGAN does not generate such samples, however it generates completely off manifold samples (red boxes) due to having redundant generators and a fixed prior. DMWGAN-PL is able to correctly learn the disconnected support of real data. The samples and trained models are not cherry picked. divergences in order to compare their inter mode variation. 20 generators are used for multi-generator models. See Appendix C for experiments using modified GAN objective. Results demonstrate the advantage of adding our proposed modification on both GAN and WGAN. See Appendix D for qualitative results. Face-Bed dataset. We combine 20K face images from CelebA dataset [17] and 20K bedroom images from LSUN Bedrooms dataset [27] to construct a natural image dataset supported on a disconnected manifold. We center crop and resize images to 64 × 64. 5 generators are used for multi-generator 8 (a) 0 100000 200000 300000 400000 500000 Iterations 0.00 0.02 0.04 0.06 0.08 0.10 0.12 Probability RL Policy (b) (c) 0 100000 200000 300000 400000 500000 Iterations 0.0 0.1 0.2 0.3 0.4 0.5 Probability RL Policy (d) Figure 6: DMWGAN-PL prior learning during training on MNIST with 20 generators (a,b) and on Face-Bed with 5 generators (c, d). (a, c) show samples from top generators with prior greater than 0.05 and 0.2 respectively. (b, d) show the probability of selecting each generator r(c; ζ) during training, each color denotes a different generator. The color identifying each generator in (b) and the border color of each image in (a) are corresponding, similarly for (d) and (c). Notice how prior learning has correctly learned probability of selecting each generators and dropped out redundant generators without any supervision. models. Figures 4c, 5 and Table 1 show the results of this experiment. See Appendix E for more qualitative results. 6 Conclusion and Future Works In this work we showed why the single generator GANs can not correctly learn distributions supported on disconnected manifolds, what consequences this shortcoming has in practice, and how multigenerator GANs can effectively address these issues. Moreover, we showed the importance of learning a prior over the generators rather than using a fixed prior in multi-generator models. However, it is important to highlight that throughout this work we assumed the disconnectedness of the real data support. Verifying this assumption in major datasets, and studying the topological properties of these datasets in general, are interesting future works. Extending the prior learning to other methods, such as learning a prior over shape of Z space, and also investigating the effects of adding diversity to discriminator as well as the generators, also remain as exciting future paths for research. Acknowledgement This work was supported by Verisk Analytics and NSF-USA award number 1409683. 9 References [1] Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017. [2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International Conference on Machine Learning, pages 214–223, 2017. [3] Sanjeev Arora, Rong Ge, Yingyu Liang, Tengyu Ma, and Yi Zhang. Generalization and equilibrium in generative adversarial nets (gans). arXiv preprint arXiv:1703.00573, 2017. [4] Shane Barratt and Rishi Sharma. A note on the inception score. arXiv preprint arXiv:1801.01973, 2018. [5] Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016. [6] Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. Infogan: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, pages 2172–2180, 2016. [7] Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016. [8] Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Olivier Mastropietro, Alex Lamb, Martin Arjovsky, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016. [9] Arnab Ghosh, Viveka Kulharia, Vinay Namboodiri, Philip HS Torr, and Puneet K Dokania. Multi-agent diverse generative adversarial networks. arXiv preprint arXiv:1704.02906, 2017. [10] 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. [11] 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. [12] Swaminathan Gurumurthy, Ravi Kiran Sarvadevabhatla, and V Babu Radhakrishnan. Deligan: Generative adversarial networks for diverse and limited data. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), volume 1, 2017. [13] 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, pages 6629–6640, 2017. [14] Quan Hoang, Tu Dinh Nguyen, Trung Le, and Dinh Phung. MGAN: Training generative adversarial nets with multiple generators. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rkmu5b0a-. [15] John L Kelley. General topology. Courier Dover Publications, 2017. [16] Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998. [17] 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. [18] Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are gans created equal? a large-scale study. arXiv preprint arXiv:1711.10337, 2017. [19] Lars Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for gans do actually converge? arXiv preprint arXiv:1801.04406, 2018. [20] Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. arXiv preprint arXiv:1611.02163, 2016. [21] Vaishnavh Nagarajan and J Zico Kolter. Gradient descent gan optimization is locally stable. In Advances in Neural Information Processing Systems, pages 5591–5600, 2017. [22] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. 10 [23] 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, pages 2234–2242, 2016. [24] 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, pages 3310–3320, 2017. [25] Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. Science, 290(5500):2319–2323, 2000. [26] Ming-Hsuan Yang. Extended isomap for pattern classification. In AAAI/IAAI, pages 224–229, 2002. [27] Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 11
2018
193
7,356
Automating Bayesian optimization with Bayesian optimization Gustavo Malkomes, Roman Garnett Department of Computer Science and Engineering Washington University in St. Louis St. Louis, MO 63130 {luizgustavo, garnett}@wustl.edu Abstract Bayesian optimization is a powerful tool for global optimization of expensive functions. One of its key components is the underlying probabilistic model used for the objective function f. In practice, however, it is often unclear how one should appropriately choose a model, especially when gathering data is expensive. We introduce a novel automated Bayesian optimization approach that dynamically selects promising models for explaining the observed data using Bayesian optimization in model space. Crucially, we account for the uncertainty in the choice of model; our method is capable of using multiple models to represent its current belief about f and subsequently using this information for decision making. We argue, and demonstrate empirically, that our approach automatically finds suitable models for the objective function, which ultimately results in more-efficient optimization. 1 Introduction Global optimization of expensive, potentially gradient-free functions has long been a critical component of many complex problems in science and engineering. As an example, imagine that we want to tune the hyperparameters of a deep neural network in a self-driving car. That is, we want to maximize the generalization performance of the machine learning algorithm, but the functional form of the objective function f is unknown and even a single function evaluation is costly — it might take hours (or even days!) to train the network. These features render the optimization particularly difficult. Bayesian optimization has nonetheless shown remarkable success on optimizing expensive gradientfree functions [8, 1, 18]. Bayesian optimization works by maintaining a probabilistic belief about the objective function and designing a so-called acquisition function that intelligently indicates the most-promising locations to evaluate f next. Although the design of acquisition functions has been the subject of a great deal of research, how to appropriately model f has received comparatively less attention [17], despite being a decisive factor for performance. In fact, this was considered the most important problem in Bayesian optimization by Moˇckus [12], in a seminal work in the field: “The development of some system of a priori distributions suitable for different classes of the function f is probably the most important problem in the application of [the] Bayesian approach to ... global optimization” (Moˇckus 1974, p. 404). In this work, we develop a search mechanism for appropriate surrogate models (prior distributions) to the objective function f. Inspired by Malkomes et al. [11], our model-search procedure operates via Bayesian optimization in model space. Our method does not prematurely commit to a single model; instead, it uses several models to form a belief about the objective function and plan where the next evaluation should be. Our adaptive model averaging approach accounts for model uncertainty, which more realistically copes with the limited information available in practical Bayesian optimization 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. observations D true function predictive mean 95% credible interval expected improvement next observation location Figure 1: Importance of model selection in Bayesian optimization. Top left: one model represents the belief about the objective. Top right: a mixture of models selected by our approach represents the belief about f. Bottom: the acquisition function value (expected improvement) computed using the respective beliefs about the objective. ABO places the next observation at the optimum. applications. In Figure 1, we show two instances of Bayesian optimization where our goal is to maximize the red objective function f. Both instances use expected improvement as acquisition function. The difference between is the belief about f: using a single model (left) or combining several models using our automated Bayesian optimization (ABO) approach (right). A single model does not capture the nuances of the true function. In contrast, ABO captures the linear increasing trend of the true function and produces a credible interval which successfully captures the function’s behavior. Consequently, ABO finds the optimum in the next iteration. Finally, we demonstrate empirically that our approach is consistently competitive with or outperforms other strong baselines across several domains: benchmark functions for global optimization functions, hyperparameter tuning of machine learning algorithms, reinforcement learning for robotics, and determining cosmological parameters of a physical model of the Universe. 2 Bayesian optimization with multiple models Suppose we want to optimize an expensive, perhaps black-box function f : X →R on some compact set X ⊆X. We may query f at any point x and observe a possibly noisy value y = f(x) + ε. Our ultimate goal is to find the global optimum: xOPT = arg min x∈X f(x) (1) through a sequence of evaluations of the objective function f. This problem becomes particularly challenging when we may only make a limited number of function evaluations, representing a realworld budget B limiting the total cost of evaluating f. Throughout this text, we denote by D a set of gathered observations D = (X, y), where X is a matrix aggregating the input variables xi ∈X, and y is the respective vector of observed values yi = f(xi) + ε. Modeling the objective function. Assume we are given a prior distribution over the objective function p(f) and, after observing new information, we have means of updating our belief about f using Bayes’ rule: p(f | D) = p(D | f)p(f) p(D) . (2) The posterior distribution above is then used for decision making, i.e., selecting the x we should query next. When dealing with a single model, the posterior distribution (2) suffices. Here, however, 2 we want to make our model of f more flexible, accounting for potential misspecification. Suppose we are given a collection of probabilistic models {Mi} that offer plausible explanations for the data. Each model M is a set of probability distributions indexed by a parameter θ from the corresponding model’s parameter space ΘM. With multiple models, we need a means of aggregating their beliefs. We take a fully Bayesian approach and we use the model evidence (or marginal likelihood), the probability of generating the observed data given a model M, p(y | X, M) = Z p(y | X, θ, M) p(θ | M) dθ, (3) as the key quantity for measuring the fit of each model to the data. The evidence integrates over the parameters θ to compute the probability of the model generating the observed data under a hyperprior distribution p(θ | M). Given (3), one can easily compute the model posterior, p(M | D) = p(y | X, M)p(M) p(y | X) = p(y | X, M)p(M) P i p(y | X, Mi)p(Mi), (4) where p(M) represents a prior probability distribution over the models. The model posterior gives us a principled way of combining the beliefs of all models. Our model of f can now be summarized with the following model-marginalized posterior distribution: p(f | D) = X i p(Mi | D) Z p(f | D, θ, Mi)p(θ | D, Mi) dθ | {z } p(f|D,Mi) . (5) Note that (5) takes into consideration all plausible models {Mi} and the integral p(f | D, Mi) accounts for the uncertainty in each model’s hyperparameters θ ∈ΘMi. Unfortunately, the latter is often intractable and we will discuss means of approximating it in Section 4.2. Next, we describe how to use the model-marginalized posterior to intelligently optimize the objective function. Selecting where to evaluate next. Given our belief about f, we want to use this information to select which point x we want to evaluate next. This is typically done by maximizing an acquisition function α: X →R. Instead of solving (1) directly, we optimize the proxy (and simpler) problem x∗= arg max x∈X α(x; D). (6) We use expected improvement (EI) [12] as our acquisition function. Suppose that f ′ is the minimal value observed so far.1 EI selects the point x that, in expectation, improves upon f ′ the most: αEI(x ; D, M) = Ey  max(f ′ −y, 0) | x, D, M  . (7) Note that if p(y | x, D, M) is a Gaussian distribution (or can be approximated as one), the expected improvement can be computed in closed form. Usually, acquisition functions are evaluated for a given model choice M. As before, we want to incorporate multiple models in this framework. For EI, we can easily take into account all models as follows: αEI(x ; D) = Ey,M  max(f ′ −y, 0) | x, D  = EM  αEI(x ; D, M)  . (8) We could also derive similar results for other acquisition functions such as probability of improvement [9] and GP upper confidence bound (GP-UCB) [19]. 3 Automated model selection for fixed-size datasets Before introducing our automated method for Bayesian optimization, we need to review a previously proposed method for automated model selection of fixed-size datasets. We begin with a brief introduction to Gaussian processes and a description of the model space we adopted in this paper. Gaussian processes models. We take a standard nonparametric approach and place a Gaussian process (GP) prior distribution on f, p(f) = GP(f; µ, K), where µ: X →R is a mean function and K : X × X →R is a positive-semidefinite covariance function or kernel. Both µ and K may have hyperparameters, which we conveniently concatenate into a single vector θ. To connect to our 1We make a simplifying assumption that the noise level is small, thus f ′ ≈mini µf|D(xi) and y(x) ≈f(x). 3 framework, a GP model M comprises µ, K, and a prior over its associated hyperparameters p(θ). Thanks to the elegant marginalization properties of the Gaussian distribution, computing the posterior distribution p(f | θ, D) can be done in closed form, if we assume a standard Gaussian likelihood observation model, ε ∼N(0, σ2). For a more detailed introduction to GPs, see [16]. Gaussian processes are extremely powerful modeling tools. Their success, however, heavily depends on an appropriate choice of the mean function µ and covariance function K. In some cases, a domain expert might have an informative opinion about which GP model could be more fruitful. Here, however, we want to avoid human intervention and propose an automatic approach. Space of models. First we need a space of GP models that is general enough to explain virtually any dataset. We adopt the generative kernel grammar of [2] due to its ability to create arbitrarily complex models. We start with a set of so-called base (one-dimensional) kernels, such as the common squared exponential (SE) and rational quadratic (RQ) kernels. Then, we create new and potentially more complex kernels by summation and multiplication, over individual dimensions, of the base kernels. This let us create kernels over multidimensional inputs. As a result, we have a space of kernels that allows one to search for appropriate structures (different kernel choices) as well as relevant features (subsets of the input). Now, we need an efficient method for searching models from this given space. Fortunately, this was accomplished by the work of [11], which we summarize next. Bayesian optimization for model search. Suppose we are given a space of probabilistic models M such as the above-cited generative kernel grammar. As mentioned before, the key quantity for model comparison in a Bayesian framework is the model evidence (3). Previous work has shown that we can search for promising models M ∈M by viewing the evidence as a function g: M →R to be optimized [11]. Their method consists of a Bayesian optimization approach to model selection (BOMS), in which we try to find the optimal model MOPT = arg max M∈M g(M; D), (9) where g(M; D) is the (log) model evidence: g(M; D) = log p(y | X, M). Two key aspects of their method deserve special attention: their unusual GP prior, p(g) = GP(g; µg, Kg), where the mean and covariance functions are appropriately defined over the model space M; and their heuristic for traversing M by maintaining a set of candidate models C. The precise mechanism for traversing the space of models is not particular relevant for our exposition, but the fact that C is changing as we search for better models is. Due to limited space, we refer the reader to the original work for more information. Nevertheless, it is important to note that their approach was shown to be more efficient than previous methods. 4 Automating Bayesian optimization with Bayesian optimization Here, we present our automated Bayesian optimization (ABO) algorithm. ABO is a two-level Bayesian optimization procedure. The “outer level” solves the standard Bayesian optimization problem, where we want to search for the optimum of the objective function f. Inside the Bayesian optimization loop, we use a second “inner” Bayesian optimization, where the goal is to search for appropriate models {Mi} to the objetive function f. The inner optimization seeks models maximizing the model evidence as in BOMS (Section 3). The motivation is to refine the set of models {Mi} before choosing where we want to query the (expensive) objective function f next. Given a set of models, we can use the methodology presented in Section 2 to perform Bayesian optimization with multiple models. In the next subsection, we will describe the inner Bayesian optimization method which we refer to as active BOMS (ABOMS). Before going to the second Bayesian optimization level, we summarize ABO in Algorithm 1. First, we initialize our set of promising models {Mi} with random models chosen from the grammar of kernel, same used in [2]. To select these models, we perform random walks from the the empty kernel and repeatedly apply a random number of grammatical operations. The number of operations is sampled from a geometric distribution with termination probability of 1 3. Then, at each iteration: we update all models with current data, computing the corresponding model evidence of each model; use ABOMS (the inner model-search optimization) to include more promising candidate models in {Mi}; exclude all models that are unlikely to explain the current data, those with p(M | D) < 10−4; sample the function at location x∗using (8) and all models {Mi}; finally, we evaluate y∗= f(x∗) + ε and include this new observation in our dataset. 4 Algorithm 1 Automated Bayesian Optimization Input: function f, budget B, initial data D {Mi} ←Initial set of promising models repeat {Mi} ←update models ({Mi}, D) {Mi} ←ABOMS({Mi}, D) p(M | D) ←compute model posterior discard irrelevant models p(Mi | D) < 10−4 x∗←arg maxx∈X αEI(x ; D). y∗←f(x∗) + ε D ←D ∪{(x∗, y∗)} until budget B is depleted 4.1 Active Bayesian optimization for model search The critical component of ABO is the inner optimization procedure that searches for suitable models to the objective function: the active Bayesian optimization for model search (ABOMS). Notice that the main challenge is that ABOMS is nested in a Bayesian optimization loop, meaning that both data and models will change as we perform more outer Bayesian optimization iterations. Suppose we already gathered some observations D of the objective function f. Additionally, we use the previously proposed BOMS (Section 3) as the inner model search procedure. Inside BOMS, we tried different models, gathering observations of the (log) model evidence, g(M; D) = log p(y | X, M). We denote by Dg = {Mj, g(Mj; D)} the observations of the inner Bayesian optimization. After one loop of the outer Bayesian optimization, we obtain new data D′ = D ∪{(x∗, y∗)}. Now, the model evidence of all previously evaluated models Dg changes since g(Mj, D) ̸= g(Mj, D′) for all j. As a result, we would have to retrain all models in Dg to correctly compare them. Recall that there are good models in Dg for explaining the objective function f. These models will be passed to the outer Bayesian optimization, where they will be updated — ultimately, we want to provide outstanding suggestions x∗for where to query f next, thus they need to be retrained. A large portion of the tested models in Dg, however, are not appropriated for modeling f; in fact, they can be totally ignored by the outer optimization. Yet these “bad” models can help guide the search toward more-promising regions of model space. How to retain information from previously evaluated models without resorting to exhaustive retraining? Our answer is to modify BOMS in two ways. First, we place a GP on the normalized model evidence, g(M; D) = log p(y | X, M) / |D|, which let us compare models across iterations. Second, we assume that each evidence evaluation is corrupted by noise, the variance of which depends on the number of data points used to compute it: the more data we use, the more accurate our estimate, and the lower the noise. More specifically, we use the same GP prior of [11], p(g) = GP(g; µg, Kg), where µg : M →R is just a constant mean function and Kg : M2 →R is the “kernel kernel” defined as a squared exponential kernel that uses the (averaged) Hellinger distance between the inputs as oppose to the standard ℓ2 norm (see the original paper for more details). Our observation model, however, assumes that the observations of the normalized model evidence are corrupted by heterogenous noise: yg(M; Dn) = g(M; Dn) n + ε  1 n  . (10) To choose the amount of noise, we observed that, using the chain rule, the marginal likelihood can be written as log p(y | X, M) = P i log p yi | xi,  (xj, yj) | j < i , M  , which is the sum of the marginal predictive log likelihoods for the points in the D. When we divide log p(y | X, M) by |D| = n, we can interpret the result as an estimate of the average predictive log marginal likelihood.2 Therefore, if log p(y | X, M)/n ≈E  log p(y∗| x∗, D, M) | M  , then the variance of this estimate with n measurements is Var h log p yi | xi,  (xj, yj) | j < i , M i /n. 2Note that the training data is not independent since we are choosing the locations x, and we are not assuming that n →∞ 5 which shrinks like σ2 g/n for a small constant σg (e.g., 0.5). For large n it goes to 0. This mechanism gracefully allows us to condition on the history of all previously proposed models during the search. By modeling earlier evidence computations as noisier, we avoid recomputing the model evidence of previous models every round, but we still make the search for good models better informed. 4.2 Implementation In practice, several distributions presented above are often intractable for GPs. Now, we discuss how to efficiently approximate these quantities. First, instead of using just a delta approximation to the hyperparameter posterior p(θ | D, M), e.g. MLE/MAP, we use a Laplace approximation, i.e., we make a second-order Taylor expansion around its mode: ˆθ = arg maxθ log p(θ | D, M). This results in a multivariate Gaussian approximation: p(θ | D, M) ≈N(θ; ˆθ, Σ) where Σ−1 = −∇2 log p(θ | D, M) θ=ˆθ. Conveniently, the Laplace approximation also give us a means of approximating the model evidence: log p(y | X, M) ≈log p(y | X, ˆθ, M) + log p(ˆθ | M) −1 2 log det Σ−1 + d 2 log 2π, where d is the dimension of θ. The above approximation can be interpreted as rewarding explaining the data well while penalizing model complexity [13, 15]. Next consider the posterior distribution p(f | D, M), which is an integral over the model’s hyperparameters. This distribution is intractable, even with our Gaussian approximation to the hyperparameter posterior p(θ | D, M) ≈N(θ; ˆθ, Σ). We use a general approximation technique originally proposed by [14] (Section 4) in the context of Bayesian quadrature. This approach assumes that the posterior mean of p(f ∗| x∗, D, θ, M) is affine in θ around ˆθ and the GP covariance is constant. Let µ∗(θ) = E[f ∗| x∗, D, θ, M] and ν∗(θ) = Var[f ∗| x∗, D, θ, M] be the posterior predictive mean and variance of f ∗. The result of this approximation is that the posterior distribution of f ∗is approximated by p(f ∗| x∗, D, M) ≈N f ∗; µ∗(ˆθ), σ2 AFFINE  , where σ2 AFFINE =  ∇µ∗(ˆθ) ⊤Σ  ∇µ∗(ˆθ)  . This approach was shown to be a good alternative for propagating the uncertainty in the hyperparameters [14]. Finally, given the Gaussian approximations above (11), we use standard techniques to analytically approximate the predictive distribution: p(y∗| x∗, D, M) = Z p(y∗| f ∗) p(f ∗| x∗, D, M) df ∗. Our code and data will be available online: https://github.com/gustavomalkomes/abo. 5 Related Work Our approach is inspired by some recent developments in the field of automated model selection [11, 2, 6]. Here, we take these ideas one step further and consider automated model selection when actively acquiring new data. Gardner et al. [3] also tackled the problem of model selection in an active learning context but with a different goal. Given a fixed set of candidate models, the authors proposed a method for gathering data to quickly identify which model best explains the data. Here our ultimate goal is to perform global optimization (1) when we can dynamically change our set of models. In future work, it would be interesting to examine whether it may be possible to combine our ideas with their proposed method to actively learn in model space. More recently, Gardner et al. [4] developed an automated model search for Bayesian optimization similar to our method. Their approach, however, uses a MCMC strategy for sampling new promising models, whereas we adapt the Bayesian optimization search of proposed by Malkomes et al. [11]. We will discuss further differences between our approach and their MCMC method in the next section. 6 10 30 50 70 90 −1.42 −1.4 −1.38 −1.36 Function evaluations Log objective function SE BOM MCMC ABO (a) SVM 10 30 50 70 90 7.14 7.15 7.16 7.17 Function evaluations (b) LDA 10 30 50 70 90 −2.7 −2.6 −2.5 −2.4 Function evaluations (c) Logistic Regression 10 30 50 70 90 2.1 2.2 2.3 2.4 Function evaluations Log objective function (d) Neural Network Boston 10 20 30 40 50 −2 −1 0 1 Function evaluations (e) Robot pushing 3D 10 20 30 40 50 2 4 6 8 Function evaluations (f) Cosmological constants Figure 2: Averaged minimum observed function value and standard error of all methods for several objective functions. For better visualization, we omit the first 10 function evaluations since they are usually much higher than the final observations. 6 Empirical Results We validate our approach against several optimization alternatives and across several domains. Our first baseline is a random strategy that selects twice as many locations as the other methods. We refer to this strategy as RANDOM 2× [10]. We also consider a competitive Bayesian optimization implementation which uses a single non-isotropic squared exponential kernel (SE), expected improvement as the acquisition function and all the approximations described in Section 4.2. Then, we considered two more baselines that represent the uncertainty about the unknown function through a combination of multiple models. One baseline uses the same collection of predefined models throughout its execution; we refer to this approach as the bag of models (BOM). The other is an adaptation of the method proposed in [4], here referred as MCMC, which, similar to ABO, is allowed to dynamically select more models every iteration. Instead of using the additive class of models proposed in the original work, we adapted their Metropolis–Hastings algorithm to the more-general compositional grammar proposed by Duvenaud et al. [2], which is also used by our method. This choice lets us compare which adaptive strategy performs better in practice. Specifically, given an initial model M, the MCMC proposal distribution randomly selects a neighboring model M′ from the grammar. Then we compute the acceptance probability as in [4]. All multiple models strategies (BOM, MCMC and ABO) start with the same selection of models (See Section 4) and they aim to maximize the model-marginalized expected improvement (8). Both adaptive algorithms (ABO and MCMC) are allowed to perform five model evidence computations before each function evaluation; ABO queries five new models and MCMC performs five new proposals. In our experiments, we limited the number of models to 50, always keeping those with the higher model evidence. Model choice and acquisition functions apart, we kept all configurations the same. All methods used L-BFGS to optimize each model’s hyperparameters. To avoid bad local minima, we perform two restarts, each begining from a sample of p(θ | M). All the approximations described in Section 4.2 were also used. We maximized the acquisition functions by densely sampling 1000d2 points from a d-dimensional low-discrepancy Sobol sequence, and starting MATLAB fmincon (a 7 Table 1: Results for the average gap performance across 20 repetitions for different test functions and methods. RANDOM 2× (R 2×) results are averaged across 1000 experiments. Numbers that are not significantly different from the highest average gap for each function are bolded (one-sided paired Wilcoxon signed rank test, 5% significance level). function d R 2× SE BOM MCMC ABO Ackley 2d 2 0.422 0.717 0.984 0.988 0.980 Beale 2 0.725 0.541 0.644 0.596 0.688 Branin 2 0.743 1.000 0.950 0.996 0.998 Eggholder 2 0.461 0.516 0.529 0.546 0.579 Six-Hump Camel 2 0.673 0.723 0.988 0.992 0.998 Drop-Wave 2 0.458 0.496 0.421 0.447 0.481 Griewank 2d 2 0.669 0.924 0.954 0.941 0.964 synthetic Rastrigin 2 0.538 0.410 0.832 0.827 0.850 objectives Rosenbrock 2 0.787 1.000 0.999 0.993 0.999 Shubert 2 0.337 0.384 0.374 0.332 0.481 Hartmann 3 0.682 1.000 0.970 0.999 1.000 Levy 3 0.669 0.774 0.913 0.942 0.971 Rastrigin 4d 4 0.414 0.261 0.823 0.715 0.821 Ackley 5d 5 0.299 0.736 0.409 0.886 0.809 Griewank 5d 5 0.605 0.971 0.756 0.974 0.968 mean gap 0.566 0.697 0.770 0.812 0.839 median gap 0.605 0.723 0.832 0.941 0.964 SVM 3 0.903 0.912 0.840 0.938 0.956 LDA 3 0.939 0.950 0.925 0.950 0.950 Logistic regression 4 0.928 0.774 0.899 0.936 0.994 Robot pushing 3d 3 0.815 0.927 0.878 0.967 0.935 real-world Robot pushing 4d 4 0.824 0.748 0.619 0.668 0.715 objectives Neural network Boston 4 0.491 0.594 0.703 0.640 0.757 Neural network cancer 4 0.845 0.645 0.682 0.773 0.749 Cosmological constants 9 0.739 0.848 0.859 0.984 0.999 mean gap 0.810 0.800 0.801 0.857 0.882 median gap 0.834 0.811 0.850 0.937 0.943 local optimizer) from the sampled point with highest value. Each experiment, was repeated 20 times with five random initial examples, which were the same for all Bayesian optimization methods. RANDOM 2× results were averaged across 1000 repetitions. Benchmark functions for global optimization. Our first set of experiments are test functions commonly used as benchmarks for optimization [20]. We adopted a similar setup as previous works [5] but included more test functions. The goal is to find the global minimum of each test function given a limited number of function evaluations. We provide more information about the chosen functions in the supplementary material. The maximum number of function evaluations was limited to 10 times the dimensionality of the function domain being optimized. We report the gap measure [7], defined as f(xfirst)−f(xbest) f(xfirst)−f(xOPT), where f(xfirst) is the minimum function value among the first initial random points, f(xbest) is the best value found by the method, and f(xOPT) is the optimum. Table 1 (top) shows the results for different functions and methods. For each test function, we perform a one-sided Wilcoxon signed rank test at the 5% significance level with each method and the one that had the highest average performance. All results that are not significantly different than the highest are marked in bold. First, note that RANDOM 2× performs poorly in these synthetic constructed “hard” functions. Then, observe that the overall performance of all multi-model methods is higher than the single GP baseline, with ABO leading these algorithms with respect to the mean and median gap performance over all functions. In fact, ABO’s performance is comparable to the best method for 11 out of 15 functions. 8 0 0.2 0.4 0.6 0.8 1 0.4 0.6 0.8 Fraction of Total Number of Function Evaluations Gap Measure ABO MCMC R 2× BOM SE R 1× Figure 3: Average gap across the eight real-world objective functions vs. fraction of total number of function evaluations. Here, we display the performance of random search (R 1×) for reference. Real-world optimization functions. To further investigate the importance of model search, we consider a second set of functions used in recent publications. Our goal was to select a diverse and challenging set of functions which might better demonstrate the performance of these algorithms in a real application. More information about these functions is given in the supplementary material. We show the gap measure for the second set of experiments in Table 1 (bottom) and perform the same statistical test as before. For computing the gap measure in these experiments, when the true global minimum is unknown, we used the minimum observed value across all experiments as a proxy for the optimal value. In Figure 3 we show the average gap measure across all eight test functions as a function of the total number of functions evaluations allowed. In Figure 2, we show the averaged minimum observed function value and standard error of all methods for 6 out of the 8 functions (see supplementary material for the other two functions). With more practical objective functions, the importance of model search becomes more clear. ABO either outperforms the other methods (4 out of the 8 datasets) or achieves the lowest objective function. Figure 3 also shows that ABO quickly advances on the search for the global minimum — on average, the gap measure is higher than 0.8 after at half of the budget. Interestingly, RANDOM 2× also performs well for 2 out of these 8 datasets, those are the problems in which all methods have a similar performance, suggesting that these functions are easier to optimize than the others. Naturally, training more models and performing an extra search to dynamically select models require more computation than running a standard single Bayesian optimization. In our implementation, not optimized for speed, the median wall clock across all test functions for updating and searching the five new models was 65 and 41 seconds, respectively, for MCMC and ABO. Note that the model update is what dominates this procedure for both methods, with MCMC tending to select more complex models than ABO. In practice, one could perform this step in parallel with the expensive objective function evaluation, requiring no additional overhead besides the cost of optimizing the model-marginal acquisition function, which can also be adjusted by the user. 7 Conclusion We introduced a novel automated Bayesian optimization approach that uses multiple models to represent its belief about an objective function and subsequently decide where to query next. Our method automatically and efficiently searches for better models as more data is gathered. Empirical results show that the proposed algorithm often outperforms the baselines for several different objective functions across multiple applications. We hope that this work can represent a step towards a fully automated system for Bayesian optimization that can be used by a nonexpert on arbitrary objectives. 9 Acknowledgments GM, and RG were supported by the National Science Foundation (NSF) under award number IIA– 1355406. GM was also supported by the Brazilian Federal Agency for Support and Evaluation of Graduate Education (CAPES). References [1] James S. Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for hyperparameter optimization. In Conference on Neural Information Processing Systems (NIPS). 2011. [2] David Duvenaud, James R. Lloyd, Roger Grosse, Joshua B. Tenenbaum, and Zoubin Ghahramani. Structure discovery in nonparametric regression through compositional kernel search. In International Conference on Machine Learning (ICML), 2013. [3] Jacob R. Gardner, Gustavo Malkomes, Roman Garnett, Kilian Q. Weinberger, Dennis Barbour, and John P. Cunningham. Bayesian active model selection with an application to automated audiometry. In Conference on Neural Information Processing Systems (NIPS), 2015. [4] Jacob R. Gardner, Chuan Guo, Kilian Q. Weinberger, Roman Garnett, and Roger Grosse. Discovering and exploiting additive structure for Bayesian optimization. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2017. [5] Javier González, Michael A. Osborne, and Neil D. Lawrence. GLASSES: relieving the myopia of Bayesian optimisation. In International Conference on Artificial Intelligence and Statistics (AISTATS), 2016. [6] Roger Grosse, Ruslan Salakhutdinov, William Freeman, and Joshua Tenenbaum. Exploiting compositionality to explore a large space of model structures. In Conference on Uncertainty in Artificial Intelligence (UAI), 2012. [7] Deng Huang, Theodore T. Allen, William I. Notz, and Ning Zeng. Global optimization of stochastic black-box systems via sequential kriging meta-models. Journal of Global optimization, 34:441–466, 2006. [8] 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. [9] Harold J. Kushner. A new method of locating the maximum point of an arbitrary multipeak curve in the presence of noise. Journal of Basic Engineering, 86:97–106, 1964. [10] Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. Journal of Machine Learning Research, 18(185):1–52, 2018. URL http://jmlr.org/papers/v18/16-558. html. [11] Gustavo Malkomes, Charles Schaff, and Roman Garnett. Bayesian optimization for automated model selection. In Conference on Neural Information Processing Systems (NIPS), 2016. [12] Jonas Moˇckus. On Bayesian methods for seeking the extremum, pages 400–404. Springer, 1974. [13] Kevin P Murphy. Machine Learning: A Probabilistic Perspective. MIT Press, 2012. [14] Michael A. Osborne, David Duvenaud, Roman Garnett, Carl E. Rasmussen, Stephen J. Roberts, and Zoubin Ghahramani. Active learning of model evidence using Bayesian quadrature. In Conference on Neural Information Processing Systems (NIPS), 2012. [15] Adrian E Raftery. Approximate Bayes Factors and Accounting for Model Uncertainty in Generalised Linear Models. Biometrika, 83(2):251–266, 1996. [16] Carl E. Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006. 10 [17] Bobak Shahriari, Kevin Swersky, Ziyu Wang, Ryan P. Adams, and Nando de Freitas. Taking the human out of the loop: A review of Bayesian optimization. Proceedings of the IEEE, 104: 148–175, 2016. [18] Jasper Snoek, Hugo Larochelle, and Ryan P. Adams. Practical Bayesian optimization of machine learning algorithms. In Conference on Neural Information Processing Systems (NIPS), 2012. [19] Niranjan Srinivas, Andreas Krause, Sham Kakade, and Matthias Seeger. Gaussian process optimization in the bandit setting: No regret and experimental design. In International Conference on Machine Learning (ICML), 2010. [20] Sonja Surjanovic and Derek Bingham. Optimization test functions and datasets, 2017. URL http://www.sfu.ca/~ssurjano/optimization.html. 11
2018
194
7,357
Leveraged volume sampling for linear regression Michał Derezi´nski and Manfred K. Warmuth Department of Computer Science University of California, Santa Cruz mderezin@berkeley.edu, manfred@ucsc.edu Daniel Hsu Computer Science Department Columbia University, New York djhsu@cs.columbia.edu Abstract Suppose an n ⇥d design matrix in a linear regression problem is given, but the response for each point is hidden unless explicitly requested. The goal is to sample only a small number k ⌧n of the responses, and then produce a weight vector whose sum of squares loss over all points is at most 1 + ✏times the minimum. When k is very small (e.g., k = d), jointly sampling diverse subsets of points is crucial. One such method called volume sampling has a unique and desirable property that the weight vector it produces is an unbiased estimate of the optimum. It is therefore natural to ask if this method offers the optimal unbiased estimate in terms of the number of responses k needed to achieve a 1 + ✏loss approximation. Surprisingly we show that volume sampling can have poor behavior when we require a very accurate approximation – indeed worse than some i.i.d. sampling techniques whose estimates are biased, such as leverage score sampling. We then develop a new rescaled variant of volume sampling that produces an unbiased estimate which avoids this bad behavior and has at least as good a tail bound as leverage score sampling: sample size k = O(d log d + d/✏) suffices to guarantee total loss at most 1 + ✏times the minimum with high probability. Thus we improve on the best previously known sample size for an unbiased estimator, k = O(d2/✏). Our rescaling procedure leads to a new efficient algorithm for volume sampling which is based on a determinantal rejection sampling technique with potentially broader applications to determinantal point processes. Other contributions include introducing the combinatorics needed for rescaled volume sampling and developing tail bounds for sums of dependent random matrices which arise in the process. 1 Introduction Consider a linear regression problem where the input points in Rd are provided, but the associated response for each point is withheld unless explicitly requested. The goal is to sample the responses for just a small subset of inputs, and then produce a weight vector whose total square loss on all n points is at most 1 + ✏times that of the optimum.1 This scenario is relevant in many applications where data points are cheap to obtain but responses are expensive. Surprisingly, with the aid of having all input points available, such multiplicative loss bounds are achievable without any range dependence on the points or responses common in on-line learning [see, e.g., 8]. A natural and intuitive approach to this problem is volume sampling, since it prefers “diverse” sets of points that will likely result in a weight vector with low total loss, regardless of what the corresponding responses turn out to be [11]. Volume sampling is closely related to optimal design criteria [18, 26], which are appropriate under statistical models of the responses; here we study a worst-case setting where the algorithm must use randomization to guard itself against worst-case responses. 1The total loss being 1 + ✏times the optimum is the same as the regret being ✏times the optimum. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Volume sampling and related determinantal point processes are employed in many machine learning and statistical contexts, including linear regression [11, 13, 26], clustering and matrix approximation [4, 14, 15], summarization and information retrieval [19, 23, 24], and fairness [6, 7]. The availability of fast algorithms for volume sampling [11, 26] has made it an important technique in the algorithmic toolbox alongside i.i.d. leverage score sampling [17] and spectral sparsification [5, 25]. It is therefore surprising that using volume sampling in the context of linear regression, as suggested in previous works [11, 26], may lead to suboptimal performance. We construct an example in which, even after sampling up to half of the responses, the loss of the weight vector from volume sampling is a fixed factor >1 larger than the minimum loss. Indeed, this poor behavior arises because for any sample size >d, the marginal probabilities from volume sampling are a mixture of uniform probabilities and leverage score probabilities, and uniform sampling is well-known to be suboptimal when the leverage scores are highly non-uniform. Figure 1: Plots of the total loss for the sampling methods (averaged over 100 runs) versus sample size (shading is standard error) for the libsvm dataset cpusmall [9]. A possible recourse is to abandon volume sampling in favor of leverage score sampling [17, 33]. However, all i.i.d. sampling methods, including leverage score sampling, suffer from a coupon collector problem that prevents their effective use at small sample sizes [13]. Moreover, the resulting weight vectors are biased (when regarded as estimators for the least squares solution based on all responses). This is a nuisance when averaging multiple solutions (e.g., as produced in distributed settings). In contrast, volume sampling offers multiplicative loss bounds even with sample sizes as small as d and it is the only known non-trivial method that gives unbiased weight vectors [11]. We develop a new solution, called leveraged volume sampling, that retains the aforementioned benefits of volume sampling while avoiding its flaws. Specifically, we propose a variant of volume sampling based on rescaling the input points to “correct” the resulting marginals. On the algorithmic side, this leads to a new determinantal rejection sampling procedure which offers significant computational advantages over existing volume sampling algorithms, while at the same time being strikingly simple to implement. We prove that this new sampling scheme retains the benefits of volume sampling (like unbiasedness) but avoids the bad behavior demonstrated in our lower bound example. Along the way, we prove a new generalization of the Cauchy-Binet formula, which is needed for the rejection sampling denominator. Finally, we develop a new method for proving matrix tail bounds for leveraged volume sampling. Our analysis shows that the unbiased least-squares estimator constructed this way achieves a 1 + ✏approximation factor from a sample of size O(d log d + d/✏), addressing an open question posed by [11]. Experiments. Figure 1 presents experimental evidence on a benchmark dataset (cpusmall from the libsvm collection [9]) that the potential bad behavior of volume sampling proven in our lower bound does occur in practice. Appendix E shows more datasets and a detailed discussion of the experiments. In summary, leveraged volume sampling avoids the bad behavior of standard volume sampling, and performs considerably better than leverage score sampling, especially for small sample sizes k. Related work. Despite the ubiquity of volume sampling in many contexts already mentioned above, it has only recently been analyzed for linear regression. Focusing on small sample sizes, [11] proved multiplicative bounds for the expected loss of size k = d volume sampling. Because the estimators produced by volume sampling are unbiased, averaging a number of such estimators produced an estimator based on a sample of size k = O(d2/✏) with expected loss at most 1 + ✏times the optimum. It was shown in [13] that if the responses are assumed to be linear functions of the input points plus white noise, then size k = O(d/✏) volume sampling suffices for obtaining the same expected bounds. These noise assumptions on the response vector are also central to the task of A-optimal design, where volume sampling is a key technique [2, 18, 28, 29]. All of these previous results were concerned with bounds that hold in expectation; it is natural to ask if similar (or better) bounds can also be shown to hold with high probability, without noise assumptions. Concentration bounds for volume sampling and other strong Rayleigh measures were studied in [30], but these results are not sufficient to obtain the tail bounds for volume sampling. 2 Other techniques applicable to our linear regression problem include leverage score sampling [17] and spectral sparsification [5, 25]. Leverage score sampling is an i.i.d. sampling procedure which achieves tail bounds matching the ones we obtain here for leveraged volume sampling, however it produces biased weight vectors and experimental results (see [13] and Appendix E) show that it has weaker performance for small sample sizes. A different and more elaborate sampling technique based on spectral sparsification [5, 25] was recently shown to be effective for linear regression [10], however this method also does not produce unbiased estimates, which is a primary concern of this paper and desirable in many settings. Unbiasedness seems to require delicate control of the sampling probabilities, which we achieve using determinantal rejection sampling. Outline and contributions. We set up our task of subsampling for linear regression in the next section and present our lower bound for standard volume sampling. A new variant of rescaled volume sampling is introduced in Section 3. We develop techniques for proving matrix expectation formulas for this variant which show that for any rescaling the weight vector produced for the subproblem is unbiased. Next, we show that when rescaling with leverage scores, then a new algorithm based on rejection sampling is surprisingly efficient (Section 4): Other than the preprocessing step of computing leverage scores, the runtime does not depend on n (a major improvement over existing volume sampling algorithms). Then, in Section 4.1 we prove multiplicative loss bounds for leveraged volume sampling by establishing two important properties which are hard to prove for joint sampling procedures. We conclude in Section 5 with an open problem and with a discussion of how rescaling with approximate leverage scores gives further time improvements for constructing an unbiased estimator. 2 Volume sampling for linear regression In this section, we describe our linear regression setting, and review the guarantees that standard volume sampling offers in this context. Then, we present a surprising lower bound which shows that under worst-case data, this method can exhibit undesirable behavior. 2.1 Setting Suppose the learner is given n input vectors x1, . . . , xn 2 Rd, which are arranged as the rows of an n ⇥d input matrix X. Each input vector xi has an associated response variable yi 2 R from the response vector y 2 Rn. The goal of the learner is to find a weight vector w 2 Rd that minimizes the square loss: w⇤def= argmin w2Rd L(w), where L(w) def= n X i=1 (x > i w −yi)2 = kXw −yk2. Given both matrix X and vector y, the least squares solution can be directly computed as w⇤= X+y, where X+ is the pseudo-inverse. Throughout the paper we assume w.l.o.g. that X has (full) rank d.2 In our setting, the learner is initially given the entire input matrix X, while response vector y remains hidden. The learner is then allowed to select a subset S of row indices in [n] = {1, . . . , n} for which the corresponding responses yi are revealed. The learner next constructs an estimate bw of w⇤ using matrix X and the partial vector of observed responses. Finally, the learner is evaluated by the loss over all rows of X (including the ones with unobserved responses), and the goal is to obtain a multiplicative loss bound, i.e., that for some ✏> 0, L(bw) (1 + ✏) L(w⇤). 2.2 Standard volume sampling Given X 2 Rn⇥d and a size k ≥d, standard volume sampling jointly chooses a set S of k indices in [n] with probability Pr(S) = det(X> SXS) #n−d k−d $ det(X>X) , 2Otherwise just reduce X to a subset of independent columns. Also assume X has no rows of all zeros (every weight vector has the same loss on such rows, so they can be removed). 3 where XS is the submatrix of the rows from X indexed by the set S. The learner then obtains the responses yi, for i 2 S, and uses the optimum solution w⇤ S = (XS)+yS for the subproblem (XS, yS) as its weight vector. The sampling procedure can be performed using reverse iterative sampling (shown on the right), which, if carefully implemented, takes O(nd2) time (see [11, 13]). Reverse iterative sampling VolumeSample(X, k): S [n] while |S| > k 8i2S : qi det(X> S\iXS\i) det(X> S XS) Sample i / qi out of S S S\{i} end return S The key property (unique to volume sampling) is that the subsampled estimator w⇤ S is unbiased, i.e. E[w⇤ S] = w⇤, where w⇤= argmin w L(w). As discussed in [11], this property has important practical implications in distributed settings: Mixtures of unbiased estimators remain unbiased (and can conveniently be used to reduce variance). Also if the rows of X are in general position, then for volume sampling E ⇥ (X > SXS)−1⇤ = n −d + 1 k −d + 1 (X >X)−1. (1) This is important because in A-optimal design bounding tr((X> SXS)−1) is the main concern. Given these direct connections of volume sampling to linear regression, it is natural to ask whether this distribution achieves a loss bound of (1 + ✏) times the optimum for small sample sizes k. 2.3 Lower bound for standard volume sampling We show that standard volume sampling cannot guarantee 1 + ✏multiplicative loss bounds on some instances, unless over half of the rows are chosen to be in the subsample. Theorem 1 Let (X, y) be an n ⇥d least squares problem, such that X = 0 B B @ Id⇥d γ Id⇥d ... γ Id⇥d 1 C C A , y = 0 B B @ 1d 0d ... 0d 1 C C A , where γ > 0. Let w⇤ S = (XS)+yS be obtained from size k volume sampling for (X, y). Then, lim γ!0 E[L(w⇤ S)] L(w⇤) ≥1 + n −k n −d, (2) and there is a γ > 0 such that for any k n 2 , Pr ✓ L(w⇤ S) ≥ ⇣ 1 + 1 2 ⌘ L(w⇤) ◆ > 1 4. (3) Proof In Appendix A we show (2), and that for the chosen (X, y) we have L(w⇤)=Pd i=1(1 −li) (see (8)), where li = x> i (X>X)−1xi is the i-th leverage score of X. Here, we show (3). The marginal probability of the i-th row under volume sampling (as given by [12]) is Pr(i 2 S) = ✓li + (1 −✓) 1 = 1 −✓(1 −li), where ✓= n −k n −d. (4) Next, we bound the probability that all of the first d input vectors were selected by volume sampling: Pr # [d] ✓S $ (⇤)  d Y i=1 Pr(i 2 S) = d Y i=1 ⇣ 1 −n −k n −d (1 −li) ⌘ exp ⇣ −n −k n −d Pd i=1(1−li) z }| { L(w⇤) ⌘ , where (⇤) follows from negative associativity of volume sampling (see [26]). If for some i 2 [d] we have i 62 S, then L(w⇤ S) ≥1. So for γ such that L(w⇤) = 2 3 and any k n 2 : Pr ✓ L(w⇤ S) ≥ ⇣ 1 + 1 2 ⌘ 2/3 z }| { L(w⇤) ◆ ≥1 −exp ⇣ −n −k n −d · 2 3 ⌘ ≥1 −exp ⇣ −1 2 · 2 3 ⌘ > 1 4. Note that this lower bound only makes use of the negative associativity of volume sampling and the form of the marginals. However the tail bounds we prove in Section 4.1 rely on more subtle properties of volume sampling. We begin by creating a variant of volume sampling with rescaled marginals. 4 3 Rescaled volume sampling Given any size k ≥d, our goal is to jointly sample k row indices ⇡1, . . . , ⇡k with replacement (instead of a subset S of [n] of size k, we get a sequence ⇡2 [n]k). The second difference to standard volume sampling is that we rescale the i-th row (and response) by 1 pqi , where q = (q1, ..., qn) is any discrete distribution over the set of row indices [n], such that Pn i=1 qi = 1 and qi > 0 for all i 2 [n]. We now define q-rescaled size k volume sampling as a joint sampling distribution over ⇡2 [n]k, s.t. q-rescaled size k volume sampling: Pr(⇡) ⇠det ⇣ k X i=1 1 q⇡i x⇡ix > ⇡i ⌘ k Y i=1 q⇡i. (5) Using the following rescaling matrix Q⇡ def= P|⇡| i=1 1 q⇡i e⇡ie> ⇡i 2 Rn⇥n, we rewrite the determinant as det(X>Q⇡X). As in standard volume sampling, the normalization factor in rescaled volume sampling can be given in a closed form through a novel extension of the Cauchy-Binet formula (proof in Appendix B.1). Proposition 2 For any X 2 Rn⇥d, k ≥d and q1, . . . , qn > 0, such that Pn i=1 qi = 1, we have X ⇡2[n]k det(X >Q⇡X) k Y i=1 q⇡i = k(k−1) · · · (k−d+1) det(X >X). Given a matrix X 2 Rn⇥d, vector y 2 Rn and a sequence ⇡2 [n]k, we are interested in a leastsquares problem (Q 1/2 ⇡X, Q 1/2 ⇡y), which selects instances indexed by ⇡, and rescales each of them by the corresponding 1/pqi. This leads to a natural subsampled least squares estimator w⇤ ⇡= argmin w k X i=1 1 q⇡i # x > ⇡iw −y⇡i $2 = (Q 1/2 ⇡X)+Q 1/2 ⇡y. The key property of standard volume sampling is that the subsampled least-squares estimator is unbiased. Surprisingly this property is retained for any q-rescaled volume sampling (proof in Section 3.1). As we shall see, this will give us great leeway for choosing q to optimize our algorithms. Theorem 3 Given a full rank X 2 Rn⇥d and a response vector y 2 Rn, for any q as above, if ⇡is sampled according to (5), then E[w⇤ ⇡] = w⇤, where w⇤= argmin w kXw −yk2. The matrix expectation equation (1) for standard volume sampling (discussed in Section 2) has a natural extension to any rescaled volume sampling, but now the equality turns into an inequality (proof in Appendix B.2): Theorem 4 Given a full rank X 2 Rn⇥d and any q as above, if ⇡is sampled according to (5), then E ⇥ (X >Q⇡X)−1⇤ ⪯ 1 k−d+1(X >X)−1. 3.1 Proof of Theorem 3 We show that the least-squares estimator w⇤ ⇡= (Q 1/2 ⇡X)+Q 1/2 ⇡y produced from any q-rescaled volume sampling is unbiased, illustrating a proof technique which is also useful for showing Theorem 4, as well as Propositions 2 and 5. The key idea is to apply the pseudo-inverse expectation formula for standard volume sampling (see e.g., [11]) first on the subsampled estimator w⇤ ⇡, and then again on the full estimator w⇤. In the first step, this formula states: w⇤ ⇡ z }| { (Q 1/2 ⇡X)+Q 1/2 ⇡y = X S2( [k] d) det(X>Q⇡SX) det(X>Q⇡X) w⇤ ⇡S z }| { (Q 1/2 ⇡SX)+Q 1/2 ⇡Sy, 5 where #[k] d $ def= {S ✓{1, . . . , k} : |S| = d} and ⇡S denotes a subsequence of ⇡indexed by the elements of set S. Note that since S is of size d, we can decompose the determinant: det(X >Q⇡SX) = det(X⇡S)2 Y i2S 1 q⇡i . Whenever this determinant is non-zero, w⇤ ⇡S is the exact solution of a system of d linear equations: 1 pq⇡i x > ⇡iw = 1 pq⇡i y⇡i, for i 2 S. Thus, the rescaling of each equation by 1 pq⇡i cancels out, and we can simply write w⇤ ⇡S = (X⇡S)+y⇡S. (Note that this is not the case for sets larger than d whenever the optimum solution incurs positive loss.) We now proceed with summing over all ⇡2 [n]k. Following Proposition 2, we define the normalization constant as Z = d! #k d $ det(X>X), and obtain: Z E[w⇤ ⇡] = X ⇡2[n]k ✓ k Y i=1 q⇡i ◆ det(X >Q⇡X) w⇤ ⇡= X ⇡2[n]k X S2( [k] d) ✓ Y i2[k]\S q⇡i ◆ det(X⇡S)2(X⇡S)+y⇡S (1) = ✓k d ◆X ¯⇡2[n]d det(X¯⇡)2(X¯⇡)+y¯⇡ X ˜⇡2[n]k−d k−d Y i=1 q˜⇡i (2) = ✓k d ◆ d! X S2( [n] d) det(XS)2(XS)+yS ✓ n X i=1 qi ◆k−d (3) = Z z }| { ✓k d ◆ d! det(X >X) w⇤. Note that in (1) we separate ⇡into two parts, ¯⇡and ˜⇡(respectively, for subsets S and [k]\S), and sum over them separately. The binomial coefficient #k d $ counts the number of ways that S can be “placed into” the sequence ⇡. In (2) we observe that whenever ¯⇡has repetitions, determinant det(X¯⇡) is zero, so we can switch to summing over sets. Finally, (3) again uses the standard size d volume sampling unbiasedness formula, now for the least-squares task (X, y), and the fact that qi’s sum to 1. 4 Leveraged volume sampling: a natural rescaling Determinantal rejection sampling 1: Input: X2Rn⇥d, q = ( l1 d , . . . , ln d ), k ≥d 2: s max{k, 4d2} 3: repeat 4: Sample ⇡1, . . . , ⇡s i.i.d. ⇠(q1, . . . , qn) 5: Sample Accept ⇠Bernoulli ⇣det( 1 s X>Q⇡X) det(X>X) ⌘ 6: until Accept = true 7: S VolumeSample # (Q 1/2 [1..n]X)⇡, k $ 8: return ⇡S Rescaled volume sampling can be viewed as selecting a sequence ⇡of k rank-1 matrices from the covariance matrix X>X = Pn i=1 xix> i . If ⇡1, . . . , ⇡k are sampled i.i.d. from q, i.e., Pr(⇡) = Qk i=1 q⇡i, then matrix 1 kX>Q⇡X is an unbiased estimator of the covariance matrix because E[q−1 ⇡i x⇡ix> ⇡i] = X>X. In rescaled volume sampling (5), Pr(⇡) ⇠ # Qk i=1 q⇡i $ det(X>Q⇡X) det(X>X) , and the latter volume ratio introduces a bias to that estimator. However, we show that this bias vanishes when q is exactly proportional to the leverage scores (proof in Appendix B.3). Proposition 5 For any q and X as before, if ⇡2 [n]k is sampled according to (5), then E[Q⇡] = (k−d) I + diag ⇣l1 q1 , . . . , ln qn ⌘ , where li def= x > i (X >X)−1xi. In particular, E[ 1 kX>Q⇡X] = X>E[ 1 kQ⇡]X = X>X if and only if qi = li d > 0 for all i 2 [n]. This special rescaling, which we call leveraged volume sampling, has other remarkable properties. Most importantly, it leads to a simple and efficient algorithm we call determinantal rejection sampling: Repeatedly sample O(d2) indices ⇡1, . . . , ⇡s i.i.d. from q = ( l1 d , . . . , ln d ), and accept the sample with probability proportional to its volume ratio. Having obtained a sample, we can further reduce its size via reverse iterative sampling. We show next that this procedure not only returns a q-rescaled volume sample, but also exploiting the fact that q is proportional to the leverage scores, it requires (surprisingly) only a constant number of iterations of rejection sampling with high probability. 6 Theorem 6 Given the leverage score distribution q = ( l1 d , . . . , ln d ) and the determinant det(X>X) for matrix X 2 Rn⇥d, determinantal rejection sampling returns sequence ⇡S distributed according to leveraged volume sampling, and w.p. at least 1−δ finishes in time O((d2+ k)d2 ln( 1 δ )). Proof We use a composition property of rescaled volume sampling (proof in Appendix B.4): Lemma 7 Consider the following sampling procedure, for s > k: ⇡ s⇠ X (q-rescaled size s volume sampling), S k⇠ 0 B @ 1 pq⇡1 x> ⇡1 . . . 1 pq⇡s x> ⇡s 1 C A = # Q 1/2 [1..n]X $ ⇡ (standard size k volume sampling). Then ⇡S is distributed according to q-rescaled size k volume sampling from X. First, we show that the rejection sampling probability in line 5 of the algorithm is bounded by 1: det( 1 sX>Q⇡X) det(X>X) = det ⇣1 sX >Q⇡X(X >X)−1⌘(⇤)  ✓1 dtr ⇣1 sX >Q⇡X(X >X)−1⌘◆d = ⇣1 dstr # Q⇡X(X >X)−1X >$⌘d = ⇣1 ds s X i=1 d li x > i (X >X)−1xi ⌘d = 1, where (⇤) follows from the geometric-arithmetic mean inequality for the eigenvalues of the underlying matrix. This shows that sequence ⇡is drawn according to q-rescaled volume sampling of size s. Now, Lemma 7 implies correctness of the algorithm. Next, we use Proposition 2 to compute the expected value of acceptance probability from line 5 under the i.i.d. sampling of line 4: X ⇡2[n]s ✓ s Y i=1 q⇡i ◆det( 1 sX>Q⇡X) det(X>X) = s(s−1) . . . (s−d+1) sd ≥ ⇣ 1 −d s ⌘d ≥1 −d2 s ≥3 4, where we also used Bernoulli’s inequality and the fact that s ≥4d2 (see line 2). Since the expected value of the acceptance probability is at least 3 4, an easy application of Markov’s inequality shows that at each trial there is at least a 50% chance of it being above 1 2. So, the probability of at least r trials occurring is less than (1 −1 4)r. Note that the computational cost of one trial is no more than the cost of SVD decomposition of matrix X>Q⇡X (for computing the determinant), which is O(sd2). The cost of reverse iterative sampling (line 7) is also O(sd2) with high probability (as shown by [13]). Thus, the overall runtime is O((d2 + k)d2r), where r ln( 1 δ )/ ln( 4 3) w.p. at least 1 −δ. 4.1 Tail bounds for leveraged volume sampling An analysis of leverage score sampling, essentially following [33, Section 2] which in turn draws from [31], highlights two basic sufficient conditions on the (random) subsampling matrix Q⇡that lead to multiplicative tail bounds for L(w⇤ ⇡). It is convenient to shift to an orthogonalization of the linear regression task (X, y) by replacing matrix X with a matrix U = X(X>X)−1/2 2 Rn⇥d. It is easy to check that the columns of U have unit length and are orthogonal, i.e., U>U = I. Now, v⇤= U>y is the least-squares solution for the orthogonal problem (U, y) and prediction vector Uv⇤= UU>y for (U, y) is the same as the prediction vector Xw⇤= X(X>X)−1X>y for the original problem (X, y). The same property holds for the subsampled estimators, i.e., Uv⇤ ⇡= Xw⇤ ⇡, where v⇤ ⇡= (Q 1/2 ⇡U)+Q 1/2 ⇡y. Volume sampling probabilities are also preserved under this transformation, so w.l.o.g. we can work with the orthogonal problem. Now L(v⇤ ⇡) can be rewritten as L(v⇤ ⇡) = kUv⇤ ⇡−yk2 (1) = kUv⇤−yk2 + kU(v⇤ ⇡−v⇤)k2 (2) = L(v⇤) + kv⇤ ⇡−v⇤k2, (6) where (1) follows via Pythagorean theorem from the fact that U(v⇤ ⇡−v⇤) lies in the column span of U and the residual vector r = Uv⇤−y is orthogonal to all columns of U, and (2) follows from U>U = I. By the definition of v⇤ ⇡, we can write kv⇤ ⇡−v⇤k as follows: kv⇤ ⇡−v⇤k = k(U >Q⇡U)−1 U >Q⇡(y −Uv⇤)k k(U >Q⇡U)−1 d⇥d k kU >Q⇡r d⇥1 k, (7) 7 where kAk denotes the matrix 2-norm (i.e., the largest singular value) of A; when A is a vector, then kAk is its Euclidean norm. This breaks our task down to showing two key properties: 1. Matrix multiplication: Upper bounding the Euclidean norm kU>Q⇡rk, 2. Subspace embedding: Upper bounding the matrix 2-norm k(U>Q⇡U)−1k. We start with a theorem that implies strong guarantees for approximate matrix multiplication with leveraged volume sampling. Unlike with i.i.d. sampling, this result requires controlling the pairwise dependence between indices selected under rescaled volume sampling. Its proof is an interesting application of a classical Hadamard matrix product inequality from [3] (Proof in Appendix C). Theorem 8 Let U 2 Rn⇥d be a matrix s.t. U>U = I. If sequence ⇡2 [n]k is selected using leveraged volume sampling of size k ≥2d ✏, then for any r 2 Rn, E 9991 k U >Q⇡r −U >r 999 2: ✏krk2. Next, we turn to the subspace embedding property. The following result is remarkable because standard matrix tail bounds used to prove this property for leverage score sampling are not applicable to volume sampling. In fact, obtaining matrix Chernoff bounds for negatively associated joint distributions like volume sampling is an active area of research, as discussed in [21]. We address this challenge by defining a coupling procedure for volume sampling and uniform sampling without replacement, which leads to a curious reduction argument described in Appendix D. Theorem 9 Let U 2 Rn⇥d be a matrix s.t. U>U = I. There is an absolute constant C, s.t. if sequence ⇡2 [n]k is selected using leveraged volume sampling of size k ≥C d ln( d δ ), then Pr ✓ λmin ⇣1 k U >Q⇡U ⌘ 1 8 ◆ δ. Theorems 8 and 9 imply that the unbiased estimator w⇤ ⇡produced from leveraged volume sampling achieves multiplicative tail bounds with sample size k = O(d log d + d/✏). Corollary 10 Let X 2 Rn⇥d be a full rank matrix. There is an absolute constant C, s.t. if sequence ⇡2 [n]k is selected using leveraged volume sampling of size k ≥C # d ln( d δ )+ d ✏δ $ , then for estimator w⇤ ⇡= argmin w kQ 1/2 ⇡(Xw −y)k2, we have L(w⇤ ⇡) (1 + ✏) L(w⇤) with probability at least 1 −δ. Proof Let U = X(X>X)−1/2. Combining Theorem 8 with Markov’s inequality, we have that for large enough C, kU>Q⇡rk2 ✏k2 82 krk2 w.h.p., where r = y −Uv⇤. Finally following (6) and (7) above, we have that w.h.p. L(w⇤ ⇡) L(w⇤) + k(U >Q⇡U)−1k2 kU >Q⇡rk2 L(w⇤) + 82 k2 ✏k2 82 krk2 = (1 + ✏) L(w⇤). 5 Conclusion We developed a new variant of volume sampling which produces the first known unbiased subsampled least-squares estimator with strong multiplicative loss bounds. In the process, we proved a novel extension of the Cauchy-Binet formula, as well as other fundamental combinatorial equalities. Moreover, we proposed an efficient algorithm called determinantal rejection sampling, which is to our knowledge the first joint determinantal sampling procedure that (after an initial O(nd2) preprocessing step for computing leverage scores) produces its k samples in time eO(d2+k)d2), independent of the data size n. When n is very large, the preprocessing time can be reduced to eO(nd + d5) by rescaling with sufficiently accurate approximations of the leverage scores. Surprisingly the estimator stays unbiased and the loss bound still holds with only slightly revised constants. For the sake of clarity we presented the algorithm based on rescaling with exact leverage scores in the main body of the paper. However we outline the changes needed when using approximate leverage scores in Appendix F. In this paper we focused on tail bounds. However we conjecture that there are also volume sampling based unbiased estimators achieving expected loss bounds E[L(w⇤ ⇡)] (1+✏)L(w⇤) with size O( d ✏). 8 Acknowledgements Michał Derezi´nski and Manfred K. Warmuth were supported by NSF grant IIS-1619271. Daniel Hsu was supported by NSF grant CCF-1740833. References [1] Nir Ailon and Bernard Chazelle. The fast Johnson–Lindenstrauss transform and approximate nearest neighbors. SIAM Journal on computing, 39(1):302–322, 2009. [2] Zeyuan Allen-Zhu, Yuanzhi Li, Aarti Singh, and Yining Wang. Near-optimal design of experiments via regret minimization. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 126–135, International Convention Centre, Sydney, Australia, 2017. [3] T Ando, Roger A. Horn, and Charles R. Johnson. The singular values of a Hadamard product: A basic inequality. Journal of Linear and Multilinear Algebra, 21(4):345–365, 1987. [4] Haim Avron and Christos Boutsidis. Faster subset selection for matrices and applications. SIAM Journal on Matrix Analysis and Applications, 34(4):1464–1499, 2013. [5] Joshua Batson, Daniel A Spielman, and Nikhil Srivastava. Twice-Ramanujan sparsifiers. SIAM Journal on Computing, 41(6):1704–1721, 2012. [6] L Elisa Celis, Amit Deshpande, Tarun Kathuria, and Nisheeth K Vishnoi. How to be fair and diverse? arXiv:1610.07183, October 2016. [7] L Elisa Celis, Vijay Keswani, Damian Straszak, Amit Deshpande, Tarun Kathuria, and Nisheeth K Vishnoi. Fair and diverse dpp-based data summarization. arXiv:1802.04023, February 2018. [8] N. Cesa-Bianchi, P. M. Long, and M. K. Warmuth. Worst-case quadratic loss bounds for on-line prediction of linear functions by gradient descent. IEEE Transactions on Neural Networks, 7(3):604–619, 1996. Earlier version in 6th COLT, 1993. [9] Chih-Chung Chang and Chih-Jen Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1–27:27, 2011. Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm. [10] Xue Chen and Eric Price. Condition number-free query and active learning of linear families. CoRR, abs/1711.10051, 2017. [11] Michał Derezi´nski and Manfred K Warmuth. Unbiased estimates for linear regression via volume sampling. In Advances in Neural Information Processing Systems 30, pages 3087–3096, Long Beach, CA, USA, December 2017. [12] Michał Derezi´nski and Manfred K. Warmuth. Reverse iterative volume sampling for linear regression. Journal of Machine Learning Research, 19(23):1–39, 2018. [13] Michał Derezi´nski and Manfred K. Warmuth. Subsampling for ridge regression via regularized volume sampling. In Proceedings of the 21st International Conference on Artificial Intelligence and Statistics, 2018. [14] Amit Deshpande and Luis Rademacher. Efficient volume sampling for row/column subset selection. In Proceedings of the 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, FOCS ’10, pages 329–338, Washington, DC, USA, 2010. [15] Amit Deshpande, Luis Rademacher, Santosh Vempala, and Grant Wang. Matrix approximation and projective clustering via volume sampling. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithm, SODA ’06, pages 1117–1126, Philadelphia, PA, USA, 2006. 9 [16] Petros Drineas, Malik Magdon-Ismail, Michael W. Mahoney, and David P. Woodruff. Fast approximation of matrix coherence and statistical leverage. J. Mach. Learn. Res., 13(1):3475– 3506, December 2012. [17] Petros Drineas, Michael W Mahoney, and S Muthukrishnan. Sampling algorithms for `2 regression and applications. In Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm, pages 1127–1136, 2006. [18] Valerii V. Fedorov, William J. Studden, and E. M. Klimko, editors. Theory of optimal experiments. Probability and mathematical statistics. Academic Press, New York, 1972. [19] Mike Gartrell, Ulrich Paquet, and Noam Koenigstein. Bayesian low-rank determinantal point processes. In Proceedings of the 10th ACM Conference on Recommender Systems, RecSys ’16, pages 349–356, New York, NY, USA, 2016. [20] David Gross and Vincent Nesme. Note on sampling without replacing from a finite collection of matrices. arXiv:1001.2738, January 2010. [21] Nicholas JA Harvey and Neil Olver. Pipage rounding, pessimistic estimators and matrix concentration. In Proceedings of the twenty-fifth annual ACM-SIAM symposium on Discrete algorithms, pages 926–945. SIAM, 2014. [22] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [23] Alex Kulesza and Ben Taskar. k-DPPs: Fixed-Size Determinantal Point Processes. In Proceedings of the 28th International Conference on Machine Learning, pages 1193–1200. Omnipress, 2011. [24] Alex Kulesza and Ben Taskar. Determinantal Point Processes for Machine Learning. Now Publishers Inc., Hanover, MA, USA, 2012. [25] Yin Tat Lee and He Sun. Constructing linear-sized spectral sparsification in almost-linear time. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on, pages 250–269. IEEE, 2015. [26] Chengtao Li, Stefanie Jegelka, and Suvrit Sra. Polynomial time algorithms for dual volume sampling. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 5045–5054. 2017. [27] Michael W. Mahoney. Randomized algorithms for matrices and data. Found. Trends Mach. Learn., 3(2):123–224, February 2011. [28] Zelda E. Mariet and Suvrit Sra. Elementary symmetric polynomials for optimal experimental design. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 2136–2145. 2017. [29] Aleksandar Nikolov, Mohit Singh, and Uthaipon Tao Tantipongpipat. Proportional volume sampling and approximation algorithms for A-optimal design. arXiv:1802.08318, July 2018. [30] Robin Pemantle and Yuval Peres. Concentration of Lipschitz functionals of determinantal and other strong rayleigh measures. Combinatorics, Probability and Computing, 23(1):140–160, 2014. [31] Tamas Sarlos. Improved approximation algorithms for large matrices via random projections. In Proceedings of the 47th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’06, pages 143–152, Washington, DC, USA, 2006. [32] Joel A. Tropp. User-friendly tail bounds for sums of random matrices. Foundations of Computational Mathematics, 12(4):389–434, August 2012. [33] David P Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends® in Theoretical Computer Science, 10(1–2):1–157, 2014. 10
2018
195
7,358
Scalable Robust Matrix Factorization with Nonconvex Loss Quanming Yao1,2, James T. Kwok2 14Paradigm Inc. Beijing, China 2Department of Computer Science and Engineering, Hong Kong University of Science and Technology, Hong Kong yaoquanming@4paradigm.com, jamesk@cse.ust.hk Abstract Matrix factorization (MF), which uses the ℓ2-loss, and robust matrix factorization (RMF), which uses the ℓ1-loss, are sometimes not robust enough for outliers. Moreover, even the state-of-the-art RMF solver (RMF-MM) is slow and cannot utilize data sparsity. In this paper, we propose to improve robustness by using nonconvex loss functions. The resultant optimization problem is difficult. To improve efficiency and scalability, we use majorization-minimization (MM) and optimize the MM surrogate by using the accelerated proximal gradient algorithm on its dual problem. Data sparsity can also be exploited. The resultant algorithm has low time and space complexities, and is guaranteed to converge to a critical point. Extensive experiments show that it outperforms the state-of-the-art in terms of both accuracy and speed. 1 Introduction Matrix factorization (MF) is a fundamental tool in machine learning, and an important component in many applications such as computer vision [1, 38], social networks [37] and recommender systems [30]. The square loss has been commonly used in MF [8, 30]. This implicitly assumes the Gaussian noise, and is sensitive to outliers. Eriksson and van den Hengel [12] proposed robust matrix factorization (RMF), which uses the ℓ1-loss, and obtains much better empirical performance. However, the resultant nonconvex nonsmooth optimization problem is much more difficult. Most RMF solvers are not scalable [6, 12, 22, 27, 40]. The current state-of-the-art solver is RMF-MM [26], which is based on majorization minimization (MM) [20, 24]. In each iteration, a convex nonsmooth surrogate is optimized. RMF-MM is advantageous in that it has theoretical convergence guarantees, and demonstrates fast empirical convergence [26]. However, it cannot utilize data sparsity. This is problematic in applications such as structure from motion [23] and recommender system [30], where the data matrices, though large, are often sparse. Though the ℓ1-loss used in RMF is more robust than the ℓ2, still it may not be robust enough for outliers. Recently, better empirical performance is obtained in total-variation image denosing by using the ℓ0-loss instead [35], and in sparse coding the capped-ℓ1 loss [21]. A similar observation is also made on the ℓ1-regularizer in sparse learning and low-rank matrix learning [16, 38, 41]. To alleviate this problem, various nonconvex regularizers have been introduced. Examples include the Geman penalty [14], Laplace penalty [34], log-sum penalty (LSP) [9] minimax concave penalty (MCP) [39], and the smooth-capped-absolute-deviation (SCAD) penalty [13]. These regularizers are similar in shape to Tukey’s biweight function in robust statistics [19], which flattens for large values. Empirically, they achieve much better performance than ℓ1. In this paper, we propose to improve the robustness of RMF by using these nonconvex functions (instead of ℓ1 or ℓ2) as the loss function. The resultant optimization problem is difficult, and existing 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. RMF solvers cannot be used. As in RMF-MM, we rely on the more flexible MM optimization technique, and a new MM surrogate is proposed. To improve scalability, we transform the surrogate to its dual and then solve it with the accelerated proximal gradient (APG) algorithm [2, 32]. Data sparsity can also be exploited in the design of the APG algorithm. As for its convergence analysis, proof techniques in RMF-MM cannot be used as the loss is no longer convex. Instead, we develop new proof techniques based on the Clarke subdifferential [10], and show that convergence to a critical point can be guaranteed. Extensive experiments on both synthetic and real-world data sets demonstrate superiority of the proposed algorithm over the state-of-the-art in terms of both accuracy and scalability. Notation. For scalar x, sign (x) = 1 if x > 0, 0 if x = 0, and −1 otherwise. For a vector x, Diag(x) constructs a diagonal matrix X with Xii = xi. For a matrix X, ∥X∥F = (P i,j X2 ij)1/2 is its Frobenius norm, ∥X∥1 = P i,j |Xij| is its ℓ1-norm, and nnz(X) is the number of nonzero elements in X. For a square matrix X, tr(X) = P i Xii is its trace. For two matrices X, Y , X ⊙Y denotes their element-wise product. For a smooth function f, ∇f is its gradient. For a convex f, G ∈∂f(X) = {U : f(Y ) ≥f(X) + tr(U ⊤(Y −X))} is a subgradient. 2 Related Work 2.1 Majorization Minimization Majorization minimization (MM) is a general technique to make difficult optimization problems easier [20, 24]. Consider a function h(X) which is hard to optimize. Let the iterate at the kth MM iteration be Xk. The next iterate is generated as Xk+1 = Xk + arg minX f k(X; Xk), where f k is a surrogate that is being optimized instead of h. A good surrogate should have the following properties [24]: (i) h(Xk + X) ≤f k(X; Xk) for any X; (ii) 0 = arg minX f k(X; Xk) −h(Xk + X)  and h(Xk) = f k(0; Xk); and (iii) f k is convex on X. MM only guarantees that the objectives obtained in successive iterations are non-increasing, but does not guarantee convergence of Xk [20, 24]. 2.2 Robust Matrix Factorization (RMF) In matrix factorization (MF), the data matrix M ∈Rm×n is approximated by UV ⊤, where U ∈ Rm×r, V ∈Rn×r and r ≪min(m, n) is the rank. In applications such as structure from motion (SfM) [1] and recommender systems [30], some entries of M may be missing. In general, the MF problem can be formulated as: minU,V 1 2∥W ⊙(M −UV ⊤)∥2 F + λ 2 (∥U∥2 F + ∥V ∥2 F ), where W ∈{0, 1}m×n contains indices to the observed entries in M (with Wij = 1 if Mij is observed, and 0 otherwise), and λ ≥0 is a regularization parameter. The ℓ2-loss is sensitive to outliers. In [11], it is replaced by the ℓ1-loss, leading to robust matrix factorization (RMF): min U,V ∥W ⊙(M −UV ⊤)∥1 + λ 2 (∥U∥2 F + ∥V ∥2 F ). (1) Many RMF solvers have been developed [6, 7, 12, 18, 22, 26, 27, 40]. However, as the objective in (1) is neither convex nor smooth, these solvers lack scalability, robustness and/or convergence guarantees. Interested readers are referred to Section 2 of [26] for details. Recently, the RMF-MM algorithm [26] solves (1) using MM. Let the kth iterate be (U k, V k). RMF-MM tries to find increments ( ¯U, ¯V ) that should be added to obtain the target (U, V ): U = U k + ¯U, V = V k + ¯V . (2) Substituting into (1), the objective can be rewritten as Hk( ¯U, ¯V ) ≡∥W ⊙(M −(U k + ¯U)(V k + ¯V )⊤)∥1 + λ 2 ∥U k + ¯U∥2 F + λ 2 ∥V k + ¯V ∥2 F . The following Proposition constructs a surrogate F k of Hk that satisfies properties (i) and (ii) in Section 2.1. Unlike Hk, F k is jointly convex in ( ¯U, ¯V ). Proposition 2.1. [26] Let nnz(W(i,:)) (resp. nnz(W(:,j))) be the number of nonzero elements in the ith row (resp. jth column) of W, Λr = Diag( √ nnz(W(1,:)), . . . , √ nnz(W(m,:))), and Λc = Diag( √ nnz(W(:,1)), . . . , √ nnz(W(:,n))). Then, Hk( ¯U, ¯V ) ≤F k( ¯U, ¯V ), where F k( ¯U, ¯V ) ≡∥W ⊙(M −U k(V k)⊤−¯U(V k)⊤−U k ¯V ⊤)∥1 + λ 2 ∥U k + ¯U∥2 F + 1 2∥Λr ¯U∥2 F + λ 2 ∥V k + ¯V ∥2 F + 1 2∥Λc ¯V ∥2 F . (3) 2 Equality holds iff ( ¯U, ¯V ) = (0, 0). Because of the coupling of ¯U, V k (resp. U k, ¯V ) in ¯U(V k)⊤(resp. U k ¯V ⊤) in (3), F k is still difficult to optimize. To address this problem, RMF-MM uses the LADMPSAP algorithm [25], which is a multi-block variant of the alternating direction method of multipliers (ADMM) [3]. RMF-MM has a space complexity of O(mn), and a time complexity of O(mnrIK), where I is the number of (inner) LADMPSAP iterations and K is the number of (outer) RMF-MM iterations. These grow linearly with the matrix size, and can be expensive on large data sets. Besides, as discussed in Section 1, the ℓ1-loss may still be sensitive to outliers. 3 Proposed Algorithm 3.1 Use a More Robust Nonconvex Loss In this paper, we improve robustness of RMF by using a general nonconvex loss instead of the ℓ1-loss. Problem (1) is then changed to: min U,V ˙H(U, V ) ≡ m X i=1 n X j=1 Wijφ |Mij −[UV ⊤]ij|  + λ 2 (∥U∥2 F + ∥V ∥2 F ), (4) where φ is nonconvex. We assume the following on φ: Assumption 1. φ(α) is concave, smooth and strictly increasing on α ≥0. Assumption 1 is satisfied by many nonconvex functions, including the Geman, Laplace and LSP penalties mentioned in Section 1, and slightly modified variants of the MCP and SCAD penalties. Details can be found in Appendix A. Unlike previous papers [16, 38, 41], we use these nonconvex functions as the loss, not as regularizer. The ℓ1 also satisfies Assumption 1, and thus (4) includes (1). When the ith row of W is zero, the ith row of U obtained is zero because of the ∥U∥2 F regularizer. Similarly, when the ith column of W is zero, the corresponding column in V is zero. To avoid this trivial solution, we assume the following, as in matrix completion [8] and RMF-MM. Assumption 2. W has no zero row or column. 3.2 Constructing the Surrogate Problem (4) is difficult to solve, and existing RMF solvers cannot be used as they rely crucially on the ℓ1-norm. In this Section, we use the more flexible MM technique as in RMF-MM. However, its surrogate construction scheme cannot be used here. RMF-MM uses the convex ℓ1 loss, and only needs to handle nonconvexity resulting from the product UV ⊤in (1). Here, nonconvexity in (4) comes from both from the loss and UV ⊤. The following Proposition first obtains a convex upper bound of the nonconvex φ using Taylor expansion. An illustration is shown in Figure 1. Note that this upper bound is simply a re-weighted ℓ1, with scaling factor φ′(|β|) and offset φ(|β|) −φ′(|β|)|β|. As one may expect, recovery of the ℓ1 makes optimization easier. It is known that the LSP, when used as a regularizer, can be interpreted as re-weighted ℓ1 regularization [8]. Thus, Proposition 3.1 includes this as a special case. Proposition 3.1. For any given β ∈R, φ(|α|) ≤φ′(|β|)|α|+(φ(|β|)−φ′(|β|)|β|), and the equality holds iff α = ±β. (a) Geman. (b) Laplace. (c) LSP. (d) modified MCP. (e) modified SCAD. Figure 1: Upper bounds for the various nonconvex penalties (see Table 5 in Appendix A.2) β = 1, θ = 2.5 for SCAD and θ = 0.5 for the others; and δ = 0.05 for MCP and SCAD. 3 Given the current iterate (U k, V k), we want to find increments ( ¯U, ¯V ) as in (2). ˙H in (4) can be rewritten as: ˙Hk( ¯U, ¯V ) ≡Pm i=1 Pn j=1 Wijφ(|Mij −[(U k+ ¯U)(V k + ¯V )⊤]ij|) + λ 2 ∥U k + ¯U∥2 F + λ 2 ∥V k + ¯V ∥2 F . Using Proposition 3.1, we obtain the following convex upper bound for ˙Hk. Corollary 3.2. ˙Hk( ¯U, ¯V ) ≤bk + λ 2 ∥U k + ¯U∥2 F + λ 2 ∥V k + ¯V ∥2 F + ∥˙W k ⊙(M −U k(V k)⊤− ¯U(V k)⊤−U k ¯V ⊤−¯U ¯V ⊤)∥1, where bk = Pm i=1 Pn j=1 Wij(φ(|[U k(V k)⊤]ij|)−Ak ij|[U k(V k)⊤]ij|), ˙W k = Ak ⊙W, and Ak ij = φ′(|[U k(V k)⊤]ij|). The product ¯U ¯V ⊤still couples ¯U and ¯V together. As ˙Hk is similar to Hk in Section 2.2, one may want to reuse Proposition 2.1. However, Proposition 2.1 holds only when W is a binary matrix, while ˙W k here is real-valued. Let Λk r = Diag( p sum( ˙W k (1,:)), . . . , p sum( ˙W k (m,:))) and Λk c = Diag( p sum( ˙W k (:,1)), . . . , p sum( ˙W k (:,n))). The following Proposition shows that ˙F k( ¯U, ¯V ) ≡ ∥˙W k ⊙(M −U k(V k)⊤−¯U(V k)⊤−U k ¯V ⊤)∥1 + λ 2 ∥U k + ¯U∥2 F + 1 2∥Λk r ¯U∥2 F + λ 2 ∥V k + ¯V ∥2 F + 1 2∥Λk c ¯V ∥2 F +bk, can be used as a surrogate. Moreover, it can be easily seen that ˙F k qualifies as a good surrogate in Section 2.1: (a) ˙H( ¯U +U k, ¯V +V k) ≤˙F k( ¯U, ¯V ); (b) (0, 0) = arg min ¯U, ¯V ˙F k( ¯U, ¯V )− ˙Hk( ¯U, ¯V ) and ˙F k(0, 0) = ˙H(0, 0); and (c) ˙F k is jointly convex in ¯U, ¯V . Proposition 3.3. ˙Hk( ¯U, ¯V ) ≤˙F k( ¯U, ¯V ), with equality holds iff ( ¯U, ¯V ) = (0, 0). Remark 3.1. In the special case where the ℓ1-loss is used, ˙W k = W, bk = 0 Λk r = Λr, and Λk c = Λc. The surrogate ˙F k( ¯U, ¯V ) then reduces to that in (3), and Proposition 3.3 becomes Proposition 2.1. 3.3 Optimizing the Surrogate via APG on the Dual LADMPSAP, which is used in RMF-MM, can also be used to optimize ˙F k. However, the dual variable in LADMPSAP is a dense matrix, and cannot utilize possible sparsity of W. Moreover, LADMPSAP converges at a rate of O(1/T) [25], which is slow. In the following, we propose a timeand space-efficient optimization procedure based on running the accelerated proximal gradient (APG) algorithm on the surrogate optimization problem’s dual. Note that while the primal problem has O(mn) variables, the dual problem has only nnz(W) variables. Problem Reformulation. Let Ω≡{(i1, j1), . . . , (innz(W ), jnnz(W ))} be the set containing indices of the observed elements in W, HΩ(·) be the linear operator which maps a nnz(W)-dimensional vector x to the sparse matrix X ∈Rm×n with nonzero positions indicated by Ω(i.e., Xitjt = xt where (it, jt) is the tth element in Ω), and H−1 Ω(·) be the inverse operator of HΩ. Proposition 3.4. The dual problem of min ¯U, ¯V ˙F k( ¯U, ¯V ) is min x∈Wk Dk(x) ≡ 1 2tr((HΩ(x)V k −λU k)⊤Ak r(HΩ(x)V k −λU k)) −tr(HΩ(x)⊤M) +1 2tr((HΩ(x)⊤U k −λV k)⊤Ak c(HΩ(x)⊤U k −λV k)), (5) where Wk ≡{x ∈Rnnz(W ) : |xi| ≤[ ˙wk]−1 i }, ˙wk = H−1 Ω( ˙W k), Ak r = (λI + (Λk r)2)−1, and Ak c = (λI + (Λk c)2)−1. From the obtained x, the primal ( ¯U, ¯V ) solution can be recovered as ¯U = Ak r(HΩ(x)V k −λU k) and ¯V = Ak c(HΩ(x)⊤U k −λV k). Problem (5) can be solved by the APG algorithm, which has a convergence rate of O(1/T 2) [2, 32] and is faster than LADMPSAP. As Wk involves only ℓ1 constraints, the proximal step can be easily computed with closed-form (details are in Appendix B.3) and takes only O(nnz(W)) time. The complete procedure, which will be called Robust Matrix Factorization with Nonconvex Loss (RMFNL) algorithm, is shown in Algorithm 1. The surrogate is optimized via its dual in step 4. The primal solution is recovered in step 5, and (U k, V k) are updated in step 6. Exploiting Sparsity. A direct implementation of APG takes O(mn) space and O(mnr) time per iteration. In the following, we show how these can be reduced by exploiting sparsity of W. The objective in (5) involves Ak r, Ak c and Wk, which are all related to ˙W k. Recall that ˙W k in Corollary 3.2 is sparse (as W is sparse). Thus, by exploiting sparsity, constructing Ak r, Ak c and Wk only take O(nnz(W)) time and space. 4 Algorithm 1 Robust matrix factorization using nonconvex loss (RMFNL) algorithm. 1: initialize U 1 ∈Rm×r and V 1 ∈Rm×r; 2: for k = 1, 2, . . . , K do 3: compute ˙W k in Corollary 3.2 (only on the observed positions), and Λk r, Λk c; 4: compute xk = arg minx∈Wk Dk(x) in Proposition 3.4 using APG; 5: ¯U k = Ak r HΩ(xk)V k −λU k , ¯V k = Ak c(HΩ(xk)⊤U k −λV k); 6: U k+1 = U k + ¯U k, V k+1 = V k + ¯V k; 7: end for 8: return U K+1 and V K+1. In each APG iteration, one has to compute the gradient, objective, and proximal step. First, consider the gradient ∇Dk(x) of the objective, which is equal to H−1 Ω(Ak r(HΩ(x)V k −λU k)(V k)⊤) + H−1 Ω(U k[(U k)⊤HΩ(x) −λ(V k)⊤]Ak c) −H−1 Ω(M). (6) The first term can be rewritten as ˆgk = H−1 Ω(Qk(V k)⊤), where Qk = Ak r(HΩ(x)V k −λU k). As Ak r is diagonal and HΩ(x) is sparse, Qk can be computed as Ak r(HΩ(x)V k)−λ(Ak rU k) in O(nnz(W)r+ mr) time, where r is the number of columns in U k and V k. Let the tth element in Ωbe (it, jt). By the definition of H−1 Ω(·), we have ˆgk t = Pr q=1 Qk itqV k jtq, and this takes O(nnz(W)r+mr) time. Similarly, computing the second term in (6) takes O(nnz(W)r + nr) time. Hence, computing ∇Dk(x) takes a total of O(nnz(W)r + (m + n)r) time and O(nnz(W) + (m + n)r) space (the Algorithm is shown in Appendix B.1). Similarly, the objective can be obtained in O(nnz(W)r + (m + n)r) time and O(nnz(W) + (m + n)r) space (details are in Appendix B.2). The proximal step takes O(nnz(W)) time and space, as x ∈Rnnz(W ). Thus, by exploiting sparsity, the APG algorithm has a space complexity of O(nnz(W) + (m + n)r) and iteration time complexity of O(nnz(W)r + (m + n)r). In comparison, LADMPSAP needs O(mn) space and iteration time complexity of O(mnr). A summary of the complexity results is shown in Figure 2(a). 3.4 Convergence Analysis In this section, we study the convergence of RMFNL. Note that the proof technique in RMF-MM cannot be used, as it relies on convexity of the ℓ1-loss while φ in (4) is nonconvex (in particular, Proposition 1 in [26] fails). Moreover, the proof of RMF-MM uses the subgradient. Here, as φ is nonconvex, we will use the Clarke subdifferential [10], which generalizes subgradients to nonconvex functions (a brief introduction is in Appendix C). For the iterates {Xk} generated by RMF-MM, it is guaranteed to have a sufficient decrease on the objective f in the following sense [26]: There exists a constant γ > 0 such that f(Xk) −f(Xk+1) ≥γ∥Xk −Xk+1∥2 F , ∀k. The following Proposition shows that RMFNL also achieves a sufficient decrease on its objective. Moreover, the {(U k, V k)} sequence generated is bounded, which has at least one limit point. Proposition 3.5. For Algorithm 1, {(U k, V k)} is bounded, and has a sufficient decrease on ˙H. Theorem 3.6. The limit points of the sequence generated by Algorithm 1 are critical points of (4). 4 Experiments In this section, we compare the proposed RMFNL with state-of-the-art MF algorithms. Experiments are performed on a PC with Intel i7 CPU and 32GB RAM. All the codes are in Matlab, with sparse matrix operations implemented in C++. We use the nonconvex loss functions of LSP, Geman and Laplace in Table 5 of Appendix A, with θ = 1; and fix λ = 20/(m + n) in (1) as suggested in [26]. 4.1 Synthetic Data We first perform experiments on synthetic data, which is generated as X = UV ⊤with U ∈Rm×5, V ∈Rm×5, and m = {250, 500, 1000}. Elements of U and V are sampled i.i.d. from the standard normal distribution N(0, 1). This is then corrupted to form M = X + N + S, where N is the noise matrix from N(0, 0.1), and S is a sparse matrix modeling outliers with 5% nonzero elements randomly sampled from {±5}. We randomly draw 10 log(m)/m% of the elements from 5 M as observations, with half of them for training and the other half for validation. The remaining unobserved elements are for testing. Note that the larger the m, the sparser is the observed matrix. The iterate (U 1, V 1) is initialized as Gaussian random matrices, and the iterative procedure is stopped when the relative change in objective values between successive iterations is smaller than 10−4. For the subproblems in RMF-MM and RMFNL, iteration is stopped when the relative change in objective value is smaller than 10−6 or a maximum of 300 iterations is used. Rank r is set to the ground truth (i.e., 5). For performance evaluation, we follow [26] and use the (i) testing root mean square error, RMSE = √ ∥¯W ⊙(X −¯U ¯V T )∥2 F /nnz( ¯W), where ¯W is a binary matrix indicating positions of the testing elements; and (ii) CPU time. To reduce statistical variability, results are averaged over five repetitions. Solvers for Surrogate Optimization. Here, we compare three solvers for surrogate optimization in each RMFNL iteration (with the LSP loss and m = 1000): (i) LADMPSAP in RMF-MM; (ii) APG(dense), which uses APG but without utilizing data sparsity; and (iii) APG in Algorithm 1, which utilizes data sparsity as in Section 3.3. The APG stepsize is determined by line-search, and adaptive restart is used for further speedup [32]. Figure 2 shows convergence in the first RMFNL iteration (results for the other iterations are similar). As can be seen, LADMPSAP is the slowest w.r.t. the number of iterations, as its convergence rate is inferior to both variants of APG (whose rates are the same). In terms of CPU time, APG is the fastest as it can also utilize data sparsity. (a) Complexities of surrogate optimizers. (b) Number of iterations. (c) CPU time. Figure 2: Convergence of the objective on the synthetic data set (with the LSP loss and m = 1000). Note that the curves for APG-dense and APG overlap in Figure 2(b). Table 1 shows performance of the whole RMFNL algorithm with different surrogate optimizers.1 As can be seen, the various nonconvex losses (LSP, Geman and Laplace) lead to similar RMSE’s, as has been similarly observed in [16, 38]. Moreover, the different optimizers all obtain the same RMSE. In terms of speed, APG is the fastest, then followed by APG(dense), and LADMPSAP is the slowest. Hence, in the sequel, we will only use APG to optimize the surrogate. Table 1: Performance of RMFNL with different surrogate optimizers. m = 250 (nnz: 11.04%) m = 500 (nnz: 6.21%) m = 1000 (nnz: 3.45%) loss solver RMSE CPU time RMSE CPU time RMSE CPU time LADMPSAP 0.110±0.004 17.0±1.4 0.072±0.001 195.7±34.7 0.45±0.007 950.8±138.8 LSP APG(dense) 0.110±0.004 12.1±0.6 0.073±0.001 114.4±18.8 0.45±0.007 490.1±91.9 APG 0.110±0.004 3.2±0.6 0.073±0.001 5.5±1.0 0.45±0.006 24.6±3.2 LADMPSAP 0.115±0.014 20.4±0.8 0.074±0.006 231.0±36.9 0.45±0.007 950.8±138.8 Geman APG(dense) 0.115±0.011 13.9±1.6 0.073±0.002 146.9±24.8 0.45±0.007 490.1±91.9 APG 0.114±0.009 3.1±0.5 0.073±0.002 8.3±1.1 0.45±0.006 24.6±3.2 LADMPSAP 0.110±0.004 17.1±1.5 0.072±0.001 203.4±22.7 0.45±0.007 950.8±138.8 Laplace APG(dense) 0.110±0.004 12.1±2.1 0.073±0.003 120.9±28.9 0.45±0.007 490.1±91.9 APG 0.111±0.004 2.8±0.4 0.074±0.001 5.6±1.0 0.45±0.006 24.6±3.2 Comparison with State-of-the-Art Matrix Factorization Algorithms. The ℓ2-loss-based MF algorithms that will be compared include alternating gradient descent (AltGrad) [30], Riemannian preconditioning (RP) [29], scaled alternating steepest descent (ScaledASD) [33], alternative minimization for large scale matrix imputing (ALT-Impute) [17] and online massive dictionary learning (OMDL) [28]. The ℓ1-loss-based RMF algorithms being compared include RMF-MM [26], robust matrix completion (RMC) [7] and Grassmannian robust adaptive subspace tracking algorithm 1For all tables in the sequel, the best and comparable results according to the pairwise t-test with 95% confidence are highlighted. 6 (GRASTA) [18]. Codes are provided by the respective authors. We do not compare with AOPMC [36], which has been shown to be slower than RMC [7]. As can be seen from Table 2, RMFNL produces much lower RMSE than the MF/RMF algorithms, and the RMSEs from different nonconvex losses are similar. AltGrad, RP, ScaledASD, ALT-Impute and OMDL are very fast because they use the simple ℓ2 loss. However, their RMSEs are much higher than RMFNL and RMF algorithms. A more detailed convergence comparison is shown in Figure 3. As can be seen, RMF-MM is the slowest. RMFNL with different nonconvex losses have similar convergence behavior, and they all converge to a lower testing RMSE much faster than the others. Table 2: Performance of the various matrix factorization algorithms on synthetic data. m = 250 (nnz: 11.04%) m = 500 (nnz: 6.21%) m = 1000 (nnz: 3.45%) loss algorithm RMSE CPU time RMSE CPU time RMSE CPU time ℓ2 AltGrad 1.062±0.040 1.0±0.6 0.950±0.005 1.8±0.3 0.853±0.010 6.0±4.2 RP 1.048±0.071 0.1±0.1 0.953±0.012 0.4±0.2 0.848±0.009 1.1±0.1 ScaledASD 1.042±0.066 0.2±0.1 0.950±0.009 0.4±0.3 0.847±0.009 1.2±0.5 ALT-Impute 1.030±0.060 0.2±0.1 0.937±0.010 0.3±0.1 0.838±0.009 1.0±0.2 OMDL 1.089±0.055 0.1±0.1 0.945±0.018 0.2±0.1 0.847±0.009 0.5±0.2 ℓ1 GRASTA 0.338±0.033 1.5±0.1 0.306±0.002 2.9±0.3 0.244±0.009 6.1±0.4 RMC 0.226±0.040 2.8±1.0 0.201±0.001 2.7±0.5 0.195±0.006 4.2±2.5 RMF-MM 0.194±0.032 13.4±0.6 0.145±0.009 154.9±12.5 0.122±0.004 827.7±116.3 LSP RMFNL 0.110±0.004 3.2±0.6 0.073±0.001 5.5±1.0 0.047±0.002 14.0±5.2 Geman RMFNL 0.114±0.004 3.1±0.5 0.073±0.001 8.3±1.1 0.047±0.001 19.0±4.9 Laplace RMFNL 0.111±0.004 2.8±0.4 0.074±0.001 5.6±1.0 0.047±0.002 15.9±6.1 (a) m = 250. (b) m = 500. (c) m = 1000. Figure 3: Convergence of testing RMSE for the various algorithms on synthetic data. 4.2 Robust Collaborative Recommendation In a recommender system, the love/hate attack changes the ratings of selected items to the minimum (hate) or maximum (love) [5]. The love/hate attack is very simple, but can significantly bias overall prediction. As no love/hate attack data sets are publicly available, we follow [5, 31] and manually add permutations. Experiments are performed on the popular MovieLens recommender data sets: MovieLens-100K, MovieLens-1M, and MovieLens-10M (Some statistics on these data sets are in Appendix E.1). We randomly select 3% of the items from each data set. For each selected item, all its observed ratings are set to either the minimum or maximum with equal possibilities. 50% of the observed ratings are used for training, 25% for validation, and the rest for testing. Algorithms in Section 4.1 will be compared. To reduce statistical variability, results are averaged over five repetitions. As in Section 4.1, the testing RMSE and CPU time are used for performance evaluation. Results are shown in Table 3, and Figure 4 shows convergence of the RMSE. Again, RMFNL with different nonconvex losses have similar performance and achieve the lowest RMSE. The MF algorithms are fast, but have high RMSEs. GRASTA is not stable, with large RMSE and variance. 4.3 Affine Rigid Structure-from-Motion (SfM) SfM reconstructs the 3D scene from sparse feature points tracked in m images of a moving camera [23]. Each feature point is projected to every image plane, and is thus represented by a 2mdimensional vector. With n feature points, this leads to a 2m × n matrix. Often, this matrix has missing data (e.g., some feature points may not be always visible) and outliers (arising from feature mismatch). We use the Oxford Dinosaur sequence, which has 36 images and 4, 983 feature points. As in [26], we extract three data subsets using feature points observed in at least 5, 6 and 7 7 Table 3: Performance on the MovieLens data sets. CPU time is in seconds. RMF-MM cannot converge in 104 seconds on the MovieLens-1M and MovieLens-10M data sets, and thus is not reported. MovieLens-100K MovieLens-1M MovieLens-10M loss algorithm RMSE CPU time RMSE CPU time RMSE CPU time ℓ2 AltGrad 0.954±0.004 1.0±0.2 0.856±0.005 30.6±2.5 0.872±0.003 1130.4±9.6 RP 0.968±0.008 0.2±0.1 0.867±0.002 4.4±0.4 0.948±0.011 199.9±39.0 ScaledASD 0.951±0.004 0.3±0.1 0.878±0.003 8.7±0.2 0.884±0.001 230.2±7.7 ALT-Impute 0.942±0.021 0.2±0.1 0.859±0.001 10.7±0.2 0.872±0.001 198.9±2.6 OMDL 0.958±0.003 0.1±0.1 0.873±0.008 2.6±0.5 0.881±0.003 63.4±4.2 ℓ1 GRASTA 1.057±0.218 4.6±0.3 0.842±0.011 31.1±0.6 0.876±0.047 1304.3±18.0 RMC 0.920±0.001 1.4±0.2 0.849±0.001 40.6±2.2 0.855±0.001 526.0±29.5 RMF-MM 0.901±0.003 402.3±80.0 — — — — LSP RMFNL 0.885±0.006 5.9±1.5 0.828±0.001 34.9±1.0 0.817±0.004 1508.2±69.1 Geman RMFNL 0.885±0.005 6.6±1.2 0.829±0.005 35.3±0.3 0.817±0.004 1478.5±72.8 Laplace RMFNL 0.885±0.005 4.9±1.1 0.828±0.001 35.1±0.2 0.817±0.005 1513.4±12.2 (a) MovieLens-100K. (b) MovieLens-1M. (c) MovieLens-10M. Figure 4: Convergence of testing RMSE on the recommendation data sets. images. These are denoted “D1" (with size 72×932), “D2" (72×557) and “D3" (72×336). The fully observed data matrix can be recovered by rank-4 matrix factorization [12], and so we set r = 4. We compare RMFNL with RMF-MM and its variant (denoted RMF-MM(heuristic)) in Section 4.2 of [26]. In this variant, the diagonal entries of Λr and Λc are initialized with small values and then increased gradually. It is claimed in [26] that this leads to faster convergence. However, our experimental results show that this heuristic leads to more accurate, but not faster, results. Moreover, its key pitfall is that Proposition 2.1 and the convergence guarantee for RMF-MM no longer holds. For performance evaluation, as there is no ground-truth, we follow [26] and use the (i) mean absolute error (MAE) ∥¯W ⊙( ¯U ¯V ⊤−X)∥1/nnz( ¯W), where ¯U and ¯V are outputs from the algorithm, X is the data matrix with observed positions indicated by the binary ¯W; and (ii) CPU time. As the various nonconvex penalties have been shown to have similar performance, we will only report the LSP here. Results are shown in Table 4. As can be seen, RMF-MM(heuristic) obtains a lower MAE than RMF-MM, but is still outperformed by RMFNL. RMFNL is the fastest, though the speedup is not as significant as in previous sections. This is because the Dinosaur subsets are not very sparse (the percentages of nonzero entries in “D1", “D2" and “D3" are 17.9%, 20.5% and 23.1%, respectively). Table 4: Performance on the Dinosaur data subsets. CPU time is in seconds. D1 D2 D3 MAE CPU time MAE CPU time MAE CPU time RMF-MM(heuristic) 0.374±0.031 43.9±3.3 0.381±0.022 25.9±3.1 0.382±0.034 10.8±3.4 RMF-MM 0.442±0.096 26.9±3.4 0.458±0.043 14.9±2.2 0.466±0.072 9.2±2.1 RMFNL 0.323±0.012 8.3±1.9 0.332±0.005 6.8±1.3 0.316±0.006 3.4±1.0 5 Conclusion In this paper, we improved the robustness of matrix factorization by using a nonconvex loss instead of the commonly used (convex) ℓ1 and ℓ2-losses. Second, we improved its scalability by exploiting data sparsity (which RMF-MM cannot) and using the accelerated proximal gradient algorithm (which is faster than the commonly used ADMM). The space and iteration time complexities are greatly reduced. Theoretical analysis shows that the proposed RMFNL algorithm generates a critical point. Extensive experiments on both synthetic and real-world data sets demonstrate that RMFNL is more accurate and more scalable than the state-of-the-art. 8 References [1] R. Basri, D. Jacobs, and I. Kemelmacher. Photometric stereo with general, unknown lighting. International Journal of Computer Vision, 72(3):239–257, 2007. [2] M. Beck, A.and Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009. [3] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends in Machine Learning, 3(1):1–122, 2011. [4] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [5] R. Burke, M. O’Mahony, and N. Hurley. Recommender Systems Handbook. Springer, 2015. [6] R. Cabral, F. De la Torre, J. Costeira, and A. Bernardino. Unifying nuclear norm and bilinear factorization approaches for low-rank matrix decomposition. In International Conference on Computer Vision, pages 2488–2495, 2013. [7] L. Cambier and P. Absil. Robust low-rank matrix completion by Riemannian optimization. SIAM Journal on Scientific Computing, 38(5):S440–S460, 2016. [8] E.J. Candès and B. Recht. Exact matrix completion via convex optimization. Foundations of Computational Mathematics, 9(6):717–772, 2009. [9] E.J. Candès, M.B. Wakin, and S. Boyd. Enhancing sparsity by reweighted ℓ1 minimization. Journal of Fourier Analysis and Applications, 14(5-6):877–905, 2008. [10] F. Clarke. Optimization and Nonsmooth Analysis. SIAM, 1990. [11] F. De La Torre and M. Black. A framework for robust subspace learning. International Journal of Computer Vision, 54(1):117–142, 2003. [12] A. Eriksson and A. Van Den Hengel. Efficient computation of robust low-rank matrix approximations in the presence of missing data using the ℓ1-norm. In International Conference on Computer Vision and Pattern Recognition, pages 771–778, 2010. [13] J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456):1348–1360, 2001. [14] D. Geman and C. Yang. Nonlinear image recovery with half-quadratic regularization. IEEE Transactions on Image Processing, 4(7):932–946, 1995. [15] P. Gong and J. Ye. HONOR: Hybrid optimization for non-convex regularized problems. In Advance in Neural Information Processing Systems, pages 415–423, 2015. [16] P. Gong, C. Zhang, Z. Lu, J. Huang, and J. Ye. A general iterative shrinkage and thresholding algorithm for non-convex regularized optimization problems. In International Conference on Machine Learning, pages 37–45, 2013. [17] T. Hastie, R. Mazumder, J. Lee, and R. Zadeh. Matrix completion and low-rank SVD via fast alternating least squares. Journal of Machine Learning Research, 16:3367–3402, 2015. [18] J. He, L. Balzano, and A. Szlam. Incremental gradient on the Grassmannian for online foreground and background separation in subsampled video. In Computer Vision and Pattern Recognition, pages 1568–1575, 2012. [19] P. Huber. Robust Statistics. Springer, 2011. [20] D. Hunter and K. Lange. A tutorial on MM algorithms. The American Statistician, 58(1):30–37, 2004. [21] W. Jiang, F. Nie, and H. Huang. Robust dictionary learning with capped ℓ1-norm. In International Joint Conference on Artificial Intelligence, pages 3590–3596, 2015. [22] E. Kim, M. Lee, C. Choi, N. Kwak, and S. Oh. Efficient ℓ1-norm-based low-rank matrix approximations for large-scale problems using alternating rectified gradient method. IEEE Transactions on Neural Networks and Learning Systems, 26(2):237–251, 2015. 9 [23] J. Koenderink and A. Van Doorn. Affine structure from motion. Journal of the Optical Society of America, 8(2):377–385, 1991. [24] K. Lange, R. Hunter, and I. Yang. Optimization transfer using surrogate objective functions. Journal of Computational and Graphical Statistics, 9(1):1–20, 2000. [25] Z. Lin, R. Liu, and H. Li. Linearized alternating direction method with parallel splitting and adaptive penalty for separable convex programs in machine learning. Machine Learning, 2(99):287–325, 2015. [26] Z. Lin, C. Xu, and H. Zha. Robust matrix factorization by majorization minimization. IEEE Transactions on Pattern Analysis and Machine Intelligence, (99), 2017. [27] D. Meng, Z. Xu, L. Zhang, and J. Zhao. A cyclic weighted median method for ℓ1 low-rank matrix factorization with missing entries. In AAAI Conference on Artificial Intelligence, pages 704–710, 2013. [28] A. Mensch, J. Mairal, B. Thirion, and G. Varoquaux. Dictionary learning for massive matrix factorization. In International Conference on Machine Learning, pages 1737–1746, 2016. [29] B. Mishra and R. Sepulchre. Riemannian preconditioning. SIAM Journal on Optimization, 26(1):635–660, 2016. [30] A. Mnih and R. Salakhutdinov. Probabilistic matrix factorization. In Advance in Neural Information Processing Systems, pages 1257–1264, 2008. [31] B. Mobasher, R. Burke, R. Bhaumik, and C. Williams. Toward trustworthy recommender systems: An analysis of attack models and algorithm robustness. ACM Transactions on Internet Technology, 7(4):23, 2007. [32] Y. Nesterov. Gradient methods for minimizing composite functions. Mathematical Programming, 140(1):125–161, 2013. [33] J. Tanner and K. Wei. Low rank matrix completion by alternating steepest descent methods. Applied and Computational Harmonic Analysis, 40(2):417–429, 2016. [34] J. Trzasko and A. Manduca. Highly undersampled magnetic resonance image reconstruction via homotopicminimization. IEEE Transactions on Medical Imaging, 28(1):106–121, 2009. [35] M. Yan. Restoration of images corrupted by impulse noise and mixed Gaussian impulse noise using blind inpainting. SIAM Journal on Imaging Sciences, 6(3):1227–1245, 2013. [36] M. Yan, Y. Yang, and S. Osher. Exact low-rank matrix completion from sparsely corrupted entries via adaptive outlier pursuit. Journal of Scientific Computing, 56(3):433–449, 2013. [37] J. Yang and J. Leskovec. Overlapping community detection at scale: a nonnegative matrix factorization approach. In Web Search and Data Mining, pages 587–596, 2013. [38] Q. Yao, J. Kwok, T. Wang, and T. Liu. Large-scale low-rank matrix learning with nonconvex regularizers. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018. [39] C. Zhang. Nearly unbiased variable selection under minimax concave penalty. Annals of Statistics, 38(2):894–942, 2010. [40] Y. Zheng, G. Liu, S. Sugimoto, S. Yan, and M. Okutomi. Practical low-rank matrix approximation under robust ℓ1-norm. In International Conference on Computer Vision and Pattern Recognition, pages 1410–1417, 2012. [41] W. Zuo, D. Meng, L. Zhang, X. Feng, and D. Zhang. A generalized iterated shrinkage algorithm for non-convex sparse coding. In International Conference on Computer Vision, pages 217–224, 2013. 10
2018
196
7,359
Pipe-SGD: A Decentralized Pipelined SGD Framework for Distributed Deep Net Training Youjie Li†, Mingchao Yu*, Songze Li*, Salman Avestimehr*, Nam Sung Kim†, and Alexander Schwing† †University of Illinois at Urbana-Champaign *University of Southern California Abstract Distributed training of deep nets is an important technique to address some of the present day computing challenges like memory consumption and computational demands. Classical distributed approaches, synchronous or asynchronous, are based on the parameter server architecture, i.e., worker nodes compute gradients which are communicated to the parameter server while updated parameters are returned. Recently, distributed training with AllReduce operations gained popularity as well. While many of those operations seem appealing, little is reported about wall-clock training time improvements. In this paper, we carefully analyze the AllReduce based setup, propose timing models which include network latency, bandwidth, cluster size and compute time, and demonstrate that a pipelined training with a width of two combines the best of both synchronous and asynchronous training. Specifically, for a setup consisting of a four-node GPU cluster we show wall-clock time training improvements of up to 5.4× compared to conventional approaches. 1 Introduction Deep nets [25, 3] are omnipresent across fields from computer vision and natural language processing to computational biology and robotics. Across domains and tasks they have demonstrated impressive results by automatically extracting hierarchical abstractions of representations from many different datasets. The surge in popularity pivoted in the 2010s, with impressive results being demonstrated on the ImageNet dataset [22, 42]. Since then, deep nets have been applied to many more tasks. Prominent examples include recognition of places [53], playing of Atari games [34, 35], and the game of Go [45]. Common to all those methods is the use of large datasets to fuel the many layers of deep nets. Importantly, in the last few years, the number of layers, or more generally the depth of the computation tree has increased significantly from a few layers for LeNet [26] to several 100s or 1000s [14, 24]. Inherent to the increasing complexity of the computation graph is an increase in training time and often also an increase in the amount of data that is processed. Traditionally, computational performance increases do not keep up with the desired processing needs despite the use of accelerators like GPUs. Beyond accelerators, parallelization of computation on multiple computers is therefore popular. However, it requires frequent communication to exchange a large amount of data among compute nodes while the bandwidth of network interfaces is limited. This in turn significantly diminishes the benefit of parallelization, as a substantial fraction of training time is spent to communicate data. The fraction of time spent on communication is further increased when applying accelerators [16, 7, 38, 52, 48, 49, 44], as they decrease computation time while leaving communication time untouched. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. To take advantage of parallelization across machines, a variety of approaches have been developed starting from the popular MapReduce paradigm [9, 51, 19, 37]. Despite their benefits, communication heavy training of deep nets is often based on custom implementations [8, 6, 36, 20] relying on the parameter server architecture [28, 27, 15], where the centralized server aggregates the gradients from workers and distributes the updated weights, either in a synchronous or asynchronous manner. Recent research proposed to use a decentralized architecture with global synchronization among nodes [12, 33]. However, in common to all the aforementioned techniques, little is reported regarding the timing analysis of distributed deep net training. In this paper, we analyze the wall-clock time trade-offs between communication and computation. To this end we develop a model to assess the training time based on a set of parameters such as latency, cluster size, network bandwith, model size, etc. Based on the results of our model we develop Pipe-SGD, a framework with pipelined training and balanced communication, and show its convergence properties by adjusting proofs of [23, 15]. We also show what types of compression can be efficiently included in an AllReduce based framework. Finally, we assess the speedups of our proposed approach on a GPU cluster of four nodes with 10GbE network, showing wall-clock time training improvements by a factor of 3.2 ∼5.4× compared to conventional centralized and decentralized approaches without degradation in accuracy. 2 Background General Training of Deep Nets: Training of deep nets involves finding the parameters w of a predictor F(x,w) given input data x. To this end we minimize a loss function ℓ(F(x,w),y) which compares the predictor output F(x,w) for given data x and the current w to the ground-truth annotation y. Given a dataset D = {(x,y)}, finding w is formally summarized via: min w fD(w) := 1 |D| ∑ (x,y)∈D ℓ(F(x,w),y). (1) Optimization of the objective given in Eq. (1) w.r.t. the parameters w, e.g., via gradient descent using ∂fD ∂w , can be challenging due to not only the complexity of evaluating the predictor F(x,w) and its derivative, but also the size of the dataset |D|. Consequently, stochastic gradient descent (SGD) emerged as a popular technique. We randomly sample a subset B of the dataset, often also referred to as a minibatch. Instead of computing the gradient on the entire dataset D, we approximate it using the samples in the minibatch, i.e., we assume ∂fD ∂w ≈∂fB ∂w . However, for present day datasets and predictors, computation of the gradient ∂fB ∂w on a single machine is still challenging. Minibatch sizes |B| of less than 20 samples are common, e.g., when training for semantic image segmentation [5]. Distributed Training of Deep Nets: To train larger models or to increase the minibatch size, distributed training on multiple compute nodes is used [8, 15, 6, 27, 28, 36, 16]. A popular architecture to facilitate distributed training is the parameter server framework [15, 27, 28]. The parameter server maintains a copy of the current parameters, and communicates with a group of worker nodes, each of which operates on a small minibatch to compute local gradients based on the retrieved parameters w. Upon having completed its task, the worker shares the gradients with the parameter server. Once the parameter server has obtained all or some of the gradients it updates the parameters using the negative gradient direction and afterwards shares the latest values with the workers. Asynchronous updates where each worker independently pulls w from the server, computes its own local gradient, and pushes results back are available and illustrated in Fig. 1 (a). Due to the asynchrony, minimal synchronization overhead is traded with staleness of gradients. Methods for staleness control exist, which bound the number of delay steps [15]. However, note that stale gradients may slow down training significantly. Importantly, all those frameworks are based on a centralized compute topology which forms a communication bottleneck, increasing the training time as the cluster size scales. The time taken by pushing gradient, update, and pulling w can be linear in the cluster size due to network congestion. Therefore, most recently, decentralized training frameworks gained popularity in both the synchronous and asynchronous setting [30, 31]. However, those approaches assume decentralized workers are either completely synchronous (as in Fig. 1 (b)) or completely asynchronous, which requires to either deal with long execution time every iteration or pay for uncontrolled gradient staleness. 2 (a) Worker 1 Iteration Dependence: K=2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 1 Iteration Dependence: K=2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Time Worker 2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 1 Iteration Dependence: K=2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Time Worker 2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 3 Update Compute Communicate Update Compute Communicate Worker 3 Time Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 2 Update Compute Communicate Update Compute Communicate Worker 2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 1 Update Compute Communicate Update Compute Communicate Worker 1 Update Compute Communicate Update Compute Communicate Worker 3 Time Update Compute Communicate Update Compute Communicate Worker 2 Update Compute Communicate Update Compute Communicate Worker 1 push grad Compute Communicate Communicate Compute Communicate Communicate Compute Communicate Communicate Compute Communicate Communicate W2 W3 Worker 1 Worker 2 Worker 3 Worker 4 W4 W5 Time Parameter Server pull w Compute Communicate Communicate Compute Communicate Communicate Communicate Compute Communicate Communicate Compute Communicate W1 push grad Compute Communicate Communicate Compute Communicate Communicate W2 W3 Worker 1 Worker 2 Worker 3 Worker 4 W4 W5 Time Parameter Server pull w Compute Communicate Communicate Communicate Compute Communicate W1 Worker 1 Iteration Dependence: K=2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Time Worker 2 Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Update Compute Communicate Worker 3 Time Update Compute Communicate Update Compute Communicate Worker 2 Update Compute Communicate Update Compute Communicate Worker 1 push grad Compute Communicate Communicate Compute Communicate Communicate W2 W3 Worker 1 Worker 2 Worker 3 Worker 4 W4 W5 Time Parameter Server pull w Compute Communicate Communicate Communicate Compute Communicate W1 (b) (c) Figure 1: Comparison between different distributed learning frameworks: (a) parameter server with asynchronous training, (b) decentralized synchronous training, and (c) decentralized pipeline training. Compression in Distributed Training: As the model size increases and cluster size scales, communication overhead in distributed learning system dominates the training time, e.g., up to 80 ∼90% even in a high-speed network environment [29, 10]. To reduce the communication time, various compression algorithms have been proposed recently [43, 46, 11, 4, 50, 33, 2], some of which focus on reducing the precision of communicated gradients through scalar quantization into 1 bit, while others focus on reducing the quantity of gradients to be transferred. Most compression works, however, only emphasize on achieving high compression ratio or low loss in accuracy without reporting the wall-clock training time. In practice, compression without knowledge of the communication process is usually counterproductive [29], i.e., the total training time often increases. This is due to the fact that AllReduce is a multi-step algorithm which requires transferred gradients to be compressed and decompressed repeatedly with a worst-case complexity linear in the cluster size, as we discuss below in Sec. 3.2. 3 Decentralized Pipelined Stochastic Gradient Descent Overview: To address the aforementioned issues (network congestion for a central server, long execution time for synchronous training, and stale gradients in asynchronous training) we propose a new decentralized learning framework, Pipe-SGD, shown in Fig. 1 (c). It balances communication among nodes via AllReduce and pipelines the local training iterations to hide communication time. We developed Pipe-SGD by analyzing a timing model for wall-clock train time under different resource conditions using various communication approaches. We find that the proposed Pipe-SGD is optimal when gradient updates are delayed by only one iteration and the time taken by each iteration is dominated by local computation on workers. Moreover, we found lossy compression to further reduce communication time without impacting accuracy. Due to local pipelined training, balanced communication, and compression, the communication time is no longer part of the critical path, i.e., it is completely masked by computation, leading to linear speedup of end-to-end training time as the cluster size scales. Finally, we prove the convergence of Pipe-SGD for convex and strongly convex objectives by adjusting the proof of [23, 15]. 3.1 Timing Models and Decentralized Pipe-SGD Timing Model: We propose timing models based on decentralized synchronous SGD to analyze the wall-clock runtime of training. Each training iteration consists of three major stages: model update, gradient computation, and gradient communication. Classical synchronous SGD (Fig. 1 (b)) runs local iterations on workers sequentially, i.e., each update depends on the gradient from the previous iteration, i.e., the iteration dependency is 1. Therefore the total runtime of synchronous SGD can be formulated easily as: ltotal_sync = T ·(lup +lcomp +lcomm), (2) where T denotes the total number of training iterations and lup,lcomp,lcomm refer to the time taken by update, compute, and communication, respectively. It is apparent that synchronous SGD depends on the sum of execution time taken by all stages, which leads to long end-to-end training time. 3 Each Worker Iteration Dependence: K=2 Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle (With limited resources) Each Worker Iteration Dependence: K=2 Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle (With limited resources) Update Forward B 1 B 2 ... B L Allred1 Allred2 AllredL ... Update Forward B 1 B 2 ... B L Allred1 Allred2 AllredL ... Update Forward Allreduce Backward Update Forward Allreduce Backward Sequential Pipeline Update Forward B 1 B 2 ... B L Allred1 Allred2 AllredL ... Update Forward Allreduce Backward Sequential Pipeline W[0] W[1] W[2] Step 1 and 2: Transmit and Reduce Step3 and 4: Send back Reduced Results blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] Step 1 and 2: Transmit and Reduce Step3 and 4: Send back Reduced Results blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] W[0] W[1] W[2] Step 1 and 2: Transmit and Reduce Step3 and 4: Send back Reduced Results blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] Each Worker Iteration Dependence: K=2 Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle Update Compute Communicate Idle (With limited resources) Update Forward B 1 B 2 ... B L Allred1 Allred2 AllredL ... Update Forward Allreduce Backward Sequential Pipeline W[0] W[1] W[2] Step 1 and 2: Transmit and Reduce Step3 and 4: Send back Reduced Results blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] blk[0] blk[1] blk[2] (a) (b) (c) Figure 2: Timing model of Pipe-SGD: (a) each worker with limited resources, (b) sequential v.s. pipelined gradient communication, and (c) an example of gradient communication: Ring-AllReduce. On the contrary, Pipe-SGD relaxes the iteration dependency to K, i.e., each update depends only on the gradients of the K-th last iteration. This enables interleaving between neighboring iterations while maintaining globally synchronized communication, as shown in Fig. 1 (c). If we assume ideal conditions where both computation resources (CPU, GPU, other accelerators) and communication resources (communication links) are unlimited or abundant in counts/bandwidth, then the total runtime of Pipe-SGD is: ltotal_pipe = T/K ·(lup +lcomp +lcomm), (3) where K denotes the iteration dependency or the gradient staleness. We observe that the end-to-end training time in Pipe-SGD can be shortened by a factor of K. However, the ideal resource assumption doesn’t hold in practice, because both computation and communication resources are strictly limited on each worker node in today’s distributed systems. As a result, the timing model for distributed learning is resource bound, either communication or computation bound, as shown in Fig. 2 (a), i.e., the total runtime is: ltotal_pipe = T ·max(lup +lcomp,lcomm), (4) where the total runtime is solely determined by either computation or communication resources, regardless of K (when K ≥2). Also, since gradient updates are always delayed by (K −1) iterations, increasing K > 2 only harms, i.e., the optimal value of K = 2 for Pipe-SGD with limited resources. Hence, the staleness of gradients is limited to 1 iteration, i.e., the minimal staleness achievable in asynchronous updates. Besides, we generally prefer a computation-bound setting for distributed training system, i.e., lup + lcomp > lcomm. To achieve this we discuss compression techniques in Sec. 3.2. In addition to pipelined execution of iterations, we also analyze pipelined gradient communication within each iteration to reduce train time. Computation of gradients, i.e., the backward-pass, and communication of gradients are often executed in a strictly sequential manner (see Fig. 2 (b)). However, pipelined gradient communication, i.e., communicating gradients immediately after they are computed, is feasible. Again, we assume limited resources and compare the sequential and pipelined gradient communication in Fig. 2 (b). To analyze the detailed timing of the those two approaches, we use the timing models for communication [47]. Communication of gradients is an AllReduce operation which aggregates the gradient vector from all workers, performs the sum reduction element-wise, and then sends the result back to all. In practice, the underlying algorithms are much more involved [47]. For example, Ring-AllReduce, one of the fastest AllReduce algorithms, performs gradient aggregation collectively among workers through balanced communication. As shown in Fig. 2 (c), each worker transmits only a block of the entire gradient vector to its neighbor and performs the sum reduction on the received block. This “transmit-and-reduce” runs in parallel on all workers, until the gradient blocks are fully reduced on a worker (different for each block). Afterwards those fully reduced blocks are sent back to the remaining workers along the virtual ring. This approach optimally utilizes the network bandwidth of all nodes. Adopting the Ring-AllReduce model of [47], we obtain the total runtime of Pipe-SGD with sequential gradient communication under the limited resource assumption via: ltotal_pipe_s = T ·max  lup +lfor +lback, 2(p−1)·α +2( p−1 p )·n·β +( p−1 p )·n·γ +S  , (5) 4 Algorithm 1: Decentralized Pipe-SGD training algorithm for each worker. On the computation thread of each worker: 1: Initialize by the same model w[0], learning rate γ, iteration dependency K, and number of iterations T. 2: for t = 1,...,T do 3: Wait until aggregated gradient gc sum in compressed format at iteration [t −K] is ready 4: Decompress gradient gsum[t −K] ←Decompress(gc sum[t −K]) 5: Update w[t] ←w[t −1]−γ ·gsum[t −K] 6: Load a batch B of training data 7: Forward pass to compute current loss fB 8: Backward pass to compute gradient glocal[t] ←∂fB ∂w[t] 9: Compress gradient gc local[t] ←Compress(glocal[t]) 10: Denote local gradient gc local[t] as ready 11: end for On the communication thread of each worker: 1: Initialize aggregated gradients gc sum of iteration [1−K,1−K +1,...,0] as zero and mark them as ready 2: for t = 1,...,T do 3: Wait until local gradient gc local[t] is ready 4: AllReduce gc sum[t] ←∑gc local[t] 5: Denote aggregated gradient gc sum[t] as ready 6: end for where lfor and lback denote forward-pass and backward-pass time, p denotes the number of workers, α the network latency, n the model size in bytes, β the byte transfer time, γ the byte sum reduction time, and S the global synchronization time. Similarly, we obtain the total runtime of Pipe-SGD with pipelined gradient communication via: ltotal_pipe_p = T ·max  lup +lfor +lb, 2(p−1)L·α +2( p−1 p )·n·β +( p−1 p )·n·γ +L·S  , (6) where L denotes the number of gradient segments, and lb denotes the backward-pass time taken by the first segment. Based on Eq. (5) and Eq. (6) we note: if a pipelined system remains communication bound, then sequential gradient communication is preferred over the pipelined gradient communication (Eq. (5) is smaller than Eq. (6) due to positive L). In practice, distributed training of large models is often communication bound, making sequential exchange the best option. To sum up, based on our timing models, we find: Pipe-SGD is optimal for K = 2, system is compute bound (after compression), and sequential gradient communication is used. Note that although our model is derived based on the Ring-AllReduce, this conclusion also applies to other AllReduce algorithms, such as recursive doubling, recursive halving and doubling, pairwise exchange, etc. [47]. Decentralized Pipeline SGD: Guided by the timing models, we develop the decentralized Pipe-SGD framework illustrated in Fig. 1 (c) where neighboring training iterations on workers are interleaved with a width of K = 2 while the execution within each iteration remains strictly sequential. Decentralized workers perform pipelined training in parallel with synchronization on gradient communication after every iteration. Due to the synchronous nature of our framework, the gradient update is always delayed by K −1 iterations, which enforces a deterministic rather than an uncontrolled staleness. In our optimal setting, the number of iterations for a delayed update is 1, as compared to O(p) where p is the cluster size in the conventional asynchronous parameter server training [15, 31, 1]. Importantly, our framework still enjoys the advantage of an asynchronous approach – interleaving of training iterations to reduce end-to-end runtime. Also, different from the parameter server architecture, we don’t congest the head node. Instead, in our case, every worker is only responsible for aggregating part of the gradients in a balanced manner such that communication and aggregate operation time are much more scalable. More formally, we outline the algorithmic structure of our implementation for each worker in Alg. 1. To be specific, each worker has two threads: one for computation and one for communication, where the former thread consumes the aggregated gradient of the K-th last iteration and generates the local gradient to be communicated, and the latter thread exchanges the local gradient and buffers the aggregated results to be consumed by the former thread. 5 The Block Transfer in Ring-AllReduce Time Line The Block Transfer in Pipelined Ring-AllReduce 1. COMM 2. REDUCE 1. COMM 2. REDUCE 1. COMM 2. REDUCE 1. COMM 2. REDUCE The Block Transfer in Ring-AllReduce Time Line The Block Transfer in Pipelined Ring-AllReduce 1. COMM 2. REDUCE 1. COMM 2. REDUCE Ring-AllReduce + Light Compression 1. COMM 2. REDUCE 1. COMM 2. REDUCE 1. COMM 2. REDUCE 1. COMM 2. REDUCE Decomp Pipelined Ring-AllReduce + Light Compression Sum Comp Time Line Ring-AllReduce + Light Compression 1. COMM 2. REDUCE 1. COMM 2. REDUCE Decomp Pipelined Ring-AllReduce + Light Compression Sum Comp Time Line (a) (b) Figure 3: Pipelining within AllReduce: (a) block transfer in native Ring-AllReduce and pipelined Ring-AllReduce, and (b) block transfer with light-weight compression. 3.2 Compression in Pipe-SGD To further reduce the communication time we integrate lossy compression into our decentralized Pipe-SGD framework. Unlike the conventional parameter server or recent decentralized framework transferring parameters over the network [8, 6, 27, 28, 36, 16, 15, 31, 30], our approach communicates only gradients and we justified empirically that gradients are much more tolerant to lossy compression than the model parameters. This seems intuitive since reducing the precision of parameters in every iteration harms the final precision of the trained model directly. Importantly, as mentioned in Sec. 3.1, compressing the communication overhead contributes to the optimal setting of Pipe-SGD. Once Pipe-SGD is completely computation bound, linear speedups of end-to-end training time can be realized as the cluster size increases. Analytically, we show this observation by deriving the scaling efficiency using the timing model given in Eq. (4). Assume that: 1) the singe-node training takes Tsingle iterations to complete with an execution time of lsingle taken by each iteration; 2) given a Pipe-SGD cluster with p workers we use the same batch size on each worker as the single-node [12]; 3) the single node and Pipe-SGD train the same epochs on the dataset. From 2) and 3), we find that the total number of iterations required for Pipe-SGD is Tsingle/p, because Pipe-SGD has a p times larger batch size while still training the same number of samples. From this we obtain the scaling efficiency SE of Pipe-SGD via SE = Actual Speedup Ideal Speedup = lsingle·Tsingle ltotal_pipe p = lsingle·Tsingle max(lup+lcomp, lcomm)· Tsingle p p = lup +lcomp max(lup +lcomp, lcomm). (7) Thus, we showed that once our system becomes compute bound with compressed communication, Pipe-SGD can achieve linear speedup as the cluster scales, i.e., SE = 1. To maintain applicability of Ring-AllReduce, we choose two simple compression approaches: truncation and scalar quantization. Truncation drops the less significant mantissa bits of floating-point values for each gradient. The scalar quantization discretizes each gradient value into an integer of limited bits, with a quantization range determined by the maximal element of a gradient vector. Due to their simplicity, we easily parallelize those compression approaches to minimize overhead. Note that compression itself can be compute-heavy and the introduced computation overhead can outweigh the benefit of compressed communication. Particularly when considering that AllReduce based communication performs multiple steps to transfer and reduce the data (see Fig. 2 (c)), requiring repeated invocation of compression and decompression, i.e., for each “transmit-and-reduce” step, with an invocation complexity linear in cluster size. Therefore, many proposed complex compression techniques [43, 46, 11, 4, 50, 33] often fail in the communication-optimal AllReduce setting, resulting in longer wallclock time. For these reasons, compression embedded inside AllReduce must be light, fast and easy to parallelize, such as a floating-point truncation or our element-wise quantization. Indeed, pipelining within AllReduce can help alleviate the heavy overhead of complex compression. However, its benefit might still be limited. Instead of pipelining of training iterations as in PipeSGD, pipelining within AllReduce interleaves the gradient communication and reduction within each AllReduce process, as illustrated in Fig. 3 (a). Since the communication time is often larger than the reduction time, the latter can be hidden by the former. Once compression is used (as in Fig. 3 (b)), the two stage pipeline becomes (decompression, sum, compression) and (compressed communication) such that light compression overhead can be masked completely. Although complex compression may also benefit from the pipelined AllReduce, the improvement is limited because the time spent by complex compression often outweighs the communication time. For example, 6 we implemented [50] within the pipelined AllReduce and found that the compression overhead is 1.6 ∼2.3× the uncompressed communication time and 25.6 ∼36.8× the compressed communication time for the benchmarks in Sec. 4, in which case the heavy overhead cannot be masked. Complete masking requires the compression overhead to be smaller than the compressed communication. In the remainder, we only consider light compressions (truncation/quantization) with native AllReduce. 3.3 Convergence To prove the convergence of Pipe-SGD we adapt the derivation from parameter-server based asynchronous training [15, 23]. We can show that the convergence rate of Pipe-SGD for convex objectives via SGD is 8FL q K T , where K = 2, F and L are constants for gradient distance and Lipschitz continuity, respectively. We can also show the convergence of Pipe-SGD for strongly convex functions, and find a rate of O( logT T ) for gradient descent. These rates are consistent with [15, 23]. Due to the page limit we defer details to the supplementary material. 4 Experimental Evaluation In this section, we demonstrate the efficacy of our approach on four benchmarks using three datasets: MNIST [26], CIFAR100 [21] and ImageNet [42]. We briefly review characteristics of those datasets before discussing metrics and setup, and finally presenting experimental results and analysis. Datasets and Deep Net Architecture • MNIST: The MNIST dataset consists of 60,000 training and 10,000 test images, each showing one of ten possible digits. The images are of size 28×28 pixels with digits located at the center of the images. We use a classical 3-layer perceptron, MNIST-MLP, with both hidden layers being 500-dimensional and with a global batch size of 100. • ImageNet: For our experiments we use 1,281,167 training and 50,000 validation examples from the ImageNet challenge. Each example comprises a color image of 256×256 pixels and belongs to one of 1000 classes. We use the classical AlexNet [22] and ResNet [14], both with a global batch size of 256. • CIFAR100: The CIFAR100 dataset is composed of 50,000 training and 10,000 test examples with 100 classes. The simple AlexNet-style CIFAR100 architecture in [32] is used for benchmarking this datasets. It consists of 3 convolutional layers and 2 fully connected layers followed by a softmax layer. The detailed parameters are available in [32]. Importantly, we adapt this 5 layer CIFAR100-CNN into a convex optimization benchmark, CIFAR100-Convex, to match our proof of convergence. The convexity is achieved by training only the last fully connected layer while fixing the parameters of all previous layers. Metrics and Setup We measure the wall-clock time of end-to-end training, i.e., the same number of iterations for different settings. For each benchmark, we evaluate the timing model we proposed using end-to-end train time and detailed timing breakdowns. We plot the test/validation accuracy over training time to evaluate the actual convergence. Also, final top-1 accuracies on the test/validation set are reported. For the setup, we use a cluster of four nodes, each of which consists of a Titan XP GPU [40] and a Xeon CPU E5-2640 [17]. We employ an additional node as the parameter server to support the conventional centralized design. All nodes are connected by 10Gb Ethernet. We implement a distributed training framework in C++ using CUDA 8.0 [39], MKL 2018 [18], and OpenMPI 2.0 [41], which supports the parameter-server and Pipe-SGD approach. Results and Analysis We evaluate the performance of three different frameworks: parameter server with synchronous SGD (PS-Sync), decentralized synchronous SGD (D-Sync), and Pipe-SGD. Our compression schemes, i.e., 16-bit truncation (T) and 8-bit quantization (Q), are also applied to AllReduce communication in D-Sync and Pipe-SGD. Evaluation results are summarized in Fig. 4 where the first two columns show the convergence performances and the third column shows detailed timing breakdowns with final accuracies labeled. 7 MNIST-MLP 10 20 30 40 50 60 Train Time (sec) 0.93 0.94 0.95 0.96 0.97 0.98 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 10 20 30 40 50 60 Train Time (sec) 0.93 0.94 0.95 0.96 0.97 0.98 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 10 20 30 40 50 60 Train Time (sec) 0.93 0.94 0.95 0.96 0.97 0.98 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 200 400 600 800 1000 Train Time (sec) 0 0.2 0.4 0.6 0.8 1 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 200 400 600 800 1000 Train Time (sec) 0 0.2 0.4 0.6 0.8 1 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 200 400 600 800 1000 Train Time (sec) 0 0.2 0.4 0.6 0.8 1 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 0.5 1 1.5 2 2.5 3 3.5 Train Time (sec) x 105 0.3 0.35 0.4 0.45 0.5 0.55 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 0.5 1 1.5 2 2.5 3 3.5 Train Time (sec) x 105 0.3 0.35 0.4 0.45 0.5 0.55 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 0.5 1 1.5 2 2.5 3 3.5 Train Time (sec) x 105 0.3 0.35 0.4 0.45 0.5 0.55 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant AlexNet 0 1 2 3 4 5 6 7 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 1 2 3 4 5 6 7 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 1 2 3 4 5 6 7 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Decentralized Sync + 8-bit Quant Pipe-SGD Pipe-SGD + 16-bit Trunct Pipe-SGD + 8-bit Quant 0 5 10 15 Train Time (sec) x 104 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 5 10 15 Train Time (sec) x 104 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 5 10 15 Train Time (sec) x 104 0.35 0.4 0.45 0.5 0.55 0.6 0.65 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 0.5 1 1.5 2 2.5 3 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 0.5 1 1.5 2 2.5 3 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 0.5 1 1.5 2 2.5 3 Train Time (sec) x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct ResNet18 2 4 6 8 10 12 14 16 Train Time (sec) 0.36 0.38 0.4 0.42 0.44 0.46 0.48 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 2 4 6 8 10 12 14 16 Train Time (sec) 0.36 0.38 0.4 0.42 0.44 0.46 0.48 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 2 4 6 8 10 12 14 16 Train Time (sec) 0.36 0.38 0.4 0.42 0.44 0.46 0.48 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct CIFAR100-Convex 0 10 20 30 40 50 60 Train Time (sec) 0 0.1 0.2 0.3 0.4 0.5 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 10 20 30 40 50 60 Train Time (sec) 0 0.1 0.2 0.3 0.4 0.5 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct 0 10 20 30 40 50 60 Train Time (sec) 0 0.1 0.2 0.3 0.4 0.5 Top-1 Accuracy Parameter Server Sync Decentralized Sync Decentralized Sync + 16-bit Trunct Pipe-SGD Pipe-SGD + 16-bit Trunct Train Time (sec) 0 200 400 600 800 1000 0.9833 0.9833 0.9834 0.9830 0.9834 0.9836 0.9833 Computation Truncation/Quantization Allreduce/Communication Train Time (sec) 0 200 400 600 800 1000 0.9833 0.9833 0.9834 0.9830 0.9834 0.9836 0.9833 Computation Truncation/Quantization Allreduce/Communication Train Time (sec) 0 2 4 6 8 x 105 0.5697 0.5697 0.5655 0.5710 0.5683 0.5698 0.5646 Computation Truncation/Quantization Allreduce/Communication Train Time (sec) 0 2 4 6 8 x 105 0.5697 0.5697 0.5655 0.5710 0.5683 0.5698 0.5646 Computation Truncation/Quantization Allreduce/Communication Train Time (sec) 0 1 2 3 x 105 0.6610 0.6611 0.6602 0.6635 0.6630 Computation Truncation Allreduce/Communication Train Time (sec) 0 1 2 3 x 105 0.6610 0.6611 0.6602 0.6635 0.6630 Computation Truncation Allreduce/Communication Train Time (sec) 0 20 40 60 0.4793 0.4793 0.4793 0.4793 0.4797 Computation Truncation Allreduce/Communication Train Time (sec) 0 20 40 60 0.4793 0.4793 0.4793 0.4793 0.4797 Computation Truncation Allreduce/Communication Figure 4: Experimental results: Each row shows different benchmarks. The left two columns show convergence via test/validation accuracy vs. wallclock training time, where the first column is an inset of the second one. The right most column shows the detailed timing breakdown of end-to-end training. Note that the final top-1 accuracies on test/validation set are labeled on top of the bars. Convergence: From Fig. 4, we observe: decentralized approaches, i.e., D-Sync and Pipe-SGD, converge much faster than the parameter server even without compression, and Pipe-SGD shows the fastest convergence among these frameworks, especially when compression is applied. For example, the convergence curve of the CIFAR100-Convex shows that D-Sync is around 40% faster than PS-Sync and Pipe-SGD is another 37% faster than D-Sync. The advantage of Pipe-SGD is further boosted by compression, i.e., truncation in this case, and demonstrates an additional 46% faster convergence than the D-Sync with the same compression scheme. Therefore Pipe-SGD prevails with a great margin. Timing Breakdown: From Fig. 4, the comparison between centralized and decentralized designs shows 50% reduction in uncompressed communication time, thus justifying the efficacy of balanced communication. Once compression is applied, further reduction is observed. However, the actual improvement in D-Sync is not ideal considering compression factors of 2× for truncation and 4× for quantization, because the compression overhead is paid at the critical path of D-Sync. In contrast, our Pipe-SGD can hide this overhead together with computation due to the pipelined nature, as shown in “D-Sync+T” vs. “PipeSGD +T” in the MNIST benchmark. As communication is further reduced by quantization, the system becomes compute bound and Pipe-SGD switches to hide the communication instead, thus reaching the optimal setting of Pipe-SGD. This optimum can also be achieved via the simplest truncation for models with less dominant communication time, e.g., ResNet18 and CIFAR100-Convex. As a result, our approach achieves a speedup of 2.0 ∼3.2× compared to D-Sync and 4.0 ∼5.4× compared to PS-Sync for these benchmarks. Note that these speedups are based on the comparison between different approaches in the same cluster without scaling the cluster size. 8 Accuracy: Considering the potential drawback of the 1-iteration staled update and lossy compression in Pipe-SGD, we also evaluate the final test/validation accuracies after end-to-end training, as shown in Fig. 4. Interestingly, in our optimal settings “PipeSGD +T/Q,” we find that only AlexNet drops top-1 accuracy by 0.005 compared to baseline D-Sync while all other benchmarks show slightly improved accuracies. To obtain the best accuracies for the two large non-convex models such as AlexNet and ResNet, we employ a similiar warm-up scheme as in [33], i.e., we don’t turn on the pipelined training until the 5-th epoch, before which we still stick to D-Sync training to avoid the undesirable gradient change in the initial stage. Since the warm-up period is marginal compared to total number of epochs, the system performance benefits from Pipe-SGD most of the time. Note that for smaller models, especially convex ones (e.g., CIFAR100-Convex), no warm-up is required. 5 Related Work Li et al. [27, 28] proposed a parameter server framework for distributed learning and a few approaches to reduce the cost of communication among compute nodes, such as exchanging only nonzero parameter values, local caching of index list, and random skip of messages to be transmitted. Abadi et al. [1] also proposed a centralized framework, TensorFlow, which incorporates model and data parallelism for training deep nets. Both works support the asynchronous setting to improve communication efficiency but without controlling the staleness of the gradient update. Ho et al. [15] proposed SSP, another centralized asynchronous framework but with bounded staleness for gradients. The key idea of SSP: 1) each worker has its own iteration index, 2) the slowest and fastest worker must be within S iterations, otherwise, the fastest worker is forced to wait until the slowest worker catches up. However, this bound S applies to the iteration drift among workers instead of directly on the stale updates of the parameter server. As a result, each worker within the bound can still commit their updates to the server asynchronously, making the last gradient update staled heavily. In the worst case, the staleness is linear in the cluster size. Lin et al. [33] employed AllReduce as the gradient aggregation method in their synchronous framework, but little is reported regarding wallclock time benefits, especially considering that the full synchronous design suffers from the longest execution time among all workers. Besides, Lian et al. proposed AD-PSGD [31] which parallelizes the SGD process over decentralized workers in a completely asynchronous fashion. Workers run completely independently, and only communicate with a set of neighboring nodes to exchange trained weights, i.e., neighboring models are averaged to replace each worker’s local model in each iteration. However, this approach suffers from uncontrolled staleness, which in practice increases with cluster size and the time taken by each iteration. In addition, such a communication method requires each worker to act as the center node of a local graph, which results in a local communication bottleneck. As a result, each worker suffers from long iteration time which further increases the staleness of weight updates. Although Lian et al. [31] compared their framework with the full synchronous design in wall-clock time, the performance turns out to be similar when network speeds are roughly equal. Recently, independent work [13] also proposed a distributed pipelined system for DNN training. Different from Pipe-SGD, [13] focuses on pipelining with model parallelism, partitioning the DNN layers onto different machines and pipelining the execution of the machines by injecting consecutive mini-batches into the first one. This approach reduces communication load since only activations and gradients of a subset of layers are communicated between machines. However, complex mechanisms (such as profiling, partitioning algorithm, and replicated stages) are necessary to balance the workload among different machines, otherwise compute resources turn idle. Furthermore, [13] may suffer from staleness of the weight update, which is linear in the number of stages. This limits the effectiveness of model pipelining and throttles speedups. 6 Conclusion We developed a rigorous timing model for distributed deep net training which takes into account network latency, model size, byte transfer time, etc. Based on our timing model and realistic resource assumptions, e.g., limited network bandwidth, we assessed scalability and developed Pipe-SGD, a pipelined training framework which is able to mask the faster of computation or communication time. We showed efficacy of the proposed method on a four-node GPU cluster connected with 10Gb links. Rigorously assessing wall-clock time for Pipe-SGD, we are able to achieve improvements of up to 5.4× compared to conventional approaches. 9 Acknowledgement This work is supported in part by grants from NSF (IIS 17-18221, CNS 17-05047, CNS 15-57244, CCF-1763673 and CCF-1703575). This work is also supported by 3M and the IBM-ILLINOIS Center for Cognitive Computing Systems Research (C3SR). Besides, this material is based in part upon work supported by Defense Advanced Research Projects Agency (DARPA) under Contract No. HR001117C0053. The views, opinions, and/or findings expressed are those of the author(s) and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. References [1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner, P. A. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and X. Zhang. TensorFlow: A System for Large-Scale Machine Learning. In OSDI, 2016. [2] D. Alistarh, D. Grubic, J. Li, R. Tomioka, and M. Vojnovic. QSGD: Communication-Efficient SGD via Gradient Quantization and Encoding. In NIPS, 2017. [3] Y. Bengio, A. Courville, and P. Vincent. Representation Learning: A Review and New Perspectives. PAMI, 2013. [4] C.-Y. Chen, J. Choi, D. Brand, A. Agrawal, W. Zhang, and K. Gopalakrishnan. AdaComp : Adaptive Residual Gradient Compression for Data-Parallel Distributed Training. In AAAI, 2018. [5] L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, and A. L. Yuille. Semantic Image Segmentation with Deep Convolutional Nets and Fully Connected CRFs. In ICLR, 2015. [6] T. Chilimbi, Y. Suzue, J. Apacible, and K. Kalyanaraman. Project Adam: Building an efficient and scalable deep learning training system. In OSDI, 2014. [7] H. Cui, H. Zhang, G. R. Ganger, P. B. Gibbons, and E. P. Xing. GeePS: Scalable Deep Learning on Distributed GPUs with a GPU-Specialized Parameter Server. In EuroSys, 2016. [8] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, M. Ranzato, A. Senior, P. Tucker, K. Yang, Q. V. Le, and A. Y. Ng. Large Scale Distributed Deep Networks. In NIPS, 2012. [9] J. Dean and S. Ghemawat. MapReduce: Simplified Data Processing on Large Clusters. Communications of the ACM, 2008. [10] N. Dryden, N. Maruyama, T. Moon, T. Benson, A. Yoo, M. Snir, and B. V. Essen. Aluminum: An Asynchronous, GPU-Aware Communication Library Optimized for Large-Scale Training of Deep Neural Networks on HPC Systems. In MLHPC, 2018. [11] N. Dryden, T. Moon, S. A. Jacobs, and B. V. Essen. Communication Quantization for Data-Parallel Training of Deep Neural Networks. In MLHPC, 2016. [12] P. Goyal, P. Dollár, R. B. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. In CVPR, 2017. [13] A. Harlap, D. Narayanan, A. Phanishayee, V. Seshadri, N. R. Devanur, G. R. Ganger, and P. B. Gibbons. PipeDream: Fast and Efficient Pipeline Parallel DNN Training. In arXiv:1806.03377v1, 2018. [14] K. He, X. Zhang, S. Ren, and J. Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016. [15] Q. Ho, J. Cipar, H. Cui, S. Lee, J. K. Kim, P. B. Gibbons, G. A. Gibson, G. R. Ganger, and E. P. Xing. More Effective Distributed ML via a Stale Synchronous Parallel Parameter Server. In NIPS, 2013. [16] F. N. Iandola, K. Ashraf, M. W. Moskewicz, and K. Keutzer. FireCaffe: Near-linear Acceleration of Deep Neural Network Training on Compute Clusters. In CVPR, 2016. [17] Intel Corporation. Xeon CPU E5, https://www.intel.com/content/www/us/en/products/processors/xeon/e5processors.html, 2017. [18] Intel Corporation. Intel Math Kernel Library, https://software.intel.com/en-us/mkl, 2018. [19] M. Isard, M. Budiu, Y. Yu, A. Birrell, and D. Fetterly. Dryad: Distributed data-parallel programs from sequential building blocks. In ACM SIGOP, 2007. [20] H. Kim, J. Park, J. Jang, and S. Yoon. Deepspark: A spark-based distributed deep learning framework for commodity clusters. arXiv:1602.08191 [cs], 2016. [21] A. Krizhevsky. Learning Multiple Layers of Features from Tiny Images, 2009. [22] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet Classification with Deep Convolutional Neural Networks. In NIPS, 2012. 10 [23] J. Langford, A. J. Smola, and M. Zinkevich. Slow Learners are Fast. In NIPS, 2009. [24] G. Larsson, M. Maire, and G. Shakhnarovich. FractalNet: Ultra-Deep Neural Networks without Residuals. In https://arxiv.org/abs/1605.07648, 2016. [25] Y. LeCun, Y. Bengio, and G. E. Hinton. Deep learning. Nature, 2015. [26] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. IEEE, 1998. [27] M. Li, D. G. Andersen, J. W. Park, A. J. Smola, A. Ahmed, V. Josifovski, J. Long, E. J. Shekita, and B.-Y. Su. Scaling Distributed Machine Learning with the Parameter Server. In OSDI, 2014. [28] M. Li, D. G. Andersen, A. J. Smola, and K. Yu. Communication Efficient Distributed Machine Learning with the Parameter Server. In NIPS, 2014. [29] Y. Li, J. Park, M. Alian, Y. Yuan, Z. Qu, P. Pan, R. Wang, A.G. Schwing, H. Esmaeilzadeh, and N.S. Kim. A Network-Centric Hardware/Algorithm Co-Design to Accelerate Distributed Training of Deep Neural Networks. In MICRO, 2018. [30] X. Lian, C. Zhang, H. Zhang, C. Hsieh, W. Zhang, and J. Liu. Can Decentralized Algorithms Outperform Centralized Algorithms? A Case Study for Decentralized Parallel Stochastic Gradient Descent. In NIPS, 2017. [31] X. Lian, W. Zhang, C. Zhang, and J. Liu. Asynchronous Decentralized Parallel Stochastic Gradient Descent. In arXiv:1710.06952v3, 2018. [32] R. Liao, A. Schwing, R. Zemel, and R. Urtasun. Learning Deep Parsimonious Representations. In NIPS, 2016. [33] Y. Lin, S. Han, H. Mao, Y. Wang, and W. J. Dally. Deep Gradient Compression: Reducing the Communication Bandwidth for Distributed Training. In ICLR, 2018. [34] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing Atari with Deep Reinforcement Learning. In NIPS Deep Learning Workshop, 2013. [35] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, S. Petersen, C. Beattie, A. Sadik, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. Human-level Control through Deep Reinforcement Learning. Nature, 2015. [36] P. Moritz, R. Nishihara, I. Stoica, and M. I. Jordan. SparkNet: Training Deep Networks in Spark. In ICLR, 2016. [37] D. G. Murray, R. Isaacs F. McSherry, M. Isard, P. Barham, and M. Abadi. Naiad: A Timely Dataflow System. In SOSP, 2013. [38] Nvidia. GPU-Based Deep Learning Inference: A Performance and Power Analysis. In Whitepaper, 2015. [39] NVIDIA Corporation. NVIDIA CUDA C programming guide, 2010. [40] NVIDIA Corporation. TITAN Xp, https://www.nvidia.com/en-us/design-visualization/products/titan-xp/, 2017. [41] OpenMPI Community. OpenMPI: A High Performance Message Passing Library, https://www.openmpi.org/, 2017. [42] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. IJCV, 2015. [43] F. Seide, H. Fu, J. Droppo, G. Li, and D. Yu. 1-Bit Stochastic Gradient Descent and Its Application to Data-Parallel Distributed Training of Speech DNNs. In INTERSPEECH, 2014. [44] H. Sharma, J. Park, D. Mahajan, E. Amaro, J. K. Kim, C. Shao, A. Misra, and H. Esmaeilzadeh. From High-Level Deep Neural Models to FPGAs. In MICRO, 2016. [45] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. van den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, S. Dieleman, D. Grewe, J. Nham, N. Kalchbrenner, I. Sutskever, T. Lillicrap, M. Leach, K. Kavukcuoglu, T. Graepel, and D. Hassabis. Mastering the Game of Go with Deep Neural Networks and Tree Search. Nature, 2016. [46] N. Strom. Scalable Distributed DNN Training using Commodity GPU Cloud Computing. In INTERSPEECH, 2015. [47] R. Thakur, R. Rabenseifner, and W. Gropp. Optimization of Collective Communication Operations in MPICH. IJHPCA, 2005. [48] Q. Wang, Y. Li, and P. Li. Liquid State Machine based Pattern Recognition on FPGA with Firing-Activity Dependent Power Gating and Approximate Computing. In ISCAS, 2016. 11 [49] Q. Wang, Y. Li, B. Shao, S. Dey, and Peng Li. Energy Efficient Parallel Neuromorphic Architectures with Approximate Arithmetic on FPGA. Neurocomputing, 2017. [50] W. Wen, C. Xu, F. Yan, C. Wu, Y. Wang, Y. Chen, and H. Li. TernGrad: Ternary Gradients to Reduce Communication in Distributed Deep Learning. In NIPS, 2017. [51] M. Zaharia, M. Chowdhury, Michael J. Franklin, S. Shenker, and I. Stoica. Spark: Cluster Computing with Working Sets. In HotCloud, 2010. [52] C. Zhang, P. Li, G. Sun, Y. Guan, B. Xiao, and J. Cong. Optimizing FPGA-based Accelerator Design for Deep Convolutional Neural Networks. In FPGA, 2015. [53] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva. Learning Deep Features for Scene Recognition using Places Database. In NIPS, 2014. 12
2018
197
7,360
Wasserstein Variational Inference Luca Ambrogioni* Radboud University l.ambrogioni@donders.ru.nl Umut Güçlü* Radboud University u.guclu@donders.ru.nl Ya˘gmur Güçlütürk Radboud University y.gucluturk@donders.ru.nl Max Hinne University of Amsterdam m.hinne@uva.nl Eric Maris Radboud University e.maris@donders.ru.nl Marcel A. J. van Gerven Radboud University m.vangerven@donders.ru.nl Abstract This paper introduces Wasserstein variational inference, a new form of approximate Bayesian inference based on optimal transport theory. Wasserstein variational inference uses a new family of divergences that includes both f-divergences and the Wasserstein distance as special cases. The gradients of the Wasserstein variational loss are obtained by backpropagating through the Sinkhorn iterations. This technique results in a very stable likelihood-free training method that can be used with implicit distributions and probabilistic programs. Using the Wasserstein variational inference framework, we introduce several new forms of autoencoders and test their robustness and performance against existing variational autoencoding techniques. 1 Introduction Variational Bayesian inference is gaining a central role in machine learning. Modern stochastic variational techniques can be easily implemented using differentiable programming frameworks [1–3]. As a consequence, complex Bayesian inference is becoming almost as user friendly as deep learning [4, 5]. This is in sharp contrast with old-school variational methods that required modelspecific mathematical derivations and imposed strong constraints on the possible family of models and variational distributions. Given the rapidness of this transition it is not surprising that modern variational inference research is still influenced by some legacy effects from the days when analytical tractability was the main concern. One of the most salient examples of this is the central role of the (reverse) KL divergence [6, 7]. While several other divergence measures have been suggested [8–12], the reverse KL divergence still dominates both research and applications. Recently, optimal transport divergences such as the Wasserstein distance [13, 14] have gained substantial popularity in the generative modeling literature as they can be shown to be well-behaved in several situations where the KL divergence is either infinite or undefined [15–18]. For example, the distribution of natural images is thought to span a sub-manifold of the original pixel space [15]. In these situations Wasserstein distances are considered to be particularly appropriate because they can be used for fitting degenerate distributions that cannot be expressed in terms of densities [15]. In this paper we introduce the use of optimal transport methods in variational Bayesian inference. To this end, we define the new c-Wasserstein family of divergences, which includes both Wasserstein *These authors contributed equally to this paper. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. metrics and all f-divergences (which have both forward and reverse KL) as special cases. Using this family of divergences we introduce the new framework of Wasserstein variational inference, which exploits the celebrated Sinkhorn iterations [19, 20] and automatic differentiation. Wasserstein variational inference provides a stable gradient-based black-box method for solving Bayesian inference problems even when the likelihood is intractable and the variational distribution is implicit [21, 22]. Importantly, as opposed to most other implicit variational inference methods [21–24], our approach does not rely on potentially unstable adversarial training [25]. 1.1 Background on joint-contrastive variational inference We start by briefly reviewing the framework of joint-contrastive variational inference [23, 21, 9]. For notational convenience we will express distributions in terms of their densities. Note however that those densities could be degenerate. For example, the density of a discrete distribution can be expressed in terms of delta functions. The posterior distribution of the latent variable z given the observed data x is p(z|x) = p(z, x)/p(x). While the joint probability p(z, x) is usually tractable, the evaluation of p(x) often involves an intractable integral or summation. The central idea of variational Bayesian inference is to minimize a divergence functional between the intractable posterior p(z|x) and a tractable parametrized family of variational distributions. This form of variational inference is sometimes referred to as posterior-contrastive. Conversely, in joint-contrastive inference the divergence to minimize is defined between two structured joint distributions. For example, using the reverse KL we have the following cost functional: DKL(p(x, z)∥q(x, z)) = Eq(x,z)  log q(x, z) p(x, z)  , (1) where q(x, z) = q(z|x)k(x) is the product between the variational posterior and the sampling distribution of the data. Usually k(x) is approximated as the re-sampling distribution of a finite training set, as in the case of variational autoencoders (VAE) [26]. The advantage of this jointcontrastive formulation is that it does not require the evaluation of the intractable distribution p(z|x). Joint-contrastive variational inference can be seen as a generalization of amortized inference [21]. 1.2 Background on optimal transport Intuitively speaking, optimal transport divergences quantify the distance between two probability distributions as the cost of transporting probability mass from one to the other. Let Γ[p, q] be the set of all bivariate probability measures on the product space X × X whose marginals are p and q respectively. An optimal transport divergence is defined by the following optimization: Wc(p, q) = inf γ∈Γ[p,q] Z c(x1, x2) dγ(x1, x2) , (2) where c(x1, x2) is the cost of transporting probability mass from x1 to x2. When the cost is a metric function the resulting divergence is a proper distance and it is usually referred to as the Wasserstein distance. We will denote the Wasserstein distance as W(p, q). The computation of the optimization problem in Eq. 2 suffers from a super-cubic complexity. Recent work showed that this complexity can be greatly reduced by adopting entropic regularization [20]. We begin by defining a new set of joint distributions: Uϵ[p, q] =  γ ∈Γ[p, q] DKL(γ(x, y)∥p(x)q(y)) ≤ϵ−1 . (3) These distributions are characterized by having the mutual information between the two variables bounded by the regularization parameter ϵ−1. Using this family of distributions we can define the entropy regularized optimal transport divergence: Wc,ϵ(p, q) = inf u∈Uϵ[p,q] Z c(x1, x2) du(x1, x2) . (4) This regularization turns the optimal transport into a strictly convex problem. When p and q are discrete distributions the regularized optimal transport cost can be efficiently obtained using the Sinkhorn iterations [19, 20]. The ϵ-regularized optimal transport divergence is then given by: Wc,ϵ(p, q) = lim t→∞Sϵ t [p, q, c] , (5) where the function Sϵ t [p, q, c] gives the output of the t-th Sinkhorn iteration. The pseudocode of the Sinkhorn iterations is given in Algorithm 1. Note that all the operations in this algorithm are differentiable. 2 Algorithm 1 Sinkhorn Iterations. C: Cost matrix, t: Number of iterations, ϵ: Regularization strength 1: procedure SINKHORN(C, t, ϵ) 2: K = exp(−C/ϵ), n, m = shape(C) 3: r = ones(n, 1)/n, c = ones(m, 1)/m, u0 = r, τ = 0 4: while τ ≤t do 5: a = KT uτ ▷Juxtaposition denotes matrix product 6: b = c/a ▷"/" denotes entrywise division 7: uτ+1 = m/(Kb), τ = τ + 1 v = c/(KT ut), Sϵ t = sum(ut ∗(K ∗C)v) ▷"*" denotes entrywise product 8: return Sϵ t 2 Wasserstein variational inference We can now introduce the new framework of Wasserstein variational inference for general-purpose approximate Bayesian inference. We begin by introducing a new family of divergences that includes both optimal transport divergences and f-divergences as special cases. Subsequently, we develop a black-box and likelihood-free variational algorithm based on automatic differentiation through the Sinkhorn iterations. 2.1 c-Wasserstein divergences Traditional divergence measures such as the KL divergence depend explicitly on the distributions p and q. Conversely, optimal transport divergences depend on p and q only through the constraints of an optimization problem. We will now introduce the family of c-Wasserstein divergences that generalize both forms of dependencies. A c-Wasserstein divergence has the following form: WC(p, q) = inf γ∈Γ[p,q] Z Cp,q(x1, x2) dγ(x1, x2) , (6) where the real-valued functional Cp,q(x1, x2) depends both on the two scalars x1 and x2 and on the two distributions p and q. Note that we are writing this dependency in terms of the densities only for notational convenience and that this dependency should be interpreted in terms of distributions. The cost functional Cp,q(x1, x2) is assumed to respect the following requirements: 1. Cp,p(x1, x2) ≥0, ∀x1, x2 ∈supp(p) 2. Cp,p(x, x) = 0, ∀x ∈supp(p) 3. Eγ[Cp,q(x1, x2)] ≥0, ∀γ ∈Γ[p, q] , where supp(p) denotes the support of the distribution p. From these requirements we can derive the following theorem: Theorem 1. The functional WC(p, q) is a (pseudo-)divergence, meaning that WC(p, q) ≥0 for all p and q and WC(p, p) = 0 for all p. Proof. From property 1 and property 2 it follows that, when p is equal to q, Cp,p(x1, x2) is a nonnegative function of x and y that vanishes when x = y. In this case, the optimization in Eq. 6 is optimized by the diagonal transport γ(x1, x2) = p(x1)δ(x1 −x2). In fact: WC(p, p) = Z Cp,p(x1, x2)p(x1)δ(x1 −x2) dx1 dx2 = Z Cp,p(x1, x1)p(x1) dx1 = 0 . (7) This is a global minimum since property 3 implies that WC(p, q) is always non-negative. All optimal transport divergences are part of the c-Wasserstein family, where Cp,q(x, y) reduces to a non-negative valued function c(x1, x2) independent from p and q. Proving property 3 for an arbitrary cost functional can be a challenging task. The following theorem provides a criterion that is often easier to verify: 3 Theorem 2. Let f : R →R be a convex function such that f(1) = 0. The cost functional Cp,q(x, y) = f(g(x, y)) respects property 3 when Eγ[g(x, y)] = 1 for all γ ∈Γ[p, q]. Proof. The result follows directly from Jensen’s inequality. 2.2 Stochastic Wasserstein variational inference We can now introduce the general framework of Wasserstein variational inference. The loss functional is a c-Wasserstein divergence between p(x, z) and q(x, z): LC[p, q] = WC(p(z, x), q(z, x)) = inf γ∈Γ[p,q] Z Cp,q(x1, z1; x2, z2) dγ(x1, z1; x1, z1) . (8) From Theorem 1 it follows that this variational loss is always minimized when p is equal to q. Note that we are allowing members of the c-Wasserstein divergence family to be pseudo-divergences, meaning that LC[p, q] could be 0 even if p ̸= q. It is sometimes convenient to work with pseudodivergences when some features of the data are not deemed to be relevant. We can now derive a black-box Monte Carlo estimate of the gradient of Eq. 8 that can be used together with gradient-based stochastic optimization methods [27]. A Monte Carlo estimator of Eq 8 can be obtained by computing the discrete c-Wasserstein divergence between two empirical distributions: LC[pn, qn] = inf γ X j,k Cp,q(x(j) 1 , z(j) 1 , x(k) 2 , z(k) 2 )γ(x(j) 1 , z(j) 1 , x(k) 2 , z(k) 2 ) , (9) where (x(j) 1 , z(j) 1 ) and (x(k) 2 , z(k) 2 ) are sampled from p(x, z) and q(x, z) respectively. In the case of the Wasserstein distance, we can show that this estimator is asymptotically unbiased: Theorem 3. Let W(pn, qn) be the Wasserstein distance between two empirical distributions pn and qn. For n tending to infinity, there is a positive number s such that Epq[W(pn, qn)] ≲W(p, q) + n−1/s . (10) Proof. Using the triangle inequality and the linearity of the expectation we obtain: Epq[W(pn, qn)] ≤Ep[W(pn, p)] + W(p, q) + Eq[W(q, qn)] . (11) In [28] it was proven that for any distribution u: Eu[W(un, u)] ≤n−1/su , (12) when su is larger than the upper Wasserstein dimension (see definition 4 in [28]). The result follows with s = max(sp, sq). Unfortunately the Monte Carlo estimator is biased for finite values of n. In order to eliminate the bias when p is equal to q, we use the following modified loss: ˜LC[pn, qn] = LC[pn, qn] −(LC[pn, pn] + LC[qn, qn])/2 . (13) It is easy to see that the expectation of this new loss is zero when p is equal to q. Furthermore: lim n→∞ ˜LC[pn, qn] = LC[p, q] . (14) As we discussed in Section 1.2, the entropy-regularized version of the optimal transport cost in Eq. 9 can be approximated by truncating the Sinkhorn iterations. Importantly, the Sinkhorn iterations are differentiable and consequently we can compute the gradient of the loss using automatic differentiation [17]. The approximated gradient of the ϵ-regularized loss can be written as ∇LC[pn, qn] = ∇Sϵ t [pn, qn, Cp,q] , (15) where the function Sϵ t [pn, qn, Cp,q] is the output of t steps of the Sinkhorn algorithm with regularization ϵ and cost function Cp,q. Note that the cost is a functional of p and q and consequently the gradient contains the term ∇Cp,q. Also note that this approximation converges to the real gradient of Eq. 8 for n →∞and ϵ →0 (however the Sinkhorn algorithm becomes unstable when ϵ →0). 4 3 Examples of c-Wasserstein divergences We will now introduce two classes of c-Wasserstein divergences that are suitable for deep Bayesian variational inference. Moreover, we will show that the KL divergence and all f-divergences are part of the c-Wasserstein family. 3.1 A metric divergence for latent spaces In order to apply optimal transport divergences to a Bayesian variational problem we need to assign a metric, or more generally a transport cost, to the latent space of the Bayesian model. The geometry of the latent space should depend on the geometry of the observable space since differences in the latent space are only meaningful as far as they correspond to differences in the observables. The simplest way to assign a geometric transport cost to the latent space is to pull back a metric function from the observable space: Cp P B(z1, z2) = dx(gp(z1), gp(z2)) , (16) where dx(x1, x2) is a metric function in the observable space and gp(z) is a deterministic function that maps z to the expected value of p(x|z). In our notation the subscript p in gp denotes the fact that the distribution p(z|x) and the function gp depend on a common set of parameters which are optimized during variational inference. The resulting pullback cost function is a proper metric if gp is a diffeomorphism (i.e. a differentiable map with differentiable inverse) [29]. 3.2 Autoencoder divergences Another interesting special case of c-Wasserstein divergence can be obtained by considering the distribution of the residuals of an autoencoder. Consider the case where the expected value of q(z|x) is given by the deterministic function hq(z). We can define the latent autoencoder cost functional as the transport cost between the latent residuals of the two models: Cq LA(x1, z1; x2, z2) = d(z1 −hq(x1), z2 −hq(x2)) , (17) where d is a distance function. It is easy to check that this cost functional defines a proper cWasserstein divergence since it is non-negative valued and it is equal to zero when p is equal to q and x1, z1 are equal to x2, z2. Similarly, we can define the observable autoencoder cost functional as follows: Cp OA(x1, z1; x2, z2) = d(x1 −gp(z1), x2 −gp(z2)) , (18) where again gp(z) gives the expected value of the generator. In the case of a deterministic generator, this expression reduces to Cp OA(x1, z1; x2, z2) = d(0, x2 −gp(z2)) . (19) Note that the transport optimization is trivial in this special case since the cost does not depend on x1 and z1. In this case, the resulting divergence is just the average reconstruction error: inf γ∈Γ[p] Z d(0, x2 −gp(z2)) dγ = Eq(x,z)[d(0, x −gp(z))] . (20) As expected, this is a proper (pseudo-)divergence since it is non-negative valued and x −gp(z) is always equal to zero when x and z are sampled from p(x, z). 3.3 f-divergences We can now show that all f-divergences are part of the c-Wasserstein family. Consider the following cost functional: Cp,q f (x1, x2) = f p(x2) q(x2)  , (21) where f is a convex function such that f(0) = 1. From Theorem 2 it follows that this cost functional defines a valid c-Wasserstein divergence. We can now show that the c-Wasserstein divergence defined by this functional is the f-divergence defined by f. In fact inf γX∈Γ[p,q] Z f p(x2) q(x2)  dγX(x1, x2) = Eq(x2)  f p(x2) q(x2)  , (22) since q(x2) is the marginal of all γ(x1, x2) in Γ[p, q]. 5 4 Wasserstein variational autoencoders We will now use the concepts developed in the previous sections in order to define a new form of autoencoder. VAEs are generative deep amortized Bayesian models where the parameters of both the probabilistic model and the variational model are learned by minimizing a joint-contrastive divergence [26, 30, 31]. Let Dp and Dq be parametrized probability distributions and gp(z) and hq(x) be the outputs of deep networks determining the parameters of these distributions. The probabilistic model (decoder) of a VAE has the following form: p(z, x) = Dp(x|gp(z)) p(z) , (23) The variational model (encoder) is given by: q(z, x) = Dq(z|hq(x)) k(x) . (24) We can define a large family of objective functions of VAEs by combining the cost functionals defined in the previous section. The general form is given by the following total autoencoder cost functional: Cp,q w,f(x1, z1; x2, z2) = w1dx(x1, x2) + w2Cp P B(z1, z2) + w3Cp LA(x1, z1; x2, z2) + w4Cq OA(x1, z1; x2, z2) + w5Cp,q f (x1, z1; x2, z2) , (25) where w is a vector of non-negative valued weights, dx(x1, x2) is a metric on the observable space and f is a convex function. 5 Connections with related methods In the previous sections we showed that variational inference based on f-divergences is a special case of Wasserstein variational inference. We will discuss several theoretical links with some recent variational methods. 5.1 Operator variational inference Wasserstein variational inference can be shown to be a special case of a generalized version of operator variational inference [10]. The (amortized) operator variational objective is defined as follows: LOP = sup f∈F ζ(Eq(x,z)[Op,qf]) (26) where F is a set of test functions and ζ(·) is a positive valued function. The dual representation of the optimization problem in the c-Wasserstein loss (Eq. 6) is given by the following expression: Wc(p, q) = sup f∈LC  Ep(x,z)[f(x, z)] −Eq(x,z)[f(x, z)]  , (27) where LC[p, q] = {f : X →R | f(x1, z1) −f(x2, z2) ≤Cp,q(x1, z1; x2, z2)} . (28) Converting the expectation over p to an expectation over q using importance sampling, we obtain the following expression: Wc(p, q) = sup f∈LC[p,q]  Eq(x,z) p(x, z) q(x, z) −1  f(x, z)  , (29) which has the same form as the operator variational loss in Eq. 26 with t(x) = x and Op,q = p/q −1. Note that the fact that ζ(·) is not positive valued is irrelevant since the optimum of Eq. 27 is always non-negative. This is a generalized form of operator variational loss where the functional family can now depend on p and q. In the case of optimal transport divergences, where Cp,q(x1, z1; x2, z2) = c(x1, z1; x2, z2), the resulting loss is a special case of the regular operator variational loss. 6 5.2 Wasserstein autoencoders The recently introduced Wasserstein autoencoder (WAE) uses a regularized optimal transport divergence between p(x) and k(x) in order to train a generative model [32]. The regularized loss has the following form: LW A = Eq(x,z)[cx(x, gp(z))] + λD(p(z)∥q(z)) , (30) where cx does not depend on p and q and D(p(z)∥q(z)) is an arbitrary divergence. This loss was not derived from a variational Bayesian inference problem. Instead, the WAE loss is derived as a relaxation of an optimal transport loss between p(x) and k(x): LW A ≈Wcx(p(x), k(x)) . (31) When D(p(z)∥q(z)) is a c-Wasserstein divergence, we can show that the LW A is a Wasserstein variational inference loss and consequently that Wasserstein autoencoders are approximate Bayesian methods. In fact: Eq(x,z)[cx(x, gp(x))]+λWCz(p(z), q(z)) = inf γ∈Γ[p,q] Z [cx(x2, gp(z2)) + λCp,q z (z1, z2)] dγ . (32) In the original paper the regularization term D(p(z)∥q(z)) is either the Jensen-Shannon divergence (optimized using adversarial training) or the maximum mean discrepancy (optimized using a reproducing kernel Hilbert space estimator). Our reformulation suggests another way of training the latent space using a metric optimal transport divergence and the Sinkhorn iterations. 6 Experimental evaluation We will now demonstrate experimentally the effectiveness and robustness of Wasserstein variational inference. We focused our analysis on variational autoecoding problems on the MNIST dataset. We decided to use simple deep architectures and to avoid any form of structural and hyper-parameter optimization for three main reasons. First and foremost, our main aim is to show that Wasserstein variational inference works off-the-shelf without user tuning. Second, it allows us to run a large number of analyses and consequently to systematically investigate the performance of several variants of the Wasserstein autoencoder on several datasets. Finally, it minimizes the risk of inducing a bias that disfavors the baselines. In our first experiment, we assessed the performance of our Wasserstein variation autoencoder against VAE, ALI and WAE. We used the same neural architecture for all models. The generative models were parametrized by three-layered fully connected networks (100300-500-1568) with Relu nonlinearities in the hidden layers. Similarly, the variational models were parametrized by three-layered ReLu networks (784-500-300-100). The cost functional of our Wasserstein variational autoencoder (see Eq. 25) had the weights w1, w2, w3 and w4 different from zero. Conversely, in this experiment w5 was set to zero, meaning that we did not use a f-divergence component. We refer to this model as 1111. We trained 1111 using t = 20 Sinkhorn iterations. We evaluated three performance metrics: 1) mean squared reconstruction error in the latent space, 2) pixelwise mean squared reconstruction error in the image space and 3) sample quality estimated as the smallest Euclidean distance with an image in the validation set. Variational autoencoders are known to be sensitive to the fine tuning of the parameter regulating the relative contribution of the latent and the observable component of the loss. For each method, we optimized this parameter on the validation set. VAE, ALI and WAE losses have a single independent parameter α: the relative contribution of the two components of the loss (VAE-loss/WAE-loss = α*latent-loss + (1 - α)*observable-loss, ALI-loss = α*generator-loss + (1 - α)*discriminator-loss for ALI). In the case of our 1111 model we reduced the optimization to a single parameter by giving equal weights to the two latent and the two observable losses (loss = α*latent-loss + (1 -α)*observable-loss). We estimated the errors of all methods with respect to all metrics with alpha ranging from 0.1 to 0.9 in steps of 0.1. For each model we selected an optimal value of α by minimizing the sum of the three error metrics in the validation set (individually re-scaled by z-scoring). Fig. 1 shows the test set square errors both in the latent and in the observable space for the optimized models. Our model has better performance than both VAE and ALI with respect to all error metrics. WAE has lower observable error but higher sample error and slightly higher latent error. All differences are statistically significant (p<0.001, paired t-test). In our second experiment we tested several other forms of Wasserstein variational autoencoders on three different datasets. We denote different versions of our autoencoder with a binary string 7 Figure 1: Comparison between Wasserstein variational inference, VAE, ALI and WAE. Table 1: Detailed analysis on MNIST, fashion MNIST and Quick Sketches. MNIST Fashion-MNIST Quick Sketch Latent Observable Sample Latent Observable Sample Latent Observable Sample ALI 1.0604 0.1419 0.0631 1.0179 0.1210 0.0564 1.0337 0.3477 0.1157 VAE 1.1807 0.0406 0.1766 1.7671 0.0214 0.0567 0.9445 0.0758 0.0687 1001 0.9256 0.0710 0.0448 0.9453 0.0687 0.0277 0.9777 0.1471 0.0654 0110 1.0052 0.0227 0.0513 1.4886 0.0244 0.0385 0.8894 0.0568 0.0743 0011 1.0030 0.0273 0.0740 1.0033 0.0196 0.0447 1.0016 0.0656 0.1204 1100 1.0145 0.0268 0.0483 1.3748 0.0246 0.0291 1.0364 0.0554 0.0736 1111 0.8991 0.0293 0.0441 0.9053 0.0258 0.0297 0.8822 0.0642 0.0699 h-ALI 0.8865 0.0289 0.0462 0.9026 0.0260 0.0300 0.8961 0.0674 0.0682 h-VAE 0.9007 0.0292 0.0442 0.9072 0.0227 0.0306 0.8983 0.0638 0.0677 denoting which weight was set to either zero or one. For example, we denote the purely metric version without autoencoder divergences as 1100. We also included two hybrid models obtained by combining our loss (1111) with the VAE and the ALI losses. These methods are special cases of Wasserstein variational autoencoders with non-zero w5 weight and where the f function is chosen to give either the reverse KL divergence or the Jensen-Shannon divergence respectively. Note that this fifth component of the loss was not obtained from the Sinkhorn iterations. As can be seen in Table 1, most versions of the Wasserstein variational autoencoder perform better than both VAE and ALI on all datasets. The 0011 has good reconstruction errors but significantly lower sample quality as it does not explicitly train the marginal distribution of x. Interestingly, the purely metric 1100 version has a small reconstruction error even if the cost functional is solely defined in terms of the marginals over x and z. Also interestingly, the hybrid methods h-VAE and h-ALI have high performances. This result is promising as it suggests that the Sinkhorn loss can be used for stabilizing adversarial methods. ALI VAE 1111 ALI VAE 1111 Data A B Figure 2: Observable reconstructions (A) and samples (B). 8 7 Conclusions In this paper we showed that Wasserstein variational inference offers an effective and robust method for black-box (amortized) variational Bayesian inference. Importantly, Wasserstein variational inference is a likelihood-free method and can be used together with implicit variational distributions and differentiable variational programs [22, 21]. These features make Wasserstein variational inference particularly suitable for probabilistic programming, where the aim is to combine declarative general purpose programming and automatic probabilistic inference. References [1] M. D. Hoffman, D. M. Blei, C. Wang, and J. Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013. [2] R. Ranganath, S. Gerrish, and D. Blei. Black box variational inference. International Conference on Artificial Intelligence and Statistic, 2014. [3] D. J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. International Conference on Machine Learning, 2014. [4] A. Kucukelbir, D. Tran, R. Ranganath, A. Gelman, and D. M. Blei. Automatic differentiation variational inference. The Journal of Machine Learning Research, 18(1):430–474, 2017. [5] D. Tran, A. Kucukelbir, A. B. Dieng, M. Rudolph, D. Liang, and D. M. Blei. Edward: A library for probabilistic modeling, inference, and criticism. arXiv preprint arXiv:1610.09787, 2016. [6] D. M. Blei, A. Kucukelbir, and J. D. McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017. [7] C. Zhang, J. Butepage, H. Kjellstrom, and S. Mandt. Advances in variational inference. arXiv preprint arXiv:1711.05597, 2017. [8] Y. Li and R. E. Turner. Rényi divergence variational inference. Advances in Neural Information Processing Systems, 2016. [9] L. Ambrogioni, U. Güçlü, J. Berezutskaya, E. W.P. van den Borne, Y. Güçlütürk, M. Hinne, E. Maris, and M. A.J. van Gerven. Forward amortized inference for likelihood-free variational marginalization. arXiv preprint arXiv:1805.11542, 2018. [10] R. Ranganath, D. Tran, J. Altosaar, and D. Blei. Operator variational inference. Advances in Neural Information Processing Systems, 2016. [11] A. B. Dieng, D. Tran, R. Ranganath, J. Paisley, and D. Blei. Variational inference via chi upper bound minimization. Advances in Neural Information Processing Systems, 2017. [12] R. Bamler, C. Zhang, M. Opper, and S. Mandt. Perturbative black box variational inference. Advances in Neural Information Processing Systems, pages 5086–5094, 2017. [13] C. Villani. Topics in Optimal Transportation. Number 58. American Mathematical Society, 2003. [14] Cuturi M. Peyré G. Computational Optimal Transport. arXiv preprint arXiv:1803.00567, 2018. [15] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein generative adversarial networks. International Conference on Machine Learning, 2017. [16] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. C. Courville. Improved training of Wasserstein GANs. Advances in Neural Information Processing Systems, 2017. [17] A. Genevay, G. Peyré, and M. Cuturi. Learning generative models with Sinkhorn divergences. International Conference on Artificial Intelligence and Statistics, pages 1608–1617, 2018. [18] G. Montavon, K. Müller, and M. Cuturi. Wasserstein training of restricted Boltzmann machines. Advances in Neural Information Processing Systems, 2016. 9 [19] R. Sinkhorn and P. Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343–348, 1967. [20] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in Neural Information Processing Systems, 2013. [21] F. Huszár. Variational inference using implicit distributions. arXiv preprint arXiv:1702.08235, 2017. [22] D. Tran, R. Ranganath, and David M. Blei. Hierarchical implicit models and likelihood-free variational inference. arXiv preprint arXiv:1702.08896, 2017. [23] V. Dumoulin, I. Belghazi, B. Poole, O. Mastropietro, A. Lamb, M. Arjovsky, and A. Courville. Adversarially learned inference. International Conference on Learning Representations, 2017. [24] L. Mescheder, S. Nowozin, and A. Geiger. Adversarial variational bayes: Unifying variational autoencoders and generative adversarial networks. arXiv preprint arXiv:1701.04722, 2017. [25] M. Arjovsky and L. Bottou. Towards principled methods for training generative adversarial networks. International Conference on Learning Representations, 2017. [26] D. P. Kingma and M. Welling. Auto–encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013. [27] D. Fouskakis and D. Draper. Stochastic optimization: A review. International Statistical Review, 70(3):315–349, 2002. [28] J. Weed and F. Bach. Sharp asymptotic and finite-sample rates of convergence of empirical measures in Wasserstein distance. arXiv preprint arXiv:1707.00087, 2017. [29] D. Burago, I. D. Burago, and S. Ivanov. A Course in Metric Geometry, volume 33. American Mathematical Society, 2001. [30] Y. Pu, Z. Gan, R. Henao, X. Yuan, C. Li, A. Stevens, and L. Carin. Variational autoencoder for deep learning of images, labels and captions. Advances in Neural Information Processing Systems, 2016. [31] A. Makhzani, J. Shlens, N. Jaitly, I. Goodfellow, and B. Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015. [32] I. Tolstikhin, O. Bousquet, S. Gelly, and B. Schoelkopf. Wasserstein auto-encoders. International Conference on Learning Representations, 2018. 10
2018
198
7,361
Bayesian Control of Large MDPs with Unknown Dynamics in Data-Poor Environments Mahdi Imani Texas A&M University College Station, TX, USA m.imani88@tamu.edu Seyede Fatemeh Ghoreishi Texas A&M University College Station, TX, USA f.ghoreishi88@tamu.edu Ulisses M. Braga-Neto Texas A&M University College Station, TX, USA ulisses@ece.tamu.edu Abstract We propose a Bayesian decision making framework for control of Markov Decision Processes (MDPs) with unknown dynamics and large, possibly continuous, state, action, and parameter spaces in data-poor environments. Most of the existing adaptive controllers for MDPs with unknown dynamics are based on the reinforcement learning framework and rely on large data sets acquired by sustained direct interaction with the system or via a simulator. This is not feasible in many applications, due to ethical, economic, and physical constraints. The proposed framework addresses the data poverty issue by decomposing the problem into an offline planning stage that does not rely on sustained direct interaction with the system or simulator and an online execution stage. In the offline process, parallel Gaussian process temporal difference (GPTD) learning techniques are employed for near-optimal Bayesian approximation of the expected discounted reward over a sample drawn from the prior distribution of unknown parameters. In the online stage, the action with the maximum expected return with respect to the posterior distribution of the parameters is selected. This is achieved by an approximation of the posterior distribution using a Markov Chain Monte Carlo (MCMC) algorithm, followed by constructing multiple Gaussian processes over the parameter space for efficient prediction of the means of the expected return at the MCMC sample. The effectiveness of the proposed framework is demonstrated using a simple dynamical system model with continuous state and action spaces, as well as a more complex model for a metastatic melanoma gene regulatory network observed through noisy synthetic gene expression data. 1 Introduction Dynamic programming (DP) solves the optimal control problem for Markov Decision Processes (MDPs) with known dynamics and finite state and action spaces. However, in complex applications there is often uncertainty about the system dynamics. In addition, many practical problems have large or continuous state and action spaces. Reinforcement learning is a powerful technique widely used for adaptive control of MDPs with unknown dynamics [1]. Existing RL techniques developed for MDPs with unknown dynamics rely on data that is acquired via interaction with the system or via simulation. While this is feasible in areas such as robotics or speech recognition, in other applications such as medicine, materials science, and business, there is either a lack of reliable simulators or inaccessibility to the real system due to practical limitations, including cost, ethical, and physical considerations. For instance, recent advances in metagenomics and neuroscience call for the development of efficient intervention strategies for disease treatment. However, these systems are often modeled with MDPs with continuous state and action spaces, with limited access to expensive data. Thus, there is a need for control of systems with unknown dynamics and large or continuous state, action, and parameter spaces in data-poor environments. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Related Work: Approximate dynamic programming (ADP) techniques have been developed for problems in which the exact DP solution is not achievable. These include parametric and nonparametric reinforcement learning (RL) techniques for approximating the expected discounted reward over large or continuous state and action spaces. Parametric RL techniques include neural fitted Q-iteration [2], deep reinforcement learning [3], and kernel-based techniques [4]. A popular class of non-parametric RL techniques is Gaussian process temporal difference (GPTD) learning [5], which provides a Bayesian representation of the expected discounted return. However, all aforementioned methods involve approximate offline planning for MDPs with known dynamics or online learning by sustained direct interaction with the system or a simulator. The multiple model-based RL (MMRL) [6] is a framework that allows the extension of the aforementioned RL techniques to MDPs with unknown dynamics represented over a finite parameter space, and therefore cannot handle large or continuous parameter spaces. In addition, there are several Bayesian reinforcement learning techniques in the literature [7]. For example, Bayes-adaptive RL methods assume a parametric family for the MDP transition matrix and simultaneously learn the parameters and policy. A closely related method in this class is the Beetle algorithm [8], which converts a finite-state MDP into a continuous partially-observed MDP (POMDP). Then, an approximate offline algorithm is developed to solve the POMDP. The Beetle algorithm is however capable of handling finite state and action spaces only. Online tree search approximations underlie a varied and popular class of Bayesian RL techniques [9–16]. In particular, the Bayes-adaptive Monte-Carlo planning (BAMCP) algorithm [16] has been shown empirically to outperform the other techniques in this category. This is due to the fact that BAMCP uses a rollout policy during the learning process, which effectively biases the search tree towards good solutions. However, this class of methods applies to finite-state MDPs with finite actions; application to continuous state and action spaces requires discretization of these spaces, rendering computation intractable in most cases of interest. Lookahead policies are a well-studied class of techniques that can be used for control of MDPs with large or continuous state, action, and parameter spaces [17]. However, ignoring the long future horizon in their decision making process often results in poor performance. Other methods to deal with systems carrying other sources of uncertainty include [18, 19]. Main Contributions: The goal of this paper is to develop a framework for Bayesian decision making for MDPs with unknown dynamics and large or continuous state, action and parameter spaces in data-poor environments. The framework consists of offline and online stages. In the offline stage, samples are drawn from a prior distribution over the space of parameters. Then, parallel Gaussian process temporal difference (GPTD) learning algorithms are applied for Bayesian approximation of the expected discounted reward associated with these parameter samples. During the online process, a Markov Chain Monte Carlo (MCMC) algorithm is employed for sample-based approximation of the posterior distribution. For decision making with respect to the posterior distribution, Gaussian process regression over the parameter space based on the means and variances of the expected returns obtained in the offline process is used for prediction of the expected returns at the MCMC sample points. The proposed framework offers several benefits, summarized as follows: • Risk Consideration: Most of the existing techniques try to estimate fixed values for approximating the expected Q-function and make a decision upon that, while the proposed method is capable of Bayesian representation of the Q-function. This allows risk consideration during action selection, which is required by many real-world applications, such as cancer drug design. • Fast Online Decision Making: The proposed method is suitable for problems with tight timelimit constraints, in which the action should be selected relatively fast. Most of the computational effort spent by the proposed method is in the offline process. By contrast, the online process used by Monte-Carlo based techniques is often very slow, especially for large MDPs, in which a large number of trajectories must be simulated for accurate estimation of the Q-functions. • Continuous State/Action Spaces: Existing Bayesian RL techniques can handle continuous state and action spaces to some extent (e.g., via discretization). However, the difficulty in picking a proper quantization rate, which directly impacts accuracy, and the computational intractability for large MDPs make the existing methods less attractive. • Generalization: Another feature of the proposed method is the ability to serve as an initialization step for Monte-Carlo based techniques. In fact, if the expected error at each time point is large 2 (according to the Bayesian representation of the Q-functions), Monte-Carlo techniques can be employed for efficient online search using the available results of the proposed method. • Anytime Planning: The Bayesian representation of the Q-function allows starting the online decision making process at anytime to improve the offline planning results. In fact, while the online planning is undertaken, the accuracy of the Q-functions at the current offline samples can be improved or the Q-functions at new offline samples from the posterior distribution can be computed. 2 Background A Markov decision process (MDP) is formally defined by a 5-tuple ⟨S, A, T, R, γ⟩, where S is the state space, A is the action space, T : S × A × S is the state transition probability function such that T(s, a, s′) = p(s′ | s, a) represents the probability of moving to state s′ after taking action a in state s, R : S × A →R is a bounded reward function such that R(s, a) encodes the reward earned when action a is taken in state s, and 0 < γ < 1 is a discount factor. A deterministic stationary policy π for an MDP is a mapping π : S →A from states to actions. The expected discounted reward function at state s ∈S after taking action a ∈A and following policy π afterward is defined as: Qπ(s, a) = E " ∞ X t=0 γtR(st, at) | s0 = s, a0 = a # . (1) The optimal action-value function, denoted by Q∗, provides the maximum expected return Q∗(s, a) that can be obtained after executing action a in state s. An optimal stationary policy π∗, which attains the maximum expected return for all states, is given by π∗(s) = maxa∈A Q∗(s, a). An MDP is said to have known dynamics if the 5-tuple ⟨S, A, T, R, γ⟩is fully specified, otherwise it is said to have unknown dynamics. For an MDP with known dynamics and finite state and action spaces, planning algorithms such as Value Iteration or Policy Iteration [20] can be used to compute the optimal policy offline. Several approximate dynamic programming (ADP) methods have been developed for approximating the optimal stationary policy over continuous state and action spaces. However, in this paper, we are concerned with large MDP with unknown dynamics in data-poor environments. 3 Proposed Bayesian Decision Framework Let the unknown parts of the dynamics be encoded into a finite dimensional vector θ, where θ takes value in a parameter space Θ ⊂Rm. Notice that each θ ∈Θ specifies an MDP with known dynamics. Assuming (a0:k−1, s0:k) be the sequence of taken actions and observed states up to time step k during the execution process, the proposed method selects an action according to: ak = argmax a∈A Eθ|s0:k,a0:k−1[Q∗ θ(sk, a)] , (2) where the expectation is taken relative to the posterior distribution p(θ | s0:k, a0:k−1), and Q∗ θ characterizes the optimal expected return for the MDP associated with θ. Two main issues complicate finding the exact solution in (2). First, computation of the posterior distribution might not have a closed-form solution, and one needs to use techniques such as MarkovChain Monte-Carlo (MCMC) for sample-based approximation of the posterior. Secondly, the exact computation of Q∗ θ for any given θ is not possible, due to the large or possibly continuous state and action spaces. However, for any θ ∈Θ, the expected return can be approximated with one of the many existing techniques such as neural fitted Q-iteration [2], deep reinforcement learning [3], and Gaussian process temporal difference (GPTD) learning [5]. On the other hand, all the aforementioned techniques can be extremely slow over an MCMC sample that is sufficiently large to achieve accurate results. In sum, computation of the expected returns associated with samples of the posterior distribution during the execution process is not practical. In the following paragraphs, we propose efficient offline and online planning processes capable of computing an approximate solution to the optimization problem in (2). 3 3.1 Offline Planner The offline process starts by drawing a sample Θprior = {θprior i }N prior i=1 ∼p(θ) of size N prior from the parameter prior distribution. For each sample point θ ∈Θprior, one needs to approximate the optimal expected return Q∗ θ over the entire state and action spaces. We propose to do this by using Gaussian process temporal difference (GPTD) learning [5]. The detailed reasoning behind this choice will be provided when the online planner is discussed. GP-SARSA is a GPTD algorithm that provides a Bayesian approximation of Q∗ θ for given θ ∈ Θprior. We describe the GP-SARSA algorithm over the next several paragraphs. Given a policy πθ : S →A for an MDP corresponding to θ, the discounted return at time step t can be written as: U t,πθ θ (st, at) = E " ∞ X r=t γr−t Rθ(sr+1, ar+1) # , (3) where sr+1 ∼p (s′ | sr, ar = πθ(sr), θ), and U t,πθ θ (st, at) is the expected accumulated reward for the system corresponding to parameter θ obtained over time if the current state and action are st and at and policy πθ is followed afterward. In the GPTD method, the expected discounted return U t,πθ θ (st, at) is approximated as: U t,πθ θ (st = s, at = a) ≈Qπθ θ (s, a) + ∆Qπθ θ , (4) where Qπθ θ (s, a) is a Gaussian process [21] over the space S×A and ∆Qπθ θ is a zero-mean Gaussian residual with variance σ2 q. A zero-mean Gaussian process is usually considered as a prior: Qπθ θ (s, a) = GP (0, kθ ((s, a), (s′, a′))) , (5) where kθ(·, ·) is a real-valued kernel function, which encodes our prior belief on the correlation between (s, a) and (s′, a′). One possible choice is considering decomposable kernels over the state and action spaces: kθ ((s, a), (s′, a′)) = kS,θ (s, s′)×kU,θ (a, a′). A proper choice of the kernel function depends on the nature of the state and action spaces, e.g., whether they are finite or continuous. Let Bθ t = [(s0, a0), . . . , (st, at)]T be the sequence of observed joint state and action pairs simulated by a policy πθ from an MDP corresponding to θ, with the corresponding immediate rewards rθ t = [Rθ(s0, a0), . . . , Rθ(st, at)]T . The posterior distribution of Qπθ θ (s, a) can be written as [5]: Qπθ θ (s, a) | rθ t , Bθ t ∼N Qθ(s, a), covθ ((s, a), (s, a))  , (6) where Qθ(s, a)=K(s,a),Bθ t HT t (HtKBθ t ,Bθ t HT t + σ2 qHtHT t )−1rθ t , covθ((s, a), (s, a))=kθ((s, a), (s, a))−K(s,a),Bθ t HT t (HtKBθ t ,Bθ t HT t + (σq θ)2HtHT t )−1HtKT (s,a),Bθ t (7) with Ht =   1 −γ 0 . . . 0 0 0 1 −γ . . . 0 0 ... ... ... ... ... ... 0 0 0 . . . 1 −γ 0 0 0 . . . 0 1   , KB,B′ =   kθ((s0, a0), (s′ 0, a′ 0)) . . . kθ((s0, a0), (s′ n, a′ n)) ... ... ... kθ((sm, am), (s′ 0, a′ 0)) . . . kθ((sm, am), (s′ n, a′ n))  , (8) for B = [(s0, a0), . . . , (sm, am)]T and B′ = [(s′ 0, a′ 0), . . . , (s′ n, a′ n)]T . The hyper-parameters of the kernel function can be estimated by maximizing the likelihood of the observed reward [22]: rθ t | Bθ t ∼N  0, Ht  KBθ t ,Bθ t + (σθ q)2ItHT t  , (9) where It is the identity matrix of size t × t. The choice of policy for gathering data has significant impact on the proximity of the estimated discounted return to the optimal one. A well-known option, which uses Bayesian representation of the expected return and adaptively balances exploration and exploitation, is given by [22]: πθ(s)=argmax a∈A qa, qa ∼N Qθ(s, a), covθ ((s, a), (s, a))  . (10) 4 The GP-SARSA algorithm approximates the expected return by simulating several trajectories based on the above policy. Running N prior parallel GP-SARSA algorithms for each θ ∈Θprior leads to N prior near-optimal approximations of the expected reward functions. 3.2 Online Planner Let ˆQθ(s, a) be the Gaussian process approximating the optimal Q-function for any s ∈S and a ∈A computed by a GP-SARSA algorithm associated with parameter θ ∈Θprior. One can approximate (2) as: ak ≈argmax a∈A Eθ|s0:k,a0:k−1 h E h ˆQθ(sk, a) ii = argmax a∈A Eθ|s0:k,a0:k−1  Qθ(sk, a)  . (11) While the value of Qθ(sk, a) at values θ ∈Θprior drawn from the prior distribution is available, the expectation in (11) is over the posterior distribution. Rather than restricting ourselves to parametric families, we compute the expectation in (11) by a Markov Chain Monte-Carlo (MCMC) algorithm for generating i.i.d. sample values from the posterior distribution. For simplicity, and without loss of generality, we employ the basic Metropolis Hastings MCMC [23] algorithm. Let the last accepted MCMC sample in the sequence of samples be θpost j , generated at the j-th iteration. A candidate MCMC sample point θcand is drawn according to a symmetric proposal distribution q(θ | θpost j ). The candidate MCMC sample point θcand is accepted with probability α given by: α = min ( 1, p(s0:k, a0:k−1 | θcand) p(θcand) p(s0:k, a0:k−1 | θpost j ) p(θpost j ) ) , (12) otherwise it is rejected, where p(θ) denotes the prior probability of θ. Accordingly, the (j + 1)th MCMC sample point is: θpost j+1 = θn with probability α θpost j otherwise (13) Repeating this process leads to a sequence of MCMC sample points. The positivity of the proposal distribution (i.e. q(θ | θpost j ) > 0, for any θpost j ) is a sufficient condition for ensuring an ergodic Markov chain whose steady-state distribution is the posterior distribution p(θ | s0:k, a0:k−1) [24]. Removing a fixed number of initial “burn-in” sample points, the MCMC sample Θpost = (θpost 1 , . . . , θpost N post) is approximately a sample from the posterior distribution. The last step towards the computation of (11) is the approximation of the mean of the predicted expected return Qθ(., .) at values of the MCMC sample Θpost. We take advantage of the Bayesian representation of the expected return computed by the offline GP-SARSAs for this, as described next. Let f a sk = [Qθprior 1 (sk, a), . . . , Qθprior Nprior(sk, a)]T and va sk = [covθprior 1 ((sk, a), (sk, a)), . . ., covθprior Nprior((sk, a), (sk, a))]T be the means and variances of the predicted expected returns computed based on the results of offline GP-SARSAs at current state sk for a given action a ∈A. This information can be used for constructing a Gaussian process for predicting the expected return over the MCMC sample:   Qθpost 1 (sk, a) ... Qθpost Npost(sk, a)  =ΣΘpost,Θprior ΣΘprior,Θprior +Diag(va k) −1f a sk, (14) where ΣΘm,Θn =   k(θ1, θ′ 1) . . . k(θ1, θ′ n) ... ... ... k(θm, θ′ n) . . . k(θm, θ′ n)  , 5 for Θm = {θ1, . . . , θm} and Θn = {θ′ 1, . . . , θ′ n}, and k(θ, θ′) denotes the correlation between sample points in the parameter space. The parameters of the kernel function can be inferred by maximizing the marginal likelihood: f a k | Θprior ∼N 0, ΣΘprior,Θprior + Diag(va k)  . (15) The process is summarized in Figure 1(a). The red vertical lines represent the expected returns at sample points from the posterior. It can be seen that only a single offline sample point is in the area covered by the MCMC samples, which illustrates the advantage of the constructed Gaussian process for predicting the expected return over the posterior distribution. Offline Planner Online Planner prior posterior Figure 1: (a) Gaussian process for prediction of the expected returns at posterior sample points based on prior sample points. (b) Proposed framework. The GP is constructed for any given a ∈A. For a large or continuous action space, one needs to draw a finite set of actions {a1, . . . , aM} from the space, and compute Qθ(sk, a) for a ∈{a1, . . . , aM} and θ ∈Θpost. It should be noted that the uncertainty in the expected return of the offline sample points is efficiently taken into account for predicting the mean expected error at the MCMC sample points. Thus, equation (11) can be written as: ak ≈argmax a∈A Eθ|s0:k,a0:k−1  Qθ(sk, a)  ≈ argmax a∈{a1,...,aM} 1 N post X θ∈Θpost Qθ(sk, a) . (16) It is shown empirically in numerical experiments that as more data are observed during execution, the proposed method becomes more accurate, eventually achieving the performance of a GP-SARSA trained on data from the true system model. The entire proposed methodology is summarized in Algorithm 1 and Figure 1(b) respectively. Notice that the values of N prior and N post should be chosen based on the size of the MDP, the availability of computational resources, and presence of time constraints. Indeed, large N prior means that larger parameter samples must be obtained in the offline process, while large N post is associated with larger MCMC samples in the posterior update step. 4 Numerical Experiments The numerical experiments compare the performance of the proposed framework with two other methods: 1) Multiple Model-based RL (MMRL) [6]: the parameter space in this method is quantized into a finite set Θquant according to its prior distribution and the results of offline parallel GP-SARSA algorithms associated with this set are used for decision making during the execution process via: aMMRL k = argmaxa∈A P θ∈Θquant Qθ(sk, ak = a)P(θ | s0:k, a0:k−1). 2) One-step lookahead policy [17]: this method selects the action with the highest expected immediate reward: aseq k = argmaxa∈A Eθ|s0:k,a0:k−1[R(sk, ak = a)]. As a baseline for performance, the results of the GP-SARSA algorithm tuned to the true model are also displayed. 6 Algorithm 1 Bayesian Control of Large MDPs with Unknown Dynamics in Data-Poor Environments. Offline Planning 1: Draw N prior parameters from the prior distribution: Θprior = {θ1, . . . , θNprior} ∼p(θ). 2: Run N prior parallel GP-SARSAs: ˆQθ ←GP-SARSA(θ), θ ∈Θprior. Online Planning 3: Initial action selection: a0 = arg max a∈A 1 N prior X θ∈Θprior Qθ(s0, a). 4: for k = 1, . . . do 5: Take action ak−1, record the new state sk. 6: Given s0:k, a0:k−1, run MCMC and collect Θpost k . 7: for a ∈{a1, . . . , aM} do 8: Record the means and variances of offline GPs at (sk, a): f a sk =[Qθ1(sk, a), . . . , Qθprior Nprior (sk, a)]T , va sk =[covθ1((sk, a), (sk, a)), . . . , covθprior Nprior ((sk, a), (sk, a))]T. 9: Construct a GP using f a sk, va sk over Θprior. 10: Use the constructed GP to compute Qθ(sk, a), for θ ∈Θpost. 11: end for 12: Action selection: ak = arg max a∈{a1,...,aM } 1 N post X θ∈Θpost Qθ(sk, a). 13: end for Simple Continuous State and Action Example: The following simple MDP with unknown dynamics is considered in this section: sk = bound[sk−1 −θsk−1(0.5 −sk−1) + 0.2ak−1 + nk] , (17) where sk ∈S = [0, 1] and ak ∈A = [−1, 1] for any k ≥0, nk ∼N(0, 0.05), θ is the unknown parameter with true value θ∗= 0.2 and bound maps the argument to the closest point in state space. The reward function is R(s, a) = −10 δs<0.1 −10 δs>0.9 −2 |a|, so that the cost is minimum when the system is in the interval [0.1, 0.9]. The prior distribution is p(θ) ∼N(0, 0.2). The decomposable squared exponential kernel function is used over the state and action spaces. The offline and MCMC sample sizes are 10 and 1000, respectively. Figures 2(a) and (b) plot the optimal actions in the state and parameter spaces and the Q-function over state and action spaces for the true model θ∗, obtained by GP-SARSA algorithms. It can be seen that the decision is significantly impacted by the parameter, especially in regions of the state space between 0.5 to 1. The Bayesian approximation of the Q-function is represented by two surfaces that define 95%-confidence intervals for the expected return. The average reward per step over 100 independent runs starting from different initial states are plotted in Figure 2(c). As expected, the maximum average reward is obtained by the GP-SARSA associated with the true model. The proposed framework significantly outperforms both MMRL and one-step lookahead techniques. One can see that the average reward for the proposed algorithm converges to the true model results after less than 20 actions while the other methods do not. The very poor performance of the one-step lookahead method is due to the greedy heuristics involved in its decision making process, which do not factor in long-term rewards. Melanoma Gene Regulatory Network: A key goal in genomics is to find proper intervention strategies for disease treatment and prevention. Melanoma is the most dangerous form of skin cancer, the gene-expression behavior of which can be represented through the Boolean activities of 7 genes displayed in Figure 3. Each gene expression can be 0 or 1, corresponding to gene inactivation or activation, respectively. The gene states are assumed to be updated at each discrete time through 7 0.6 0.4 -1 0 0.2 0.25 state (s) 0.5 0 0 action (a) 0.75 -0.2 1 1 (a) (b) (c) Proposed Method Figure 2: Small example results. the following nonlinear signal model: xk = f (xk−1) ⊕ak−1 ⊕nk , (18) where xk = [WNT5Ak, pirink, S100Pk, RET1k, MART1k, HADHBk, STC2k] is the state vector at time step k, action ak−1 ∈A ⊂{0, 1}7, such that ak−1(i) = 1 flips the state of the ith gene, f is the Boolean function displayed in Table 1, in which the ith binary string specifies the output value for the given input genes, “⊕” indicates component-wise modulo-2 addition and nk ∈{0, 1}7 is Boolean transition noise, such that P(nk(i) = 1) = p, for i = 1, . . . , 7. Figure 3: Melanoma regulatory network Table 1: Boolean functions for the melanoma GRN. Genes Input Gene(s) Output WNT5A HADHB 10 pirin prin, RET1,HADHB 00010111 S100P S100P,RET1,STC2 10101010 RET1 RET1,HADHB,STC2 00001111 MART1 pirin,MART1,STC2 10101111 HADHB pirin,S100P,RET1 01110111 STC2 pirin,STC2 1101 In practice, the gene states are observed through gene expression technologies such as cDNA microarray or image-based assay. A Gaussian observation model is appropriate for modeling the gene expression data produced by these technologies: yk(i) ∼N (20 xk(i) + θ, 10) , (19) for i = 1, . . . , 7; where parameter θ is the baseline expression in the inactivated state with the true value θ∗= 30. Such a model is known as a partially-observed Boolean dynamical system in the literature [25, 26]. It can be shown that for any given θ ∈R, the partially-observed MDP in (18) and (19) can be transformed into an MDP in a continuous belief space [27, 28]: sk = g(sk−1, ak−1, θ) ∝p(yk | xk, θ) P(xk | xk−1, ak) sk−1 , (20) 8 Figure 4: Melanoma gene regulatory network results. where “∝" indicates that the right-hand side must be normalized to add up to 1. The belief state is a vector of length 128 in a simplex of size 127. In [29, 30], the expression of WNT5A was found to be highly discriminatory between cells with properties typically associated with high metastatic competence versus those with low metastatic competence. Hence, an intervention that blocked the WNT5A protein from activating its receptor could substantially reduce the ability of WNT5A to induce a metastatic phenotype. Thus, we consider the following immediate reward function in belief space: R(s, a) = 50 P128 i=1 s(i) δxi(1)=0 −10||a||1. Three actions are available for controlling the system: A = {[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0]}. The decomposable squared exponential and delta Kronecker kernel functions are used for Gaussian process regression over the belief state and action spaces, respectively. The offline and MCMC sample sizes are 10 and 3000, respectively. The average reward per step over 100 independent runs for all methods is displayed in Figure 4. Uniform and Gaussian distributions with different variances are used as prior distributions in order to investigate the effect of prior peakedness. As expected, the highest average reward is obtained for GP-SARSA tuned to the true parameter θ∗. The proposed method has higher average reward than the MMRL and one-step lookahead algorithms. In fact, the expected return produced by the proposed method converges to the GP-SARSA tuned to the true parameter faster for peaked prior distributions. As more actions are taken, the performance of MMRL approaches, but not quite reaches, the baseline performance of the GP-SARSA tuned to the true parameter. The one-step lookahead method performs poorly in all cases as it does not account for long-term rewards in the decision making process. 5 Conclusion In this paper, we introduced a Bayesian decision making framework for control of MDPs with unknown dynamics and large or continuous state, actions and parameter spaces in data-poor environments. The proposed framework does not require sustained direct interaction with the system or a simulator, but instead it plans offline over a finite sample of parameters from a prior distribution over the parameter space and transfers this knowledge efficiently to sample parameters from the posterior during the execution process. The methodology offers several benefits, including the possibility of handling large and possibly continuous state, action, and parameter spaces; data-poor environments; anytime planning; and dealing with risk in the decision making process. Acknowledgment The authors acknowledge the support of the National Science Foundation, through NSF award CCF1718924. 9 References [1] R. S. Sutton and A. G. Barto, Reinforcement learning: An introduction. MIT press, 1998. [2] A. Antos, C. Szepesvári, and R. Munos, “Fitted Q-iteration in continuous action-space MDPs,” in Advances in neural information processing systems, pp. 9–16, 2008. [3] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K. Fidjeland, G. Ostrovski, et al., “Human-level control through deep reinforcement learning,” Nature, vol. 518, no. 7540, p. 529, 2015. [4] L. Busoniu, R. Babuska, B. De Schutter, and D. Ernst, Reinforcement learning and dynamic programming using function approximators, vol. 39. CRC press, 2010. [5] Y. Engel, S. Mannor, and R. Meir, “Reinforcement learning with Gaussian processes,” in Proceedings of the 22nd international conference on Machine learning, pp. 201–208, ACM, 2005. [6] K. Doya, K. Samejima, K.-i. Katagiri, and M. Kawato, “Multiple model-based reinforcement learning,” Neural computation, vol. 14, no. 6, pp. 1347–1369, 2002. [7] M. Ghavamzadeh, S. Mannor, J. Pineau, A. Tamar, et al., “Bayesian reinforcement learning: A survey,” Foundations and Trends R⃝in Machine Learning, vol. 8, no. 5-6, pp. 359–483, 2015. [8] P. Poupart, N. Vlassis, J. Hoey, and K. Regan, “An analytic solution to discrete Bayesian reinforcement learning,” in Proceedings of the 23rd international conference on Machine learning, pp. 697–704, ACM, 2006. [9] A. Guez, D. Silver, and P. Dayan, “Efficient Bayes-adaptive reinforcement learning using sample-based search,” in Advances in Neural Information Processing Systems, pp. 1025–1033, 2012. [10] J. Asmuth and M. L. Littman, “Learning is planning: near Bayes-optimal reinforcement learning via Monte-Carlo tree search,” arXiv preprint arXiv:1202.3699, 2012. [11] Y. Wang, K. S. Won, D. Hsu, and W. S. Lee, “Monte Carlo Bayesian reinforcement learning,” arXiv preprint arXiv:1206.6449, 2012. [12] N. A. Vien, W. Ertel, V.-H. Dang, and T. Chung, “Monte-Carlo tree search for Bayesian reinforcement learning,” Applied intelligence, vol. 39, no. 2, pp. 345–353, 2013. [13] S. Ross and J. Pineau, “Model-based Bayesian reinforcement learning in large structured domains,” in Uncertainty in artificial intelligence: proceedings of the... conference. Conference on Uncertainty in Artificial Intelligence, vol. 2008, p. 476, NIH Public Access, 2008. [14] T. Wang, D. Lizotte, M. Bowling, and D. Schuurmans, “Bayesian sparse sampling for on-line reward optimization,” in Proceedings of the 22nd international conference on Machine learning, pp. 956–963, ACM, 2005. [15] R. Fonteneau, L. Busoniu, and R. Munos, “Optimistic planning for belief-augmented Markov decision processes,” in Adaptive Dynamic Programming And Reinforcement Learning (ADPRL), 2013 IEEE Symposium on, pp. 77–84, IEEE, 2013. [16] A. Guez, D. Silver, and P. Dayan, “Scalable and efficient Bayes-adaptive reinforcement learning based on Monte-Carlo tree search,” Journal of Artificial Intelligence Research, vol. 48, pp. 841–883, 2013. [17] W. B. Powell and I. O. Ryzhov, Optimal learning, vol. 841. John Wiley & Sons, 2012. [18] N. Drougard, F. Teichteil-Königsbuch, J.-L. Farges, and D. Dubois, “Structured possibilistic planning using decision diagrams.,” in AAAI, pp. 2257–2263, 2014. [19] F. W. Trevizan, F. G. Cozman, and L. N. de Barros, “Planning under risk and Knightian uncertainty.,” in IJCAI, vol. 2007, pp. 2023–2028, 2007. [20] D. P. Bertsekas, Dynamic programming and optimal control, vol. 1. Athena scientific Belmont, MA, 1995. [21] C. E. Rasmussen and C. Williams, Gaussian processes for machine learning. MIT Press, 2006. [22] M. Gasic and S. Young, “Gaussian processes for POMDP-based dialogue manager optimization,” IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 22, no. 1, pp. 28–40, 2014. 10 [23] W. K. Hastings, “Monte Carlo sampling methods using Markov chains and their applications,” Biometrika, vol. 57, no. 1, pp. 97–109, 1970. [24] W. R. Gilks, S. Richardson, and D. Spiegelhalter, Markov chain Monte Carlo in practice. CRC press, 1995. [25] U. Braga-Neto, “Optimal state estimation for Boolean dynamical systems,” in Signals, Systems and Computers (ASILOMAR), 2011 Conference Record of the Forty Fifth Asilomar Conference on, pp. 1050–1054, IEEE, 2011. [26] M. Imani and U. Braga-Neto, “Maximum-likelihood adaptive filter for partially-observed Boolean dynamical systems,” IEEE Transactions on Signal Processing, vol. 65, no. 2, pp. 359–371, 2017. [27] M. Imani and U. M. Braga-Neto, “Point-based methodology to monitor and control gene regulatory networks via noisy measurements,” IEEE Transactions on Control Systems Technology, 2018. [28] M. Imani and U. M. Braga-Neto, “Finite-horizon LQR controller for partially-observed Boolean dynamical systems,” Automatica, vol. 95, pp. 172–179, 2018. [29] M. Bittner, P. Meltzer, Y. Chen, Y. Jiang, E. Seftor, M. Hendrix, M. Radmacher, R. Simon, Z. Yakhini, A. Ben-Dor, et al., “Molecular classification of cutaneous malignant melanoma by gene expression profiling,” Nature, vol. 406, no. 6795, pp. 536–540, 2000. [30] A. T. Weeraratna, Y. Jiang, G. Hostetter, K. Rosenblatt, P. Duray, M. Bittner, and J. M. Trent, “Wnt5a signaling directly affects cell motility and invasion of metastatic melanoma,” Cancer cell, vol. 1, no. 3, pp. 279–288, 2002. 11
2018
199
7,362
Self-Supervised Generation of Spatial Audio for 360◦Video Pedro Morgado University of California, San Diego∗ Nuno Vasconcelos University of California, San Diego Timothy Langlois Adobe Research, Seattle Oliver Wang Adobe Research, Seattle Abstract We introduce an approach to convert mono audio recorded by a 360◦video camera into spatial audio, a representation of the distribution of sound over the full viewing sphere. Spatial audio is an important component of immersive 360◦video viewing, but spatial audio microphones are still rare in current 360◦video production. Our system consists of end-to-end trainable neural networks that separate individual sound sources and localize them on the viewing sphere, conditioned on multi-modal analysis of audio and 360◦video frames. We introduce several datasets, including one filmed ourselves, and one collected in-the-wild from YouTube, consisting of 360◦videos uploaded with spatial audio. During training, ground-truth spatial audio serves as self-supervision and a mixed down mono track forms the input to our network. Using our approach, we show that it is possible to infer the spatial location of sound sources based only on 360◦video and a mono audio track. 1 Introduction 360◦video provides viewers an immersive viewing experience where they are free to look in any direction, either by turning their heads with a Head-Mounted Display (HMD), or by mouse-control while watching the video in a browser (e.g., YouTube). Capturing 360◦video involves filming the scene with multiple cameras and stitching the result together. While early systems relied on expensive rigs with carefully mounted cameras, recent consumer-level devices combine multiple lenses in a small fixed-body frame that enables automatic stitching, allowing 360◦video to be recorded with a single push of a button. As humans rely on audio localization cues for full scene awareness, spatial audio is a crucial component of 360◦video. Spatial audio enables viewers to experience sound in all directions, while adjusting the audio in real time to match the viewing position. This gives users a more immersive experience, as well as providing cues about which part of the scene might have interesting content to look at. However, unlike 360◦video, producing spatial audio content still requires a moderate degree of expertise. Most consumer-level 360◦cameras only record mono audio, and syncing an external spatial audio microphone can be expensive and technically challenging. As a consequence, while most video platforms (e.g., YouTube and Facebook) support spatial audio, it is often ignored by content creators, and at the time of submission, a random polling of 1000 YouTube 360◦videos yielded less than 5% with spatial audio. In order to close this gap between the audio and visual experiences, we introduce three main contributions: (1) we formalize the 360◦spatialization problem; (2) design the first 360◦spatialization procedure; and (3) collect two datasets and propose an evaluation protocol to benchmark ours and ∗Contact author: pmaravil@eng.ucsd.edu 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Copy Copy Copy X CNN CNN RGB FLOW STFT 𝑤𝑧𝑖𝑡 𝑤𝑦𝑖𝑡 𝑤𝑥𝑖𝑡 𝜙𝑥𝑡 𝜙𝑦𝑡 𝜙𝑧𝑡 𝑤𝑥𝑇𝑓 𝑤𝑦𝑇𝑓 𝑤𝑧𝑇𝑓 iSTFT 𝑎𝑖𝑡, 𝜔 𝚽𝑖𝑡, 𝜔 Tile & Concat Audio 𝑖𝑡 Video 𝑣𝑡 𝚽𝑡, 𝜔 (a) (b) (c) (d) Figure 1: Architecture overview. Our approach is composed of four main blocks. The input video and audio signals are fed into the analysis block (a), which extracts high-level features. The separation block (b) then learns k time-frequency attenuation maps ai(t, w) to modulate the input STFT and produce modified waveforms f i(t). The localization block (c) computes a set of linear transform weights wi(t) that localize each source. In the ambisonics generation step (d), localization weights are then combined with the separated sound sources to produce the final spatial audio output. future algorithms. 360◦spatialization aims to upconvert a single mono recording into spatial audio guided by full 360 view video. More specifically, we seek to generate spatial audio in the form of a popular encoding format called first-order ambisonics (FOA), given the mono audio and corresponding 360◦video as inputs. In addition to formulating the 360◦spatialization task, we design the first data-driven system to upgrade mono audio using self-supervision from 360◦videos recorded with spatial audio. The proposed procedure is based on a novel neural network architecture that disentangles two fundamental challenges in audio spatialization: the separation of sound sources from a mixed audio input and respective localization of these sources. In order to train and validate our approach, we introduce two 360◦video datasets with spatial audio, one recorded by ourselves in a constrained domain, and a large-scale dataset collected in-the-wild from YouTube. During training, the captured spatial audio serves as ground truth, with a mixed down mono version provided as input to our system. Experiments conducted in both datasets show that the proposed neural network can generate plausible spatial audio for 360◦video. We further validate each component of the proposed architecture and show its superiority over a state-of-the-art, but domain-independent baseline architecture. In the interest of reproducibility, code, data and trained models will be made available to the community at https://pedro-morgado.github.io/spatialaudiogen. 2 Related Work To the best of our knowledge, we propose the first system for audio spatialization. In addition to spatial audio, the fields most related to our work are self-supervised learning, audio generation, source separation and audio-visual cross-modal learning, which we now briefly describe. Spatial audio Artificial environments, such as those rendered by game engines, can play sounds from any location in the video. This capability requires recording sound sources separately and mixing them according to the desired scene configuration (i.e., the positions of each source relative to the user). In a real world recording, however, sound sources cannot be recorded separately. In this case where sound sources are naturally mixed, spatial audio is often encoded using Ambisonics [13, 9, 30]. Ambisonics aim to approximate the sound pressure field at a single point in space using a spherical harmonic decomposition. More specifically, an audio signal f(θθθ, t) arriving from direction θθθ = (ϕ, ϑ) (where ϕ is the zenith angle and ϑ the azimuth angle) at time t is represented by a truncated spherical harmonic expansion of order N f(θθθ, t) = PN n=0 Pn m=−n Y m n (ϕ, ϑ)φm n (t) (1) where Y m n (ϕ, ϑ) is the real spherical harmonic of order n and degree m, and φm n (t) are the coefficients of the expansion. For ease of notation, Y m n and φm n can be stacked into vectors yyyN and φφφN, and (Eq. 1) written as f(θθθ, t) = yyyT N(θθθ)φφφN(t). 2 In a controlled environment, sound sources with known locations can be synthetically encoded into ambisonics using their spherical harmonic projection. More specifically, given a set of k audio signals s1(t), . . . , sk(t) originating from directions θθθ1, . . . ,θθθk, φφφN(t) = Pk i=1 yyyN(θθθi)si(t). (2) For ambisonics playback, φφφN is then decoded into a set of speakers or headphone signals in order to provide a plane-wave reconstruction of the sound field. In sum, the coefficients φφφN, also known as ambisonic channels, are sufficient to encode and reproduce spatial audio. Hence, our goal is to generate φφφN from non-spatial audio and the corresponding video. Self-supervised learning Neural networks have been successfully trained through self-supervision for tasks such as image super-resolution [10, 27] and image colorization [20, 46]. In the audio domain, self-supervision has also enabled the detection of sound-video misalignment [37] and audio super-resolution [31]. Inspired by these approaches, we propose a self-supervised technique for audio spatialization. We show that the generation of ambisonic audio can be learned using a dataset of 360◦ video with spatial audio collected in-the-wild without additional human intervention. Generative models Recent advances in generative models such as Generative Adversarial Networks (GANs) [14] or Variational Auto-Encoders (VAE) [29] have enabled the generation of complex patterns, such as images [14] or text [23]. In the audio domain, Wavenet [36] has demonstrated the ability to produce high fidelity audio samples of both speech and music, by generating a waveform from scratch on a sample-by-sample basis. Furthermore, neural networks have also outperformed prior solutions to audio super-resolution [31] (e.g. converting from 4kHz to 16kHz audio) using a U-Net encoder-decoder architecture, and have enabled “automatic-Foley” type applications [41, 38], i.e. generating sounds that correspond to image features, and vice-versa. In this work, instead of generating audio from scratch, our goal is to augment the input audio channels so as to introduce spatial information. Thus, unlike Wavenet, efficient audio generation can be achieved without sacrificing audio fidelity, by transforming the input audio. We also demonstrate the advantages of our approach, inspired by the ambisonics encoding process in controlled environments, over a generic U-Net architecture for spatial audio generation. Source separation Source separation is a classic problem with an extensive literature. While early methods present the problem as independent component analysis, and focused on maximizing the statistical independence of the extracted signals [24, 7, 6, 2], recent approaches focus on data-driven solutions. For example, [19] proposes a recurrent neural-network for monaural separation of two speakers, [1, 12, 11] seek to isolate sound sources by leveraging synchronized visual information in addition to the audio input, and [44] studies a wide range of frequency-based separation methods. Similarly to recent trends, we rely on neural networks guided by cross-modal video analysis. However, instead of only separating human speakers [44] or musical instruments [47], we aim to separate multiple unidentified types of sound sources. Also, unlike previous algorithms, no explicit supervision is available to learn the separation block. Source localization Sound source localization is a mature area of signal processing and robotics research [3, 35, 34, 42]. However, unlike the proposed 360◦spatialization problem, these works rely on microphone arrays using beamforming techniques [43] or binaural audio and HRTF cues similar to those used by humans [18]. Furthermore, the need for carefully calibrated microphones limits the applicability of these techniques to videos collected in-the-wild. Cross visual-audio analysis Cross-modal analysis has been extensively studied in the vision and graphics community, due to the inherently paired nature of video and audio. For example, [4] learns audio feature representations in an unsupervised setting by leveraging synchronized video. [22] segments and localizes dominant sound sources using clustering of video and sound features. Other methods correlate repeated motions with sounds to identify sound sources such as the strumming of a guitar using for example canonical correlation analysis [25, 26], joint embedding spaces [41, 38] or other temporal features [5]. 3 3 Method In this section, we define the 360◦spatialization task to upconvert common audio recordings to support spatial audio playback. We then introduce a deep learning architecture to address this task, and two datasets to train the proposed architecture. 3.1 Audio spatialization The goal of 360◦spatialization is to generate ambisonic channels φφφN(t) from non-spatial audio i(t) and corresponding video v(t). To handle the most common audio formats supported by commercial 360◦cameras and video viewing platforms (e.g., YouTube and Facebook), we upgrade monaural recordings (mono) into first-order ambisonics (FOA). FOA consists of four channels that store the first-order coefficients, φ0 0, φ−1 1 , φ0 1 and φ1 1, of the spherical harmonic expansion in (Eq. 1). For ease of notation, we refer to these tracks as φw, φy, φz and φx, respectively. Self-supervised audio spatialization Converting mono to FOA ideally requires learning from videos with paired mono and ambisonics recordings, which are difficult to collect in-the-wild. In order to learn from self-supervision, we assume that monaural audio is recorded with an omnidirectional microphone. Under this assumption, mono is equivalent to zeroth-order ambisonics (up to an amplitude scale) and, as a consequence, the upconversion only requires the synthesis of the missing higher-order channels. More specifically, we learn to predict the first-order components φx(t), φy(t), φz(t) from the (surrogate) mono audio i(t) = φw(t) and video input v(t). Note that the proposed framework is also applicable to other conversion scenarios, e.g. FOA to second-order ambisonics (SOA), simply by changing the number of input and output audio tracks (see Sec 5). 3.2 Architecture Audio spatialization requires solving two fundamental problems: source separation and localization. In controlled environments, where the separated sound sources si(t) and respective localization θθθi are known in advance, ambisonics can be generated using (Eq. 2). However, since si(t) and θθθi are not known in practice, we design dedicated modules to isolate sources from the mixed audio input and localize them in the video. Also, because audio and video are complementary for identifying each source, both separation and localization modules are guided by a multi-modal audio-visual analysis module. A schematic description of our architecture is shown in Fig. 1. We now describe each component. Details of network architectures are provided in Appendix A. Audio and visual analysis Audio features are extracted in the time-frequency domain, which has produced successful audio representations for tasks such as audio classification [17] and speaker identification [33]. More specifically, we extract a sequence of short-term Fourier transforms (STFT) computed on 25ms segments of the input audio with 25% hop size and multiplied by Hann window functions. Then, we apply a (two-dimensional) CNN encoder to the audio spectrogram, which progressively reduces the spectrogram dimensionality and extracts high-level features. Video features are extracted using a two-stream network, based on Resnet-18 [16], to encode both appearance (RGB frames) and motion (optical flow predicted by FlowNet2 [21]). Both streams are initialized with weights pre-trained on ImageNet [8] for classification, and fine-tuned on our task. A joint audio-visual representation is then obtained by merging the three feature maps (audio, RGB and flow) produced at each time t. Since audio features are extracted at a higher frame rate than video features, we first synchronize the audio and video feature maps by nearest neighbor up-sampling of video features. Each feature map is then projected into a feature vector (1024 for audio and 512 for RGB and flow), and the outputs concatenated and fed to the separation and localization modules. Audio separation Although the number of sources may vary, this is often small in practice. Furthermore, psycoaccoustic studies have shown that humans can only distinguish a small number of simultaneous sources (three according to [39]). We thus assume an upper-bound of k simultaneous sources, and implement a separation network that extracts k audio tracks f i(t) from the input audio i(t). The separation module takes the form of a U-Net decoder that progressively restores the STFT dimensionality through a series of transposed convolutions and skip connections from the audio 4 analysis stage of equivalent resolution. Furthermore, to visually guide the separation module, we concatenate the multi-modal features to the lowest resolution layer of the audio encoder. In the last up-sampling layer, we produce k sigmoid activated maps ai(t, ω), which are used to modulate the STFT of the mono input ΦΦΦ(t; ω). The STFT of the ith source ΦΦΦi(t; ω) is thus obtained through the soft-attention mechanism ΦΦΦi(t; ω) = ai(t, ω) · ΦΦΦ(t; ω), and the separated audio track f i(t) reconstructed as the inverse STFT of ΦΦΦi(t; ω) using an overlap-add method. Localization To localize the sounds f i(t) extracted by the separation network, we implement a module that generates, at each time t, the localization weights wi(t) = (wi x(t), wi y(t), wi z(t)) associated with each of the k sources, through a series of fully-connected layers applied to the multi-modal feature vectors of the analysis stage. In a parallel to the encoding mechanism of (Eq. 2) used in controlled environments, wi(t) can be interpreted as the spherical harmonics yyyN(θθθi(t)) evaluated at the predicted position of the ith source θθθi(t). Ambisonic generation Given the localization weights wi(t) and separated wave-forms f i(t), the first-order ambisonic channels φφφ(t) = (φx(t), φy(t), φz(t)) are generated by φφφ(t) = Pk i=1 wi(t)f i(t). In summary, we split the generation task into two components: generating the attenuation maps ai(t, ω) for source separation, and the localization weights wi(t). As audio is not generated from scratch, but through a transformation of the original input inspired by the encoding framework of (Eq. 2), we are able to achieve fast deployment speeds with high quality results. 3.3 Evaluation metrics Let φφφ(t) and ˆφφφ(t) be the ground-truth and predicted ambisonics, and ΦΦΦ(t; ω) and ˆΦΦΦ(t; ω) their respective STFTs. We now discuss several metrics used for evaluating the generated signals ˆφφφ(t). STFT distance Our network is trained end-to-end to minimize errors between STFTs, i.e., MSEstft = P p∈{x,y,z} P t P ω ∥Φp(t, ω) −ˆΦp(t, ω)∥2, (3) where ∥· ∥is the euclidean complex norm. MSEstft has well-defined and smooth partial derivatives and, thus, it is a suitable loss function. Furthermore, unlike the euclidean distance between raw waveforms, the STFT loss is able to separate the signal into its frequency components, which enables the network to learn the easier parts of the spectrum without distraction from other errors. Log-spectral distance (LSD) Distances that only compare the smoothed spectral behavior of audio signals are widely used throughout the audio literature. We use the log-spectral distance [15] between ΦΦΦ(t; ω) and ˆΦΦΦ(t; ω), which measures the distance in dB between the two spectrograms using LSD = P p∈{x,y,z} P t r 1 K PK ω=1  10 log10 Φp(t,ω) ˆΦp(t,ω) 2 . (4) Envelope distance (ENV) Due to the high-frequency nature of audio and the human insensitivity to phase differences, frame-by-frame comparison of raw waveforms do not capture perceptual similarity of two audio signals. Instead, we measure the euclidean distance between envelopes of φφφ(t) and ˆφφφ(t), where the envelope of an audio wave is computed using the Hilbert transform method [40]. Earth Mover’s Distance (EMD) Ambisonics model the sound field f(θθθ, t) over all directions θθθ. The energy of the sound field measured over a small window wt around time t along direction θθθ is E(θθθ, t) = q 1 T P τ∈wt f(θθθ, τ)2 = q 1 T P τ∈wt yyyT N(θθθ)φφφN(τ) 2. (5) Thus, E(θθθ, t) represents the directional energy map of φφφ(t). In order to measure the localization accuracy of the generated spatial audio, we propose to compute the EMD [32] between the energy maps E(θθθ, t) associated with φφφ(t) and ˆφφφ(t). In practice, we uniformly sample the maps E(θθθ, t) over the sphere, normalize the sampled map so that P i E(θθθi, t) = 1, and measure the distance between samples over the sphere’s surface using cosine (angular) distances for EMD calculation. 5 REC-STREET YT-ALL YT-MUSIC YT-CLEAN 0 100 200 300 Counts Autos & Vehicles Sports Film & Animation Science & Technology Entertainment Travel & Events Music People & Blogs YT-All YT-Music YT-Clean Figure 2: Representative images. Example video frames from each dataset. 3.4 Datasets To train our model, we collected two datasets of 360◦videos with FOA audio. The first dataset, denoted REC-STREET, was recorded by us using a Theta V 360◦camera with an attached TA-1 spatial audio microphone. REC-STREET consists of 43 videos of outdoor street scenes, totaling 3.5 hours and 123k training samples (0.1s each). Due to the consistency of capture hardware and scene content, the audio of REC-STREET videos is relatively easier to spatialize. The second dataset, denoted YT-ALL, was collected in-the-wild by scraping 360◦videos from YouTube using queries related to spatial audio, e.g., spatial audio, ambisonics, and ambix. To clean the search results, we automatically removed videos that did not contain valid ambisonics, as described by YouTube’s format, keeping only videos containing all 4 channels or with only the Z channel missing (a common spatial audio capture scenario). Finally, we performed a manual curation to remove videos containing 1) still images, 2) computer generated content, or 3) post-processed and non-visually indicated sounds such as background music or voice-overs. During this pruning process, 799 videos were removed, resulting in 1146 valid videos totaling 113.1 hours of content (3976k training samples). YT-ALL was further separated into live musical performances, YT-MUSIC (397 videos), and videos with a small number of super-imposed sources which could be localized in the image, YT-CLEAN (496 videos). Upgrading YT-MUSIC videos into spatial audio is especially challenging due to the large number of mixed sources (voices and instruments). We also identified 489 videos that were recorded with a “horizontal” spatial audio microphone (i.e. only containing φw(t),φx(t) and φy(t) channels). In this case, we simply ignore the Z channel φz(t) when computing each metric including the STFT loss. Fig. 2 shows illustrative video frames and summarizes the most common categories for each dataset. 4 Evaluation For our experiments, we randomly sample three partitions, each containing 75% of all videos for training and 25% for testing. Networks are trained to generate audio at 48kHz from input mono audio processed at 48kHz and video at 10Hz. Each training sample consists of a chunk of 0.6s of mono audio and a single frame of RGB and flow, which are used to predict 0.1s of spatial audio at the center of the 0.6s input window. To make the model more robust and remove any bias to content in the center, we augment datasets during training by randomly rotating both video and spatial audio around the vertical (z) axis. Spatial audio can be rotated by multiplying the ambisonic channels with the appropriate rotation matrix as described in [30], and video frames (in equirectangular format) can be rotated using horizontal translations with wrapping. Networks are trained by back-propagation using the Adam optimizer [28] for 150k iterations (roughly two days) with parameters β1 = 0.9, β2 = 0.999 and ϵ = 1e −8, batch size of 32, learning rate of 1e −4 and weight decay of 0.0005. During evaluation, we predict a chunk of 0.1s for each second of the test video, and average the results across all chunks. Also, to avoid bias towards longer videos, all evaluation metrics are computed for each video separately, and averaged across videos. 6 REC-STREET YT-CLEAN YT-MUSIC YT-ALL STFT ENV EMD STFT ENV EMD STFT ENV EMD STFT ENV EMD SPATIAL PRIOR 0.187 0.958 0.492 1.394 2.063 1.478 4.652 4.355 3.479 2.691 3.394 2.246 U-NET BASELINE 0.180 0.935 0.449 1.361 2.039 1.403 4.338 4.678 2.855 2.658 3.239 2.137 OURS-NOVIDEO 0.178 0.973 0.450 1.370 2.081 1.428 4.220 4.591 2.654 2.635 3.200 2.117 OURS-NORGB 0.158 0.779 0.425 1.339 1.847 1.405 3.664 3.569 2.432 2.546 2.907 2.063 OURS-NOFLOW 0.172 0.784 0.440 1.349 1.778 1.402 3.615 3.467 2.403 2.455 2.665 2.023 OURS-NOSEP 0.152 0.790 0.422 1.381 1.773 1.415 3.627 3.602 2.447 2.435 2.694 2.050 OURS-FULL 0.158 0.767 0.419 1.379 1.776 1.417 3.524 3.366 2.350 2.447 2.649 2.019 Table 1: Quantitative comparisons. We report three quality metrics (Sec 3.3): Envelope distance (ENV), Log-spectral distance (LSD), and earth-mover’s distance (EMD), on test videos from different datasets (Sec 3.4). Lower is better. All results within 0.01 of the top performer are shown in bold. GT Ours Figure 3: Qualitative Results. Comparison between predicted and recorded FOA. Spatial audio is visualized as a color overlay over the frame, with darker red indicating locations with higher audio energy. Real time performance The proposed procedure can generate 1s of spatial audio at 48000Hz sampling rate in 103ms, using a single 12GB Titan Xp GPU (3840 cores running at 1.6GHz). Baselines Since spatial audio generation is a novel task, no established methods exist for comparison purposes. Instead, we ablate our architecture to determine the relevance of each component, and compare it to the prior spatial distribution of audio content and a popular, domain-independent baseline architecture. Quantitative results are shown in Table 1. To determine the role of the visual input, we remove the RGB encoder (NORGB), the flow encoder (NOFLOW), or both (NOVIDEO). We also remove the separation block entirely (NOSEP), and multiply the localization weights with the input mono directly. The results indicate that the network is highly relying on visual features, with NOVIDEO being one of the worse performers overall. Interestingly, most methods performed well on REC-STREET and YT-CLEAN. However, the visual encoder and separation block are necessary for more complex videos as in YT-MUSIC and YT-ALL. Since the main sound sources in 360◦videos often appear in the center, we validate the need for a complex model by directly using the prior distribution of audio content (SPATIAL-PRIOR). We compute the spatial prior ¯E(θ) by averaging the energy maps E(θ, t) of (Eq. 5) over all videos in the training set. Then, to induce the same distribution on test videos, we decompose ¯E(θ) into its spherical harmonics coefficients (cw, cx, cy, cz) and upconvert the input mono using (φw(t), φx(t), φy(t), φz(t)) = (1, cx/cw, cy/cw, cz/cw) i(t). As shown in Table 1, relying solely on the prior distribution is not enough for accurate ambisonic conversion. We finally compare to a popular encoder-decoder U-NET architecture, which has been sucessfully applied to audio tasks such as audio super-resolution [31]. This network consists of a number of convolutional downsampling layers that progressively reduce the dimension of the signal, distilling higher level features, followed by a number of upsampling layers to restore the signal’s resolution. In each upsampling layer, a skip connection is added from the encoding layer of equivalent resolution. To generate spatial audio, we modify the U-NET architecture by setting the number of units in the output layer to the number of ambisonic channels, and concatenate video features to the U-Net bottleneck (i.e., the lowest resolution layer). Our approach significantly outperforms the U-NET architecture, which demonstrates the importance of an architecture tailored to the task of spatial audio generation. 7 Ground-truth U-NET NOAUDIO NOSEP OURS Figure 4: Comparisons. Predicted FOA produced by different procedures. Figure 5: Mono recordings. Predicted FOA on videos recorded with a real mono microphone (unknown FOA). HMD In-Browser 0 20 40 60 80 100 % Real 84.4 72.5 62.2 55.0 31.1 40.4 22.2 35.8 GT Ours U-Net Mono Figure 6: User studies. Percentage of videos labeled as "Real" when viewed with audio generated by various methods (GT, OURS, U-NET and MONO) under two viewing experiences (using a HMD device, and in-browser viewing). Error bars represent Wilson score intervals [45] for a 95% confidence level. Qualitative results Designing robust metrics for comparing spatial audio is an open problem, and we found that only so much can be determined by these metrics alone. For example, fully flat predictions can have a similar EMD to a mis-placed prediction, but perceptually be much worse. Therefore, we also rely on qualitative evaluation and a user study. Fig. 3 shows illustrative examples of the spatial audio output of our network, and Fig. 4 shows a comparison with other baselines. To depict spatial audio, we overlay the directional energy map E(θθθ, t) of the predicted ambisonics (Eq. 5) over the video frame at time t. As can be seen in most of these examples, our network generates spatial audio that has a similar spatial distribution of energy as the ground truth. Furthermore, due to the form of the audio generator, the sound fidelity of the original mono input is carried over to the synthesized audio. These and other examples, together with the predicted spatial audio, are provided in Supp. material. The results shown in Table 1 and Fig. 3 use videos recorded with ambisonic microphones and converted to mono audio. To validate whether our method extends to real mono microphones, we scraped additional videos from YouTube that were not recorded with ambisonics, and show that we can still generate convincing spatial audio (see Fig. 5 and Supp. material). User study The real criteria for success is whether viewers believe that the generated audio is correctly spatialized. To evaluate this, we conducted a “real vs fake” user study, where participants were shown a 360◦video and asked to decide whether the perceived location of the audio matches the location of its sources in the video (real) or not (fake). Two studies were conducted in different viewing environments: a popular in-browser 360◦video viewing platform (YouTube), and with a head-mounted display (HMD) in a controlled environment. We recruited 32 participants from Amazon Mechanical Turk for the in-browser study. For the HMD study, we recruited 9 participants (aged between 20 and 32, 1 female) through an engineering school email list of a large university. In both cases, participants were asked to have normal hearing, and to listen to the audio using headphones. In the HMD study, participants were asked to wear a KAMLE VR Headset. To familiarize participants with the spatial audio experience, each participant was first asked to watch two versions of a preselected video with and without correct spatial audio. After the practice round, participants watched 20 randomly selected videos whose audio was generated by one of four methods: GT, the original ground-truth recorded spatial audio; MONO, just the mono track (no spatialization); U-NET, the baseline method; and OURS, the result of our full method. After each video, participants were asked to decide whether its audio was real or fake. In total, 280 clips per method were watched for the in-browser study, and 45 per method in the HMD study. The results of both studies, shown in Fig 6, support several conclusions. First, our approach outperforms the U-NET baseline and MONO by statistically significant margins in both studies. 8 Ground truth Ours Figure 7: Limitations. Our algorithm predicts the wrong people who are laughing in a room full of people (top), and the wrong violin who is currently playing in the live performance (right). FOA SOA MONO →FOA FOA →SOA ENV 1.870 0.333 LSD 3.228 0.513 EMD 1.400 0.232 Figure 8: Higher order ambisonics. (Top) Examples from our synthetic FOA to SOA conversion experiment. (Bottom) Comparison between Mono to FOA and FOA to SOA conversion tasks. Second, in comparison to in-browser video platforms, HMD devices offer a more realistic viewing experience, which enables non-spatial audio to be identified more easily. Thus, participants were convinced by the ambisonics predicted by our approach at higher rates while wearing an HMD device (62% HMD vs. 55% in-browser). Finally, spatial audio may not always be experienced easily, e.g., when the video does not contain clean sound sources. As a consequence, even videos with GT ambisonics were misclassified in both studies at a significant rate. 5 Discussion Limitations We observe several cases where sound sources are not correctly separated or localized. This occurs with challenging examples such as those with many overlapping sources, reverberant environments which are hard to separate, or where there is an ambiguous mapping from visual appearance to sound source (such as multiple, similar looking cars). Fig. 7 shows a few examples. While general purpose spatial audio generation is still an open problem, we provide a first approach. We hope that future advances in audio-visual analysis and audio generation will enable more robust solutions. Also, while total amount of content (in hours) is on par with other video datasets, the number of videos is still low, due to the limited number of 360◦video with spatial audio available from online sources. As this number increases, our method should also improve significantly. Future work Although hardware trends change and we begin to see commercial cameras that include spatial audio microphone arrays capable of recording FOA, we believe that up-converting to spatial audio will remain relevant for a number of reasons. Besides the spatialization of legacy recordings with only mono or stereo audio, our method can be used to further increase the ambisonics spatial resolution, for example by up-converting first into second-order ambisonics (SOA). Unfortunately, ground-truth SOA recordings are difficult to collect in-the-wild, since SOA microphones are rare and expensive. Instead, to demonstrate future potential, we applied our approach to the FOA to SOA conversion task, using a small synthetic dataset where pre-recorded sounds are placed at chosen locations, which move over time in random trajectories. These are accompanied by an artificially constructed video consisting of a random background image with identifying icons synchronized with the sound location (see Fig. 8). The results shown in Fig. 8 indicate that converting FOA into SOA may be significantly easier than ZOA to FOA. This is because FOA signals already contain substantial spatial information, and partially separated sounds. Given these findings, a promising area for future work is to synthesize a realistic large scale SOA dataset for learning to convert FOA into high-order ambisonics in order to support more realistic viewing experience. Conclusion We presented the first approach for up-converting conventional mono recordings into spatial audio given a 360◦video, and introduced an end-to-end trainable network tailored to this task. We also demonstrate the benefits of each component of our network and show that the proposed generator performs substantially better than a domain independent baseline. Acknowledgments This work was partially funded by graduate fellowship SFRH/BD/109135/2015 from the Portuguese Ministry of Sciences and Education and NRI Grant IIS-1637941. 9 References [1] T. Afouras, J. S. Chung, and A. Zisserman. The conversation: Deep audio-visual speech enhancement. In Interspeech, 2018. 3 [2] S. Amari, A. Cichocki, and H. H. Yang. A new learning algorithm for blind signal separation. In Advances in Neural Information and Processing Systems (NIPS), 1996. 3 [3] S. Argentieri, P. Danès, and P. Souères. A survey on sound source localization in robotics: From binaural to array processing methods. Computer Speech & Language, 34(1):87–112, 2015. 3 [4] Y. Aytar, C. Vondrick, and A. Torralba. Soundnet: Learning sound representations from unlabeled video. In Advances in Neural Information and Processing Systems (NIPS), 2016. 3 [5] Z. Barzelay and Y. Y. Schechner. Harmony in motion. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2007. 3 [6] A. J. Bell and T. J. Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural computation, 7(6):1129–1159, 1995. 3 [7] P. Comon. Independent component analysis, a new concept? Signal Processing, 36(3):287 – 314, 1994. 3 [8] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2009. 4 [9] G. Dickins and R. Kennedy. Towards optimal soundfield representation. In Audio Engineering Society Convention, 1999. 2 [10] C. Dong, C. C. Loy, K. He, and X. Tang. Learning a deep convolutional network for image super-resolution. In European Conference on Computer Vision (ECCV), 2014. 3 [11] A. Ephrat, I. Mosseri, O. Lang, T. Dekel, K. Wilson, A. Hassidim, W. Freeman, and M. Rubinstein. Looking to listen at the cocktail party: A speaker-independent audio-visual model for speech separation. In ACM SIGGRAPH, 2018. 3 [12] A. Gabbay, A. Shamir, and S. Peleg. Visual speech enhancement using noise-invariant training. In Interspeech, 2018. 3 [13] M. A. Gerzon. Periphony: With-height sound reproduction. J. Audio Eng. Soc, 21(1):2–10, 1973. 2 [14] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Advances in Neural Information and Processing Systems (NIPS), 2014. 3 [15] A. Gray and J. Markel. Distance measures for speech processing. IEEE Transactions on Acoustics, Speech, and Signal Processing, 24(5):380–391, 1976. 5 [16] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision (ECCV), 2016. 4 [17] S. Hershey, S. Chaudhuri, D. P. Ellis, J. F. Gemmeke, A. Jansen, R. C. Moore, M. Plakal, D. Platt, R. A. Saurous, B. Seybold, et al. CNN architectures for large-scale audio classification. In IEEE International Conf. on Acoustics, Speech and Signal Processing (ICASSP), 2017. 4 [18] J. Hornstein, M. Lopes, J. Santos-Victor, and F. Lacerda. Sound localization for humanoid robots-building audio-motor maps based on the HRTF. In IEEE/RSJ International Conf. on Intelligent Robots and Systems, 2006. 3 [19] P.-S. Huang, M. Kim, M. Hasegawa-Johnson, and P. Smaragdis. Deep learning for monaural speech separation. In IEEE International Conf. on Acoustics, Speech and Signal Processing (ICASSP), 2014. 3 [20] S. Iizuka, E. Simo-Serra, and H. Ishikawa. Let there be color!: joint end-to-end learning of global and local image priors for automatic image colorization with simultaneous classification. ACM Transactions on Graphics (TOG), 35(4):110, 2016. 3 [21] E. Ilg, N. Mayer, T. Saikia, M. Keuper, A. Dosovitskiy, and T. Brox. Flownet 2.0: Evolution of optical flow estimation with deep networks. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2017. 4 [22] H. Izadinia, I. Saleemi, and M. Shah. Multimodal analysis for identification and segmentation of movingsounding objects. IEEE Transactions on Multimedia, 15(2):378–390, 2013. 3 [23] R. Jozefowicz, O. Vinyals, M. Schuster, N. Shazeer, and Y. Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. 3 [24] C. Jutten and J. Herault. Blind separation of sources, part I: An adaptive algorithm based on neuromimetic architecture. Signal Processing, 24(1), 1991. 3 [25] E. Kidron, Y. Y. Schechner, and M. Elad. Pixels that sound. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2005. 3 [26] E. Kidron, Y. Y. Schechner, and M. Elad. Cross-modal localization via sparsity. IEEE Trans. on Signal Processing (TIP), 55(4):1390–1404, 2007. 3 [27] J. Kim, J. Kwon Lee, and K. Mu Lee. Accurate image super-resolution using very deep convolutional networks. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2016. 3 [28] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. 6 [29] D. P. Kingma and M. Welling. Auto-encoding variational Bayes. In International Conference on Learning Representations (ICLR), 2014. 3 10 [30] M. Kronlachner. Spatial transformations for the alteration of ambisonic recordings. Master’s thesis, Graz University of Technology, 2014. 2, 6 [31] V. Kuleshov, S. Z. Enam, and S. Ermon. Audio super resolution using neural networks. In Workshops at International Conference on Learning Representations (ICLR), 2017. 3, 7 [32] E. Levina and P. Bickel. The earth mover’s distance is the mallows distance: Some insights from statistics. In IEEE International Conference on Computer Vision (ICCV), 2001. 5 [33] A. Nagrani, J. S. Chung, and A. Zisserman. Voxceleb: A large-scale speaker identification dataset. In Interspeech, 2017. 4 [34] K. Nakadai, H. G. Okuno, and H. Kitano. Real-time sound source localization and separation for robot audition. In International Conference on Spoken Language Processing, 2002. 3 [35] K. Nakamura, K. Nakadai, F. Asano, and G. Ince. Intelligent sound source localization and its application to multimodal human tracking. In IEEE/RSJ International Conf. on Intelligent Robots and Systems (IROS), 2011. 3 [36] A. v. d. Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. In 9th ISCA Speech Synthesis Workshop, 2016. 3 [37] A. Owens and A. A. Efros. Audio-visual scene analysis with self-supervised multisensory features. In European Conference on Computer Vision (ECCV), 2018. 3 [38] A. Owens, P. Isola, J. McDermott, A. Torralba, E. H. Adelson, and W. T. Freeman. Visually indicated sounds. In IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2016. 3 [39] O. Santala and V. Pulkki. Directional perception of distributed sound sources. The Journal of the Acoustical Society of America, 129(3):1522–1530, 2011. 4 [40] J. O. Smith. Mathematics of the discrete Fourier transform (DFT): with audio applications, chapter The Analytic Signal and Hilbert Transform Filters. Julius Smith, 2007. 5 [41] M. Soler, J.-C. Bazin, O. Wang, A. Krause, and A. Sorkine-Hornung. Suggesting sounds for images from video collections. In European Conference on Computer Vision (ECCV), 2016. 3 [42] N. Strobel, S. Spors, and R. Rabenstein. Joint audio-video object localization and tracking. IEEE Signal Processing Magazine, 18(1):22–31, 2001. 3 [43] J.-M. Valin, F. Michaud, and J. Rouat. Robust localization and tracking of simultaneous moving sound sources using beamforming and particle filtering. Robotics and Autonomous Systems, 55(3):216–228, 2007. 3 [44] D. Wang and J. Chen. Supervised speech separation based on deep learning: An overview. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2018. 3 [45] E. B. Wilson. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158):209–212, 1927. 8 [46] R. Zhang, P. Isola, and A. A. Efros. Colorful image colorization. In European Conference on Computer Vision (ECCV), 2016. 3 [47] H. Zhao, C. Gan, A. Rouditchenko, C. Vondrick, J. McDermott, and A. Torralba. The sound of pixels. In European Conference on Computer Vision (ECCV), 2018. 3 11
2018
2
7,363
Critical initialisation for deep signal propagation in noisy rectifier neural networks Arnu Pretorius∗ Computer Science Division CAIR† Stellenbosch University Elan Van Biljon Computer Science Division Stellenbosch University Steve Kroon Computer Science Division Stellenbosch University Herman Kamper Department of Electrical and Electronic Engineering Stellenbosch University Abstract Stochastic regularisation is an important weapon in the arsenal of a deep learning practitioner. However, despite recent theoretical advances, our understanding of how noise influences signal propagation in deep neural networks remains limited. By extending recent work based on mean field theory, we develop a new framework for signal propagation in stochastic regularised neural networks. Our noisy signal propagation theory can incorporate several common noise distributions, including additive and multiplicative Gaussian noise as well as dropout. We use this framework to investigate initialisation strategies for noisy ReLU networks. We show that no critical initialisation strategy exists using additive noise, with signal propagation exploding regardless of the selected noise distribution. For multiplicative noise (e.g. dropout), we identify alternative critical initialisation strategies that depend on the second moment of the noise distribution. Simulations and experiments on real-world data confirm that our proposed initialisation is able to stably propagate signals in deep networks, while using an initialisation disregarding noise fails to do so. Furthermore, we analyse correlation dynamics between inputs. Stronger noise regularisation is shown to reduce the depth to which discriminatory information about the inputs to a noisy ReLU network is able to propagate, even when initialised at criticality. We support our theoretical predictions for these trainable depths with simulations, as well as with experiments on MNIST and CIFAR-10.‡ 1 Introduction Over the last few years, advances in network design strategies have made it easier to train large networks and have helped to reduce overfitting. These advances include improved weight initialisation strategies (Glorot and Bengio, 2010; Saxe et al., 2014; Sussillo and Abbott, 2014; He et al., 2015; Mishkin and Matas, 2016), non-saturating activation functions (Glorot et al., 2011) and stochastic regularisation techniques (Srivastava et al., 2014). Authors have noted, for instance, the critical dependence of successful training on noise-based methods such as dropout (Krizhevsky et al., 2012; Dahl et al., 2013). ∗Correspondence: arnupretorius@gmail.com †CSIR/SU Centre for Artificial Intelligence Research. ‡Code to reproduce all the results is available at https://github.com/ElanVB/noisy_signal_prop 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. ˜xl−1 xl−1 ϵl−1 W l bl ˜hl xl ⊙ + × φ Figure 1: Noisy layer recursion. The input xl−1 from the previous layer gets corrupted by the sampled noise ϵl−1, either by vector addition or component-wise multiplication, producing the noisy inputs ˜xl−1. The lth layer’s corrupted pre-activations are then computed by multiplication with the layer weight matrix W l, followed by a vector addition of the biases bl. Finally, the inputs to the next layer are simply the activations of the current layer, i.e. xl = φ(˜hl). In many cases, successful results arise only from effective combination of these advances. Despite this interdependence, our theoretical understanding of how these mechanisms and their interactions affect neural networks remains impoverished. One approach to studying these effects is through the lens of deep neural signal propagation. By modelling the empirical input variance dynamics at the point of random initialisation, Saxe et al. (2014) were able to derive equations capable of describing how signal propagates in nonlinear fully connected feed-forward neural networks. This “mean field” theory was subsequently extended by Poole et al. (2016) and Schoenholz et al. (2017), in particular, to analyse signal correlation dynamics. These analyses highlighted the existence of a critical boundary at initialisation, referred to as the “edge of chaos”. This boundary defines a transition between ordered (vanishing), and chaotic (exploding) regimes for neural signal propagation. Subsequently, the mean field approximation to random neural networks has been employed to analyse other popular neural architectures (Yang and Schoenholz, 2017; Xiao et al., 2018; Chen et al., 2018). This paper focuses on the effect of noise on signal propagation in deep neural networks. Firstly we ask: How is signal propagation in deep neural networks affected by noise? To gain some insight into this question, we extend the mean field theory developed by Schoenholz et al. (2017) for the special case of dropout noise, into a generalised framework capable of describing the signal propagation behaviour of stochastically regularised neural networks for different noise distributions. Secondly we ask: How much are current weight initialisation strategies affected by noise-induced regularisation in terms of their ability to initialise at a critical point for stable signal propagation? Using our derived theory, we investigate this question specifically for rectified linear unit (ReLU) networks. In particular, we show that no such critical initialisation exists for arbitrary zero-mean additive noise distributions. However, for multiplicative noise, such an initialisation is shown to be possible, given that it takes into account the amount of noise being injected into the network. Using these insights, we derive novel critical initialisation strategies for several different multiplicative noise distributions. Finally, we ask: Given that a network is initialised at criticality, in what way does noise influence the network’s ability to propagate useful information about its inputs? By analysing the correlation between inputs as a function of depth in random deep ReLU networks, we highlight the following: even though the statistics of individual inputs are able to propagate arbitrarily deep at criticality, discriminatory information about the inputs becomes lost at shallower depths as the noise in the network is increased. This is because in the later layers of a random noisy network, the internal representations from different inputs become uniformly correlated. Therefore, the application of noise regularisation directly limits the trainable depth of critically initialised ReLU networks. 2 Noisy signal propagation We begin by presenting mean field equations for stochastically regularised fully connected feedforward neural networks, allowing us to study noisy signal propagation for a variety of noise distributions. To understand how noise influences signal propagation in a random network given an input x0 ∈RD0, we inject noise into the model ˜hl = W l(xl−1 ⊙ϵl−1) + bl, spa for l = 1, ..., L (1) 2 using the operator ⊙to denote either addition or multiplication where ϵl is an input noise vector, sampled from a pre-specified noise distribution. For additive noise, the distribution is assumed to be zero mean, for multiplicative noise distributions, the mean is assumed to be equal to one. The weights W l ∈RDl×Dl−1 and biases bl ∈RDl are sampled i.i.d. from zero mean Gaussian distributions with variances σ2 w/Dl−1 and σ2 b, respectively, where Dl denotes the dimensionality of the lth hidden layer in the network. The hidden layer activations xl = φ(˜hl) are computed element-wise using an activation function φ(·), for layers l = 1, ..., L. Figure 1 illustrates this recursive sequence of operations. To describe forward signal propagation for the model in (1), we make use of the mean field approximation as in Poole et al. (2016) and analyse the statistics of the internal representations of the network in expectation over the parameters and the noise. Since the weights and biases are sampled from zero mean Gaussian distributions with pre-specified variances, we can approximate the distribution of the pre-activations at layer l, in the large width limit, by a zero mean Gaussian with variance ˜ql = σ2 w  Ez  φ p ˜ql−1z 2 ⊙µl−1 2  + σ2 b, (2) where z ∼N(0, 1) (see Section A.1 in the supplementary material). Here, µl 2 = Eϵ[(ϵl)2] is the second moment of the noise distribution being sampled from at layer l. The initial input variance is given by q0 = 1 D0 x0 · x0. Furthermore, to study the behaviour of a pair of signals from two different inputs, x0,a and x0,b, passing through the network, we can compute the covariance at each layer as ˜ql ab = σ2 wEz1 [Ez2 [φ(˜u1)φ(˜u2)]] + σ2 b (3) where ˜u1 = p ˜ql−1 aa z1 and ˜u2 = q ˜ql−1 bb h ˜cl−1z1 + p 1 −(˜cl−1)2z2 i , with the correlation between inputs at layer l given by ˜cl = ˜ql ab/ q ˜qlaa˜ql bb. Here, ql aa is the variance of ˜hl,a j (see Section A.2 in the supplementary material for more details). For the backward pass, we use the equations derived in Schoenholz et al. (2017) to describe error signal propagation.1 In the context of mean field theory, the expected magnitude of the gradient at each layer can be shown to be proportional to the variance of the error, ˜δl i = φ′(˜hl i) PDl+1 j=1 ˜δl+1 j W l+1 ji . This allows for the distribution of the error signal at layer l to be approximated by a zero mean Gaussian with variance ˜ql δ = ˜ql+1 δ Dl+1 Dl σ2 wEz  φ′ p ˜qlz 2 . (4) Similarly, for noise regularised networks, the covariance between error signals can be shown to be ˜ql ab,δ = ˜ql+1 ab,δ Dl+1 Dl+2 σ2 wEz1 [Ez2 [φ′(˜u1)φ′(˜u2)]] , (5) where ˜u1 and ˜u2 are defined as was done in the forward pass. Equations (2)-(5) fully capture the relevant statistics that govern signal propagation for a random network during both the forward and the backward pass. In the remainder of this paper, we consider, as was done by Schoenholz et al. (2017), the following necessary condition for training: “for a random network to be trained information about the inputs should be able to propagate forward through the network, and information about the gradients should be able to propagate backwards through the network.” The behaviour of the network at this stage depends on the choice of activation, noise regulariser and initial parameters. In the following section, we will focus on networks that use the Rectified Linear Unit (ReLU) as activation function. The chosen noise regulariser is considered a design choice left to the practitioner. Therefore, whether a random noisy ReLU network satisfies the above stated necessary condition for training largely depends on the starting parameter values of the network, i.e. its initialisation. 1It is, however, important to note that the derivation relies on the assumption that the weights used in the forward pass are sampled independently from those used during backpropagation. 3 0 2 4 6 8 10 12 14 Input variance (ql−1) 0 2 4 6 8 10 12 14 Output variance (ql) Iterative variance map Identity line tanh - None tanh - Add Gauss (σ2 ϵ = 1) ReLU - None ReLU - Add Gauss (σ2 ϵ = 1) 0 2 4 6 8 10 12 14 Layer (l) 0 2 4 6 8 10 12 14 Variance (ql) Dynamics of q (a) (b) Figure 2: Deep signal propagation with and without noise. (a): Iterative variance map. (b): Variance dynamics during forward signal propagation. In (a) and (b), lines correspond to theoretical predictions and points to numerical simulations (means over 50 runs with shaded one standard deviation bounds), for noiseless tanh (yellow) and noiseless ReLU (purple) networks, as well as for noisy tanh (red) and noisy ReLU (brown) networks regularised using additive noise from a standard Gaussian. Both tanh networks use (σw, σb) = (1, 0), the “Xavier” initialisation (Glorot and Bengio, 2010), while the ReLU networks use (σw, σb) = ( √ 2, 0) the “He” initialisation (He et al., 2015). In our experiments, we use network layers consisting of 1000 hidden units (see Section C in the supplementary material for more details on all our simulated experiments). 3 Critical initialisation for noisy rectifier networks Unlike the tanh nonlinearity investigated in previous work (Poole et al., 2016; Schoenholz et al., 2017), rectifying activation functions such as ReLU are unbounded. This means that the statistics of signal propagation through the network is not guaranteed to naturally stabilise through saturating activations, as shown in Figure 2. A point on the identity line in Figure 2 (a) represents a fixed point to the recursive variance map in equation (2). At a fixed point, signal will stably propagate through the remaining layers of the network. For tanh networks, such a fixed point always exists irrespective of the initialisation, or the amount of noise injected into the network. For ReLU networks, this is not the case. Consider the “He” initialisation (He et al., 2015) for ReLU, commonly used in practice. In (b), we plot the variance dynamics for this initialisation in purple and observe stable behaviour. But what happens when we inject noise into each network? In the case of tanh (shown in red), the added noise simply shifts the fixed point to a new stable value. However, for ReLU, the noise entirely destroys the fixed point for the “He” initialisation, making signal propagation unstable. This can be seen in (a), where the variance map for noisy ReLU (shown in brown) moves off the identity line entirely, causing the signal in (b) to explode. Therefore, to investigate whether signal can stably propagate through a random noisy ReLU network, we examine (2) more closely, which for ReLU becomes (see Section B.1 in supplementary material) ˜ql = σ2 w  ˜ql−1 2 ⊙µ2  + σ2 b. (6) For ease of exposition we assume equal noise levels at each layer, i.e. µl 2 = µ2, ∀l. A critical initialisation for a noisy ReLU network occurs when the tuple (σw, σb, µ2) provides a fixed point ˜q∗, to the recurrence in (6). This at least ensures that the statistics of individual inputs to the network will be preserved throughout the first forward pass. The existence of such a solution depends on the type of noise that is injected into the network. In the case of additive noise, ˜q∗= σ2 w 1 2 ˜q∗+ µ2σ2 w + σ2 b, implying that the only critical point initialisation for non-zero ˜q∗is given by (σw, σb, µ2) = ( √ 2, 0, 0). Therefore, critical initialisation is not possible using any amount of zero-mean additive noise, regardless of the noise distribution. For multiplicative noise, ˜q∗= σ2 w 1 2 ˜q∗µ2 + σ2 b, so the solution (σw, σb, µ2) = q 2 µ2 , 0, µ2  provides a critical initialisation for noise distributions with mean one and a non-zero second moment µ2. For example, in the case of multiplicative Gaussian noise, µ2 = σ2 ϵ + 1, yielding critical initialisation with (σw, σb) = q 2 σ2+1, 0  . For dropout noise, 4 Table 1: Critical point initialisation for noisy ReLU networks. DISTRIBUTION P(ϵ) µ2 CRITICAL INITIALISATION — ADDITIVE NOISE — GAUSSIAN N(0, σ2 ϵ ) σ2 ϵ (σw, σb, σϵ) = ( √ 2, 0, 0) LAPLACE Lap(0, β) 2β2 (σw, σb, β) = ( √ 2, 0, 0) — MULTIPLICATIVE NOISE — GAUSSIAN N(1, σ2 ϵ ) (σ2 ϵ + 1) (σw, σb, σϵ) = q 2 σ2ϵ +1, 0, σϵ  LAPLACE Lap(1, β) (2β2 + 1) (σw, σb, β) = q 2 2β2+1, 0, β  POISSON Poi(1) 2 (σw, σb, λ) = (1, 0, 1) DROPOUT P(ϵ = 1 p) = p, P(ϵ = 0) = 1 −p 1 p (σw, σb, p) = (√2p, 0, p) 0 5 10 15 Input variance (ql−1) 0.0 2.5 5.0 7.5 10.0 12.5 15.0 Output variance (ql) σ2 w > 2 µ2 σ2 w < 2 µ2 σ2 w = 2 µ2 Iterative variance map 0 5 10 15 Layer (l) 0.0 2.5 5.0 7.5 10.0 12.5 15.0 Variance (ql) Dynamics of q Mult Gauss dropout 1.0 1.2 1.4 1.6 1.8 2.0 Weight initialisation (σ2 w) 1.0 1.2 1.4 1.6 1.8 2.0 Second moment of noise dist. (µ2) Overflow (σ2 w > 2 µ2) Underflow (σ2 w < 2 µ2) σ2 w = 2 µ2 Variance propagation dynamics Variance critical boundary (a) (b) (c) Figure 3: Critical initialisation for noisy ReLU networks. (a): Iterative variance map. (b): Variance dynamics during forward signal propagation. In (a) and (b), lines correspond to theoretical predictions and points to numerical simulations. Dropout (p = 0.6) is shown in green for different initialisations, σ2 w = 2(0.6) = 2 µ2 (critical), σ2 w = (1.15)2 2 (0.6)−1 > 2 µ2 (exploding signal) and σ2 w = (0.85)2 2 (0.6)−1 < 2 µ2 (vanishing signal). Similarly, multiplicative Gaussian noise (σϵ = 0.25) is shown in red with σ2 w = 2 (0.25)2+1 = 2 µ2 (critical), σ2 w = (1.25)2 2 µ2 (exploding) and σ2 w = (0.75)2 2 µ2 ( vanishing). (c): Variance critical boundary for initialisation, separating numerical overflow and underflow signal propagation regimes. µ2 = 1/p (with p the probability of retaining a neuron); thus, to initialise at criticality, we must set (σw, σb) = (√2p, 0). Table 1 summarises critical initialisations for some commonly used noise distributions. We also note that similar results can be derived for other rectifying activation functions; for example, for multiplicative noise the critical initialisation for parametric ReLU (PReLU) activations (with slope parameter α) is given by (σw, σb, µ2) = q 2 µ2(α2+1), 0, µ2  . To see the effect of initialising on or off the critical point for ReLU networks, Figure 3 compares the predicted versus simulated variance dynamics for different initialisation schemes. For schemes not initialising at criticality, the variance map in (a) no longer lies on the identity line and as a result the forward propagating signal in (b) either explodes, or vanishes. In contrast, the initialisations derived above lie on the critical boundary between these two extremes, as shown in (c) as a function of the noise. By compensating for the amount of injected noise, the signal corresponding to the initialisation σ2 w = 2 µ2 is preserved in (b) throughout the entire forward pass, with roughly constant variance dynamics. 5 0.0 0.5 1.0 Input correlation (cl−1) 0.0 0.5 1.0 Output correlation (cl) Iterative correlation map none dropout (p = 0.6) dropout (p = 0.8) Mult Gauss (σϵ = 0.25) Mult Gauss (σϵ = 2) 0 10 20 30 Layer (l) 0.0 0.5 1.0 Correlation (cl) Dynamics of c 2 4 6 8 10 Second moment of noise distribution (µ2) 0.0 0.2 0.4 0.6 0.8 1.0 Slope at fixed point (χ(c∗)) Ordered regime (vanishing gradients) Phase diagram Noise critical initialisation Edge of chaos (a) (b) (c) Figure 4: Propagating correlation information in noisy ReLU networks. (a): Iterative correlation map with fixed points indicated by “X” marks on the identity line. (b): Correlation dynamics during forward signal propagation. In (a) and (b), lines correspond to theoretical predictions and points to numerical simulations. All simulated networks were initialised at criticality for each noise type and level. (c): Slope at the fixed point correlation as a function of the amount of noise injected into the network. Next, we investigate the correlation dynamics between inputs. Assuming that (6) is at its fixed point ˜q∗, which exists only if σ2 w = 2 µ2 , the correlation map for a noisy ReLU network is given by (see Section B.2 in supplementary material) ˜cl = 1 µ2 ( ˜cl−1sin−1 ˜cl−1 + p 1 −(˜cl−1)2 π + ˜cl−1 2 ) . (7) Figure 4 plots this theoretical correlation map against simulated dynamics for different noise types and levels. For no noise, the fixed point c∗in (a) is situated at one (marked with an “X” on the blue line). The slope of the blue line indicates a non-decreasing function of the input correlations. After a certain depth, inputs end up perfectly correlated irrespective of their starting correlation, as shown in (b). In other words, random deep ReLU networks lose discriminatory information about their inputs as the depth of the network increases, even when initialised at criticality. When noise is added to the network, inputs decorrelate and c∗moves away from one. However, more importantly, correlation information in the inputs become lost at shallower depths as the noise level increases, as can be seen in (b). How quickly a random network loses information about its inputs depends on the rate of convergence to the fixed point c∗. Using this observation, Schoenholz et al. (2017) derived so-called depth scales ξc, by assuming |cl −c∗| ∼e−l/ξc. These scales essentially control the feasible depth at which networks can be considered trainable, since they may still allow useful correlation information to propagate through the network. In our case, the depth scale for a noisy ReLU network under this assumption can be shown to be (see Section B.3 in supplementary material) ξc = −1/ln [χ(c∗)] , (8) where χ(c∗) = 1 µ2π h sin−1 (c∗) + π 2 i . (9) The exponential rate assumption underlying the derivation of (8) is supported in Figure 5, where for different noise types and levels, we plot |cl −c∗| as a function of depth on a log-scale, with corresponding linear fits (see panels (a) and (c)). We then compare the theoretical depth scales from (8) to actual depth scales obtained through simulation (panels (b) and (d)), as a function of noise and observe a good fit for non-zero noise levels.4 We thus find that noise limits the depth at which critically initialised ReLU networks are expected to perform well through training. 4We note Hayou et al. (2018) recently showed that the rate of convergence for noiseless ReLU networks is not exponential, but polynomial instead. Interestingly, keeping with the exponential rate assumption, we indeed find that the discrepancy between our theoretical depth scales from (8) and our simulated depth scales, is largest at very low noise levels. However, at more typical noise levels, such as a dropout rate of p = 0.5 for example, the assumption seems to provide a close fit, with good agreement between theory and simulation. 6 0 5 10 15 20 25 30 10−15 10−12 10−9 10−6 10−3 100 |cl −c∗| Rate of convergence to fixed point Simulation Linear fit 2 4 6 8 10 0.5 1.0 1.5 2.0 ξc Two input depth scales Theory Simulation 0 5 10 15 20 25 30 Layer (l) 10−16 10−13 10−10 10−7 10−4 10−1 |cl −c∗| Simulation Linear fit 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 µ2 1 2 3 4 5 6 ξc Theory Simulation (a) (b) (c) (d) Figure 5: Noise dependent depth scales for training. (a): Linear fits (dashed lines) to |cl −c∗| as a function of depth on a log-scale (solid lines) for varying amounts of dropout (p = 0.1 to p = 0.9 by 0.1). (b): Theoretical depth scales (solid lines) versus empirically inferred scales (dashed lines) per dropout rate. Scales are inferred noting that if |cl −c∗| ∼e−l/ξc, then a linear fit, al + b, in the logarithmic domain gives ξc ≈−1 a, for large l. In other words, the negative inverse slope of a linear fit to the log differences in correlation should match the theoretical values for ξc. Therefore, we compare ξc = −1/ln [χ(c∗)] to −1 a for different levels of noise. (c) - (d): Similar to (a) and (b), but for Gaussian noise (σϵ = 0.1 to σϵ = 1.9 by 0.15). We next briefly discuss error signal propagation during the backward pass for noise regularised ReLU networks. When critically initialised, the error variance recurrence relation in (4) for these networks is (see Section B.4 in supplementary material) ˜ql δ = ˜ql+1 δ Dl+1 Dlµ2 , (10) with the covariance between error signals in (5), given by (see Section B.5 in supplementary material) ˜ql ab,δ = ˜ql+1 ab,δ Dl+1 Dl+2 χ(c∗). (11) Note the explicit dependence on the width of the layers of the network in (10) and (11). We first consider constant width networks, where Dl+1 = Dl, for all l = 1, ..., L. For any amount of multiplicative noise, µ2 > 1, and we see from (10) that gradients will tend to vanish for large depths. Furthermore, Figure 4 (c) plots χ(c∗) as a function of µ2. As µ2 increases from one, χ(c∗) decreases from one. Therefore, from (11), we also find that error signals from different inputs will tend to decorrelate at large depths. Interestingly, for non-constant width networks, stable gradient information propagation may still be possible. If the network architecture adapts to the amount of noise being injected by having the widths of the layers grow as Dl+1 = Dlµ2, then (10) should be at its fixed point solution. For example, in the case of dropout Dl+1 = Dl/p, which implies that for any p < 1, each successive layer in the network needs to grow in width by a factor of 1/p to promote stable gradient flow. Similarly, for multiplicative Gaussian noise, Dl+1 = Dl(σ2 ϵ + 1), which requires the network to grow in width unless σ2 ϵ = 0. Similarly, if Dl+2 = Dl+1χ(c∗) = Dlµ2χ(c∗) in (11), the covariance of the error signal should be preserved during the backward pass, for arbitrary values of µ2 and χ(c∗). 7 0.3 0.6 0.9 1.2 1.5 1.8 2.1 Weight initialisation (σ2 w) 0 200 400 600 800 1000 Number of layers Underflow Overflow MNIST - Variance propagation depth: dropout with p = 0.6, crit. init. at σ2 w = 1.2 Theory criticality 0.5 1.0 1.5 2.0 Critical initialisation for p (σ2 w) 10 20 30 40 Number of layers MNIST - Depth at criticality 0.5 1.0 1.5 2.0 Critical initialisation for p (σ2 w) 10 20 30 40 Number of layers MNIST - Depth at criticality 0.3 0.6 0.9 1.2 1.5 1.8 2.1 Weight initialisation (σ2 w) 0 200 400 600 800 1000 Number of layers Underflow Overflow CIFAR-10 - Variance propagation depth: dropout with p = 0.6, crit. init. at σ2 w = 1.2 Theory criticality 0.5 1.0 1.5 2.0 Critical initialisation for p (σ2 w) 10 20 30 40 Number of layers CIFAR-10 - Depth at criticality 0.5 1.0 1.5 2.0 Critical initialisation for p (σ2 w) 10 20 30 40 Number of layers CIFAR-10 - Depth at criticality −80 −60 −40 −20 0 20 40 60 80 log(ql) 0.07 0.08 0.09 0.10 0.11 Train loss 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p 0.07 0.08 0.09 0.10 0.11 Val. loss 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p −80 −60 −40 −20 0 20 40 60 80 log(ql) 0.050 0.075 0.100 0.125 0.150 0.175 0.200 0.225 0.250 Train loss 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p 0.050 0.075 0.100 0.125 0.150 0.175 0.200 0.225 0.250 Val. loss 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 p (a) (b) (c) (d) (e) (f) Figure 6: Depth scale experiments on MNIST and CIFAR-10. (a) Variance propagation dynamics for MNIST on and off the critical point initialisation (dashed black line) with dropout (p = 0.6). The cyan curve represents the theoretical boundary at which numerical instability issues are predicted to occur and is computed as L∗= ln(K)/ln( σ2 w 2 µ2), where K is the largest (or smallest) positive number representable by the computer. Specifically, we use 32-bit floating point numbers and set K = 3.4028235 × 1038, if σ2 w > 2 µ2 and K = 1.1754944 × 10−38, if σ2 w < 2 µ2 . (b) Depth scales fit to the training loss on MNIST for networks initialised at criticality for dropout rates p = 0.1 (severe dropout) to p = 1 (no dropout). (c) Depth scales fit to the validation loss on MNIST. (d) - (f): Similar to (a) - (c), but for CIFAR-10. For each plot we highlight trends by smoothing the colour grid (for non smoothed versions see Section C.5 in the supplementary material). 4 Experimental results From our analysis of deep noisy ReLU networks in the previous section, we expect that a necessary condition for such a network to be trainable, is that the network be initialised at criticality. However, whether the layer widths are varied or not for the sake of backpropagation, the correlation dynamics in the forward pass may still limit the depth at which these networks perform well. We therefore investigate the performance of noise-regularised deep ReLU networks on real-world data. First, we validate the derived critical initialisation. As the depth of the network increases, any initialisation strategy that does not factor in the effects of noise, will cause the forward propagating signal to become increasingly unstable. For very deep networks, this might cause the signal to either explode or vanish, even within the first forward pass, making the network untrainable. To test this, we sent inputs from MNIST and CIFAR-10 through ReLU networks using dropout (with p = 0.6) at varying depths and for different initialisations of the network. Figure 6 (a) and (d) shows the evolution of the input statistics as the input propagates through each network for the different data sets. For initialisations not at criticality, the variance grows or shrinks rapidly to the point of causing numerical overflow or underflow (indicated by black regions). For deep networks, this can happen well before any signal is able to reach the output layer. In contrast, initialising at criticality (as shown by the dashed black line), allows for the signal to propagate reliably even at very large depths. Furthermore, given the floating point precision, if σ2 w ̸= 2 µ2 , we can predict the depth at which numerical overflow (or underflow) will occur by solving for L∗in K = σ2 wµ2/2 L∗ q0, where K is the largest (or smallest) positive number representable by the computer (see Section C.4 in supplementary material). These predictions are shown by the cyan line and provide a good fit to the empirical limiting depth from numerical instability. We now turn to the issue of limited trainability. Due to the loss of correlation information between inputs as a function of noise and network depth, we expect noisy ReLU networks not to be able to perform well beyond certain depths. We investigated depth scales for ReLU networks with dropout initialised at criticality: we trained 100 networks on MNIST and CIFAR-10 for 200 epochs using SGD and a learning rate of 10−3 with dropout rates ranging from 0.1 to 1 for varying depths. The results 8 are shown in Figure 6 (see Section C.5 of the supplementary material for additional experimental results). For each network configuration and noise level, the critical initialisation σ2 w = 2 µ2 was used. We indeed observe a relationship between depth and noise on the loss of a network, even at criticality. Interestingly, the line 6ξc (Schoenholz et al., 2017), seems to track the depth beyond which the relative performance on the validation loss becomes poor, more so than on the training loss. However, in both cases, we find that even modest amounts of noise can limit performance. 5 Discussion By developing a general framework to study signal propagation in noisy neural networks, we were able to show how different stochastic regularisation strategies may impact the flow of information in a deep network. Focusing specifically on ReLU networks, we derived novel critical initialisation strategies for multiplicative noise distributions and showed that no such critical initialisations exist for commonly used additive noise distributions. At criticality however, our theory predicts that the statistics of the input should remain within a stable range during the forward pass and enable reliable signal propagation for noise regularised deep ReLU networks. We verified these predictions by comparing them with numerical simulations as well as experiments on MNIST and CIFAR-10 using dropout and found good agreement. Interestingly, we note that a dropout rate of p = 0.5 has often been found to work well for ReLU networks (Srivastava et al., 2014). The critical initialisation corresponding to this rate is (σw, σb) = (√2p, 0) = (1, 0). This is exactly the “Xavier” initialisation proposed by Glorot and Bengio (2010), which prior to the development of the “He” initialisation, was often used in combination with dropout (Simonyan and Zisserman, 2014). This could therefore help to explain the initial success associated with this specific dropout rate. Similarly, Srivastava et al. (2014) reported that adding multiplicative Gaussian noise where ϵ ∼N(1, σ2 ϵ ), with σ2 ϵ = 1, also seemed to perform well, for which the critical initialisation is q 2 σ2ϵ +1, 0  = (1, 0), again corresponding to the “Xavier” method. Although our initialisations ensure that individual input statistics are preserved, we further analysed the correlation dynamics between inputs and found the following: at large depths inputs become predictably correlated with each other based on the amount of noise injected into the network. As a consequence, the representations for different inputs to a deep network may become indistinguishable from each other in the later layers of the network. This can make training infeasible for noisy ReLU networks of a certain depth and depends on the amount of noise regularisation being applied. We now note the following shortcomings of our work: firstly, our findings only apply to fully connected feed-forward neural networks and focus almost exclusively on the ReLU activation function. Furthermore, we limit the scope of our architectural design to a recursive application of a dense layer followed by a noise layer, whereas in practice a larger mix of layers is usually required to solve a specific task. Ultimately, we are interested in reducing the number of decisions that need to made when designing deep neural networks and understanding the implications of those decisions on network behaviour and performance. Any machine learning engineer exploring a neural network based solution to a practical problem will be faced with a large number of possible design decisions. All these decisions cost valuable time to explore. In this work, we hope to have at least provided some guidance in this regard, specifically when choosing between different initialisation strategies for noise regularised ReLU networks and understanding their associated implications. Acknowledgements We would like to thank the reviewers for their insightful comments which improved the quality of this work. Furthermore, we would like to thank Google, the CSIR/SU Centre for Artificial Intelligence Research (CAIR) as well as the Science Faculty and the Postgraduate and International Office of Stellenbosch University for financial support. Finally, we gratefully acknowledge the support of NVIDIA Corporation with the donation of a Titan Xp GPU used for this research. 9 References X. Glorot and Y. Bengio, “Understanding the difficulty of training deep feedforward neural networks,” in Proceedings of the International Conference on Artificial Intelligence and Statistics, 2010, pp. 249–256. A. M. Saxe, J. L. McClelland, and S. Ganguli, “Exact solutions to the nonlinear dynamics of learning in deep linear neural networks,” Proceedings of the International Conference on Learning Representations, 2014. D. Sussillo and L. Abbott, “Random walk initialization for training very deep feedforward networks,” arXiv preprint arXiv:1412.6558, 2014. K. He, X. Zhang, S. Ren, and J. Sun, “Delving deep into rectifiers: Surpassing human-level performance on ImageNet classification,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 1026–1034. D. Mishkin and J. Matas, “All you need is a good init,” Proceedings of International Conference on Learning Representations, 2016. X. Glorot, A. Bordes, and Y. Bengio, “Deep sparse rectifier neural networks,” in Proceedings of the International Conference on Artificial Intelligence and Statistics, 2011, pp. 315–323. N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting.” Journal of Machine Learning Research, vol. 15, no. 1, pp. 1929–1958, 2014. A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet classification with deep convolutional neural networks,” in Advances in Neural Information Processing Systems, 2012, pp. 1097–1105. G. E. Dahl, T. N. Sainath, and G. E. Hinton, “Improving deep neural networks for LVCSR using rectified linear units and dropout,” in Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, 2013, pp. 8609–8613. B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein, and S. Ganguli, “Exponential expressivity in deep neural networks through transient chaos,” in Advances in Neural Information Processing Systems, 2016, pp. 3360–3368. S. S. Schoenholz, J. Gilmer, S. Ganguli, and J. Sohl-Dickstein, “Deep information propagation,” Proceedings of the International Conference on Learning Representations, 2017. G. Yang and S. Schoenholz, “Mean field residual networks: On the edge of chaos,” in Advances in Neural Information Processing Systems, 2017, pp. 7103–7114. L. Xiao, Y. Bahri, J. Sohl-Dickstein, S. S. Schoenholz, and J. Pennington, “Dynamical isometry and a mean field theory of CNNs: How to train 10,000-layer vanilla convolutional neural networks,” Proceedings of the International Conference on Machine Learning, 2018. M. Chen, J. Pennington, and S. S. Schoenholz, “Dynamical isometry and a mean field theory of RNNs: Gating enables signal propagation in recurrent neural networks,” Proceedings of the International Conference on Machine Learning, 2018. S. Hayou, A. Doucet, and J. Rousseau, “On the selection of initialization and activation function for deep neural networks,” arXiv preprint arXiv:1805.08266, 2018. K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. 10
2018
20
7,364
A Smoothed Analysis of the Greedy Algorithm for the Linear Contextual Bandit Problem Sampath Kannan University of Pennsylvania Jamie Morgenstern Georgia Tech Aaron Roth University of Pennsylvania Bo Waggoner Microsoft Research, NYC Zhiwei Steven Wu University of Minnesota Abstract Bandit learning is characterized by the tension between long-term exploration and short-term exploitation. However, as has recently been noted, in settings in which the choices of the learning algorithm correspond to important decisions about individual people (such as criminal recidivism prediction, lending, and sequential drug trials), exploration corresponds to explicitly sacrificing the well-being of one individual for the potential future benefit of others. In such settings, one might like to run a “greedy” algorithm, which always makes the optimal decision for the individuals at hand — but doing this can result in a catastrophic failure to learn. In this paper, we consider the linear contextual bandit problem and revisit the performance of the greedy algorithm. We give a smoothed analysis, showing that even when contexts may be chosen by an adversary, small perturbations of the adversary’s choices suffice for the algorithm to achieve “no regret”, perhaps (depending on the specifics of the setting) with a constant amount of initial training data. This suggests that in slightly perturbed environments, exploration and exploitation need not be in conflict in the linear setting.1 1 Introduction Learning algorithms often need to operate in partial feedback settings (also known as bandit settings), in which the decisions of the algorithm determine the data that it observes. Many real-world application domains of machine learning have this flavor. Predictive policing algorithms [Rudin, 2013] deploy police officers and receive feedback about crimes committed and observed in areas the algorithm chose to deploy officers. Lending algorithms [Byrnes, 2016] observe whether individuals who were granted loans pay them back, but do not get to observe counterfactuals: would an individual not granted a loan have repaid such a loan? Algorithms which inform bail and parole decisions [Barry-Jester et al., 2015] observe whether individuals who are released go on to recidivate, but do not get to observe whether individuals who remain incarcerated would have committed crimes had they been released. Algorithms assigning drugs to patients in clinical trials do not get to observe the effects of the drugs that were not assigned to particular patients. Learning in partial feedback settings faces the well-understood tension between exploration and exploitation. In order to perform well, the algorithms need at some point to exploit the information they have gathered and make the best decisions they can. But they also need to explore: to make decisions which do not seem optimal according to the algorithm’s current point-predictions, in order to gather more information about less explored portions of the decision space. 1The full version of this paper is available at https://arxiv.org/abs/1801.03423. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. However, in practice, decision systems often do not explicitly explore, for a number of reasons. Exploration is important for maximizing long-run performance, but decision makers might be myopic — more interested in their short-term reward. In other situations, the decisions made at each round affect the lives of individuals, and explicit exploration might be objectionable on its face: it can be considered immoral to harm an individual today (explicitly sacrificing present utility) for a potential benefit to future individuals (long-term learning rates) [Bird et al., 2016, Bastani et al., 2017]. For example, in a medical trial, it may be repugnant to knowingly assign a patient a drug that is thought to be sub-optimal (or even dangerous) given the current state of knowledge, simply to increase statistical certainty. In a parole scenario, we may not want to release a criminal that we estimate is at high risk for committing violent crime. On the other hand, a lack of exploration can lead to a catastrophic failure to learn, which is highly undesirable – and which can also lead to unfairness. A lack of exploration (and a corresponding failure to correctly learn about crime statistics) has been blamed as a source of “unfairness” in predictive policing algorithms [Ensign et al., 2017]. In this paper, we seek to quantify how costly we should expect a lack of exploration to be when the instances are not entirely worst-case. In other words: is myopia a friction that we should generically expect to quickly be overcome, or is it really a long-term obstacle to learning? Empirical evaluation shows that greedy algorithms often do well — even outperforming algorithms with explicit exploration [Bietti et al., 2018]. Our work provides a theoretical explanation for this phenomenon. 1.1 Our Results We study the linear contextual bandits problem, which informally, represents the following learning scenario which takes place over a sequence of rounds t (formal definitions appear in Section 2). At each round t, the learner must make a decision amongst k choices, which are represented by contexts xt i ∈Rd. If the learner chooses action it at round t, he observes a reward rt it — but does not observe the rewards corresponding to choices not taken. The rewards are stochastic, and their expectations are governed by unknown linear functions of the contexts. For an unknown set of parameters βi ∈Rd, E[rt i] = βi · xt i. We consider two variants of the problem: in one (the single parameter setting), all of the rewards are governed by the same linear function: β1 = . . . = βk = β. In the other (the multiple parameter setting), the parameter vectors βi for each choice can be distinct. Normally, these two settings are equivalent to one another (up to a factor of k in the problem dimension) — but as we show, in our case, they have distinct properties2. The single-parameter setting can model, for example, the choice of which of some subset of individuals should participate in a particular clinical trial. The multi-parameter setting can model, for example, the risk of criminal recidivism amongst different individuals who come from different backgrounds, when observable features correlate differently to crime risk amongst different groups of individuals. We study the greedy algorithm, which trains least-squares estimates ˆβt i on the current set of observations, and at each round, picks the arm with the highest predicted reward: it = arg maxi ˆβt i · xt i. In the single parameter setting, greedy simply maintains a single estimate ˆβt. It is well known that the greedy algorithm does not obtain any non-trivial worst-case regret bound. We give a smoothed analysis which shows that the worst case is brittle, however. Specifically, we consider a model in which the contexts xt i are chosen at each round by an adaptive adversary, but are then perturbed by independent Gaussian perturbations in each coordinate, with standard deviation σ. We show that under smoothed analysis, there is a qualitative distinction between the single parameter and multiple parameter settings: 1. In the single parameter setting (Section 4), the greedy algorithm with high probability obtains regret bounded by ˜O  √ T d σ2  over T rounds. 2. In the multiple parameter setting (Section 5), the greedy algorithm requires a “warm start” – that is, to start with a small number of observations for each action – to obtain non-trivial regret bounds, even when facing a perturbed adversary. We show that if the warm start provides for each arm a small number of examples (depending polynomially on fixed parameters of the instance, like 1/σ, d, k, and 1/(mini ||βi||)), that may themselves be 2To convert a multi-parameter problem to single-parameter, concatenate the parameter vectors βi ∈Rd into a single vector β ∈Rkd, and lift contexts xt i into kd dimensions with zeros in all irrelevant kd −d coordinates. 2 chosen by an adversary and perturbed, then with high probability greedy obtains regret ˜O  √ T k σ2  . Moreover, this warm start is necessary: we give lower bounds showing that if the greedy algorithm is not initialized with a number of examples n that grows polynomially with both 1/σ and with 1/ mini ||βi||, then there are simple fixed instances that force the algorithm to have regret growing linearly with T, with constant probability. (See Section 6 for a formal statement of the lower bounds.) Our results extend beyond this particular perturbed adversary: we give general conditions on the distribution over contexts which imply our regret bounds. All missing proofs can be found in the full version. 1.2 Related Work The most closely related piece of work (from which we take direct inspiration) is Bastani et al. [2017], who, in a stochastic setting, give conditions on the sampling distribution over contexts that causes the greedy algorithm to have diminishing regret in a closely related but incomparable version of the two-armed linear contextual bandits problem3. The conditions on the context distribution given in that work are restrictive, however. They imply, for example, that every linear policy (and in particular the optimal policy) will choose each action with constant probability bounded away from zero. When translated to our perturbed adversarial setting, the distributional conditions of Bastani et al. [2017] do not imply regret bounds that are sub-exponential in either the perturbation magnitude σ or the dimension d of the problem. There is also strong empirical evidence that exploration free algorithms perform well on real datasets: [Bietti et al., 2018]. Our work can be viewed as providing an explanation of this phenomenon. Finally, building on our work, [Raghavan et al., 2018] use the same diversity condition that we introduce in this paper to show a stronger result in a more restrictive setting. They show that in the single parameter setting, when one further assumes that 1) the linear parameter is drawn from a Bayesian prior that is not too concentrated, 2) the contexts are drawn i.i.d. from a fixed distribution and then perturbed, and 3) that the algorithm is allowed to make its decisions in “batches” of polylog(d, t)/σ2 many rounds, then the greedy algorithm is essentially instance optimal in terms of Bayesian regret, and moreover, that its regret grows at a rate of O(T 1/3) in the worst case. In contrast, we make substantially weaker assumptions (the parameter vector and contexts can be worst case, we need not be in the single parameter setting, and we don’t need batches), but prove a worse regret bound of O(T 1/2), without a guarantee of instance optimality. A large literature focuses on designing no-regret algorithms for contextual bandit problems (e.g. Li et al. [2010], Agarwal et al. [2014], Li et al. [2011]), particularly for linear contextual bandits (e.g. [Chu et al., 2011, Abbasi-Yadkori et al., 2011]). Some of these (e.g. Syrgkanis et al. [2016]) use “follow the perturbed leader” style algorithms, which invite a natural comparison to our setting. However, the phenomenon we are exploiting is quite different. It is very important in our setting that the perturbations are added by nature, and if the perturbations were instead added by our algorithm (against worst-case contexts), the regret guarantee would cease to hold. To see this, note that against worst-case adversaries, the single parameter and multiple parameter settings are equivalent to one another — but in our smoothed setting, we prove a qualitative separation. We defer further related work, including work on smoothed analysis and algorithmic fairness, to the full version. 2 Model and Preliminaries We now introduce the notation and definitions we use for this work. For a vector x, ∥x∥represents its Euclidean norm. We consider two variants of the k-arm linear contextual bandits problem. The first setting has a single d-dimensional parameter vector β which governs rewards for all contexts x ∈Rd; the second has k distinct parameter vectors βi ∈Rd governing the rewards for different arms. 3Bastani et al. [2017] assume a single context at each round, shared between two actions. We consider each action as parameterized by its own context, and k can be arbitrary. 3 In rounds t, contexts xt 1, . . . , xt k, are presented, where xt i ∈Rd is treated as a row vector unless otherwise noted. The learner chooses an arm it ∈{1, . . . , k}, and obtains s2-subgaussian4 reward rt whose mean satisfies E [rt] = β · xt it in the single parameter setting and E [rt] = βit · xt it in the multi-parameter setting. The regret of a sequence of actions and contexts of length T is (again, in the single parameter setting all βi = β): Regret = Regret(x1, i1, . . . , xT , iT ) = T X t=1  max i βi · xt i −βit · xt it  . We next formalize the history or transcript of an algorithm on a sequence of contexts. A history entry is a member of H = Rdk × {1, . . . , k} × R. A history is a list of history entries, i.e. a member of H∗. Given a history H ∈HT , entry t is denoted ht = (x1, . . . , xk, it, rt it). Formally, an adaptive adversary A is a (possibly randomized) algorithm that maps a history to k contexts: A : H∗→ Rdk. We denote the output of the adversary by (µ1, µ2, . . . , µk)5 We assume that ∥µi∥≤1 always. Next we define the notion of a perturbed adversary, which encompasses both stages of the context-generation process. Definition 1 (Perturbed Adversary). For any adversary A, the σ-perturbed adversary Aσ is defined by the following process. In round t: 1. Given history Ht−1 ∈Ht−1, let µt 1, . . . , µt k = A(Ht−1). 2. Perturbations et 1, . . . , et k are drawn independently from N(0, σ2I). 3. Output the list of contexts (xt 1, . . . , xt k) = (µt 1 + et 1, . . . , µt k + et k). We define a perturbed adversary to be R-bounded if with probability 1, ∥xt i∥≤R for all i and t and all histories. We call perturbations (r, δ)-centrally bounded if, for each history, and fixed unit vectors w1, . . . , wk (possibly all equal), we have with probability 1 −δ that maxi=1,...,k wi · et i ≤r. We can interpret the output of a perturbed adversary as being a mild perturbation of the (unperturbed) adaptive adversary when the magnitude of the perturbations is smaller than the magnitude of the original context choices µi themselves. Said another way, we can think of the perturbations as being mild when they do not substantially increase the norms of the contexts with probability at least 1 −δ. This will be the case throughout the run of the algorithm (via a union bound over T) when σ ≤˜O(1/ √ d). We refer to this case as the “low perturbation regime”. We view it as the most interesting case because otherwise, the perturbations tend to be large enough to overwhelm the adversarial choices and the problem becomes easier. Here we focus on presenting results for the low perturbation regime, leaving the rest to the full version. 3 Proof Approach and Key Conditions Our goal will be to show that the greedy algorithm achieves no regret against any perturbed adversary in both the single-parameter and multiple-parameter settings. The key idea is to show that the distribution on contexts generated by perturbed adversaries satisfy certain conditions which suffice to prove a regret bound. The conditions we work with are related to (but substantially weaker than) the conditions shown to be sufficient for a no regret guarantee by Bastani et al. [2017]. The first key condition, diversity of contexts, considers the positive semidefinite d × d matrix E [x⊺x] for a context x, and asks for a lower bound on its minimum eigenvalue. This implies the distribution over x has non-trivial variance in all directions, which is necessary for the least squares estimator to converge to the underlying parameter β. It implies that observations of β · x convey information about β in all directions. However, we only observe the rewards for contexts x conditioned on Greedy selecting them: we see a biased (conditional) distribution on x. Thus we need the diversity condition to hold on these conditional distributions. Condition 1 (Diversity). Let e ∼D on Rd and let r, λ0 ≥0. We call D (r, λ0)-diverse if for all ˆβ, all µ with ∥µ∥≤1, and all ˆb ≤r∥ˆβ∥, for x = µ + e: 4A random variable Y with mean µ is s2-subgaussian if E h et(Y −µ)i ≤et2s2/2 for all t. 5The notation is chosen since µi will be the mean around which the perturbed context is drawn. 4 λmin  E e∼D h x⊺x ˆβ · e ≥ˆb i ≥λ0. In the single parameter setting, diversity will imply a regret guarantee: when any arm is pulled, the context-reward pair gives useful information about all components of the (single) parameter β. In the multiple parameter setting, diversity will suffice to guarantee that the learner’s estimate of arm i’s parameter vector converges to βi as a function of the number of times arm i is pulled; but alone it does not cause arm i to be pulled sufficiently often (even in rounds where i is the best alternative, when failing to pull it will cause our algorithm to suffer regret). Thus the multiple parameter setting will require a second key condition, margins. Margins will imply that conditioned on an arm being optimal on a given round, there is a non-trivial probability (over the randomness in the contexts) that Greedy perceives it to be optimal based on current estimates {ˆβt i}, so long as the current estimates achieve at least some constant baseline accuracy. A small initial training set can guarantee that initial estimates achieve constant error, and so the margin condition implies that Greedy will continue to explore arms with a frequency that is proportional to the number of rounds for which they are optimal; then diversity implies that estimates of those arms’ parameters will improve quickly (without promising anything about arms that are rarely optimal – and hence inconsequential for regret). Condition 2 (Conditional Margins). Let e ∼D and let r, α, γ ≥0. We say D has (r, α, γ) margins if for all β ̸= 0 and b ≤r∥β∥, P [β · e > b + α∥β∥| β · e ≥b] ≥γ. So, on rounds for which arm i has largest expected reward, with probability at least γ its expected reward is largest by at least some margin (α∥β∥). If Greedy has sufficiently accurate estimates {ˆβt i}, this implies that Greedy will pull arm i. We say a perturbed adversary satisfies the diversity and margin conditions if the distributions of et i are independent and satisfy these conditions for all i, t. We will show the diversity condition implies no-regret in single-parameter settings, and the diversity and margin conditions imply no-regret in multi-parameter settings. We further show that the perturbation distribution N(0, σ2I) satisfies these conditions. We note that our choice of Gaussian perturbations was convenient and natural but not necessary (other perturbation distributions also satisfy our conditions, implying similar results for those perturbations). Complications: extreme perturbation realizations. When the realizations of the Gaussian perturbations have extremely large magnitude, the diversity and margin conditions will not hold6. This is potentially problematic, because the probabilistic conditioning in both conditions increases the likelihood that the perturbations will be large. This is the role of the parameter r in both conditions: to provide a reasonable upper bound on the threshold that a perturbation variable should not exceed. exceed. In the succeeding sections, we will use conditions we call “good” to formalize the intuition that this is unlikely to happen often, when the perturbations satisfy a centrally-bounded condition. 4 Single Parameter Setting We define the “Greedy Algorithm” as the algorithm which myopically pulls the “best” arm at each round according to the predictions of the classic least-squares estimator. Let Xt denote the (t−1)×d design matrix at time t, in which each row t′ is some observed context xt′ it′ where arm it′ was selected at round t′ < t. The corresponding vector of rewards is denoted yt = (r1 i1, . . . , rt−1 it−1). The transposes of a matrix Z and vector z are denoted Z⊺and z⊺. At each round t, Greedy first computes the least-squares estimator based on the historical contexts and rewards: ˆβt ∈arg minβ ||Xtβ−yt||2 2, and then greedily selects the arm with the highest estimated reward: it = arg maxi ˆβt · xt i. We defer the formal description of the algorithm to the full version. “Reasonable” rounds. As discussed in Section 2, the diversity condition will only hold when an arm’s perturbations et i are not too large; we formalize these “good” situations here. Fix a round t, 6E.g. for margins, consider the one-dimensional case: a lower truncated Gaussian tightly concentrates on its minimal support value. 5 the current Greedy hypothesis ˆβt, and any choices of the adversary µt 1, . . . , µt k conditioned on the entire history up to round t. Now each value ˆβtxt i = ˆβtµt i + ˆβtet i is a random variable, and Greedy selects the arm corresponding to the largest realized value. In particular, we define the “threshold” for Greedy to pull i as follows. Definition 2. Fix a round t, Greedy’s hypothesis ˆβt, and the adversary’s choices µt 1, . . . , µt k. We define ˆct i := maxj̸=i ˆβt · xt j. We say a realization of ˆct i is r- d good if ˆct i ≤ˆβt · µt i + r∥ˆβt∥. The “hat” on d good corresponds to those on ˆct i and ˆβt. In the multiple parameter setting we will use analogous conditions without the hats. Notice that ˆct i is a random variable that depends on all the perturbations et j for j ̸= i, and Greedy pulls i if and only if ˆβtxt i ≥ˆct i. The event that ˆct i is r-good is determined by the perturbations et i′ of all arms i′ ̸= i. Intuitively, if ˆct i is r- d good, then et i need not be too large for arm i to be selected. 4.1 Regret framework for perturbed adversaries We first observe an upper-bound on Greedy’s regret as a function of the distance between ˆβt and the true model β. This allows us to focus on the diversity condition, which will guarantee that this distance shrinks. Let i∗(t) = arg maxi β · xt i, the optimal arm at time t. Lemma 4.1. Suppose for all i, t that ∥xt i∥≤R. In the single-parameter setting, for any tmin ∈[T], we have: Regret(x1, i1, . . . , xT , iT ) ≤2Rtmin + 2R T X t=tmin β −ˆβt . To apply Lemma 4.1, we need to show that estimates ˆβt →β quickly. The key idea is that if the input contexts are “diverse” enough (captured formally by Definition 1), we will be able to infer β. Lemma 4.2 shows ˆβt approaches β at a rate governed by the minimum eigenvalue of the design matrix. Lemma 4.2. Fix a round t and let Zt = (Xt)⊺Xt. Suppose all contexts satisfy ∥xt i∥≤R and recall that rewards are s2-subgaussian. Then with probability 1 −δ over the randomness in rewards, we have ∥β −ˆβt∥≤ p 2tdRs2 ln(td/δ) λmin (Zt) . Observe that the matrix Zt = P t′≤t (xt′ i ) ⊺xt′ i . The next step is to show that λmin(Zt) grows at a rate of Θ(t) with high probability, which will imply via Lemma 4.2 that ∥β −ˆβt∥≤O(1/ √ t), fixing all other parameters. This is proven in the following key result, Lemma 4.3. The proof uses a concentration result for the minimum eigenvalue to show that λmin(Zt) grows at a rate Θ(t) with high probability. This relies crucially on the (r, λ0) diversity condition, which intuitively lower-bounds the expected increase in λmin(Zt) at each round. The details are more complicated, as this increase only holds when Greedy’s choice of i has an r- d good ˆct i; we show this happens with constant probability for an (r, 1/2)-centrally bounded adversary. Lemma 4.3. For Greedy in the single parameter setting with an R-bounded, (r, 1/2)centrally bounded, (r, λ0)-diverse adversary, we have with probability 1 −δ that for all t ≥ max{0, 20R2 λ0 ln( 20R2 λ0dδ )}, we have λmin(Zt) ≥tλ0 4 . Combining these results gives a bound on the regret of Greedy against general perturbed adversaries. The Gaussian, σ-perturbed adversary. We need to show that our σ-perturbed adversary satisfies the diversity condition (and another technical condition that we defer to the supplementary materials). For the diversity condition, we show that the diversity parameter λ can be lower bounded by the variance of a single-dimensional truncated Gaussian, then analyze this variance using tight Gaussian tail bounds. Our proof makes use of the careful choice of truncations of A′ σ using a different orthonormal change of basis each round, which maintains the perturbation’s Gaussian distribution but allows the form of the conditioning to be much simplified. Finally, we arrive at the main result for this section: 6 Theorem 4.1. In the single parameter setting against the σ-perturbed adversary Aσ, fix any choice of parameters such that σ ≤ 1 2√ 2d ln(T kd/δ) (the low perturbation regime) and d ≤eO(s2T ). With probability at least 1 −δ, Greedy has Regret ≤O p Tds2 ln(Td/δ) ln(k) σ2 ! where d is the dimension of contexts, k is the number of arms, rewards are s2-subgaussian, and in all cases O(·) hides an absolute constant. 5 Multiple Parameter Setting In the multi-parameter setting, we cannot hope for the greedy algorithm to achieve vanishing regret without any initial information, as it never learns about parameters of arms it does not pull (formalized in a lower bound in Section 6). If, however, Greedy receives a small amount of initial information in the form of a constant number of n samples (xi, ri) for each arm i, perturbations will imply vanishing regret. We refer to this as an n-sample “warm start” to Greedy. (See the full version for a formal description of the algorithm.) For this setting, we show that the diversity and margin conditions together on a generic bounded adversary imply low regret. We then leverage this to give regret bounds for the Gaussian adversary Aσ. As discussed in Section 3, the key idea is as follows. Analogous to the single parameter setting, the diversity condition implies that additional datapoints we collect for an arm improve the accuracy of its estimate ˆβt i. Meanwhile, the margin condition implies that for sufficiently accurate estimates, when an arm is optimal (βixt i is largest), the perturbations have a good chance of causing Greedy to pull that arm (ˆβt ixt i is largest). Thus, the initial data sample kickstarts Greedy with reasonably accurate estimates, causing it to regularly pull optimal arms and accrue more data points, thus becoming more accurate. Notation and preliminaries. Recall that it is the arm pulled by Greedy at round t, i.e. it = arg maxi ˆβt i · xt i. Similarly let i∗(t) be the optimal arm at round t, i.e. i∗(t) = arg maxi βi · xt i. Let ni(t) be the number of times arm i is pulled prior to round t, including the warm start (so ni(1) will be nonzero). Let Si = {t : it = i} and let S∗ i = {t : i∗(t) = i}, the rounds where i is pulled and is optimal respectively. Recall that ˆct i is a threshold that i must exceed to be pulled by Greedy, and the r- d good condition captures cases where this can happen without the perturbation et i being too large. We now define this condition formally for the multiple parameter case. We also need a similar threshold ct i that i must exceed to be the optimal arm, and an analogous r-good condition. Definition 3. Fix a round t, the current Greedy hypotheses ˆβt 1, . . . , ˆβt k, and choices of an adversary µt 1, . . . , µt k. Define ˆct i := maxj̸=i ˆβt j · xt j, a random variable depending on {et j : j ̸= i}. Say an outcome of ˆct i is r- d good if ˆct i ≤ˆβt i · µt i + r∥ˆβt i∥. Similarly, define ct i := maxj̸=i βj · xt j and say an outcome of ct i is r-good if ct i ≤βi · µt i + r∥βi∥. 5.1 Regret framework for perturbed adversaries Similarly to Lemma 4.1, here the regret of Greedy shrinks as each ˆβt i →βi. The proof is essentially identical, but in this case, we prove this for each arm i ∈[k]. Lemma 5.1. In the multiple parameter setting, the regret of Greedy is bounded by Pk i=1 Regreti(T) with Regreti(T) = R X t∈Si βi −ˆβt i ! + R  X t∈S∗ i βi −ˆβt i  . As in the single parameter setting, the diversity condition implies that with enough observations ni(t) for arm i, we have ∥βi −ˆβt i∥≤O( 1 √ ni(t)). We omit the details as they are analogous to the single parameter case, and move on to the margin condition. 7 We wish to capture the benefits of the margin condition, i.e. that arms which are often optimal are also actually pulled often by Greedy. The first step is to leverage the margin condition to argue that when arm i is optimal (and ct i is r-good), it is optimal by a significant margin (α∥βi∥) with a significant probability (γ). Combining this with accurate initial estimates implies that it will actually be pulled by Greedy. Lemma 5.2. Suppose the perturbed adversary is R-bounded and has (r, α, γ) margins for some r ≤R. Consider any round t where for all j we have ∥βj −ˆβt j∥≤ α minj′ ∥βj′∥ 2R . Then P  it = i i∗(t) = i, ct i is r-good  ≥γ. Recall that Si, S∗ i are respectively the set of rounds in which it = i (Greedy pulls arm i) and i∗(t) = i (arm i is optimal), respectively. The following key result leverages the margin condition to argue that, if i is optimal for a significant number of rounds, then it is pulled by Greedy. This is vital to a good regret bound because it shows that ni(t), the number of samples from arm i, is steadily increasing in t if i is often optimal, which we know from the diversity condition implies that the estimate ˆβt i is converging. Lemma 5.3. Consider an R-bounded perturbed adversary with (r, α, γ) margins and assume ∥βi −ˆβt i∥≤α minj ∥βj∥ 2R for all i and t. With probability at least 1 −δ, we have for all natural numbers N, |{t ∈S∗ i : ni(t) = N}| ≤5 γ ln 2 δ. That is, arm i can be optimal at most 5 γ ln 2 δ times before being pulled by Greedy. The Gaussian, σ-perturbed adversary At a high level, all that remains to complete our analysis is to prove that our perturbed adversary Aσ produces distributions that satisfy our margin condition. There are some complications that make the details of this argument slightly circuitous, that we defer to the full version in the supplement (we first prove this result for an adversary that uses a truncated Gaussian distribution, and hence always produces bounded contexts, and then use this to argue that our actual adversary also has the properties that we need). Once this is proven, we obtain the main result of the multiple parameter setting. In particular, in the small-perturbation regime, a constant-size warm start (i.e. independent of T, as long as σ is small) suffices to initialize Greedy such that, with high probability, it can obtain ˜O( √ T) regret. Theorem 5.1. In the multiple parameter setting, against the σ-perturbed adversary Aσ, with a warm start of size n ≥Ω  ds2 ln( dks2 δσ minj ∥βj∥2 ) σ12 minj ∥βj∥2  , for any setting of parameters such that σ ≤ 1 3√ d ln(2T kd/δ), Greedy satisfies with probability 1 −δ Regret ≤O √ Tkds2(ln T kd δ )3/2 σ2 ! where d is the dimension of the contexts, k is the number of arms, rewards are s2-subgaussian, and in all cases O(·), Ω(·) hide absolute constants. 6 Lower Bounds for the Multi-Parameter Setting Finally, in this section, we show that our results for the multi-parameter setting are qualitatively tight. Namely, Greedy can be forced to suffer linear regret in the multi-parameter setting unless it is given a “warm start” that scales polynomially with 1 σ, the perturbation parameter, and 1/ mini ||β||i, the norm of the smallest parameter vector. This shows the polynomial dependencies on these parameters in our upper bound cannot be removed, and in particular, prove a qualitative separation between the multi-parameter setting and the single parameter setting (in which a warm start is not required). Both of our lower bounds are in the fully stochastic setting – i.e. they are based on instances in which contexts are drawn from a fixed distribution, and do not require that we make use of an adaptive adversary. First, we focus on the perturbation parameter σ. 8 Theorem 6.1. Suppose greedy is given a warm start of size n ≤  1 100σ2 ln ρ 100  in the σ-perturbed setting. Then, there exists an instance for which Greedy incurs regret Ω( ρ √n) with constant probability in its first ρ rounds. Remark 1. Theorem 6.1 implies for T < exp( 1 σ), either • n = Ω poly 1 σ  , or • Greedy suffers linear regret. The lower bound instance is simple: one-dimensional, with two arms and model parameters β1 = β2 = 1. In each round (including the warm start) the unperturbed contexts are µ1 = 1 and µ2 = 1 −1/√n, and so the perturbed contexts xt 1 and xt 2 are drawn independently from the Gaussian distributions N(1, σ2) and N(1 − 1 √n, σ2), for σ = r 1 100n ln ρ 100 . We show the estimators after the warm start have additive error Ω  1 √n  with a constant probability, and when this is true, with constant probability, arm 1 will only be pulled ˜O n2/3 rounds. So, with constant probability greedy will pull arm 2 nearly every round, even though arm 1 will be better in a constant fraction of rounds. We now turn our attention to showing that the warm start must also grow with 1/ mini ||βi||. Informally, the instance we use to show this lower bound has unperturbed contexts µt i = 1 for both arms and all rounds, and β1 = 8ϵ, β2 = 10ϵ. We show again that the warm start of size n yields, with constant probability, estimators with error ci √n, causing Greedy to choose arm 2 rather than arm 1 for a large number of rounds. When 2 is not pulled too many times, with constant probability its estimate remains small and continues to be passed over in favor of arm 1. Theorem 6.2. Let ϵ = mini |βi|, σ < 1 r ln T δ and T δ < 2n1/3. Suppose Greedy is given a warm start of size n ≤ 1 2ϵ. Then, some instances cause Greedy to incur regret R(T) = Ω  ϵ  e 1 18σ2 −n 2 3  . Remark 2. Observe again that this implies that Greedy can be forced to incur linear regret if its warm start size does not grow with 1/ mini ||βi|| for exponentially many rounds. References Yasin Abbasi-Yadkori, Dávid Pál, and Csaba Szepesvári. Improved algorithms for linear stochastic bandits. In Advances in Neural Information Processing Systems, pages 2312–2320, 2011. Alekh Agarwal, Daniel Hsu, Satyen Kale, John Langford, Lihong Li, and Robert Schapire. Taming the monster: A fast and simple algorithm for contextual bandits. In International Conference on Machine Learning, pages 1638–1646, 2014. Anna Maria Barry-Jester, Ben Casselman, and Dana Goldstein. The new science of sentencing. The Marshall Project, August 8 2015. URL https://www.themarshallproject.org/2015/08/ 04/the-new-science-of-sentencing. Retrieved 4/28/2016. H. Bastani, M. Bayati, and K. Khosravi. Exploiting the Natural Exploration In Contextual Bandits. ArXiv e-prints, April 2017. A. Bietti, A. Agarwal, and J. Langford. Practical Evaluation and Optimization of Contextual Bandit Algorithms. ArXiv e-prints, February 2018. Sarah Bird, Solon Barocas, Kate Crawford, Fernando Diaz, and Hanna Wallach. Exploring or exploiting? social and ethical implications of autonomous experimentation. Workshop on Fairness, Accountability, and Transparency in Machine Learning, 2016. Nanette Byrnes. Artificial intolerance. MIT Technology Review, March 28 2016. URL https:// www.technologyreview.com/s/600996/artificial-intolerance/. Retrieved 4/28/2016. 9 Wei Chu, Lihong Li, Lev Reyzin, and Robert E Schapire. Contextual bandits with linear payoff functions. In International Conference on Artificial Intelligence and Statistics, pages 208–214, 2011. Danielle Ensign, Sorelle A. Friedler, Scott Neville, Carlos Eduardo Scheidegger, and Suresh Venkatasubramanian. Runaway feedback loops in predictive policing. Workshop on Fairness, Accountability, and Transparency in Machine Learning, 2017. Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661–670. ACM, 2010. Lihong Li, Wei Chu, John Langford, and Xuanhui Wang. Unbiased offline evaluation of contextualbandit-based news article recommendation algorithms. In Proceedings of the fourth ACM international conference on Web search and data mining, pages 297–306. ACM, 2011. Manish Raghavan, Aleksandrs Slivkins, Jennifer Wortman Vaughan, and Zhiwei Steven Wu. The externalities of exploration and how data diversity helps exploitation. In Proceedings of the 31st Conference on Learning Theory, COLT 2018, 2018. Cynthia Rudin. Predictive policing using machine learning to detect patterns of crime. Wired Magazine, August 2013. URL http://www.wired.com/insights/2013/08/ predictive-policing-using-machine-learning-to-detect-\patterns-of-crime/. Retrieved 4/28/2016. Vasilis Syrgkanis, Akshay Krishnamurthy, and Robert Schapire. Efficient algorithms for adversarial contextual learning. In International Conference on Machine Learning, pages 2159–2168, 2016. 10
2018
200
7,365
Lifelong Inverse Reinforcement Learning Jorge A. Mendez, Shashank Shivkumar, and Eric Eaton Department of Computer and Information Science University of Pennsylvania {mendezme,shashs,eeaton}@seas.upenn.edu Abstract Methods for learning from demonstration (LfD) have shown success in acquiring behavior policies by imitating a user. However, even for a single task, LfD may require numerous demonstrations. For versatile agents that must learn many tasks via demonstration, this process would substantially burden the user if each task were learned in isolation. To address this challenge, we introduce the novel problem of lifelong learning from demonstration, which allows the agent to continually build upon knowledge learned from previously demonstrated tasks to accelerate the learning of new tasks, reducing the amount of demonstrations required. As one solution to this problem, we propose the first lifelong learning approach to inverse reinforcement learning, which learns consecutive tasks via demonstration, continually transferring knowledge between tasks to improve performance. 1 Introduction In many applications, such as personal robotics or intelligent virtual assistants, a user may want to teach an agent to perform some sequential decision-making task. Often, the user may be able to demonstrate the appropriate behavior, allowing the agent to learn the customized task through imitation. Research in inverse reinforcement learning (IRL) [29, 1, 43, 21, 31, 28] has shown success with framing the learning from demonstration (LfD) problem as optimizing a utility function from user demonstrations. IRL assumes that the user acts to optimize some reward function in performing the demonstrations, even if they cannot explicitly specify that reward function as in typical reinforcement learning (RL).1 IRL seeks to recover this reward function from demonstrations, and then use it to train an optimal policy. Learning the reward function instead of merely copying the user’s policy provides the agent with a portable representation of the task. Most IRL approaches have focused on an agent learning a single task. However, as AI systems become more versatile, it is increasingly likely that the agent will be expected to learn multiple tasks over its lifetime. If it learned each task in isolation, this process would cause a substantial burden on the user to provide numerous demonstrations. To address this challenge, we introduce the novel problem of lifelong learning from demonstration, in which an agent will face multiple consecutive LfD tasks and must optimize its overall performance. By building upon its knowledge from previous tasks, the agent can reduce the number of user demonstrations needed to learn a new task. As one illustrative example, consider a personal service robot learning to perform household chores from its human owner. Initially, the human might want to teach the robot to load the dishwasher by providing demonstrations of the task. At a later time, the user could teach the robot to set the dining table. These tasks are clearly related since they involve manipulating dinnerware and cutlery, and so we would expect the robot to leverage any relevant knowledge obtained from loading the dishwasher while setting the table for dinner. Additionally, we would hope the robot could improve its understanding of the dishwasher task with any additional 1Complex RL tasks require similarly complex reward functions, which are often hand-coded. This handcoding would be very cumbersome for most users, making demonstrations better for training novel behavior. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. knowledge it gains from setting the dining table. Over the robot’s lifetime of many tasks, the ability to share knowledge between demonstrated tasks would substantially accelerate learning. We frame lifelong LfD as an online multi-task learning problem, enabling the agent to accelerate learning by transferring knowledge among tasks. This transfer can be seen as exploiting the underlying relations among different reward functions (e.g., breaking a wine glass is always undesired). Although lifelong learning has been studied in classification, regression, and RL [10, 34, 4], this is the first study of lifelong learning for IRL. Our framework wraps around existing IRL methods, performing lifelong function approximation of the learned reward functions. As an instantiation of our framework, we propose the Efficient Lifelong IRL (ELIRL) algorithm, which adapts Maximum Entropy (MaxEnt) IRL [43] into a lifelong learning setting. We show that ELIRL can successfully transfer knowledge between IRL tasks to improve performance, and this improvement increases as it learns more tasks. It significantly outperforms the base learner, MaxEnt IRL, with little additional cost, and can achieve equivalent or better performance than IRL via Gaussian processes with far less computational cost. 2 Related Work The IRL problem is under-defined, so approaches use different means of identifying which reward function best explains the observed trajectories. Among these, maximum margin IRL methods [29, 1] choose the reward function that most separates the optimal policy and the second-best policy. Variants of these methods have allowed for suboptimal demonstrations [32], non-linear reward functions [35], and game-theoretic learning [37]. Bayesian IRL approaches [31, 30] use prior knowledge to bias the search over reward functions, and can support suboptimal demonstrations [33]. Gradient-based algorithms optimize a loss to learn the reward while, for instance, penalizing deviations from the expert’s policy [28]. Maximum entropy models [43, 21, 42] find the most likely reward function given the demonstrations, and produce a policy that matches the user’s expected performance without making further assumptions on the preference over trajectories. Other work has avoided learning the reward altogether and focuses instead on modeling the user’s policy via classification [27]. Note, however, that all these approaches focus on learning a single IRL task, and do not consider sharing knowledge between multiple tasks. Although other work has focused on multi-task IRL, existing methods either assume that the tasks share a state and action space, or scale poorly due to their computational cost; our approach differs in both respects. An early approach to multi-task IRL [12] learned different tasks by sampling from a joint prior on the rewards and policies, assuming that the state-action spaces are shared. Tanwani and Billard [38] studied knowledge transfer for learning from multiple experts, by using previously learned reward functions to bootstrap the search when a new expert demonstrates trajectories. Although efficient, their approach does not optimize performance across all tasks, and only considers learning different experts’ approaches to one task. The notion of transfer in IRL was also studied in an unsupervised setting [2, 11], where each task is assumed to be generated from a set of hidden intentions. These methods cluster an initial batch of tasks, and upon observing each new task, use the clusters to rapidly learn the corresponding reward function. However, they do not address how to update the clusters after observing a new task. Moreover, these methods assume the state-action space is shared across tasks, and, as an inner loop in the optimization, learn a single policy for all tasks. If the space was not shared, the repeated policy learning would become computationally infeasible for numerous tasks. Most recently, transfer in IRL has been studied for solving the one-shot imitation learning problem [13, 17]. In this setting, the agent is tasked with using knowledge from an initial set of tasks to generalize to a new task given a single demonstration of the new task. The main drawback of these methods is that they require a large batch of tasks available at training time, and so cannot handle tasks arriving sequentially. Our work is most similar to that by Mangin and Oudeyer [25], which poses the multi-task IRL problem as batch dictionary learning of primitive tasks, but appears to be incomplete and unpublished. Finn et al. [16] used IRL as a step for transferring knowledge in a lifelong RL setting, but they do not explore lifelong learning specifically for IRL. In contrast to existing work, our method can handle distinct state-action spaces. It is fully online and computationally efficient, enabling it to rapidly learn the reward function for each new task via transfer and then update a shared knowledge repository. New knowledge is transferred in reverse to improve the reward functions of previous tasks (without retraining on these tasks), thereby optimizing all tasks. We achieve this by adapting ideas from lifelong learning in the supervised setting [34], which we show achieves similar benefits in IRL. 2 3 Inverse Reinforcement Learning We first describe IRL and the MaxEnt IRL method, before introducing the lifelong IRL problem. 3.1 The Inverse RL Problem A Markov decision process (MDP) is defined as a tuple hS, A, T, r, γi, where S is the set of states, A is the set of actions, the transition function T : S ⇥A ⇥S 7! [0, 1] gives the probability P(si+1 | si, ai) that being in state si and taking action ai will yield a next state si+1, r : S 7! R is the reward function2, and γ 2 [0, 1) is the discount factor. A policy ⇡: S ⇥A 7! [0, 1] models the distribution P(ai | si) over actions the agent should take in any state. When fully specified, an MDP can be solved via linear or dynamic programming for an optimal policy ⇡⇤that maximizes the rewards earned by the agent: ⇡⇤= argmax⇡V ⇡, with V ⇡= E⇡ ⇥P i γir(si) ⇤ . In IRL [29], the agent does not know the MDP’s reward function, and must infer it from demonstrations Z = {⇣1, . . . , ⇣n} given by an expert user. Each demonstration ⇣j is a sequence of state-action pairs [s0:H, a0:H] that is assumed to be generated by the user’s unknown policy ˆ⇡⇤. Once the reward function is learned, the MDP is complete and so can be solved for the optimal policy ⇡⇤. Given an MDP\r = hS, A, T, γi and expert demonstrations Z, the goal of IRL is to estimate the unknown reward function r of the MDP. Previous work has defined the optimal reward such that the policy enacted by the user be (near-)optimal under the learned reward (V ⇡⇤= V ˆ⇡⇤), while (nearly) all other actions would be suboptimal. This problem is unfortunately ill-posed, since it has numerous solutions, and so it becomes necessary to make additional assumptions in order to find solutions that generalize well. These various assumptions and the strategies to recover the user’s policy have been the focus of previous IRL research. We next focus on the MaxEnt approach to the IRL problem. 3.2 Maximum Entropy IRL In the maximum entropy (MaxEnt) algorithm for IRL [43], each state si is represented by a feature vector xsi 2 Rd. Each demonstrated trajectory ⇣j gives a feature count x⇣j = PH i=0 γixsi, giving an approximate expected feature count ˜x = 1 n P j x⇣j that must be matched by the agent’s policy to satisfy the condition V ⇡⇤= V ˆ⇡⇤. The reward function is represented as a parameterized linear function with weight vector ✓2 Rd as rsi = r(xsi, ✓) = ✓>xsi and so the cumulative reward of a trajectory ⇣j is given by r⇣j = r(x⇣j, ✓) = P si2⇣j γi✓>xsi = ✓>x⇣j. The algorithm deals with the ambiguity of the IRL problem in a probabilistic way, by assuming that the user acts according to a MaxEnt policy. In this setting, the probability of a trajectory is given as: P(⇣j | ✓, T) ⇡ 1 Z(✓,T ) exp(r⇣j) Q (si,ai,si+1)2⇣j T(si+1 | si, ai), where Z(✓, T) is the partition function, and the approximation comes from assuming that the transition uncertainty has little effect on behavior. This distribution does not prefer any trajectory over another with the same reward, and exponentially prefers trajectories with higher rewards. The IRL problem is then solved by maximizing the likelihood of the observed trajectories ✓⇤= argmax✓log P(Z | ✓) = argmax✓ P ⇣j2Zlog P(⇣j | ✓, T). The gradient of the log-likelihood is the difference between the user’s and the agent’s feature expectations, which can be expressed in terms of the state visitation frequencies Ds: ˜x −P ˜⇣2ZMDP P(˜⇣| ✓, T)x˜⇣= ˜x −P s2S Dsxs, where ZMDP is the set of all possible trajectories. The Ds can be computed efficiently via a forwardbackward algorithm [43]. The maximum of this concave objective is then achieved when the feature counts match, and so V ⇡⇤= V ˆ⇡⇤. 4 The Lifelong Inverse RL Problem We now introduce the novel problem of lifelong IRL. In contrast to most previous work on IRL, which focuses on single-task learning, this paper focuses on online multi-task IRL. Formally, in the lifelong learning setting, the agent faces a sequence of IRL tasks T (1), . . . , T (Nmax), each of which is an 2Although we typically notate functions as uppercase non-bold symbols, we notate the reward function as r, since primarily it will be represented as a parameterized function of the state features and a target for learning. 3 MDP\r T (t) = ⌦ S(t), A(t), T (t), γ(t)↵ . The agent will learn tasks consecutively, receiving multiple expert demonstrations for each task before moving on to the next. We assume that a priori the agent does not know the total number of tasks Nmax, their distribution, or the order of the tasks. The agent’s goal is to learn a set of reward functions R = ' r(✓(1)), . . . , r(✓(Nmax)) with a corresponding set of parameters ⇥= ' ✓(1), . . . , ✓(Nmax) . At any time, the agent may be evaluated on any previous task, and so must strive to optimize its performance for all tasks T (1), . . . , T (N), where N denotes the number of tasks seen so far (1 N Nmax). Intuitively, when the IRL tasks are related, knowledge transfer between their reward functions has the potential to improve the learned reward function for each task and reduce the number of expert demonstrations needed. After N tasks, the agent must optimize the likelihood of all observed trajectories over those tasks: max r(1),...,r(N) P ⇣ r(1), . . . , r(N)⌘N Y t=1 0 @ nt Y j=1 P ⇣ ⇣j | r(t)⌘ 1 A 1 nt , (1) where P(r(1), . . . , r(N)) is a reward prior to encourage relationships among the reward functions, and each task is given equal importance by weighting it by the number of associated trajectories nt. 5 Lifelong Inverse Reinforcement Learning The key idea of our framework is to use lifelong function approximation to represent the reward functions for all tasks, enabling continual online transfer between the reward functions with efficient per-task updates. Intuitively, this framework exploits the fact that certain aspects of the reward functions are often shared among different (but related) tasks, such as the negative reward a service robot might receive for dropping objects. We assume the reward functions r(t) for the different tasks are related via a latent basis of reward components L. These components can be used to reconstruct the true reward functions via a sparse combination of such components with task-specific coefficients s(t), using L as a mechanism for transfer that has shown success in previous work [19, 26]. This section develops our framework for lifelong IRL, instantiating it following the MaxEnt approach to yield the ELIRL algorithm. Although we focus on MaxEnt IRL, ELIRL can easily be adapted to other IRL approaches, as shown in Appendix D. We demonstrate the merits of the novel lifelong IRL problem by showing that 1) transfer between IRL tasks can significantly increase their accuracy and 2) this transfer can be achieved by adapting ideas from lifelong learning in supervised settings. 5.1 The Efficient Lifelong IRL Algorithm As described in Section 4, the lifelong IRL agent must optimize its performance over all IRL tasks observed so far. Using the MaxEnt assumption that the reward function r(t) si = ✓>x(t) si for each task is linear and parameterized by ✓(t) 2 Rd, we can factorize these parameters into a linear combination ✓(t) = Ls(t) to facilitate transfer between parametric models, following Kumar and Daumé [19] and Maurer et al. [26]. The matrix L 2 Rd⇥k represents a set of k latent reward vectors that are shared between all tasks, with sparse task-specific coefficients s(t) 2 Rk to reconstruct ✓(t). Using this factorized representation to facilitate transfer between tasks, we place a Laplace prior on the s(t)’s to encourage them to be sparse, and a Gaussian prior on L to control its complexity, thereby encouraging the reward functions to share structure. This gives rise to the following reward prior: P ⇣ r(1), . . . , r(N)⌘ = 1 Z (λ, µ) exp 0 −NλkLk2 F 1 N Y t=1 exp ⇣ −µks(t)k1 ⌘ , (2) where Z(λ, µ) is the partition function, which has no effect on the optimization. We can substitute the prior in Equation 2 along with the MaxEnt likelihood into Equation 1. After taking logs and re-arranging terms, this yields the equivalent objective: min L 1 N N X t=1 min s(t) ( −1 nt X ⇣(t) j 2Z(t) log P ⇣ ⇣(t) j | Ls(t), T (t)⌘ + µks(t)k1 ) + λkLk2 F . (3) 4 Note that Equation 3 is separably, but not jointly, convex in L and the s(t)’s; typical multi-task approaches would optimize similar objectives [19, 26] using alternating optimization. To enable Equation 3 to be solved online when tasks are observed consecutively, we adapt concepts from the lifelong learning literature. Ruvolo and Eaton [34] approximate a multi-task objective with a similar form to Equation 3 online as a series of efficient online updates. Note, however, that their approach is designed for the supervised setting, using a general-purpose supervised loss function in place of the MaxEnt negative log-likelihood in Equation 3, but with a similar factorization of the learned parametric models. Following their approach but substituting in the IRL loss function, for each new task t, we can take a second-order Taylor expansion around the single-task point estimate of ↵(t) = argmin↵−P ⇣(t) j 2Z(t)log P 0 ⇣(t) j | ↵, T (t)1 , and then simplify to reformulate Equation 3 as min L 1 N N X t=1 min s(t) ⇢⇣ ↵(t) −Ls(t)⌘> H(t) ⇣ ↵(t) −Ls(t)⌘ + µks(t)k1 6 + λkLk2 F , (4) where the Hessian H(t) of the MaxEnt negative log-likelihood is given by (derivation in Appendix A): H(t) = 1 nt r2 ✓,✓L ⇣ r ⇣ Ls(t)⌘ , Z(t)⌘ = − X ˜⇣2ZMDP x˜⇣P(˜⇣|✓) ! X ˜⇣2ZMDP x> ˜⇣P(˜⇣|✓) ! + X ˜⇣2ZMDP x˜⇣x> ˜⇣P(˜⇣|✓) . (5) Since H(t) is non-linear in the feature counts, we cannot make use of the state visitation frequencies obtained for the MaxEnt gradient in the lifelong learning setting. This creates the need for obtaining a sample-based approximation. We first solve the MDP for an optimal policy ⇡↵(t) from the parameterized reward learned by single-task MaxEnt. We compute the feature counts for a fixed number of finite horizon paths by following the stochastic policy ⇡↵(t). We then obtain the sample covariance of the feature counts of the paths as an approximation of the true covariance in Equation 5. Given each new consecutive task t, we first estimate ↵(t) as described above. Then, Equation 4 can be approximated online as a series of efficient update equations [34]: s(t) argmin s ` ⇣ LN, s, ↵(t), H(t)⌘ LN+1 argmin L λkLk2 F + 1 N N X t=1 ` ⇣ L, s(t), ↵(t), H(t)⌘ , (6) where ` (L, s, ↵, H) = µksk1 + (↵−Ls)>H(↵−Ls), and L can be built incrementally in practice (see [34] for details). Critically, this online approximation removes the dependence of Equation 3 on the numbers of training samples and tasks, making it scalable for lifelong learning, and provides guarantees on its convergence with equivalent performance to the full multi-task objective [34]. Note that the s(t) coefficients are only updated while training on task t and otherwise remain fixed. Algorithm 1 ELIRL (k, λ, µ) L RandomMatrixd,k while some task T (t) is available do Z(t) getExampleTrajectories(T (t)) ↵(t), H(t) inverseReinforcementLearner(Z(t)) s(t) argmins(↵(t)−Ls)>H(t)(↵(t)−Ls) + µksk1 L updateL(L, s(t), ↵(t), H(t), λ) end while This process yields the estimated reward function as r(t) si = Ls(t)xsi. We can then solve the now-complete MDP for the optimal policy using standard RL. The complete ELIRL algorithm is given as Algorithm 1. ELIRL can either support a common feature space across tasks, or can support different feature spaces across tasks by making use of prior work in autonomous cross-domain transfer [3], as shown in Appendix C. 5.2 Improving Performance on Earlier Tasks As ELIRL is trained over multiple IRL tasks, it gradually refines the shared knowledge in L. Since each reward function’s parameters are modeled as ✓(t) = Ls(t), subsequent changes to L after training on task t can affect ✓(t). Typically, this process improves performance in lifelong learning [34], but it might occasionally decrease performance through negative transfer, due to the ELIRL 5 simplifications restricting that s(t) is fixed except when training on task t. To prevent this problem, we introduce a novel technique. Whenever ELIRL is tested on a task t, it can either directly use the ✓(t) vector obtained from Ls(t), or optionally repeat the optimization step for s(t) in Equation 6 to account for potential major changes in the L matrix since the last update to s(t). This latter optional step only involves running an instance of the LASSO, which is highly efficient. Critically, it does not require either re-running MaxEnt or recomputing the Hessian, since the optimization is always done around the optimal single-task parameters, ↵(t). Consequently, ELIRL can pay a small cost to do this optimization when it is faced with performing on a previous task, but it gains potentially improved performance on that task by benefiting from up-to-date knowledge in L, as shown in our results. 5.3 Computational Complexity The addition of a new task to ELIRL requires an initial run of single-task MaxEnt to obtain ↵(t), which we assume to be of order O(i⇠(d, |A|, |S|)), where i is the number of iterations required for MaxEnt to converge. The next step is computing the Hessian, which costs O(MH + Md2), where M is the number of trajectories sampled for the approximation and H is their horizon. Finally, the complexity of the update steps for L and s(t) is O(k2d3) [34]. This yields a total per-task cost of O(i⇠(d, |A|, |S|) + MH + Md2 + k2d3) for ELIRL. The optional step of re-updating s(t) when needing to perform on task t would incur a computational cost of O(d3 + kd2 + dk2) for constructing the target of the optimization and running LASSO [34]. Notably, there is no dependence on the number of tasks N, which is precisely what makes ELIRL suitable for lifelong learning. Since IRL in general requires finding the optimal policy for different choices of the reward function as an inner loop in the optimization, the additional dependence on N would make any IRL method intractable in a lifelong setting. Moreover, the only step that depends on the size of the state and action spaces is single-task MaxEnt. Thus, for high-dimensional tasks (e.g., robotics tasks), replacing the base learner would allow our algorithm to scale gracefully. 5.4 Theoretical Convergence Guarantees ELIRL inherits the theoretical guarantees showed by Ruvolo and Eaton [34]. Specifically, the optimization is guaranteed to converge to a local optimum of the approximate cost function in Equation 4 as the number of tasks grows large. Intuitively, the quality of this approximation depends on how much the factored representation ✓(t) = Ls(t) deviates from ↵(t), which in turn depends on how well this representation can capture the task relatedness. However, we emphasize that this approximation is what allows the method to solve the multi-task learning problem online, and it has been shown empirically in the contexts of supervised learning [34] and RL [4] that this approximate solution can achieve equivalent performance to exact multi-task learning in a variety of problems. 6 Experimental Results We evaluated ELIRL on two environments, chosen to allow us to create arbitrarily many tasks with distinct reward functions. This also gives us known rewards as ground truth. No previous multi-task IRL method was tested on such a large task set, nor on tasks with varying state spaces as we do. Objectworld: Similar to the environment presented by Levine et al. [21], Objectworld is a 32 ⇥32 grid populated by colored objects in random cells. Each object has one of five outer colors and one of two inner colors, and induces a constant reward on its surrounding 5 ⇥5 grid. We generated 100 tasks by randomly choosing 2–4 outer colors, and assigning to each a reward sampled uniformly from [−10, 5]; the inner colors are distractor features. The agent’s goal is then to move toward objects with “good” (positive) colors and away from objects with “bad” (negative) colors. Ideally, each column of L would learn the impact field around one color, and the s(t)’s would encode how good or bad each color is in each task. There are d = 31(5 + 2) features, representing the distance to the nearest object with each outer and inner color, discretized as binary indicators of whether the distance is less than 1–31. The agent can choose to move along the four cardinal directions or stay in place. Highway: Highway simulations have been used to test various IRL methods [1, 21]. We simulate the behavior of 100 different drivers on a three-lane highway in which they can drive at four speeds. Each driver prefers either the left or the right lane, and either the second or fourth speed. Each driver’s 6 weight for those two factors is sampled uniformly from [0, 5]. Intuitively, each column of L should learn a speed or lane, and the s(t)’s should encode the drivers’ preferences over them. There are d = 4 + 3 + 64 features, representing the current speed and lane, and the distances to the nearest cars in each lane in front and back, discretized in the same manner as Objectworld. Each time step, drivers can choose to move left or right, speed up or slow down, or maintain their current speed and lane. In both environments, the agent’s chosen action has a 70% probability of success and a 30% probability of a random outcome. The reward is discounted with each time step by a factor of γ = 0.9. 6.1 Evaluation Procedure For each task, we created an instance of the MDP by placing the objects in random locations. We solved the MDP for the true optimal policy, and generated simulated user trajectories following this policy. Then, we gave the IRL algorithms the MDP\r and the trajectories to estimate the reward r. We compared the learned reward function with the true reward function by standardizing both and computing the `2-norm of their difference. Then, we trained a policy using the learned reward function, and compared its expected return to that obtained by a policy trained using the true reward. We tested ELIRL using L trained on various subsets of tasks, ranging from 10 to 100 tasks. At each testing step, we evaluated performance of all 100 tasks; this includes as a subset evaluating all previously observed tasks, but it is significantly more difficult because the latent basis L, which is trained only on the initial tasks, must generalize to future tasks. The single-task learners were trained on all tasks, and we measured their average performance across all tasks. All learners were given nt = 32 trajectories for Objectworld and nt = 256 trajectories for Highway, all of length H = 16. We chose the size k of L via domain knowledge, and initialized L sequentially with the ↵(t)’s of the first k tasks. We measured performance on a new random instance of the MDP for each task, so as not to conflate overfitting the training environment with high performance. Results were averaged over 20 trials, each using a random task ordering. We compared ELIRL with both the original (ELIRL) and re-optimized (ELIRLre) s(t) vectors to MaxEnt IRL (the base learner) and GPIRL [21] (a strong single-task baseline). None of the existing multi-task IRL methods were suitable for this experimental setting—other methods assume a shared state space and are prohibitively expensive for more than a few tasks [12, 2, 11], or only learn different experts’ approaches to a single task [38] . Appendix B includes a comparison to MTMLIRL [2] on a simplified version of Objectworld, since MTMLIRL was unable to handle the full version. Figure 1: Average reward and value difference in the lifelong setting. Reward difference measures the error between learned and true reward. Value difference compares expected return from the policy trained on the learned reward and the policy trained on the true reward. The whiskers denote std. error. ELIRL improves as the number of tasks increases, achieving better performance than its base learner, MaxEnt IRL. Using re-optimization after learning all tasks allows earlier tasks to benefit from the latest knowledge, increasing ELIRL’s performance above GPIRL. (Best viewed in color.) 0 20 40 60 80 100 Number of tasks trained 0 5 10 15 Average reward difference 0 20 40 60 80 100 Number of tasks trained 0 1 2 3 Average value difference ELIRL ELIRLre MaxEnt IRL GPIRL (a) Objectworld 0 20 40 60 80 100 Number of tasks trained 0 2 4 6 8 10 12 Average reward difference 0 20 40 60 80 100 Number of tasks trained 0 0.5 1 1.5 2 Average value difference (b) Highway 7 (a) Green and yellow (b) Green, blue, yellow (c) Orange Figure 2: Example latent reward functions from Objectworld learned by ELIRL. Each column of L can be visualized as a reward function, and captures a reusable chunk of knowledge. The grayscale values show the learned reward and the arrows show the corresponding optimal policy. Each latent component has specialized to focus on objects of particular colors, as labeled. (Best viewed in color.) 0 10 20 30 40 50 60 70 80 90 100 Task Number 0 2 4 Delta Error (a) Objectworld – original s(t)’s 0 10 20 30 40 50 60 70 80 90 100 Task Number 0 5 10 Delta Error (b) Objectworld – re-optimized s(t)’s 0 10 20 30 40 50 60 70 80 90 100 Task Number -2 0 2 Delta Error (c) Highway – original s(t)’s 0 10 20 30 40 50 60 70 80 90 100 Task Number 0 1 2 3 Delta Error (d) Highway – re-optimized s(t)’s Figure 3: Reverse transfer. Difference in error in the learned reward between when a task was first trained and after the full model had been trained, as a function of task order. Positive change in errors indicates positive transfer; negative change indicates interference from negative transfer. Note that the re-optimization has both decreased negative transfer on the earliest tasks, and also significantly increased the magnitude of positive reverse transfer. Red curves show the best exponential curve. 6.2 Results Figure 1 shows the advantage of sharing knowledge among IRL tasks. ELIRL learned the reward functions more accurately than its base learner, MaxEnt IRL, after sufficient tasks were used to train the knowledge base L. This directly translated to increased performance of the policy trained using the learned reward function. Moreover, the s(t) re-optimization (Section 5.2) allowed ELIRLre to outperform GPIRL, by making use of the most updated knowledge. Objectworld (sec) Highway (sec) ELIRL 17.055 ± 0.091 21.438 ± 0.173 ELIRLre 17.068 ± 0.091 21.440 ± 0.173 MaxEnt IRL 16.572 ± 0.407 18.283 ± 0.775 GPIRL 1008.181 ± 67.261 392.117 ± 18.484 Table 1: The average learning time per task. The standard error is reported after the ±. As shown in Table 1, ELIRL requires little extra training time versus MaxEnt IRL, even with the optional s(t) re-optimization, and runs significantly faster than GPIRL. The re-optimization’s additional time is nearly imperceptible. This signifies a clear advantage for ELIRL when learning multiple tasks in real-time. In order to analyze how ELIRL captures the latent structure underlying the tasks, we created new instances of Objectworld and used a single learned latent component as the reward of each new MDP (i.e., a column of L, which can be treated as a latent reward function factor). Figure 2 shows example 8 Figure 4: Results for extensions of ELIRL. Whiskers denote standard errors. (a) Reward difference (lower is better) between MaxEnt, in-domain ELIRL, and cross-domain ELIRL. Transferring knowledge across domains improved the accuracy of the learned reward. (b) Value difference (lower is better) obtained by ELIRL and AMEIRL on the planar navigation environment. ELIRL improves the performance of AME-IRL, and this improvement increases as ELIRL observes more tasks. CD-ELIRL CD-ELIRLre ELIRL ELIRLre MaxEnt IRL 0 2 4 6 8 10 Avg reward diff (a) Cross-domain transfer 20 40 60 80 100 Percentage of tasks trained on 0 500 1000 1500 2000 Average Reward Loss AME-IRL ELIRL Avg value diff Number of tasks trained 10 30 40 50 20 (b) Continuous domains latent components learned by the algorithm, revealing that each latent component represents the 5 ⇥5 grid around a particular color or small subset of the colors. We also examined how performance on the earliest tasks changed during the lifelong learning process. Recall that as ELIRL learns new tasks, the shared knowledge in L continually changes. Consequently, the modeled reward functions for all tasks continue to be refined automatically over time, without retraining on the tasks. To measure this effect of “reverse transfer” [34], we compared the performance on each task when it was first encountered to its performance after learning all tasks, averaged over 20 random task orders. Figure 3 reveals that ELIRL improves previous tasks’ performance as L is refined, achieving reverse transfer in IRL. Reverse transfer was further improved by the s(t) re-optimization. 6.3 ELIRL Extensions to Cross-Domain Transfer and Continuous State-Action Spaces We performed additional experiments to show how simple extensions to ELIRL can transfer knowledge across tasks with different feature spaces and with continuous state-action spaces. ELIRL can support transfer across task domains with different feature spaces by adapting prior work in cross-domain transfer [3]; details of this extension are given in Appendix C. To evaluate cross-domain transfer, we constructed 40 Objectworld domains with different feature spaces by varying the grid sizes from 5 to 24 and letting the number of outer colors be either 3 or 5. We created 10 tasks per domain, and provided the agents with 16 demonstrations per task, with lengths varying according to the number of cells in each domain. We compared MaxEnt IRL, in-domain ELIRL with the original (ELIRL) and re-optimized (ELIRLre) s(t)’s, and cross-domain ELIRL with the original (CD-ELIRL) and reoptimized (CD-ELIRLre) s(t)’s, averaged over 10 random task orderings. Figure 4a shows how cross-domain transfer improved the performance of an agent trained only on tasks within each domain. Notice how the s(t) re-optimization compensates for the major changes in the shared knowledge that occur when the agent encounters tasks from different domains. We also explored an extension of ELIRL to continuous state spaces, as detailed in Appendix D. To evaluate this extension, we used a continuous planar navigation task similar to that presented by Levine and Koltun [20]. Analogous to Objectworld, this continuous environment contains randomly distributed objects that have associated rewards (sampled randomly), and each object has an area of influence defined by a radial basis function. Figure 4b shows the performance of ELIRL on 50 continuous navigation tasks averaged over 20 different task orderings, compared against the average performance of the single-task AME-IRL algorithm [20] across all tasks. These results show that ELIRL is able to achieve better performance in the continuous space than the single-task learner, once a sufficient number of tasks has been observed. 7 Conclusion We introduced the novel problem of lifelong IRL, and presented a general framework that is capable of sharing learned knowledge about the reward functions between IRL tasks. We derived an algorithm for lifelong MaxEnt IRL, and showed how it can be easily extended to handle different single-task IRL methods and diverse task domains. In future work, we intend to study how more powerful base learners can be used for the learning of more complex tasks, potentially from human demonstrations. 9 Acknowledgements This research was partly supported by AFRL grant #FA8750-16-1-0109 and DARPA agreement #FA8750-18-2-0117. We would like to thank the anonymous reviewers for their helpful feedback. References [1] Pieter Abbeel and Andrew Y. Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the 21st International Conference on Machine Learning (ICML-04), 2004. [2] Monica Babes, Vukosi N. Marivate, Kaushik Subramanian, and Michael L. Littman. Apprenticeship learning about multiple intentions. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), 2011. [3] Haitham Bou Ammar, Eric Eaton, Jose Marcio Luna, and Paul Ruvolo. Autonomous crossdomain knowledge transfer in lifelong policy gradient reinforcement learning. In Proceedings of the 24th International Joint Conference on Artificial Intelligence (IJCAI-15), 2015. [4] Haitham Bou Ammar, Eric Eaton, Paul Ruvolo, and Matthew E. Taylor. Online multi-task learning for policy gradient methods. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), June 2014. [5] Haitham Bou Ammar, Eric Eaton, Paul Ruvolo, and Matthew E. Taylor. Unsupervised crossdomain transfer in policy gradient reinforcement learning via manifold alignment. In Proceedings of the 29th Conference on Artificial Intelligence (AAAI-15), 2015. [6] Haitham Bou Ammar, Decebal Constantin Mocanu, Matthew E. Taylor, Kurt Driessens, Karl Tuyls, and Gerhard Weiss. Automatically mapped transfer between reinforcement learning tasks via three-way restricted Boltzmann machines. In Proceedings of the 2013 European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML-PKDD-13), 2013. [7] Haitham Bou Ammar and Matthew E. Taylor. Common subspace transfer for reinforcement learning tasks. In Proceedings of the Adaptive and Learning Agents Workshop at the 10th Autonomous Agents and Multi-Agent Systems Conference (AAMAS-11), 2011. [8] Haitham Bou Ammar, Matthew E. Taylor, Karl Tuyls, and Gerhard Weiss. Reinforcement learning transfer using a sparse coded inter-task mapping. In Proceedings of the 11th European Workshop on Multi-Agent Systems (EUMAS-13), 2013. [9] Abdeslam Boularias, Jens Kober, and Jan Peters. Relative entropy inverse reinforcement learning. In Proceedings of the 14th International Conference on Artificial Intelligence and Statistics (AISTATS-11), 2011. [10] Zhiyuan Chen and Bing Liu. Lifelong Machine Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan & Claypool Publishers, 2016. [11] Jaedeug Choi and Kee-eung Kim. Nonparametric Bayesian inverse reinforcement learning for multiple reward functions. In Advances in Neural Information Processing Systems 25 (NIPS-12). 2012. [12] Christos Dimitrakakis and Constantin A. Rothkopf. Bayesian multitask inverse reinforcement learning. In Proceedings of the 9th European Workshop on Reinforcement Learning (EWRL-11), 2011. [13] Yan Duan, Marcin Andrychowicz, Bradly Stadie, Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in Neural Information Processing Systems 30 (NIPS-17). 2017. [14] Anestis Fachantidis, Ioannis Partalas, Matthew E. Taylor, and Ioannis Vlahavas. Transfer learning via multiple inter-task mappings. In Proceedings of the 9th European Workshop on Reinforcement Learning (EWRL-11), 2011. 10 [15] Anestis Fachantidis, Ioannis Partalas, Matthew E. Taylor, and Ioannis Vlahavas. Transfer learning with probabilistic mapping selection. Adaptive Behavior, 2015. [16] Chelsea Finn, Tianhe Yu, Justin Fu, Pieter Abbeel, and Sergey Levine. Generalizing skills with semi-supervised reinforcement learning. In Proceedings of the 5th International Conference on Learning Representations (ICLR-17), 2017. [17] Chelsea Finn, Tianhe Yu, Tianhao Zhang, Pieter Abbeel, and Sergey Levine. One-shot visual imitation learning via meta-learning. In Proceedings of the 1st Annual Conference on Robot Learning (CoRL-17), 2017. [18] George Konidaris, Ilya Scheidwasser, and Andrew Barto. Transfer in reinforcement learning via shared features. Journal of Machine Learning Research (JMLR), 2012. [19] A. Kumar and H. Daumé III. Learning task grouping and overlap in multi-task learning. In Proceedings of the 29th International Conference on Machine Learning (ICML-12), 2012. [20] Sergey Levine and Vladlen Koltun. Continuous inverse optimal control with locally optimal examples. In Proceedings of the 29th International Conference on Machine Learning (ICML-12), 2012. [21] Sergey Levine, Zoran Popovic, and Vladlen Koltun. Nonlinear inverse reinforcement learning with Gaussian processes. In Advances in Neural Information Processing Systems 24 (NIPS-11). 2011. [22] Yong Luo, Dacheng Tao, and Yonggang Wen. Exploiting high-order information in heterogeneous multi-task feature learning. In Proceedings of the 26th International Joint Conference on Artificial Intelligence (IJCAI-17), 2017. [23] Yong Luo, Yonggang Wen, and Dacheng Tao. On combining side information and unlabeled data for heterogeneous multi-task metric learning. In Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI-16), 2016. [24] James MacGlashan. Brown-UMBC reinforcement learning and planning (BURLAP) Java library, version 3.0. Available online at http://burlap.cs.brown.edu, 2016. [25] Olivier Mangin and Pierre-Yves Oudeyer. Feature learning for multi-task inverse reinforcement learning. Available online at https://olivier.mangin.com/media/pdf/mangin.2014.firl.pdf, 2013. [26] Andreas Maurer, Massi Pontil, and Bernardino Romera-Paredes. Sparse coding for multitask and transfer learning. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), 2013. [27] Francisco S. Melo and Manuel Lopes. Learning from demonstration using MDP induced metrics. In Proceedings of the 2010 European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML-PKDD-10), 2010. [28] Gergely Neu and Csaba Szepesvári. Apprenticeship learning using inverse reinforcement learning and gradient methods. In Proceedings of the 23rd Conference on Uncertainty in Artificial Intelligence (UAI-07), 2007. [29] Andrew Y. Ng and Stuart Russell. Algorithms for inverse reinforcement learning. In Proceedings of the 17th International Conference on Machine Learning (ICML-00), 2000. [30] Qifeng Qiao and Peter A. Beling. Inverse reinforcement learning with Gaussian process. In Proceedings of the 2011 American Control Conference (ACC-11). IEEE, 2011. [31] Deepak Ramachandran and Eyal Amir. Bayesian inverse reinforcement learning. In Proceedings of the 20th International Joint Conference on Artificial Intelligence (IJCAI-07), 2007. [32] Nathan D. Ratliff, J. Andrew Bagnell, and Martin A. Zinkevich. Maximum margin planning. In Proceedings of the 23rd International Conference on Machine Learning (ICML-06), 2006. 11 [33] Constantin A. Rothkopf and Christos Dimitrakakis. Preference elicitation and inverse reinforcement learning. In Proceedings of the 2011 European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases (ECML-PKDD-11), 2011. [34] Paul Ruvolo and Eric Eaton. ELLA: An efficient lifelong learning algorithm. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), June 2013. [35] David Silver, J. Andrew Bagnell, and Anthony Stentz. Perceptual interpretation for autonomous navigation through dynamic imitation learning. In Proceedings of the 14th International Symposium on Robotics Research (ISRR-09), 2009. [36] Jonathan Sorg and Satinder Singh. Transfer via soft homomorphisms. In Proceedings of The 8th International Conference on Autonomous Agents and Multiagent Systems (AAMAS-09), 2009. [37] Umar Syed and Robert E. Schapire. A game-theoretic approach to apprenticeship learning. In Advances in Neural Information Processing Systems 20 (NIPS-07). 2007. [38] Ajay Kumar Tanwani and Aude Billard. Transfer in inverse reinforcement learning for multiple strategies. In Proceedings of the 2013 International Conference on Intelligent Robots and Systems (IROS-13). IEEE, 2013. [39] Matthew E. Taylor, Gregory Kuhlmann, and Peter Stone. Autonomous transfer for reinforcement learning. In Proceedings of the 7th International Conference on Autonomous Agents and Multiagent Systems (AAMAS-08), 2008. [40] Matthew E. Taylor and Peter Stone. Cross-domain transfer for reinforcement learning. In Proceedings of the 24th International Conference on Machine Learning (ICML-07), 2007. [41] Matthew E. Taylor, Shimon Whiteson, and Peter Stone. Transfer via inter-task mappings in policy search reinforcement learning. In Proceedings of the 6th International Conference on Autonomous Agents and Multiagent Systems (AAMAS-07), 2007. [42] Markus Wulfmeier, Peter Ondruska, and Ingmar Posner. Maximum entropy deep inverse reinforcement learning. arXiv preprint arXiv:1507.04888, 2015. [43] Brian D. Ziebart, Andrew Maas, J. Andrew Bagnell, and Anind Dey. Maximum entropy inverse reinforcement learning. In Proceedings of the 23rd Conference on Artificial Intelligence (AAAI-08), 2008. 12
2018
201
7,366
Recurrent World Models Facilitate Policy Evolution David Ha Google Brain Tokyo, Japan hadavid@google.com Jürgen Schmidhuber NNAISENSE The Swiss AI Lab, IDSIA (USI & SUPSI) juergen@idsia.ch Abstract A generative recurrent neural network is quickly trained in an unsupervised manner to model popular reinforcement learning environments through compressed spatiotemporal representations. The world model’s extracted features are fed into compact and simple policies trained by evolution, achieving state of the art results in various environments. We also train our agent entirely inside of an environment generated by its own internal world model, and transfer this policy back into the actual environment. Interactive version of paper: https://worldmodels.github.io 1 Introduction Humans develop a mental model of the world based on what they are able to perceive with their limited senses, learning abstract representations of both spatial and temporal aspects of sensory inputs. For instance, we are able to observe a scene and remember an abstract description thereof [7, 67]. Our decisions and actions are influenced by our internal predictive model. For example, what we perceive at any given moment seems to be governed by our predictions of the future [59, 52]. One way of understanding the predictive model inside our brains is that it might not simply be about predicting the future in general, but predicting future sensory data given our current motor actions [38, 48]. We are able to instinctively act on this predictive model and perform fast reflexive behaviours when we face danger [55], without the need to consciously plan out a course of action [52]. For many reinforcement learning (RL) problems [37, 96, 106], an artificial RL agent may also benefit from a predictive model (M) of the future [104, 95] (model-based RL). The backpropagation algorithm [50, 39, 103] can be used to train a large M in form of a neural network (NN). In partially observable environments, we can implement M through a recurrent neural network (RNN) [74, 75, 78, 49] to allow for better predictions based on memories of previous observation sequences. Figure 1: We build probabilistic generative models of OpenAI Gym [5] environments. These models can mimic the actual environments (left). We test trained policies in the actual environments (right). In fact, our M will be a large RNN that learns to predict the future given the past in an unsupervised manner. M’s internal representations of memories of past observations and actions are perceived and exploited by another NN called the controller (C) which learns through RL to perform some task without a teacher. A small and simple C limits C’s credit assignment problem to a comparatively small search space, without sacrificing the capacity and expressiveness of the large and complex M. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. We combine several key concepts from a series of papers from 1990–2015 on RNN-based world models and controllers [74, 75, 78, 76, 83] with more recent tools from probabilistic modelling, and present a simplified approach to test some of those key concepts in modern RL environments [5]. Experiments show that our approach can be used to solve a challenging race car navigation from pixels task that previously has not been solved using more traditional methods. Most existing model-based RL approaches learn a model of the RL environment, but still train on the actual environment. Here, we also explore fully replacing an actual RL environment with a generated one, training our agent’s controller C only inside of the environment generated by its own internal world model M, and transfer this policy back into the actual environment. To overcome the problem of an agent exploiting imperfections of the generated environments, we adjust a temperature parameter of M to control the amount of uncertainty of the generated environments. We train C inside of a noisier and more uncertain version of its generated environment, and demonstrate that this approach helps prevent C from taking advantage of the imperfections of M. We will also discuss other related works in the model-based RL literature that share similar ideas of learning a dynamics model and training an agent using this model. 2 Agent Model Our simple model is inspired by our own cognitive system. Our agent has a visual sensory component V that compresses what it sees into a small representative code. It also has a memory component M that makes predictions about future codes based on historical information. Finally, our agent has a decision-making component C that decides what actions to take based only on the representations created by its vision and memory components. Figure 2: Flow diagram showing how V, M, and C interacts with the environment (left). Pseudocode for how our agent model is used in the OpenAI Gym [5] environment (right). Let the agent’s life span be defined as a sequence of time steps, t = 1, 2, . . . , tdone. Let Nz, Na, Nh be positive integer constants. The environment provides our agent with a high dimensional input observation at each time step t. This input is usually a 2D image frame that is part of a video sequence. The role of V is to learn an abstract, compressed representation of each observed input at each time step. Here, we use a Variational Autoencoder (VAE) [42, 71] as V to compress an image observed at time step t into a latent vector zt ∈RNz, with Nz being a hyperparameter. While V’s role is to compress what the agent sees at each time step, we also want to compress what happens over time. The RNN M serves as a predictive model of future zt vectors that V is expected to produce. Since many complex environments are stochastic in nature, we train our RNN to output a probability density function p(zt) instead of a deterministic prediction of zt. The agent takes an action at ∈RNa at time t, where Na is the dimension of the action space. In our approach, we approximate p(zt) as a mixture of Gaussian distribution, and train M to output the probability distribution of the next latent vector zt+1 given the current and past information made available to it. More specifically, the RNN, with Nh hidden units, will model P(zt+1 | at, zt, ht), where ht ∈RNh is the hidden state of the RNN at time step t. During sampling, we can adjust a real-valued temperature parameter τ to control model uncertainty, as done in previous work [28]. We will find that adjusting τ to be useful for training our controller later on. This approach is known as a Mixture Density Network [3] combined with an RNN (MDN-RNN) [24], and has been applied in the past for sequence generation problems such as generating handwriting [24, 6] and sketches [28]. 2 C is responsible for determining the course of actions to take in order to maximize the expected cumulative reward of the agent during a rollout of the environment. In our experiments, we deliberately make C as simple and small as possible, and train it separately from V and M, so that most of our agent’s complexity resides in V and M. C is a simple single layer linear model that maps zt and ht directly to action at at each time step: at = Wc [zt ht] + bc, where Wc ∈RNa×(Nz+Nh) and bc ∈RNa are the parameters that map the concatenated input [zt ht] to the output action at. This minimal design for C also offers important practical benefits. Advances in deep learning provided us with the tools to train large, sophisticated models efficiently, provided we can define a well-behaved, differentiable loss function. V and M are designed to be trained efficiently with the backpropagation algorithm using modern GPU accelerators, so we would like most of the model’s complexity, and model parameters to reside in V and M. The number of parameters of C, a linear model, is minimal in comparison. This choice allows us to explore more unconventional ways to train C – for example, even using evolution strategies (ES) [70, 87] to tackle more challenging RL tasks where the credit assignment problem is difficult. To optimize the parameters of C, we chose the Covariance-Matrix Adaptation Evolution Strategy (CMA-ES) [29, 30] as our optimization algorithm since it is known to work well for solution spaces of up to a few thousand parameters. We evolve parameters of C on a single machine with multiple CPU cores running multiple rollouts of the environment in parallel. For more information about the models, training procedures, and experiment configurations, please see the Supplementary Materials. 3 Car Racing Experiment: World Model for Feature Extraction In this section, we describe how we can train the Agent model described earlier to solve a car racing task. To our knowledge, our agent is the first known to solve this task.1 Frame compressor V and predictive model M can help us extract useful representations of space and time. By using these features as inputs of C, we can train a compact C to perform a continuous control task, such as learning to drive from pixel inputs for a top-down car racing environment called CarRacing-v0 [44]. In this environment, the tracks are randomly generated for each trial, and our agent is rewarded for visiting as many tiles as possible in the least amount of time. The agent controls three continuous actions: steering left/right, acceleration, and brake. Algorithm 1 Training procedure in our experiments. 1. Collect 10,000 rollouts from a random policy. 2. Train VAE (V) to encode frames into z ∈RNz. 3. Train MDN-RNN (M) to model P(zt+1 | at, zt, ht). 4. Evolve controller (C) to maximize the expected cumulative reward of a rollout. To train V, we first collect a dataset of 10k random rollouts of the environment. We have first an agent acting randomly to explore the environment multiple times, and record the random actions at taken and the resulting observations from the environment. We use this dataset to train our VAE to encode each frame into low dimensional latent vector z by minimizing the difference between a given frame and the reconstructed version of the frame produced by the decoder from z. We can now use our trained V to pre-process each frame at time t into zt to train our M. Using this pre-processed data, along with the recorded random actions at taken, our MDN-RNN can now be trained to model P(zt+1| at, zt, ht) as a mixture of Gaussians. 2 In this experiment, V and M have no knowledge about the actual reward signals from the environment. Their task is simply to compress and predict the sequence of image frames observed. Only C has access to the reward information from the environment. Since there are a mere 867 parameters inside the linear C, evolutionary algorithms such as CMA-ES are well suited for this optimization task. 1We find this task interesting because although it is not difficult to train an agent to wobble around randomly generated tracks and obtain a mediocre score, CarRacing-v0 defines solving as getting average reward of 900 over 100 consecutive trials, which means the agent can only afford very few driving mistakes. 2Although in principle, we can train V and M together in an end-to-end manner, we found that training each separately is more practical, achieves satisfactory results, and does not require exhaustive hyperparameter tuning. As images are not required to train M on its own, we can even train on large batches of long sequences of latent vectors encoding the entire 1000 frames of an episode to capture longer term dependencies, on a single GPU. 3 3.1 Experiment Results V without M Training an agent to drive is not a difficult task if we have a good representation of the observation. Previous works [35, 46] have shown that with a good set of hand-engineered information about the observation, such as LIDAR information, angles, positions and velocities, one can easily train a small feed-forward network to take this hand-engineered input and output a satisfactory navigation policy. For this reason, we first want to test our agent by handicapping C to only have access to V but not M, so we define our controller as at = Wc zt + bc. Although the agent is still able to navigate the race track in this setting, we notice it wobbles around and misses the tracks on sharper corners, e.g., see Figure 1 (right). This handicapped agent achieved an average score of 632 ± 251, in line with the performance of other agents on OpenAI Gym’s leaderboard [44] and traditional Deep RL methods such as A3C [41, 36]. Adding a hidden layer to C’s policy network helps to improve the results to 788 ± 141, but not enough to solve this environment. Table 1: CarRacing-v0 results over 100 trials. Method Average Score DQN [66] 343 ± 18 A3C (continuous) [36] 591 ± 45 A3C (discrete) [41] 652 ± 10 Gym Leader [44] 838 ± 11 V model 632 ± 251 V model with hidden layer 788 ± 141 Full World Model 906 ± 21 Table 2: DoomTakeCover-v0 results, varying τ. Temperature τ Virtual Score Actual Score 0.10 2086 ± 140 193 ± 58 0.50 2060 ± 277 196 ± 50 1.00 1145 ± 690 868 ± 511 1.15 918 ± 546 1092 ± 556 1.30 732 ± 269 753 ± 139 Random Policy N/A 210 ± 108 Gym Leader [62] N/A 820 ± 58 Full World Model (V and M) The representation zt provided by V only captures a representation at a moment in time and does not have much predictive power. In contrast, M is trained to do one thing, and to do it really well, which is to predict zt+1. Since M’s prediction of zt+1 is produced from the RNN’s hidden state ht at time t, ht is a good candidate for a feature vector we can give to our agent. Combining zt with ht gives C a good representation of both the current observation, and what to expect in the future. We see that allowing the agent to access both zt and ht greatly improves its driving capability. The driving is more stable, and the agent is able to seemingly attack the sharp corners effectively. Furthermore, we see that in making these fast reflexive driving decisions during a car race, the agent does not need to plan ahead and roll out hypothetical scenarios of the future. Since ht contain information about the probability distribution of the future, the agent can just re-use the RNN’s internal representation instinctively to guide its action decisions. Like a Formula One driver or a baseball player hitting a fastball [52], the agent can instinctively predict when and where to navigate in the heat of the moment. Our agent is able to achieve a score of 906 ± 21, effectively solving the task and obtaining new state of the art results. Previous attempts [41, 36] using Deep RL methods obtained average scores of 591–652 range, and the best reported solution on the leaderboard obtained an average score of 838 ± 11. Traditional Deep RL methods often require pre-processing of each frame, such as employing edge-detection [36], in addition to stacking a few recent frames [41, 36] into the input. In contrast, our agent’s V and M take in a stream of raw RGB pixel images and directly learn a spatio-temporal representation. To our knowledge, our method is the first reported solution to solve this task. Since our agent’s world model is able to model the future, we can use it to come up with hypothetical car racing scenarios on its own. We can use it to produce the probability distribution of zt+1 given the current states, sample a zt+1 and use this sample as the real observation. We can put our trained C back into this generated environment. Figure 1 (left) shows a screenshot of the generated car racing environment. The interactive version of this work includes a demo of the generated environments. 4 4 VizDoom Experiment: Learning Inside of a Generated Environment We have just seen that a policy learned inside of the real environment appears to somewhat function inside of the generated environment. This begs the question – can we train our agent to learn inside of its own generated environment, and transfer this policy back to the actual environment? If our world model is sufficiently accurate for its purpose, and complete enough for the problem at hand, we should be able to substitute the actual environment with this world model. After all, our agent does not directly observe the reality, but merely sees what the world model lets it see. In this experiment, we train an agent inside the environment generated by its world model trained to mimic a VizDoom [40] environment. In DoomTakeCover-v0 [62], the agent must learn to avoid fireballs shot by monsters from the other side of the room with the sole intent of killing the agent. The cumulative reward is defined to be the number of time steps the agent manages to stay alive during a rollout. Each rollout of the environment runs for a maximum of 2100 time steps, and the task is considered solved if the average survival time over 100 consecutive rollouts is greater than 750 time steps. 4.1 Experiment Setup The setup of our VizDoom experiment is largely the same as the Car Racing task, except for a few key differences. In the Car Racing task, M is only trained to model the next zt. Since we want to build a world model we can train our agent in, our M model here will also predict whether the agent dies in the next frame (as a binary event donet), in addition to the next frame zt. Since M can predict the done state in addition to the next observation, we now have all of the ingredients needed to make a full RL environment to mimic DoomTakeCover-v0 [62]. We first build an OpenAI Gym environment interface by wrapping a gym.Env [5] interface over our M as if it were a real Gym environment, and then train our agent inside of this virtual environment instead of using the actual environment. Thus in our simulation, we do not need the V model to encode any real pixel frames during the generation process, so our agent will therefore only train entirely in a more efficient latent space environment. Both virtual and actual environments share an identical interface, so after the agent learns a satisfactory policy inside of the virtual environment, we can easily deploy this policy back into the actual environment to see how well the policy transfers over. Here, our RNN-based world model is trained to mimic a complete game environment designed by human programmers. By learning only from raw image data collected from random episodes, it learns how to simulate the essential aspects of the game, such as the game logic, enemy behaviour, physics, and also the 3D graphics rendering. We can even play inside of this generated environment. Unlike the actual game environment, however, we note that it is possible to add extra uncertainty into the virtual environment, thus making the game more challenging in the generated environment. We can do this by increasing the temperature τ parameter during the sampling process of zt+1. By increasing the uncertainty, our generated environment becomes more difficult compared to the actual environment. The fireballs may move more randomly in a less predictable path compared to the actual game. Sometimes the agent may even die due to sheer misfortune, without explanation. After training, our controller learns to navigate around the virtual environment and escape from deadly fireballs launched by monsters generated by M. Our agent achieved an average score of 918 time steps in the virtual environment. We then took the agent trained inside of the virtual environment and tested its performance on the original VizDoom environment. The agent obtained an average score of 1092 time steps, far beyond the required score of 750 time steps, and also much higher than the score obtained inside the more difficult virtual environment. The full results are listed in Table 2. We see that even though V is not able to capture all of the details of each frame correctly, for instance, getting the number of monsters correct, C is still able to learn to navigate in the real environment. As the virtual environment cannot even keep track of the exact number of monsters in the first place, an agent that is able to survive a noisier and uncertain generated environment can thrive in the original, cleaner environment. We also find agents that perform well in higher temperature settings generally perform better in the normal setting. In fact, increasing τ helps prevent our controller from taking advantage of the imperfections of our world model. We will discuss this in depth in the next section. 5 4.2 Cheating the World Model In our childhood, we may have encountered ways to exploit video games in ways that were not intended by the original game designer [9]. Players discover ways to collect unlimited lives or health, and by taking advantage of these exploits, they can easily complete an otherwise difficult game. However, in the process of doing so, they may have forfeited the opportunity to learn the skill required to master the game as intended by the game designer. In our initial experiments, we noticed that our agent discovered an adversarial policy to move around in such a way so that the monsters in this virtual environment governed by M never shoots a single fireball during some rollouts. Even when there are signs of a fireball forming, the agent moves in a way to extinguish the fireballs. Because M is only an approximate probabilistic model of the environment, it will occasionally generate trajectories that do not follow the laws governing the actual environment. As we previously pointed out, even the number of monsters on the other side of the room in the actual environment is not exactly reproduced by M. For this reason, our world model will be exploitable by C, even if such exploits do not exist in the actual environment. As a result of using M to generate a virtual environment for our agent, we are also giving the controller access to all of the hidden states of M. This is essentially granting our agent access to all of the internal states and memory of the game engine, rather than only the game observations that the player gets to see. Therefore our agent can efficiently explore ways to directly manipulate the hidden states of the game engine in its quest to maximize its expected cumulative reward. The weakness of this approach of learning a policy inside of a learned dynamics model is that our agent can easily find an adversarial policy that can fool our dynamics model – it will find a policy that looks good under our dynamics model, but will fail in the actual environment, usually because it visits states where the model is wrong because they are away from the training distribution. This weakness could be the reason that many previous works that learn dynamics models of RL environments do not actually use those models to fully replace the actual environments [60, 8]. Like in the M model proposed in [74, 75, 78], the dynamics model is deterministic, making it easily exploitable by the agent if it is not perfect. Using Bayesian models, as in PILCO [10], helps to address this issue with the uncertainty estimates to some extent, however, they do not fully solve the problem. Recent work [57] combines the model-based approach with traditional model-free RL training by first initializing the policy network with the learned policy, but must subsequently rely on model-free methods to fine-tune this policy in the actual environment. To make it more difficult for our C to exploit deficiencies of M, we chose to use the MDN-RNN as the dynamics model of the distribution of possible outcomes in the actual environment, rather than merely predicting a deterministic future. Even if the actual environment is deterministic, the MDN-RNN would in effect approximate it as a stochastic environment. This has the advantage of allowing us to train C inside a more stochastic version of any environment – we can simply adjust the temperature parameter τ to control the amount of randomness in M, hence controlling the tradeoff between realism and exploitability. Using a mixture of Gaussian model may seem excessive given that the latent space encoded with the VAE model is just a single diagonal Gaussian distribution. However, the discrete modes in a mixture density model are useful for environments with random discrete events, such as whether a monster decides to shoot a fireball or stay put. While a single diagonal Gaussian might be sufficient to encode individual frames, an RNN with a mixture density output layer makes it easier to model the logic behind a more complicated environment with discrete random states. For instance, if we set the temperature parameter to a very low value of τ = 0.1, effectively training our C with an M that is almost identical to a deterministic LSTM, the monsters inside this generated environment fail to shoot fireballs, no matter what the agent does, due to mode collapse. M is not able to transition to another mode in the mixture of Gaussian model where fireballs are formed and shot. Whatever policy learned inside of this generated environment will achieve a perfect score of 2100 most of the time, but will obviously fail when unleashed into the harsh reality of the actual world, underperforming even a random policy. By making the temperature τ an adjustable parameter of M, we can see the effect of training C inside of virtual environments with different levels of uncertainty, and see how well they transfer over to the actual environment. We experiment with varying τ of the virtual environment, training an agent inside of this virtual environment, and observing its performance when inside the actual environment. 6 In Table 2, while we see that increasing τ of M makes it more difficult for C to find adversarial policies, increasing it too much will make the virtual environment too difficult for the agent to learn anything, hence in practice it is a hyperparameter we can tune. The temperature also affects the types of strategies the agent discovers. For example, although the best score obtained is 1092 ± 556 with τ = 1.15, increasing τ a notch to 1.30 results in a lower score but at the same time a less risky strategy with a lower variance of returns. For comparison, the best reported score [62] is 820 ± 58. 5 Related Work There is extensive literature on learning a dynamics model, and using this model to train a policy. Many basic concepts first explored in the 1980s for feed-forward neural networks (FNNs) [104, 56, 72, 105, 58] and in the 1990s for RNNs [74, 75, 78, 76] laid some of the groundwork for Learning to Think [83]. The more recent PILCO [10, 53] is a probabilistic model-based search policy method designed to solve difficult control problems. Using data collected from the environment, PILCO uses a Gaussian process (GP) model to learn the system dynamics, and uses this model to sample many trajectories in order to train a controller to perform a desired task, such as swinging up a pendulum. While GPs work well with a small set of low dimension data, their computational complexity makes them difficult to scale up to model a large history of high dimensional observations. Other recent works [17, 12] use Bayesian neural networks instead of GPs to learn a dynamics model. These methods have demonstrated promising results on challenging control tasks [32], where the states well defined, and the observation is relatively low dimensional. Here we are interested in modelling dynamics observed from high dimensional visual data, as a sequence of raw pixel frames. In robotic control applications, the ability to learn the dynamics of a system from observing only camera-based video inputs is a challenging but important problem. Early work on RL for active vision trained an FNN to take the current image frame of a video sequence to predict the next frame [85], and use this predictive model to train a fovea-shifting control network trying to find targets in a visual scene. To get around the difficulty of training a dynamical model to learn directly from high-dimensional pixel images, researchers explored using neural networks to first learn a compressed representation of the video frames. Recent work along these lines [99, 100] was able to train controllers using the bottleneck hidden layer of an autoencoder as low-dimensional feature vectors to control a pendulum from pixel inputs. Learning a model of the dynamics from a compressed latent space enable RL algorithms to be much more data-efficient [15, 101]. Video game environments are also popular in model-based RL research as a testbed for new ideas. Previous work [51] used a feed-forward convolutional neural network (CNN) to learn a forward simulation model of a video game. Learning to predict how different actions affect future states in the environment is useful for game-play agents, since if our agent can predict what happens in the future given its current state and action, it can simply select the best action that suits its goal. This has been demonstrated not only in early work [58, 85] (when compute was a million times more expensive than today) but also in recent studies [13] on several competitive VizDoom environments. The works mentioned above use FNNs to predict the next video frame. We may want to use models that can capture longer term time dependencies. RNNs are powerful models suitable for sequence modelling [24]. Using RNNs to develop internal models to reason about the future has been explored as early as 1990 [74], and then further explored in [75, 78, 76]. A more recent work [83] presented a unifying framework for building an RNN-based general problem solver that can learn a world model of its environment and also learn to reason about the future using this model. Subsequent works have used RNN-based models to generate many frames into the future [8, 60, 11, 25], and also as an internal model to reason about the future [90, 68, 102]. In this work, we used evolution strategies (ES) to train our controller, as this offers many benefits. For instance, we only need to provide the optimizer with the final cumulative reward, rather than the entire history. ES is also easy to parallelize – we can launch many instances of rollout with different solutions to many workers and quickly compute a set of cumulative rewards in parallel. Recent works [14, 73, 26, 94] have demonstrated that ES is a viable alternative to traditional Deep RL methods on many strong baselines. Before the popularity of Deep RL methods [54], evolution-based algorithms have been shown to be effective at solving RL tasks [92, 22, 21, 18, 88]. Evolution-based algorithms have even been able to solve difficult RL tasks from high dimensional pixel inputs [45, 31, 63, 1]. 7 6 Discussion We have demonstrated the possibility of training an agent to perform tasks entirely inside of its simulated latent space world. This approach offers many practical benefits. For instance, video game engines typically require heavy compute resources for rendering the game states into image frames, or calculating physics not immediately relevant to the game. We may not want to waste cycles training an agent in the actual environment, but instead train the agent as many times as we want inside its simulated environment. Agents that are trained incrementally to simulate reality may prove to be useful for transferring policies back to the real world. Our approach may complement sim2real approaches outlined in previous work [4, 33]. The choice of implementing V as a VAE and training it as a standalone model also has its limitations, since it may encode parts of the observations that are not relevant to a task. After all, unsupervised learning cannot, by definition, know what will be useful for the task at hand. For instance, our VAE reproduced unimportant detailed brick tile patterns on the side walls in the Doom environment, but failed to reproduce task-relevant tiles on the road in the Car Racing environment. By training together with an M that predicts rewards, the VAE may learn to focus on task-relevant areas of the image, but the tradeoff here is that we may not be able to reuse the VAE effectively for new tasks without retraining. Learning task-relevant features has connections to neuroscience as well. Primary sensory neurons are released from inhibition when rewards are received, which suggests that they generally learn task-relevant features, rather than just any features, at least in adulthood [65]. In our experiments, the tasks are relatively simple, so a reasonable world model can be trained using a dataset collected from a random policy. But what if our environments become more sophisticated? In any difficult environment, only parts of the world are made available to the agent only after it learns how to strategically navigate through its world. For more complicated tasks, an iterative training procedure is required. We need our agent to be able to explore its world, and constantly collect new observations so that its world model can be improved and refined over time. Future work will incorporate an iterative training procedure [83], where our controller actively explores parts of the environment that is beneficial to improve its world model. An exciting research direction is to look at ways to incorporate artificial curiosity and intrinsic motivation [81, 80, 77, 64, 61] and information seeking [86, 23] abilities in an agent to encourage exploration [47]. In particular, we can augment the reward function based on improvement in compression quality [81, 80, 77, 83]. Another concern is the limited capacity of our world model. While modern storage devices can store large amounts of historical data generated using an iterative training procedure, our LSTM [34, 20]based world model may not be able to store all of the recorded information inside of its weight connections. While the human brain can hold decades and even centuries of memories to some resolution [2], our neural networks trained with backpropagation have more limited capacity and suffer from issues such as catastrophic forgetting [69, 16, 43]. Future work will explore replacing the VAE and MDN-RNN with higher capacity models [89, 27, 93, 97, 98], or incorporating an external memory module [19, 107], if we want our agent to learn to explore more complicated worlds. Like early RNN-based C–M systems [74, 75, 78, 76], ours simulates possible futures time step by time step, without profiting from human-like hierarchical planning or abstract reasoning, which often ignores irrelevant spatio-temporal details. However, the more general Learning To Think [83] approach is not limited to this rather naive approach. Instead it allows a recurrent C to learn to address subroutines of the recurrent M, and reuse them for problem solving in arbitrary computable ways, e.g., through hierarchical planning or other kinds of exploiting parts of M’s program-like weight matrix. A recent One Big Net [84] extension of the C–M approach collapses C and M into a single network, and uses PowerPlay-like [82, 91] behavioural replay (where the behaviour of a teacher net is compressed into a student net [79]) to avoid forgetting old prediction and control skills when learning new ones. Experiments with those more general approaches are left for future work. Acknowledgments We would like to thank Blake Richards, Kory Mathewson, Chris Olah, Kai Arulkumaran, Denny Britz, Kyle McDonald, Ankur Handa, Elwin Ha, Nikhil Thorat, Daniel Smilkov, Alex Graves, Douglas Eck, Mike Schuster, Rajat Monga, Vincent Vanhoucke, Jeff Dean and Natasha Jaques for their thoughtful feedback. This work was partially funded by SNF project RNNAISSANCE (200021_165675) and by an ERC Advanced Grant (no: 742870). 8 References [1] S. Alvernaz and J. Togelius. Autoencoder-augmented neuroevolution for visual doom playing. In Computational Intelligence and Games (CIG), 2017 IEEE Conference on, pages 1–8. IEEE, 2017. [2] T. M. Bartol Jr, C. Bromer, J. Kinney, M. A. Chirillo, J. N. Bourne, K. M. Harris, and T. J. Sejnowski. Nanoconnectomic upper bound on the variability of synaptic plasticity. Elife, 4, 2015. [3] C. M. Bishop. Neural networks for pattern recognition (chapter 6). Oxford university press, 1995. [4] K. Bousmalis, A. Irpan, P. Wohlhart, Y. Bai, M. Kelcey, M. Kalakrishnan, L. Downs, J. Ibarz, P. Pastor, K. Konolige, S. Levine, and V. Vanhoucke. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. Preprint arXiv:1709.07857, Sept. 2017. [5] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI Gym. Preprint arXiv:1606.01540, June 2016. [6] S. Carter, D. Ha, I. Johnson, and C. Olah. Experiments in handwriting with a neural network. Distill, 2016. [7] L. Chang and D. Y. Tsao. The code for facial identity in the primate brain. Cell, 169(6):1013–1028, 2017. [8] S. Chiappa, S. Racaniere, D. Wierstra, and S. Mohamed. Recurrent environment simulators. Preprint arXiv:1704.02254, Apr. 2017. [9] M. Consalvo. Cheating: Gaining Advantage in Videogames (Chapter 5). The MIT Press, 2007. [10] M. Deisenroth and C. E. Rasmussen. PILCO: A model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pages 465–472, 2011. [11] E. L. Denton et al. Unsupervised learning of disentangled representations from video. In Advances in Neural Information Processing Systems, pages 4417–4426, 2017. [12] S. Depeweg, J. M. Hernández-Lobato, F. Doshi-Velez, and S. Udluft. Learning and policy search in stochastic dynamical systems with bayesian neural networks. Preprint arXiv:1605.07127, May 2016. [13] A. Dosovitskiy and V. Koltun. Learning to act by predicting the future. Preprint arXiv:1611.01779, Nov. 2016. [14] C. Fernando, D. Banarse, C. Blundell, Y. Zwols, D. Ha, A. Rusu, A. Pritzel, and D. Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. Preprint arXiv:1701.08734, Jan. 2017. [15] C. Finn, X. Y. Tan, Y. Duan, T. Darrell, S. Levine, and P. Abbeel. Deep spatial autoencoders for visuomotor learning. In Robotics and Automation (ICRA), 2016 IEEE International Conference on, pages 512–519. IEEE, 2016. [16] R. M. French. Catastrophic interference in connectionist networks: Can it be predicted, can it be prevented? In J. D. Cowan, G. Tesauro, and J. Alspector, editors, Advances in Neural Information Processing Systems 6, pages 1176–1177. Morgan-Kaufmann, 1994. [17] Y. Gal, R. McAllister, and C. E. Rasmussen. Improving PILCO with bayesian neural network dynamics models. In Data-Efficient Machine Learning workshop, ICML, 2016. [18] J. Gauci and K. O. Stanley. Autonomous evolution of topographic regularities in artificial neural networks. Neural Computation, 22(7):1860–1898, July 2010. [19] M. Gemici, C. Hung, A. Santoro, G. Wayne, S. Mohamed, D. Rezende, D. Amos, and T. Lillicrap. Generative temporal models with memory. Preprint arXiv:1702.04649, Feb. 2017. [20] F. Gers, J. Schmidhuber, and F. Cummins. Learning to forget: Continual prediction with LSTM. Neural Computation, 12(10):2451–2471, Oct. 2000. [21] F. Gomez and J. Schmidhuber. Co-evolving recurrent neurons learn deep memory POMDPs. Proceedings of the 7th Annual Conference on Genetic and Evolutionary Computation, pages 491–498, 2005. [22] F. Gomez, J. Schmidhuber, and R. Miikkulainen. Accelerated neural evolution through cooperatively coevolved synapses. Journal of Machine Learning Research, 9:937–965, June 2008. 9 [23] J. Gottlieb, P.-Y. Oudeyer, M. Lopes, and A. Baranes. Information-seeking, curiosity, and attention: computational and neural mechanisms. Trends in cognitive sciences, 17(11):585–593, 2013. [24] A. Graves. Generating sequences with recurrent neural networks. Preprint arXiv:1308.0850, 2013. [25] A. Graves. Hallucination with recurrent neural networks. https://youtu.be/-yX1SYeDHbg, 2015. [26] D. Ha. Evolving stable strategies. http://blog.otoro.net/, 2017. [27] D. Ha, A. Dai, and Q. V. Le. Hypernetworks. In International Conference on Learning Representations, 2017. [28] D. Ha and D. Eck. A neural representation of sketch drawings. In International Conference on Learning Representations, 2018. [29] N. Hansen. The CMA evolution strategy: A tutorial. Preprint arXiv:1604.00772, 2016. [30] N. Hansen and A. Ostermeier. Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 9(2):159–195, June 2001. [31] M. Hausknecht, J. Lehman, R. Miikkulainen, and P. Stone. A neuroevolution approach to general Atari game playing. IEEE Transactions on Computational Intelligence and AI in Games, 6(4):355–366, 2014. [32] D. Hein, S. Depeweg, M. Tokic, S. Udluft, A. Hentschel, T. Runkler, and V. Sterzing. A benchmark environment motivated by industrial control problems. Preprint arXiv:1709.09480, Sept. 2017. [33] I. Higgins, A. Pal, A. A. Rusu, L. Matthey, C. P. Burgess, A. Pritzel, M. Botvinick, C. Blundell, and A. Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. Preprint arXiv:1707.08475, 2017. [34] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [35] J. Hünermann. Self-driving cars in the browser. http://janhuenermann.com/, 2017. [36] S. Jang, J. Min, and C. Lee. Reinforcement car racing with A3C. https://goo.gl/58SKBp, 2017. [37] L. P. Kaelbling, M. L. Littman, and A. W. Moore. Reinforcement learning: a survey. Journal of AI research, 4:237–285, 1996. [38] G. Keller, T. Bonhoeffer, and M. Hübener. Sensorimotor mismatch signals in primary visual cortex of the behaving mouse. Neuron, 74(5):809 – 815, 2012. [39] H. J. Kelley. Gradient theory of optimal flight paths. ARS Journal, 30(10):947–954, 1960. [40] M. Kempka, M. Wydmuch, G. Runc, J. Toczek, and W. Jaskowski. VizDoom: A Doom-based AI research platform for visual reinforcement learning. In IEEE Conference on Computational Intelligence and Games, pages 341–348, Santorini, Greece, Sep 2016. IEEE. The best paper award. [41] M. Khan and O. Elibol. Car racing using reinforcement learning. https://goo.gl/neSBSx, 2016. [42] D. Kingma and M. Welling. Auto-encoding variational bayes. Preprint arXiv:1312.6114, 2013. [43] J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521–3526, 2017. [44] O. Klimov. CarRacing-v0. http://gym.openai.com/, 2016. [45] J. Koutnik, G. Cuccu, J. Schmidhuber, and F. Gomez. Evolving large-scale neural networks for visionbased reinforcement learning. Proceedings of the 15th Annual Conference on Genetic and Evolutionary Computation, pages 1061–1068, 2013. [46] B. Lau. Using Keras and deep deterministic policy gradient to play TORCS. https://yanpanlau.github.io/, 2016. [47] J. Lehman and K. Stanley. Abandoning objectives: Evolution through the search for novelty alone. Evolutionary Computation, 19(2):189–223, 2011. [48] M. Leinweber, D. R. Ward, J. M. Sobczak, A. Attinger, and G. B. Keller. A sensorimotor circuit in mouse cortex for visual flow predictions. Neuron, 95(6):1420 – 1432.e5, 2017. 10 [49] L. Lin. Reinforcement Learning for Robots Using Neural Networks. PhD thesis, Carnegie Mellon University, Pittsburgh, January 1993. [50] S. Linnainmaa. The representation of the cumulative rounding error of an algorithm as a taylor expansion of the local rounding errors. Master’s thesis, Univ. Helsinki, 1970. [51] M. O. R. Matthew Guzdial, Boyang Li. Game engine learning from video. In Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI-17, pages 3707–3713, 2017. [52] G. W. Maus, J. Fischer, and D. Whitney. Motion-dependent representation of space in area MT+. Neuron, 78(3):554–562, 2013. [53] R. McAllister and C. E. Rasmussen. Data-efficient reinforcement learning in continuous state-action Gaussian-POMDPs. In Advances in Neural Information Processing Systems, pages 2037–2046, 2017. [54] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing Atari with deep reinforcement learning. Preprint arXiv:1312.5602, Dec. 2013. [55] D. Mobbs, C. C. Hagan, T. Dalgleish, B. Silston, and C. Prévost. The ecology of human fear: survival optimization and the nervous system. Frontiers in neuroscience, 9:55, 2015. [56] P. W. Munro. A dual back-propagation scheme for scalar reinforcement learning. Proceedings of the Ninth Annual Conference of the Cognitive Science Society, Seattle, WA, pages 165–176, 1987. [57] A. Nagabandi, G. Kahn, R. Fearing, and S. Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. Preprint arXiv:1708.02596, Aug. 2017. [58] N. Nguyen and B. Widrow. The truck backer-upper: An example of self learning in neural networks. In Proceedings of the International Joint Conference on Neural Networks, pages 357–363. IEEE Press, 1989. [59] N. Nortmann, S. Rekauzke, S. Onat, P. König, and D. Jancke. Primary visual cortex represents the difference between past and present. Cerebral Cortex, 25(6):1427–1440, 2015. [60] J. Oh, X. Guo, H. Lee, R. L. Lewis, and S. Singh. Action-conditional video prediction using deep networks in Atari games. In Advances in Neural Information Processing Systems, pages 2863–2871, 2015. [61] P.-Y. Oudeyer, F. Kaplan, and V. V. Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265–286, 2007. [62] P. Paquette. DoomTakeCover-v0. https://gym.openai.com/, 2016. [63] M. Parker and B. D. Bryant. Neurovisual control in the Quake II environment. IEEE Transactions on Computational Intelligence and AI in Games, 4(1):44–54, 2012. [64] D. Pathak, P. Agrawal, A. A. Efros, and T. Darrell. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning (ICML), volume 2017, 2017. [65] H.-J. Pi, B. Hangya, D. Kvitsiani, J. I. Sanders, Z. J. Huang, and A. Kepecs. Cortical interneurons that specialize in disinhibitory control. Nature, 503(7477):521, 2013. [66] L. Prieur. Deep-Q Learning for racecar reinforcement learning problem. https://goo.gl/VpDqSw, 2017. [67] R. Q. Quiroga, L. Reddy, G. Kreiman, C. Koch, and I. Fried. Invariant visual representation by single neurons in the human brain. Nature, 435(7045):1102, 2005. [68] S. Racanière, T. Weber, D. Reichert, L. Buesing, A. Guez, D. J. Rezende, A. P. Badia, O. Vinyals, N. Heess, Y. Li, et al. Imagination-augmented agents for deep reinforcement learning. In Advances in Neural Information Processing Systems, pages 5694–5705, 2017. [69] R. M. Ratcliff. Connectionist models of recognition memory: constraints imposed by learning and forgetting functions. Psychological review, 97 2:285–308, 1990. [70] I. Rechenberg. Evolutionsstrategien. In Simulationsmethoden in der Medizin und Biologie, pages 83–114. Springer, 1978. [71] D. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. Preprint arXiv:1401.4082, 2014. 11 [72] T. Robinson and F. Fallside. Dynamic reinforcement driven error propagation networks with application to game playing. In Proceedings of the 11th Conference of the Cognitive Science Society, Ann Arbor, pages 836–843, 1989. [73] T. Salimans, J. Ho, X. Chen, S. Sidor, and I. Sutskever. Evolution strategies as a scalable alternative to reinforcement learning. Preprint arXiv:1703.03864, 2017. [74] J. Schmidhuber. Making the world differentiable: On using supervised learning fully recurrent neural networks for dynamic reinforcement learning and planning in non-stationary environments. Technische Universität München Tech. Report: FKI-126-90, 1990. [75] J. Schmidhuber. An on-line algorithm for dynamic reinforcement learning and planning in reactive environments. In Neural Networks, 1990., 1990 IJCNN International Joint Conference on, pages 253–258. IEEE, 1990. [76] J. Schmidhuber. A possibility for implementing curiosity and boredom in model-building neural controllers. Proceedings of the First International Conference on Simulation of Adaptive Behavior on From Animals to Animats, pages 222–227, 1990. [77] J. Schmidhuber. Curious model-building control systems. In Neural Networks, 1991. 1991 IEEE International Joint Conference on, pages 1458–1463. IEEE, 1991. [78] J. Schmidhuber. Reinforcement learning in markovian and non-markovian environments. In Advances in neural information processing systems, pages 500–506, 1991. [79] J. Schmidhuber. Learning complex, extended sequences using the principle of history compression. Neural Computation, 4(2):234–242, 1992. (Based on TR FKI-148-91, TUM, 1991). [80] J. Schmidhuber. Developmental robotics, optimal artificial curiosity, creativity, music, and the fine arts. Connection Science, 18(2):173–187, 2006. [81] J. Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010. [82] J. Schmidhuber. Powerplay: Training an increasingly general problem solver by continually searching for the simplest still unsolvable problem. Frontiers in Psychology, 4:313, 2013. [83] J. Schmidhuber. On learning to think: Algorithmic information theory for novel combinations of reinforcement learning controllers and recurrent neural world models. Preprint arXiv:1511.09249, 2015. [84] J. Schmidhuber. One big net for everything. Preprint arXiv:1802.08864, Feb. 2018. [85] J. Schmidhuber and R. Huber. Learning to generate artificial fovea trajectories for target detection. International Journal of Neural Systems, 2(1-2):125–134, 1991. [86] J. Schmidhuber, J. Storck, and S. Hochreiter. Reinforcement driven information acquisition in nondeterministic environments. Technical Report FKI- -94, TUM Department of Informatics, 1994. [87] H. Schwefel. Numerical Optimization of Computer Models. John Wiley and Sons, Inc., New York, NY, USA, 1977. [88] F. Sehnke, C. Osendorfer, T. Rückstieß, A. Graves, J. Peters, and J. Schmidhuber. Parameter-exploring policy gradients. Neural Networks, 23(4):551–559, 2010. [89] N. Shazeer, A. Mirhoseini, K. Maziarz, A. Davis, Q. Le, G. Hinton, and J. Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In International Conference on Learning Representations, 2017. [90] D. Silver, H. van Hasselt, M. Hessel, T. Schaul, A. Guez, T. Harley, G. Dulac-Arnold, D. Reichert, N. Rabinowitz, A. Barreto, and T. Degris. The predictron: End-to-end learning and planning. Preprint arXiv:1612.08810, Dec. 2016. [91] R. K. Srivastava, B. R. Steunebrink, and J. Schmidhuber. First experiments with powerplay. Neural Networks, 41:130–136, 2013. [92] K. O. Stanley and R. Miikkulainen. Evolving neural networks through augmenting topologies. Evolutionary computation, 10(2):99–127, 2002. 12 [93] J. Suarez. Language modeling with recurrent highway hypernetworks. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems 30, pages 3269–3278. Curran Associates, Inc., 2017. [94] F. P. Such, V. Madhavan, E. Conti, J. Lehman, K. O. Stanley, and J. Clune. Deep neuroevolution: Genetic algorithms are a competitive alternative for training deep neural networks for reinforcement learning. Preprint arXiv:1712.06567, Dec. 2017. [95] R. S. Sutton. Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In Machine Learning Proceedings 1990, pages 216–224. Elsevier, 1990. [96] R. S. Sutton and A. G. Barto. Introduction to Reinforcement Learning. MIT Press, Cambridge, MA, USA, 1st edition, 1998. [97] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. Preprint arXiv:1609.03499, Sept. 2016. [98] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 6000–6010, 2017. [99] N. Wahlström, T. B. Schön, and M. P. Desienroth. Learning deep dynamical models from image pixels. In 17th IFAC Symposium on System Identification (SYSID), October 19-21, Beijing, China, 2015. [100] N. Wahlström, T. Schön, and M. Deisenroth. From pixels to torques: Policy learning with deep dynamical models. Preprint arXiv:1502.02251, June 2015. [101] M. Watter, J. Springenberg, J. Boedecker, and M. Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in neural information processing systems, pages 2746–2754, 2015. [102] N. Watters, A. Tacchetti, T. Weber, R. Pascanu, P. Battaglia, and D. Zoran. Visual interaction networks. Preprint arXiv:1706.01433, June 2017. [103] P. J. Werbos. Applications of advances in nonlinear sensitivity analysis. In System modeling and optimization, pages 762–770. Springer, 1982. [104] P. J. Werbos. Learning how the world works: Specifications for predictive networks in robots and brains. In Proceedings of IEEE International Conference on Systems, Man and Cybernetics, N.Y., 1987. [105] P. J. Werbos. Neural networks for control and system identification. In Decision and Control, 1989., Proceedings of the 28th IEEE Conference on, pages 260–265. IEEE, 1989. [106] M. Wiering and M. van Otterlo. Reinforcement Learning. Springer, 2012. [107] Y. Wu, G. Wayne, A. Graves, and T. Lillicrap. The Kanerva machine: A generative distributed memory. In International Conference on Learning Representations, 2018. 13
2018
202
7,367
Algorithms and Theory for Multiple-Source Adaptation Judy Hoffman CS Department UC Berkeley Berkeley, CA 94720 jhoffman@eecs.berkeley.edu Mehryar Mohri Courant Institute and Google New York, NY 10012 mohri@cims.nyu.edu Ningshan Zhang New York University New York, NY 10012 nzhang@stern.nyu.edu Abstract We present a number of novel contributions to the multiple-source adaptation problem. We derive new normalized solutions with strong theoretical guarantees for the cross-entropy loss and other similar losses. We also provide new guarantees that hold in the case where the conditional probabilities for the source domains are distinct. Moreover, we give new algorithms for determining the distributionweighted combination solution for the cross-entropy loss and other losses. We report the results of a series of experiments with real-world datasets. We find that our algorithm outperforms competing approaches by producing a single robust model that performs well on any target mixture distribution. Altogether, our theory, algorithms, and empirical results provide a full solution for the multiple-source adaptation problem with very practical benefits. 1 Introduction In many modern applications, often the learner has access to information about several source domains, including accurate predictors possibly trained and made available by others, but no direct information about a target domain for which one wishes to achieve a good performance. The target domain can typically be viewed as a combination of the source domains, that is a mixture of their joint distributions, or it may be close to such mixtures. In addition, often the learner does not have access to all source data simultaneously, for legitimate reasons such as privacy or storage limitation. Thus, the learner cannot simply pool all source data together to learn a predictor. Such problems arise commonly in speech recognition where different groups of speakers (domains) yield different acoustic models and the problem is to derive an accurate acoustic model for a broader population that may be viewed as a mixture of the source groups (Liao, 2013). In object recognition, multiple image databases exist, each with its own bias and labeled categories (Torralba and Efros, 2011), but the target application may contain images which most closely resemble only a subset of the available training data. Finally, in sentiment analysis, accurate predictors may be available for sub-domains such as TVs, laptops and CD players, each previously trained on labeled data, but no labeled data or predictor may be at the learner’s disposal for the more general category of electronics, which can be modeled as a mixture of the sub-domains (Blitzer et al., 2007; Dredze et al., 2008). The problem of transfer from a single source to a known target domain (Ben-David, Blitzer, Crammer, and Pereira, 2006; Mansour, Mohri, and Rostamizadeh, 2009b; Cortes and Mohri, 2014; Cortes, Mohri, and Muñoz Medina, 2015), either through unsupervised adaptation techniques (Gong et al., 2012; Long et al., 2015; Ganin and Lempitsky, 2015; Tzeng et al., 2015), or via lightly supervised ones (some amount of labeled data from the target domain) (Saenko et al., 2010; Yang et al., 2007; Hoffman et al., 2013; Girshick et al., 2014), has been extensively investigated in the past. Here, we focus on the problem of multiple-source domain adaptation and ask how the learner can combine relatively accurate predictors available for each source domain to derive an accurate predictor for 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. any new mixture target domain? This is known as the multiple-source adaptation (MSA) problem first formalized and analyzed theoretically by Mansour, Mohri, and Rostamizadeh (2008, 2009a) and later studied for various applications such as object recognition (Hoffman et al., 2012; Gong et al., 2013a,b). Recently, Zhang et al. (2015) studied a causal formulation of this problem for a classification scenario, using the same combination rules as Mansour et al. (2008, 2009a). A closely related problem to the MSA problem is that of domain generalization (Pan and Yang, 2010; Muandet et al., 2013; Xu et al., 2014), where knowledge from an arbitrary number of related domains is combined to perform well on a previously unseen domain. Appendix G includes a more detailed discussion of previous work related to the MSA problem. Mansour, Mohri, and Rostamizadeh (2008, 2009a) gave strong theoretical guarantees for a distributionweighted combination to address the MSA problem, but they did not provide an algorithmic solution to determine that combination. Furthermore, the solution they proposed could not be used for loss functions such as cross-entropy, which require a normalized predictor. Their work also assumed a deterministic scenario (non-stochastic) with the same labeling function for all source domains. This work makes a number of novel contributions to the MSA problem. We give new normalized solutions with strong theoretical guarantees for the cross-entropy loss and other similar losses. Our guarantees hold even when the conditional probabilities for the source domains are distinct. A by-product of our analysis is the extension of the theoretical results of Mansour et al. (2008, 2009a) to the stochastic scenario, where there is a joint distribution over the input and output space. Moreover, we give new algorithms for determining the distribution-weighted combination solution for the cross-entropy loss and other losses. We prove that the problem of determining that solution can be cast as a DC-programming (difference of convex) and prove explicit DC-decompositions for the cross-entropy loss and other losses. We also give a series of experimental results with several datasets demonstrating that our distribution-weighted combination solution is remarkably robust. Our algorithm outperforms competing approaches and performs well on any target mixture distribution. Altogether, our theory, algorithms, and empirical results provide a full solution for the MSA problem with very practical benefits. 2 Problem setup Let X denote the input space and Y the output space. We consider a multiple-source domain adaptation (MSA) problem in the general stochastic scenario where there is a distribution over the joint input-output space X × Y. This is a more general setup than the deterministic scenario in (Mansour et al., 2008, 2009a), where a target function mapping from X to Y is assumed. This extension is needed for the analysis of the most common and realistic learning setups in practice. We will assume that X and Y are discrete, but the predictors we consider can take real values. Our theory can be straightforwardly extended to the continuous case with summations replaced by integrals in the proofs. We will identify a domain with a distribution over X × Y and consider the scenario where the learner has access to a predictor hk, for each domain Dk, k ∈[p] = {1,...,p}. We consider two types of predictor functions hk, and their associated loss functions L under the regression model (R) and the probability model (P) respectively, hk∶X →R L∶R × Y →R+ (R) hk∶X × Y →[0,1] L∶[0,1] →R+ (P) We abuse the notation and write L(h,x,y) to denote the loss of a predictor h at point (x,y), that is L(h(x),y) in the regression model, and L(h(x,y)) in the probability model. We will denote by L(D,h) the expected loss of a predictor h with respect to the distribution D: L(D,h) = E (x,y)∼D￿L(h,x,y)￿= ￿ (x,y)∈X ×Y D(x,y)L(h,x,y). Much of our theory only assumes that L is convex and continuous. But, we will be particularly interested in the case where, in the regression model, L(h(x),y) = (h(x) −y)2 is the squared loss, and where, in the probability model, L(h(x,y)) = −log h(x,y) is the cross-entropy loss (log-loss). We will assume that each hk is a relatively accurate predictor for the distribution Dk: there exists ✏> 0 such that L(Dk,hk) ≤✏for all k ∈[p]. We will also assume that the loss of the source hypotheses hk is bounded, that is L(hk,x,y) ≤M for all (x,y) ∈X × Y and all k ∈[p]. 2 In the MSA problem, the learner’s objective is to combine these predictors to design a predictor with small expected loss on a target domain that could be an arbitrary and unknown mixture of the source domains, the case we are particularly interested in, or even some other arbitrary distribution. It is worth emphasizing that the learner has no knowledge of the target domain. How do we combine the hks? Can we use a convex combination rule, ∑p k=1 λkhk, for some λ ∈∆? In Appendix A (Lemmas 9 and 10) we show that no convex combination rule will perform well even in very simple MSA problems. These results generalize a previous lower bound of Mansour et al. (2008). Next, we show that the distribution-weighted combination rule is a suitable solution. Extending the definition given by Mansour et al. (2008), we define the distribution-weighted combination of the functions hk, k ∈[p] as follows. For any ⌘> 0, z ∈∆, and (x,y) ∈X × Y, h⌘ z(x) = p ￿ k=1 zkD1 k(x) + ⌘U1(x) p ∑p k=1 zkD1 k(x) + ⌘U1(x)hk(x), (R) (1) h⌘ z(x,y) = p ￿ k=1 zkDk(x,y) + ⌘U(x,y) p ∑p j=1 zjDj(x,y) + ⌘U(x,y)hk(x,y), (P) (2) where we denote by D1 the marginal distribution over X, for all x ∈X, D1(x) = ∑y∈Y D(x,y), and by U1 the uniform distribution over X. This extension may seem technically straightforward in hindsight, but the form of the predictor was not immediately clear in the stochastic case. 3 Theoretical guarantees In this section, we present a series of theoretical guarantees for distribution-weighted combinations with a suitable choice of the parameters z and ⌘, both for the regression model and for the probability model. We first give our main result for the general stochastic scenario. Next, for the probability model with cross-entropy loss, we introduce a normalized distribution weighted combination and prove that it benefits from strong theoretical guarantees. Our theoretical results rely on a measure of divergence between two distributions. The one that naturally comes up in our analysis is the Rényi Divergence (Rényi, 1961). We will denote by d↵(D ∥D′) = eD↵(D∥D′) the exponential of the ↵-Rényi Divergence of two distributions D and D′. See Appendix F for more details about the notion of Rényi Divergence. 3.1 General guarantees for regression and probability models Let DT be an unknown target distribution. We will denote by DT (⋅￿x) and Dk(⋅￿x) the conditional probability distribution on the target and the source domain k respectively. We do not assume that the target and source conditional probabilities DT (⋅￿x) and Dk(⋅￿x) coincide for all k ∈[p] and x ∈X. This is a significant extension of the MSA scenario with respect to the one considered by Mansour et al. (2009a), which assumed exactly the same labeling function f for all source domains, in the deterministic scenario. Let DT be a mixture of source distributions, such that D1 T ∈D1 = {∑p k=1 λkD1 k∶λ ∈∆} in the regression model, or DT ∈D = {∑p k=1 λkDk∶λ ∈∆} in the probability model. We also assume that under the regression model, all possible target distributions DT admit the same (unknown) conditional probability distribution. Fix ↵> 1 and define ✏T by ✏T = max k∈[p] ￿E x∼D1 k ￿d↵(DT (⋅￿x) ∥Dk(⋅￿x))↵−1 ￿￿ 1 ↵ ✏ ↵−1 ↵M 1 ↵. ✏T depends on the maximal expected Rényi divergence between the target conditional probability distribution DT (⋅￿x) and the source ones Dk(⋅￿x),∀k ∈[p], with the expectation taken over the source marginal distribution D1 k, and the maximum taken over k ∈[p]. When the target conditional is close to all source ones, ↵can be chosen to be very large and ✏T is close to ✏. In particular, when the conditional probabilities coincide, for ↵= +∞, we have ✏T = ✏. 3 Theorem 1. For any δ > 0, there exist ⌘> 0 and z ∈∆such that the following inequalities hold for any ↵> 1 and any target distribution DT that is a mixture of source distributions: L(DT ,h⌘ z) ≤✏T + δ, (R) L(DT ,h⌘ z) ≤✏+ δ. (P) As discussed later, the proof of more general results (Theorem 2 and Theorem 14) is given in Appendix B. The learning guarantees for the regression and the probability model are slightly different, since the definitions of the distribution-weighted combinations are different for the two models. Theorem 1 shows the existence of ⌘> 0 and a mixture weight z ∈∆with a remarkable property: in the regression model (R), for any target distribution DT whose conditional DT (⋅￿x) is on average not too far away from Dk(⋅￿x) for any k ∈[p], and D1 T ∈D1, the loss of h⌘ z on DT is small. It is even more remarkable that, in the probability model (P), the loss of h⌘ z is at most ✏on any target distribution DT ∈D. Thus, h⌘ z is a robust hypothesis with favorable property for any such target distribution DT . We now present a more general result, Theorem 2, that relaxes the assumptions under the regression model that all possible target distributions DT admit the same conditional probability distribution, and that the target’s marginal distribution is a mixture of source ones. In Appendix B, we show that Theorem 2 coincides with Theorem 1 under those assumptions. In Appendix B, we further give a more general result than Theorem 1 under the probability model (Theorem 14). To present this more general result, we first introduce some additional notation. Given a conditional probability distribution Q(⋅￿x) defined for all x ∈X, define ✏↵(Q) as follows: ✏↵(Q) = max k∈[p] ￿ E x∼D1 k ￿d↵(Q(⋅￿x) ∥Dk(⋅￿x))↵−1 ￿￿ 1 ↵ ✏ ↵−1 ↵M 1 ↵. Thus, ✏↵(Q) depends on the maximal expected ↵-Rényi divergence between Q(⋅￿x) and Dk(⋅￿x), and ✏↵(Q) = ✏T when Q(⋅￿x) = DT (⋅￿x). When there exists Q(⋅￿x) such that the expected ↵-Rényi divergence is small for all k ∈[p], then ✏↵(Q) is close to ✏for ↵= +∞. In addition, we will use the following definitions: Dk,Q(x,y) = D1 k(x)Q(y￿x) and DP,Q = ￿∑p k=1 λkDk,Q∶λ ∈∆￿. Theorem 2 (Regression model). Fix a conditional probability distribution Q(⋅￿x) defined for all x ∈X. Then, for any δ > 0, there exist ⌘> 0 and z ∈∆such that the following inequality holds for any ↵,β > 1 and any target distribution DT : L(DT ,h⌘ z) ≤￿￿✏↵(Q) + δ￿dβ(DT ∥DP,Q)￿ β−1 β M 1 β . The learning guarantee of Theorem 2 depends on the Rényi divergence between the conditional probabilities of the source and target domains and a fixed pivot Q(⋅￿x). In particular, when there exists a pivot Q(⋅￿x) that is close to DT (⋅￿x) and Dk(⋅￿x), for all k ∈[p], then the guarantee is significant. One candidate for such a pivot is a conditional probability distribution Q(⋅￿x) minimizing ✏↵(Q). In many learning tasks, it is reasonable to assume that the conditional probability of the output labels is the same across source domains. For example, a dog picture represents a dog regardless of whether the picture belongs to an individual’s personal collection or to a broader database of pictures from multiple individuals. This is a straightforward extension of the assumption adopted by Mansour et al. (2008) in the deterministic scenario, where exactly the same labeling function f is assumed for all source domains. In that case, we have DT (⋅￿x) = Dk(⋅￿x), ∀k ∈[p] and therefore d↵(DT (⋅￿x) ∥Dk(⋅￿x)) = 1. Setting ↵= +∞, we recover the main result of Mansour et al. (2008). Corollary 3. Assume that the conditional probability distributions Dk(⋅￿x) do not depend on k. Then, for any δ > 0, there exist ⌘> 0 and z ∈∆such that L(Dλ,h⌘ z) ≤✏+ δ for any mixture parameter λ ∈∆. Corollary 3 shows the existence of a parameter ⌘> 0 and a mixture weight z ∈∆with a remarkable property: for any δ > 0, regardless of which mixture weight λ ∈∆defines the target distribution, the loss of h⌘ z is at most ✏+ δ, that is arbitrarily close to ✏. h⌘ z is therefore a robust hypothesis with a favorable property for any mixture target distribution. To cover the realistic cases in applications, we further extend this result to the case where the distributions Dk are not directly available to the learner, and instead estimates ̂Dk have been derived 4 from data, and further to the case where the target distribution DT is not a mixture of source distributions. We will denote by ̂h⌘ z the distribution-weighted combination rule based on the estimates ̂Dk. Our learning guarantee for ̂h⌘ z depends on the Rényi divergence of ̂Dk and Dk, as well as the Rényi divergence of DT and the family of mixtures of source distributions. Corollary 4. For any δ > 0, there exist ⌘> 0 and z ∈∆, such that the following inequality holds for any ↵> 1 and arbitrary target distribution DT : L(DT ,̂h⌘ z) ≤￿(̂✏+ δ)d↵(DT ∥̂D)￿ ↵−1 ↵M 1 ↵, where ̂✏= maxk∈[p] ￿✏d↵(̂Dk ∥Dk)￿ ↵−1 ↵M 1 ↵, and ̂D = ￿∑p k=1 λk ̂Dk∶λ ∈∆￿. Corollary 4 shows that there exists a predictor ̂h⌘ z based on the estimate distributions ̂Dk that is ̂✏-accurate with respect to any target distribution DT whose Rényi divergence with respect to the family ̂D is not too large (d↵(DT ∥̂D) close to 1). Furthermore, ̂✏is close to ✏, provided that ̂Dks are good estimates of Dks (that is d↵(̂Dk ∥Dk) close to 1). The proof is given in Appendix B. 3.2 Guarantees for the probability model with the cross-entropy loss Here, we discuss the important special case where L coincides with the cross-entropy loss in the probability model, and present a guarantee for a normalized distribution-weighted combination solution. This analysis is a complement to Theorem 1, which only holds for the unnormalized hypothesis h⌘ z(x,y). The cross-entropy loss assumes normalized hypotheses. Thus, here, we assume that the source functions are normalized for every x: ∑y∈Y hk(x,y) = 1, ∀x ∈X,∀k ∈[p]. For any ⌘> 0 and z ∈∆, we define a normalized weighted combination h ⌘ z(x,y) that is based on distribution-weighted combination h⌘ z(x,y) defined by (2): h ⌘ z(x,y) = h⌘ z(x,y) ∑y∈Y h⌘ z(x,y). We will first assume the conditional probability distributions Dk(⋅￿x) do not depend on k. Theorem 5. Assume that there exists µ > 0 such that Dk(x,y) ≥µU(x,y) for all k ∈[p] and (x,y) ∈X × Y. Then, for any δ > 0, there exist ⌘> 0 and z ∈∆such that L(Dλ,h ⌘ z) ≤✏+ δ for any mixture parameter λ ∈∆. Theorem 5 provides a strong guarantee that is the analogue of Corollary 3 for normalized distributionweighted combinations. The theorem can also be extended to the case of arbitrary target distributions and estimated densities. When the conditional probabilities are distinct across the source domains, we propose a marginal distribution-weighted combination rule, which is already normalized. We can directly apply Theorem 1 to that solution and achieve favorable guarantees. More details are presented in Appendix C. These results are non-trivial and important, as they provide a guarantee for an accurate and robust predictor for a commonly used loss function, the cross-entropy loss. 4 Algorithms We have shown that, for both the regression and the probability model, there exists a vector z defining a distribution-weighted combination hypothesis h⌘ z that admits very favorable guarantees. But how can we find a such z? This is a key question in the MSA problem which was not addressed by Mansour et al. (2008, 2009a): no algorithm was previously reported to determine the mixture parameter z, even for the deterministic scenario. Here, we give an algorithm for determining that vector z. In this section, we give practical and efficient algorithms for finding the vector z in the important cases of the squared loss in the regression model, or the cross-entropy loss in the probability model, by leveraging the differentiability of the loss functions. We first show that z is the solution of a general optimization problem. Next, we give a DC-decomposition (difference of convex decomposition) 5 of the objective for both models, thereby proving an explicit DC-programming formulation of the problem. This leads to an efficient DC algorithm that is guaranteed to converge to a stationary point. Additionally, we show that it is straightforward to test if the solution obtained is the global optimum. While we are not proving that the local stationary point found by our algorithm is the global optimum, empirically, we observe that that is indeed the case. 4.1 Optimization problem Theorem 1 shows that the hypothesis h⌘ z based on the mixture parameter z benefits from a strong generalization guarantee. A key step in proving Theorem 1 is to show the following lemma. Lemma 6. For any ⌘,⌘′ > 0, there exists z ∈∆, with zk ≠0 for all k ∈[p], such that the following holds for the distribution-weighted combining rule h⌘ z: ∀k ∈[p], L(Dk,h⌘ z) ≤ p ￿ j=1 zjL(Dj,h⌘ z) + ⌘′. (3) Lemma 6 indicates that for the solution z, h⌘ z has essentially the same loss on all source domains. Thus, our problem consists of finding a parameter z verifying this property. This, in turn, can be formulated as a min-max problem: minz∈∆maxk∈[p] L(Dk,h⌘ z) −L(Dz,h⌘ z), which can be equivalently formulated as the following optimization problem: min z∈∆,γ∈R γ s.t. L(Dk,h⌘ z) −L(Dz,h⌘ z) ≤γ, ∀k ∈[p]. (4) 4.2 DC-decomposition We provide explicit DC decompositions of the objective of Problem (4) for the regression model with the squared loss and for the probability model with the cross-entropy loss. The derivations are given in Appendix D. We first rewrite h⌘ z as the division of two affine functions for both the regression (R) and the probability (P) model, hz = Jz￿Kz, where we adopt the following definitions and notation: Jz(x) = p ￿ k=1 zkD1 k(x)hk(x) + ⌘ pU1(x)hk(x), Kz(x) = D1 z(x) + ⌘U1(x), (R) Jz(x,y) = p ￿ k=1 zkDk(x,y)hk(x,y) + ⌘ pU(x,y)hk(x,y), Kz(x,y) = Dz(x,y) + ⌘U(x,y). (P) Proposition 7 (Regression model, squared loss). Let L be the squared loss. Then, for any k ∈[p], L(Dk,h⌘ z) −L(Dz,h⌘ z) = uk(z) −vk(z), where uk and vk are convex functions defined for all z by uk(z) = L￿Dk + ⌘U1Dk(⋅￿x),h⌘ z￿−2M ￿ x (D1 k + ⌘U1)(x)log Kz(x), vk(z) = L￿Dz + ⌘U1Dk(⋅￿x),h⌘ z￿−2M ￿ x (D1 k + ⌘U1)(x)log Kz(x). Proposition 8 (Probability model, cross-entropy loss). Let L be the cross-entropy loss. Then, for k ∈[p], L(Dk,h⌘ z) −L(Dz,h⌘ z) = uk(z) −vk(z), where uk and vk are convex functions defined for all z by uk(z) = −￿ x,y ￿Dk(x,y) + ⌘U(x,y)￿log Jz(x,y), vk(z) = ￿ x,y Kz(x,y)log ￿Kz(x,y) Jz(x,y) ￿−[Dk(x,y) + ⌘U(x,y)]log Kz(x,y). 4.3 DC algorithm Our DC decompositions prove that the optimization problem (4) can be cast as the following variational form of a DC-programming problem (Tao and An, 1997, 1998; Sriperumbudur and Lanckriet, 2012): min z∈∆,γ∈Rγ s.t.￿uk(z) −vk(z) ≤γ￿∧￿−zk ≤0￿∧￿∑p k=1 zk −1 = 0￿, ∀k ∈[p]. (5) 6 Figure 1: MSE sentiment analysis under mixture of two domains: (a) (left figure) dvd and electronics; (b) (right figure) kitchen and books. The DC-programming algorithm works as follows. Let (zt)t be the sequence defined by repeatedly solving the following convex optimization problem: zt+1 ∈argmin z,γ∈R γ (6) s.t. ￿uk(z) −vk(zt) −(z −zt)∇vk(zt) ≤γ￿∧￿−zk ≤0￿∧￿∑p k=1 zk −1 = 0￿, ∀k ∈[p], where z0 ∈∆is an arbitrary starting value. Then, (zt)t is guaranteed to converge to a local minimum of Problem (4) (Yuille and Rangarajan, 2003; Sriperumbudur and Lanckriet, 2012). Note that Problem (6) is a relatively simple optimization problem: uk(z) is a weighted sum of the negative logarithm of an affine function of z, plus a weighted sum of rational functions of z (squared loss), and all other terms appearing in the constraints are affine functions of z. Problem (4) seeks a parameter z verifying L(Dk,h⌘ z) −L(Dz,h⌘ z) ≤γ, for all k ∈[p] for an arbitrarily small value of γ. Since L(Dz,h⌘ z) = ∑p k=1 zkL(Dk,h⌘ z) is a weighted average of the expected losses L(Dk,h⌘ z), k ∈[p], the solution γ cannot be negative. Furthermore, by Lemma 6, a parameter z verifying that inequality exists for any γ > 0. Thus, the global solution γ of Problem (4) must be close to zero. This provides us with a simple criterion for testing the global optimality of the solution z we obtain using a DC-programming algorithm with a starting parameter z0. 5 Experiments This section reports the results of our experiments with our DC-programming algorithm for finding a robust domain generalization solution when using squared loss and cross-entropy loss. We first evaluated our algorithm using an artificial dataset assuming known densities where we could compare our result to the global solution and found that indeed our global objective approached the known optimum of zero (see Appendix E for more details). Next, we evaluated our DC-programming solution applied to real-world datasets: a sentiment analysis dataset (Blitzer et al., 2007) with the squared loss, a visual domain adaptation benchmark dataset Office (Saenko et al., 2010), as well as a generalization of digit recognition task, with the cross-entropy loss. For all real-world datasets, the probability distributions Dk are not readily available to the learner. However, Corollary 4 extends the learning guarantees of our solution to the case where an estimate ̂Dk is used in lieu of the ideal distribution Dk. Thus, we used standard density estimation methods to derive an estimate ̂Dk for each k ∈[p]. While density estimation can be a difficult task in general, for our purpose, straightforward techniques were sufficient for our predictor ̂h⌘ z to achieve a high performance, since the approximate densities only serve to indicate the relative importance of each source domain. We give full details about our density estimation procedure in Appendix E. 5.1 Sentiment analysis task with the squared loss We used the sentiment analysis dataset proposed by Blitzer et al. (2007) and used for multiple-source adaptation by Mansour et al. (2008, 2009a). This dataset consists of product review text and rating labels taken from four domains: books (B), dvd (D), electronics (E), and kitchen (K), with 2,000 samples for each domain. We defined a vocabulary of 2,500 words that occur at least twice in the intersection of the four domains. These words were used to define feature vectors, where every sample was encoded by the number of occurrences of each word. We trained our base hypotheses using support vector regression with the same hyper-parameters as in (Mansour et al., 2008, 2009a). 7 Table 1: MSE on the sentiment analysis dataset of source-only baselines for each domain, K,D, B,E, the uniform weighted predictor unif, KMM, and the distribution-weighted method DW based on the learned z. DW outperforms all competing baselines. Test Data K D B E KD BE DBE KBE KDB KDB KDBE K 1.46±0.08 2.20±0.14 2.29±0.13 1.69±0.12 1.83±0.08 1.99±0.10 2.06±0.07 1.81±0.07 1.78±0.07 1.98±0.06 1.91±0.06 D 2.12±0.08 1.78±0.08 2.12±0.08 2.10±0.07 1.95±0.07 2.11±0.07 2.00±0.06 2.11±0.06 2.00±0.06 2.01±0.06 2.03±0.06 B 2.18±0.11 2.01±0.09 1.73±0.12 2.24±0.07 2.10±0.09 1.99±0.08 1.99±0.05 2.05±0.06 2.14±0.06 1.98±0.06 2.04±0.05 E 1.69±0.09 2.31±0.12 2.40±0.11 1.50±0.06 2.00±0.09 1.95±0.07 2.07±0.06 1.86±0.04 1.84±0.06 2.14±0.06 1.98±0.05 unif 1.62±0.05 1.84±0.09 1.86±0.09 1.62±0.07 1.73±0.06 1.74±0.07 1.77±0.05 1.70±0.05 1.69±0.04 1.77±0.04 1.74±0.04 KMM 1.63±0.15 2.07±0.12 1.93±0.17 1.69±0.12 1.83±0.07 1.82±0.07 1.89±0.07 1.75±0.07 1.78±0.06 1.86±0.09 1.82±0.06 DW(ours) 1.45±0.08 1.78±0.08 1.72±0.12 1.49±0.06 1.62±0.07 1.61±0.08 1.66±0.05 1.56±0.04 1.58±0.05 1.65±0.04 1.61±0.04 Table 2: Digit dataset statistics. SVHN MNIST USPS # train images 73,257 60,000 7,291 # test images 26,032 10,000 2,007 image size 32x32 28x28 16x16 color rgb gray gray Table 3: Digit dataset accuracy. Test Data svhn mnist usps mu su sm smu mean CNN-s 92.3 66.9 65.6 66.7 90.4 85.2 84.2 78.8 CNN-m 15.7 99.2 79.7 96.0 20.3 38.9 41.0 55.8 CNN-u 16.7 62.3 96.6 68.1 22.5 29.4 32.9 46.9 CNN-unif 75.7 91.3 92.2 91.4 76.9 80.0 80.7 84.0 DW (ours) 91.4 98.8 95.6 98.3 91.7 93.5 93.6 94.7 CNN-joint 90.9 99.1 96.0 98.6 91.3 93.2 93.3 94.6 We compared our method (DW) against each source hypothesis, hk. We also computed a privileged baseline using the oracle λ mixing parameter, λ-comb: ∑p k=1 λkhk. λ-comb is of course not accessible in practice since the target mixture λ is not known to the user. We also compared against a previously proposed domain adaptation algorithm (Huang et al., 2006) known as KMM. It is important to note that the KMM model requires access to the unlabeled target data during adaptation and learns a new predictor for every target domain, while DW does not use any target data. Thus KMM operates in a favorable learning setting when compared to our solution. We first considered the same test scenario as in (Mansour et al., 2008), where the target is a mixture of two source domains. The plots of Figures 1a and 1b report the results of our experiments. They show that our distribution-weighted predictor DW outperforms all baseline predictors despite the privileged learning scenarios of λ-comb and KMM. We also compared our results with the weighted predictor used in the empirical studies by Mansour et al. (2008), which is not a realistic solution since it is using the unknown target mixture λ as z to compute hz. Nevertheless, we observed that the performance of this ”cheating” solution almost always coincides with that of our DW algorithm and thus did not include it in our plots and tables to avoid confusion. Next, we compared the performance of DW with accessible baseline predictors on various target mixtures. Since λ is not known in practice, we replaced λ-comb with the uniform combination of all hypotheses (unif), ∑p k=1 hk￿p. Table 1 reports the mean and standard deviations of MSE over 10 repetitions. Each column corresponds to a different target test data source. Our distribution-weighted method DW outperforms all baseline predictors across all test domains. Observe that, even when the target is a single source domain, our method successfully outperforms the predictor which is trained and tested on the same domain. Results on more target mixtures are available in Appendix E. 5.2 Recognition tasks with the cross-entropy loss We considered two real-world domain adaptation tasks: a generalization of a digit recognition task and a standard visual adaptation Office dataset. For each individual domain, we trained a convolutional neural network (CNN) and used the output from the softmax score layer as our base predictors hk. We computed the uniformly weighted combination of source predictors, hunif = ∑p k=1 hk￿p. As a privileged baseline, we also trained a model on all source data combined, hjoint. Note, this approach is often not feasible if independent entities contribute classifiers and densities, but not full training datasets. Thus this approach is not consistent with our scenario, and it operates in a much more favorable learning setting than our solution. Finally, our distribution weighted predictor DW was computed with hks, density estimates, and our learned weighting, z. Our baselines then consists of the classifiers from hk, hunif, hjoint, and DW. 8 Table 4: Office dataset accuracy: We report accuracy across six possible test domains. We show performance all baselines: CNN-a,w,d, CNN-unif, DW based on the learned z, and the jointly trained model CNN-joint. DW outperforms all competing models. Test Data amazon webcam dslr aw ad wd awd mean CNN-a 75.7 ± 0.3 53.8 ± 0.7 53.4 ± 1.3 71.4 ± 0.3 73.5 ± 0.2 53.6 ± 0.8 69.9 ± 0.3 64.5 ± 0.6 CNN-w 45.3 ± 0.5 91.1 ± 0.8 91.7 ± 1.2 54.4 ± 0.5 50.0 ± 0.5 91.3 ± 0.8 57.5 ± 0.4 68.8 ± 0.7 CNN-d 50.4 ± 0.4 89.6 ± 0.9 90.9 ± 0.8 58.3 ± 0.4 54.6 ± 0.4 90.0 ± 0.7 61.0 ± 0.4 70.7 ± 0.6 CNN-unif 69.7 ± 0.3 93.1 ± 0.6 93.2 ± 0.9 74.4 ± 0.4 72.1 ± 0.3 93.1 ± 0.5 75.9 ± 0.3 81.6 ± 0.5 DW (ours) 75.2 ± 0.4 93.7 ± 0.6 94.0 ± 1.0 78.9 ± 0.4 77.2 ± 0.4 93.8 ± 0.6 80.2 ± 0.3 84.7 ± 0.5 CNN-joint 72.1 ± 0.3 93.7 ± 0.5 93.7 ± 0.5 76.4 ± 0.4 76.4 ± 0.4 93.7 ± 0.5 79.3 ± 0.4 83.6 ± 0.4 We began our study with a generalization of digit recognition task, which consists of three digit recognition datasets: Google Street View House Numbers (SVHN), MNIST, and USPS. Dataset statistics as well as example images can be found in Table 2. We trained the ConvNet (or CNN) architecture following Taigman et al. (2017) as our source models and joint model. We used the second fully-connected layer’s output as our features for density estimation, and the output from the softmax score layer as our predictors. We used the full training sets per domain to learn the source model and densities. Note, these steps are completely isolated from one another and may be performed by unique entities and in parallel. Finally, for our DC-programming algorithm we used a small subset of 200 real image-label pairs from each domain to learn the parameter z. Our next experiment used the standard visual adaptation Office dataset, which has 3 domains: amazon, webcam, and dslr. The dataset contains 31 recognition categories of objects commonly found in an office environment. There are 4,110 images total with 2,817 from amazon, 795 from webcam, and 498 from dslr. We followed the standard protocol from Saenko et al. (2010), whereby 20 labeled examples are available for training from the amazon domain and 8 labeled examples are available from both the webcam and dslr domains. The remaining examples from each domain are used for testing. We used the AlexNet Krizhevsky et al. (2012) ConvNet (CNN) architecture, and used the output from the softmax score layer as our base predictors, pre-trained on ImageNet and used fc7 activations as our features for density estimation Donahue et al. (2014). We report the performance of our algorithm and that of baselines on the digit recognition dataset in Table 3, and report the performance on the Office dataset in Table 4. On both datasets, we evaluated on various test distributions: each individual domain, the combination of each two domains and the fully combined set. When the test distribution equals one of the source distributions, our distributionweighted classifier successfully outperforms (webcam,dslr) or maintains the performance of the classifier which is trained and tested on the same domain. For the more realistic scenario where the target domain is a mixture of any two or all three source domains, the performance of our method is comparable or marginally superior to that of the jointly trained network, despite the fact that we do not retrain any network parameters in our method and that we only use a small number of per-domain examples to learn the distribution weights – an optimization which may be solved on a single CPU in a matter of seconds for this problem. This again demonstrates the robustness of our distribution-weighted combined classifier to a varying target domain. 6 Conclusion We presented practically applicable multiple-source domain adaptation algorithms for the squared loss and the cross-entropy loss. Our algorithms benefit from a series of very favorable theoretical guarantees. Our results further demonstrate empirically their effectiveness and their importance in adaptation problems in practice. Acknowledgments We thank Cyril Allauzen for comments on a previous draft of this paper. This work was partly funded by NSF CCF-1535987 and NSF IIS-1618662. 9 References C. Arndt. Information Measures: Information and its Description in Science and Engineering. Signals and Communication Technology. Springer Verlag, 2004. S. Ben-David, J. Blitzer, K. Crammer, and F. Pereira. Analysis of representations for domain adaptation. In NIPS, pages 137–144, 2006. G. Blanchard, G. Lee, and C. Scott. Generalizing from several related classification tasks to a new unlabeled sample. In NIPS, pages 2178–2186, 2011. J. Blitzer, M. Dredze, and F. Pereira. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In ACL, pages 440–447, 2007. C. Cortes and M. Mohri. Domain adaptation and sample bias correction theory and algorithm for regression. Theor. Comput. Sci., 519:103–126, 2014. C. Cortes, M. Mohri, and A. Muñoz Medina. Adaptation algorithm and theory based on generalized discrepancy. In KDD, pages 169–178, 2015. T. M. Cover and J. M. Thomas. Elements of Information Theory. Wiley-Interscience, 2006. K. Crammer, M. J. Kearns, and J. Wortman. Learning from multiple sources. Journal of Machine Learning Research, 9(Aug):1757–1774, 2008. J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, volume 32, pages 647–655, 2014. M. Dredze, K. Crammer, and F. Pereira. Confidence-weighted linear classification. In ICML, volume 307, pages 264–271, 2008. L. Duan, I. W. Tsang, D. Xu, and T. Chua. Domain adaptation from multiple sources via auxiliary classifiers. In ICML, volume 382, pages 289–296, 2009. L. Duan, D. Xu, and I. W. Tsang. Domain adaptation from multiple sources: A domain-dependent regularization approach. IEEE Transactions on Neural Networks and Learning Systems, 23(3): 504–518, 2012. Y. Ganin and V. S. Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, volume 37, pages 1180–1189, 2015. R. B. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, pages 580–587, 2014. B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. In CVPR, pages 2066–2073, 2012. B. Gong, K. Grauman, and F. Sha. Connecting the dots with landmarks: Discriminatively learning domain-invariant features for unsupervised domain adaptation. In ICML, volume 28, pages 222–230, 2013a. B. Gong, K. Grauman, and F. Sha. Reshaping visual datasets for domain adaptation. In NIPS, pages 1286–1294, 2013b. J. Hoffman, B. Kulis, T. Darrell, and K. Saenko. Discovering latent domains for multisource domain adaptation. In ECCV, volume 7573, pages 702–715, 2012. J. Hoffman, E. Rodner, J. Donahue, K. Saenko, and T. Darrell. Efficient learning of domain-invariant image representations. In ICLR, 2013. J. Huang, A. J. Smola, A. Gretton, K. M. Borgwardt, and B. Schölkopf. Correcting sample selection bias by unlabeled data. In NIPS, pages 601–608, 2006. A. Khosla, T. Zhou, T. Malisiewicz, A. A. Efros, and A. Torralba. Undoing the damage of dataset bias. In ECCV, volume 7572, pages 158–171, 2012. 10 A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1106–1114, 2012. H. Liao. Speaker adaptation of context dependent deep neural networks. In ICASSP, pages 7947–7951, 2013. M. Long, Y. Cao, J. Wang, and M. I. Jordan. Learning transferable features with deep adaptation networks. In ICML, volume 37, pages 97–105, 2015. Y. Mansour, M. Mohri, and A. Rostamizadeh. Domain adaptation with multiple sources. In NIPS, pages 1041–1048, 2008. Y. Mansour, M. Mohri, and A. Rostamizadeh. Multiple source adaptation and the Rényi divergence. In UAI, pages 367–374, 2009a. Y. Mansour, M. Mohri, and A. Rostamizadeh. Domain adaptation: Learning bounds and algorithms. In COLT, 2009b. K. Muandet, D. Balduzzi, and B. Schölkopf. Domain generalization via invariant feature representation. In ICML, volume 28, pages 10–18, 2013. S. J. Pan and Q. Yang. A survey on transfer learning. IEEE Trans. Knowl. Data Eng., 22(10): 1345–1359, 2010. Z. Pei, Z. Cao, M. Long, and J. Wang. Multi-adversarial domain adaptation. In AAAI, pages 3934–3941, 2018. A. Rényi. On measures of entropy and information. In Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, pages 547–561, 1961. B. Roark, R. Sproat, C. Allauzen, M. Riley, J. Sorensen, and T. Tai. The opengrm open-source finite-state grammar software libraries. In ACL (System Demonstrations), pages 61–66, 2012. K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In ECCV, volume 6314, pages 213–226, 2010. B. K. Sriperumbudur and G. R. G. Lanckriet. A proof of convergence of the concave-convex procedure using Zangwill’s theory. Neural Computation, 24(6):1391–1407, 2012. Y. Taigman, A. Polyak, and L. Wolf. Unsupervised cross-domain image generation. In ICLR, 2017. P. D. Tao and L. T. H. An. Convex analysis approach to DC programming: theory, algorithms and applications. Acta Mathematica Vietnamica, 22(1):289–355, 1997. P. D. Tao and L. T. H. An. A DC optimization algorithm for solving the trust-region subproblem. SIAM Journal on Optimization, 8(2):476–505, 1998. A. Torralba and A. A. Efros. Unbiased look at dataset bias. In CVPR, pages 1521–1528, 2011. E. Tzeng, J. Hoffman, T. Darrell, and K. Saenko. Simultaneous deep transfer across domains and tasks. In ICCV, pages 4068–4076, 2015. Z. Xu, W. Li, L. Niu, and D. Xu. Exploiting low-rank structure from latent domains for domain generalization. In ECCV, volume 8691, pages 628–643, 2014. J. Yang, R. Yan, and A. G. Hauptmann. Cross-domain video concept detection using adaptive svms. In ACM Multimedia, pages 188–197, 2007. A. L. Yuille and A. Rangarajan. The concave-convex procedure. Neural Computation, 15(4):915–936, 2003. K. Zhang, M. Gong, and B. Schölkopf. Multi-source domain adaptation: A causal view. In AAAI, pages 3150–3157, 2015. 11
2018
203
7,368
On preserving non-discrimination when combining expert advice Avrim Blum TTI-Chicago avrim@ttic.edu Suriya Gunasekar TTI-Chicago suriya@ttic.edu Thodoris Lykouris Cornell University teddlyk@cs.cornell.edu Nathan Srebro TTI-Chicago nati@ttic.edu Abstract We study the interplay between sequential decision making and avoiding discrimination against protected groups, when examples arrive online and do not follow distributional assumptions. We consider the most basic extension of classical online learning: Given a class of predictors that are individually non-discriminatory with respect to a particular metric, how can we combine them to perform as well as the best predictor, while preserving non-discrimination? Surprisingly we show that this task is unachievable for the prevalent notion of equalized odds that requires equal false negative rates and equal false positive rates across groups. On the positive side, for another notion of non-discrimination, equalized error rates, we show that running separate instances of the classical multiplicative weights algorithm for each group achieves this guarantee. Interestingly, even for this notion, we show that algorithms with stronger performance guarantees than multiplicative weights cannot preserve non-discrimination. 1 Introduction The emergence of machine learning in the last decade has given rise to an important debate regarding the ethical and societal responsibility of its offspring. Machine learning has provided a universal toolbox enhancing the decision making in many disciplines from advertising and recommender systems to education and criminal justice. Unfortunately, both the data and their processing can be biased against specific population groups (even inadvertently) in every single step of the process [4]. This has generated societal and policy interest in understanding the sources of this discrimination and interdisciplinary research has attempted to mitigate its shortcomings. Discrimination is commonly an issue in applications where decisions need to be made sequentially. The most prominent such application is online advertising where platforms need to sequentially select which ad to display in response to particular query searches. This process can introduce discrimination against protected groups in many ways such as filtering particular alternatives [12, 2] and reinforcing existing stereotypes through search results [38, 25]. Another canonical example of sequential decision making is medical trials where underexploration on female groups often leads to significantly worse treatments for them [31]. Similar issues occur in image classification as stressed by “gender shades” [7]. The reverse (overexploration in minority populations) can also cause concerns especially if conducted in a non-transparent fashion [5]. In these sequential settings, the assumption that data are i.i.d. is often violated. Online advertising, recommender systems, medical trials, image classification, loan decisions, criminal recidivism all require decisions to be made sequentially. The corresponding labels are not identical across time and can be affected by the economy, recent events, etc. Similarly labels are also not independent across rounds – if a bank offers a loan then this decision can affect whether the loanee or their environment will be able to repay future loans thereby affecting future labels as discussed by Liu et al. [32]. As a result, it is important to understand the effect of this adaptivity on non-discrimination. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. The classical way to model settings that are not i.i.d. is via adversarial online learning [30, 17], which poses the question: Given a class F of predictors, how can we make online predictions that perform as well as the best predictor from F in hindsight? The most basic online learning question (answered via the celebrated “multiplicative weights” algorithm) concerns competing with a finite set of predictors. The class F is typically referred to as “experts” and can be thought as “features” of the example where we want to make online predictions that compete with the best 1-sparse predictor. In this work, we wish to understand the interplay between adaptivity and non-discrimination and therefore consider the most basic extension of the classical online learning question: Given a class of individually non-discriminatory predictors, how can we combine them to perform as well as the best predictor, while preserving non-discrimination? The assumption that predictors are individually non-discriminatory is a strong assumption on the predictors and makes the task trivial in the batch setting where the algorithm is given labeled examples and wishes to perform well on unseen examples drawn from the same distribution. This happens because the algorithm can learn the best predictor from the labeled examples and then follow it (since this predictor is individually non-discriminatory, the algorithm does not exhibit discrimination). This enables us to understand the potential overhead that adaptivity is causing and significantly strengthens any impossibility result. Moreover, we can assume that predictors have been individually vetted to satisfy the non-discrimination desiderata – we therefore wish to understand how to efficiently compose these non-discriminatory predictors while preserving non-discrimination. 1.1 Our contribution Our impossibility results for equalized odds. Surprisingly, we show that for a prevalent notion of non-discrimination, equalized odds, it is impossible to preserve non-discrimination while also competing comparably to the best predictor in hindsight (no-regret property). Equalized odds, suggested by Hardt et al. [20] in the batch setting, restricts the set of allowed predictors requiring that, when examples come from different groups, the prediction is independent to the group conditioned on the label. In binary classification, this means that the false negative rate (fraction of positive examples predicted negative) is equal across groups and the same holds for the false positive rate (defined analogously). This notion was popularized by a recent debate on potential bias of machine learning risk tools for criminal recividism [1, 10, 28, 16]. Our impossibility results demonstrate that the order in which examples arrive significantly complicates the task of achieving desired efficiency while preserving non-discrimination with respect to equalized odds. In particular, we show that any algorithm agnostic to the group identity either cannot achieve performance comparable to the best predictor or exhibits discrimination in some instances (Theorem 1). This occurs in phenomenally simple settings with only two individually non-discriminatory predictors, two groups, and perfectly balanced instances: groups are of equal size and each receives equal number of positive and negative labels. The only imbalance exists in the order in which the labels arrive which is also relatively well behaved – labels are generated from two i.i.d. distributions, one in the first half of the instance and one in the second half. Although in many settings we cannot actively use the group identity of the examples due to legal reasons (e.g., in hiring), one may wonder whether these impossibility results disappear if we can actively use the group information to compensate for past mistakes. We show that this is also not the case (Theorem 2). Although our groups are not perfectly balanced, the construction is again very simple and consists only of two groups and two predictors: one always predicting positive and one always predicting negative. The simplicity of the settings, combined with the very strong assumption on the predictors being individually non-discriminatory speaks to the trade-off between adaptivity and non-discrimination with respect to equalized odds. Our results for equalized error rates. The strong impossibility results with respect to equalized odds invite the natural question of whether there exists some alternative fairness notion that, given access to non-discriminatory predictors, achieves efficiency while preserving non-discrimination. We answer the above positively by suggesting the notion of equalized error rates, which requires that the average expected loss (regardless whether it stems from false positives or false negatives) encountered by each group should be the same. This notion makes sense in settings where performance and fairness are measured with respect to the same objective. Consider a medical application where people 2 from different subpopulations wish to receive appropriate treatment and any error in treatment costs equally both towards performance and towards fairness.1 It is morally objectionable to discriminate against one group, e.g. based on race, using it as experimentation to enhance the quality of service of the other, and it is reasonable to require that all subpopulations receive same quality of service. For this notion, we show that, if all predictors are individually non-discriminatory with respect to equalized error rates, running separate multiplicative weights algorithms, one for each subpopulation, preserves this non-discrimination without decay in the efficiency (Theorem 3). The key property we use is that the multiplicative weights algorithm guarantees to perform not only no worse than the best predictor in hindsight but also no better; this property holds for a broader class of algorithms [14]. Our result applies to general loss functions beyond binary predictions and only requires predictors to satisfy the weakened assumption of being approximately non-discriminatory. Finally, we examine whether the decisions of running separate algorithms and running this particular not so efficient algorithm were important for the result. We first give evidence that running separate algorithms is essential for the result; if we run a single instance of “multiplicative weights” or “follow the perturbed leader”, we cannot guarantee non-discrimination with respect to equalized error rates (Theorem 4). We then suggest that the property of not performing better than the best predictor is also crucial; in particular, better algorithms that satisfy the stronger guarantee of low shifting regret [21, 6, 34] are also not able to guarantee this non-discrimination (Theorem 5). These algorithms are considered superior to classical no-regret algorithms as they can better adapt to changes in the environment, which has nice implications in game-theoretic settings [35]. Our latter impossibility result is a first application where having these strong guarantees against changing benchmarks is not necessarily desired and therefore is of independent learning-theoretic interest. 1.2 Related work There is a large line of work on fairness and non-discrimination in machine learning (see [36, 8, 13, 41, 22, 20, 10, 28, 26] for a non-exhaustive list). We elaborate on works that either study group notions of fairness or fairness in online learning. The last decade has seen a lot of work on group notions of fairness, mostly in classification setting. Examples include notions that compare the percentage of members predicted positive such as demographic parity [8], disparate impact [15], equalized odds [20] and calibration across groups [10, 28]. There is no consensus on a universal fairness notion; rather the specific notion considered is largely task-specific. In fact, previous works identified that these notions are often not compatible to each other [10, 28], posed concerns that they may introduce unintentional discrimination [11], and suggested the need to go beyond such observational criteria via causal reasoning [27, 29]. Prior to our work, group fairness notions have been studied primarily in the batch learning setting with the goal of optimizing a loss function subject to a fairness constraint either in a post-hoc correction framework as proposed by Hardt et al. [20] or more directly during training from batch data [41, 19, 39, 40, 3] which requires care due to the predictors being discriminatory with respect to the particular metric of interest. The setting we focus on in this paper does not have the challenges of the above since all predictors are non-discriminatory; however, we obtain surprising impossibility results due to the ordering in which labels arrive. Recently fairness in online learning has also started receiving attention. One line of work focuses on imposing a particular fairness guarantee at all times for bandits and contextual bandits, either for individual fairness [22, 23] or for group fairness [9]. Another line of work points to counterintuitive externalities of using contextual bandit algorithms agnostic to the group identity and suggest that heterogeneity in data can replace the need for exploration [37, 24]. Moreover, following a seminal paper by Dwork et al. [13], a line of work aims to treat similar people similarly in online settings [33, 18]. Our work distinguishes itself from these directions mainly in the objective, since we require the non-discrimination to happen in the long-term instead of at any time; this extends the classical batch definitions of non-discrimination in the online setting. In particular, we only focus on situations where there are enough samples from each population of interest and we do not penalize the algorithm for a few wrong decisions, leading it to be overly pessimistic. Another difference is that previous work focuses either on individual notions of fairness or on i.i.d. inputs, while our work is about non-i.i.d. inputs in group notions of fairness. 1In contrast, in equalized odds, a misprediction only costs to the false negative metric if the label is positive. 3 2 Model Online learning protocol with group context. We consider the classical online learning setting of prediction with expert advice, where a learner needs to make sequential decisions for T rounds by combining the predictions of a finite set F of d hypotheses (also referred to as experts). We denote the outcome space by Y; in binary classification, this corresponds to Y = {+, −}. Additionally, we introduce a set of disjoint groups by G which identifies subsets of the population based on a protected attribute (such as gender, ethnicity, or income). The online learning protocol with group context proceeds in T rounds. Each round t is associated with a group context g(t) ∈G and an outcome y(t) ∈Y. We denote the resulting T-length timegroup-outcome sequence tuple by σ = {(t, g(t), y(t)) ∈N × G × Y}T t=1. This is a random variable that can depend on the randomness in the generation of the groups and the outcomes. We use the shorthand σ1:τ = {(t, g(t), y(t)) ∈N × G × Y}τ t=1 to denote the subsequence until round τ. The exact protocol for generating these sequences is described below. At round t = 1, 2, . . . , T: 1. An example with group context g(t) ∈G arrives stochastically or is adversarially selected. 2. The learning algorithm or learner L commits to a probability distribution pt ∈∆(d) across experts where pt f denotes the probability that she follows the advice of expert f ∈F at round t. This distribution pt can be a function of the sequence σ1:t−1. We call the learner group-unaware if she ignores the group context g(τ) for all τ ≤t when selecting pt. 3. An adversary A then selects an outcome y(t) ∈Y. The adversary is called adaptive if the groups/outcomes at round t = τ + 1 are a function of the realization of σ1:τ; otherwise she is called oblivious. The adversary always has access to the learning algorithm, but an adaptive adversary additionally has access to the realized σ1:t−1 and hence also knows pt. Simultaneously, each expert f ∈F makes a prediction ˆyt f ∈ˆY, where ˆY is a generic prediction space; for example, in binary classification, the prediction space could simply be the positive or negative labels: ˆY = {+, −}, or the probabilistic score: ˆY = [0, 1] with ˆyt f interpreted as the probability the expert f ∈F assigns to the positive label in round t, or even an uncalibrated score like the output of a support vector machine: ˆY = R. Let ℓ: ˆY × Y →[0, 1] be the loss function between predictions and outcomes. This leads to a corresponding loss vector ℓt ∈[0, 1]d where ℓt f = ℓ  ˆyt f, y(t)  denotes the loss the learner incurs if she follows expert f ∈F. 4. The learner then observes the entire loss vector ℓt (full information feedback) and incurs expected loss P f∈F pt fℓt f. For classification, this feedback is obtained by observing y(t). In this paper, we consider a setting where all the experts f ∈F are fair in isolation (formalized below). Regarding the group contexts, our main impossibility results (Theorems 1 and 2) assume that the group contexts g(t) arrive stochastically from a fixed distribution, while our positive result (Theorem 3) holds even when they are adversarially selected. For simplicity of notation, we assume throughout the presentation that the learner’s algorithm is producing the distribution pt of round t = τ + 1 deterministically based on σ1:τ and therefore all our expectations are taken only over σ which is the case in most algorithms. Our results extend when the algorithm uses extra randomness to select the distribution. Group fairness in online learning. We now define non-discrimination (or fairness) with respect to a particular evaluation metric M, e.g. in classification, the false negative rate metric (FNR) is the fraction of examples with positive outcome predicted negative incorrectly. For any realization of the time-group-outcome sequence σ and any group g ∈G, metric M induces a subset of the population Sσ g (M) that is relevant to it. For example, in classification, Sσ g (FNR) = {t : g(t) = g, y(t) = +} is the set of positive examples of group g. The performance of expert f ∈F on the subpopulation Sσ g (M) is denoted by Mσ f(g) = 1 |Sσ g (M)| P t∈Sσ g (M) ℓt f. Definition 1. An expert f ∈F is called fair in isolation with respect to metric M if, for every sequence σ, her performance with respect to M is the same across groups, i.e. Mσ f(g) = Mσ f(g′) for all g, g′ ∈G. 4 The learner’s performance on this subpopulation is Mσ L(g) = 1 |Sσ g (M)| P t∈Sσ g (M) P f∈F pt fℓt f. To formalize our non-discrimination desiderata, we require the algorithm to have similar expected performance across groups, when given access to fair in isolation predictors. We make the following assumptions to avoid trivial impossibility results due to low-probability events or underrepresented populations. First, we take expectation over sequences generated by the adversary A (that has access to the learning algorithm L). Second, we require the relevant subpopulations to be, in expectation, large enough. Our positive results do not depend on either of these assumptions. More formally: Definition 2. Consider a set of experts F such that each expert is fair in isolation with respect to metric M. Learner L is called α-fair in composition with respect to metric M if, for all adversaries that produce Eσ[min(|Sσ g (M)|, |Sσ g′(M)|)] = Ω(T) for all g, g′, it holds that: |Eσ[Mσ L(g)] −Eσ[Mσ L(g′)]| ≤α. We note that, in many settings, we wish to have non-discrimination with respect to multiple metrics simultaneously. For instance, equalized odds requires fairness in composition both with respect to false negative rate and with respect to false positive rate (defined analogously). Since we provide an impossibility result for equalized odds, focusing on only one metric makes the result even stronger. Regret notions. The typical way to evaluate the performance of an algorithm in online learning is via the notion of regret. Regret is comparing the performance of the algorithm to the performance of the best expert in hindsight on the realized sequence σ as defined below: RegT = T X t=1 X f∈F pt fℓt f −min f ⋆∈F T X t=1 ℓt f ⋆. In the above definition, regret is a random variable depending on the sequence σ; therefore depending on the randomness in groups/outcomes. An algorithm satisfies the no-regret property (or Hannan consistency) in our setting if for any losses realizable by the above protocol, the regret is sublinear in the time horizon T, i.e. RegT = o(T). This property ensures that, as time goes by, the average regret vanishes. Many online learning algorithms, such as multiplicative weights updates satisfy this property with RegT = O( p T log(d)). We focus on the notion of approximate regret, which is a relaxation of regret that gives a small multiplicative slack to the algorithm. More formally, ϵ-approximate regret with respect to expert f ⋆∈F is defined as: ApxRegϵ,T (f ⋆) = T X t=1 X f∈F pt fℓt f −(1 + ϵ) T X t=1 ℓt f ⋆. We note that typical algorithms guarantee ApxRegϵ,T (f ⋆) = O(ln(d)/ϵ) simultaneously for all experts f ⋆∈F. When the time-horizon is known in advance, by setting ϵ = p ln(d)/T, such a bound implies the aforementioned regret guarantee. In the case when the time horizon is not known, one can also obtain a similar guarantee by adjusting the learning rate of the algorithm appropriately. Our goal is to develop online learning algorithms that combine fair in isolation experts in order to achieve both vanishing average expected ϵ-approximate regret, i.e. for any fixed ϵ > 0 and f ⋆∈F, Eσ[ApxRegϵ,T (f ⋆)] = o(T), and also non-discrimination with respect to fairness metrics of interest. 3 Impossibility results for equalized odds In this section, we study a popular group fairness notion, equalized odds, in the context of online learning. A natural extension of equalized odds for online settings would require that the false negative rate, i.e. percentage of positive examples predicted incorrectly, is the same across all groups and the same also holds for the false positive rate. We assume that our experts are fair in isolation with respect to both false negative as well as false positive rate. A weaker notion of equalized odds is equality of opportunity where the non-discrimination condition is required to be satisfied only for the false negative rate. We first study whether it is possible to achieve the vanishing regret property 5 while guaranteeing α-fairness in composition with respect to false negative rate for arbitrarily small α. When the input is i.i.d., this is trivial as we can learn the best expert in O(log d) rounds and then follow its advice; since the expert is fair in isolation, this will guarantee vanishing non-discrimination. In contrast, we show that, in a non-i.i.d. online setting, this goal is unachievable. We demonstrate this in phenomenally benign settings where there are just two groups G = {A, B} that come from a fixed distribution and just two experts that are fair in isolation (with respect to false negative rate) even per round – not only ex post. Our first construction (Theorem 1) shows that any no-regret learning algorithm that is group-unaware cannot guarantee fairness in composition, even in instances that are perfectly balanced (each pair of label and group gets 1/4 of the examples) – the only adversarial component is the order in which these examples arrive. This is surprising because such a task is straightforward in the stochastic setting as all hypotheses are non-discriminatory. We then study whether actively using the group identity can correct the aforementioned similarly to how it enables correction against discriminatory predictors [20]. The answer is negative even in this scenario (Theorem 2): if the population is sufficiently not balanced, any no-regret learning algorithm will be unfair in composition with respect to false negative rate even if they are not group-unaware. Group-unaware algorithms. We first present the impossibility result for group-unaware algorithms. In our construction, the adversary is oblivious, there is perfect balance in groups (half of the population corresponds to each group), and perfect balance within group (half of the labels of each group are positive and half negative). Theorem 1. For all α < 3/8, there exists ϵ > 0 such that any group-unaware algorithm that satisfies Eσ  ApxRegϵ,T (f)  = o(T) for all f ∈F is α-unfair in composition with respect to false negative rate even for perfectly balanced sequences. Proof sketch. Consider an instance that consists of two groups G = {A, B}, two experts F = {hn, hu}, and two phases: Phase I and Phase II. Group A is the group we end up discriminating against while group B is boosted by the discrimination with respect to false negative rate. At each round t the groups arrive stochastically with probability 1/2 each, independent of σ1:t−1. The experts output a score value in ˆY = [0, 1], where score ˆyt f ∈ˆY can be interpreted as the probability that expert f assigns to label being positive in round t, i.e. y(t) = +. The loss function is the expected probability of error given by ℓ(ˆy, y) = ˆy · 1{y = −} + (1 −ˆy) · 1{y = +}. The two experts are very simple: hn always predicts negative, i.e. ˆyt hn = 0 for all t, and hu is an unbiased expert who, irrespective of the group or the label, makes an inaccurate prediction with probability β = 1/4 + √ϵ, i.e. ˆyt hu = β · 1{y(t) = −} + (1 −β) · 1{y(t) = +} for all t. Both experts are fair in isolation with respect to both false negative and false positive rates: FNR is 100% for hn and β for hu regardless the group, and FPR is 0% for hn and β for hu, again independent of the group. The instance proceeds in two phases: 1. Phase I lasts for T/2 rounds. The adversary assigns negative labels on examples with group context B and assigns a label uniformly at random to examples from group A. 2. In Phase II, there are two plausible worlds: (a) if the expected probability the algorithm assigns to expert hu in Phase I is at least Eσ hPT/2 t=1 pt hu i > √ϵ · T then the adversary assigns negative labels for both groups (b) else the adversary assigns positive labels to examples with group context B while examples from group A keep receiving positive and negative labels with probability equal to half. We will show that for any algorithm with vanishing approximate regret property, i.e. with ApxRegϵ,T (f) = o(T), the condition for the first world is never triggered and hence the above sequence is indeed balanced. We now show why this instance is unfair in composition with respect to false negative rate. The proof involves showing the following two claims, whose proofs we defer to the supplementary material. 1. In Phase I, any ϵ-approximate regret algorithm needs to select the negative expert hn most of the times to ensure small approximate regret with respect to hn. This means that, in Phase 6 I (where we encounter half of the positive examples from group A and none from group B), the false negative rate of the algorithm is close to 1. 2. In Phase II, any ϵ-approximate regret algorithm should quickly catch up to ensure small approximate regret with respect to hu and hence the false negative rate of the algorithm is closer to β. Since the algorithm is group-unaware, this creates a mismatch between the false negative rate of B (that only receives false negatives in this phase) and A (that has also received many false negatives before). Group-aware algorithms. We now turn our attention to group-aware algorithms, that can use the group context of the example to select the probability of each expert and provide a similar impossibility result. There are three changes compared to the impossibility result we provided for group-unaware algorithms. First, the adversary is not oblivious but instead is adaptive. Second, we do not have perfect balance across populations but instead require that the minority population arrives with probability b < 0.49, while the majority population arrives with probability 1 −b. Third, the labels are not equally distributed across positive and negative for each population but instead positive labels for one group are at least a c percentage of the total examples of the group for a small c > 0. Although the upper bounds on b and c are not optimized, our impossibility result cannot extend to b = c = 1/2. Understanding whether one can achieve fairness in composition for some values of b and c is an interesting open question. Our impossibility guarantee is the following: Theorem 2. For any group imbalance b < 0.49 and 0 < α < 0.49−0.99b 1−b , there exists ϵ0 > 0 such that for all 0 < ϵ < ϵ0 any algorithm that satisfies Eσ  ApxRegϵ,T (f)  = o(T) for all f ∈F, is α-unfair in composition. Proof sketch. The instance has two groups: G = {A, B}. Examples with group context A are discriminated against and arrive randomly with probability b < 1/2 while examples with group context B are boosted by the discrimination and arrive with the remaining probability 1 −b. There are again two experts F = {hn, hp}, which output score values in ˆY = [0, 1], where ˆyt f can be interpreted as the probability that expert f assigns to label being + in round t. We use the earlier loss function of ℓ(ˆy, y) = ˆy · 1{y = −} + (1 −ˆy) · 1{y = +}. The first expert hn is again pessimistic and always predicts negative, i.e. ˆyt hn = 0, while the other expert hp is optimistic and always predicts positive, i.e. ˆyt hp = 1. These satisfy fairness in isolation with respect to equalized odds (false negative rate and false positive rate). Let c = 1/1012 denote the percentage of the input that is about positive examples for A, ensuring that |Sσ g (FNR)| = Ω(T). The instance proceeds in two phases. 1. Phase I lasts Θ · T rounds for Θ = 101c. The adversary assigns negative labels on examples with group context B. For examples with group context A, the adversary acts as following: • if the algorithm assigns probability on the negative expert below γ(ϵ) = 99−2ϵ 100 , i.e. pt hn(σ1:t−1) < γ(ϵ), then the adversary assigns negative label. • otherwise, the adversary assigns positive labels. 2. In Phase II, there are two plausible worlds: (a) the adversary assigns negative labels to both groups if the expected number of times that the algorithm selected the negative expert with probability higher than γ(ϵ) on members of group A is less than c·b·T, i.e. Eσ  1  t ≤Θ · T : g(t) = A, pt hn ≥γ(ϵ)  < c·b·T. (b) otherwise she assigns positive labels to examples with group context B and negative labels to examples with group context A. Note that, as before, the condition for the first world will never be triggered by any no-regret learning algorithm (we elaborate on that below) which ensures that Eσ |Sσ A(FNR)| ≥c·b·T. The proof is based on the following claims, whose proofs are deferred to the supplementary material. 1. In Phase I, any vanishing approximate regret algorithm enters the second world of Phase II. 2. This implies a lower bound on the false negative rate on A, i.e. FNR(A) ≥γ(ϵ) = 99−2ϵ 100 . 3. In Phase II, any ϵ-approximate regret algorithm assigns large enough probability to expert hp for group B, implying an upper bound on the false negative rate on B, i.e. FNR(B) ≤ 1/2(1−b). Therefore this provides a gap in the false negative rates of at least α. 7 4 Fairness in composition with respect to an alternative metric The negative results of the previous section give rise to a natural question of whether fairness in composition can be achieved for some other fairness metric in an online setting. We answer this question positively by suggesting the equalized error rates metric EER which captures the average loss over the total number of examples (independent of whether this loss comes from false negative or false positive examples). The relevant subset induced by this metric Sσ g (EER) is the set of all examples coming from group g ∈G. We again assume that experts are fair in isolation with respect to equalized error rate and show that a simple scheme where we run separately one instance of multiplicative weights for each group achieves fairness in composition (Theorem 3). The result holds for general loss functions (beyond pure classification) and is robust to the experts only being approximately fair in isolation. A crucial property we use is that multiplicative weights not only does not perform worse than the best expert; it also does not perform better. In fact, this property holds more generally by online learning algorithms with optimal regret guarantees [14]. Interestingly, not all algorithms can achieve fairness in composition even with respect to this refined notion. We provide two algorithm classes where this is unachievable. First, we show that any algorithm (subject to a technical condition satisfied by algorithms such as multiplicative weights and follow the perturbed leader) that ignores the group identity can be unboundedly unfair with respect to equalized error rates (Theorem 4). This suggests that the algorithm needs to actively discriminate based on the groups to achieve fairness with respect to equalized error rates. Second, we show a similar negative statement for any algorithm that satisfies the more involved guarantee of small shifting regret, therefore outperforming the best expert (Theorem 5). This suggests that the algorithm used should be good but not too good. This result is, to the best of our knowledge, a first application where shifting regret may not be desirable which may be of independent interest. The positive result. We run separate instances of multiplicative weights with a fixed learning rate η, one for each group. More formally, for each pair of expert f ∈F and group g ∈G, we initialize weights w1 f,g = 1. At round t = {1, 2, . . . , T}, an example with group context g(t) arrives and the learner selects a probability distribution based to the corresponding weights: pt f = wt f,g(t) P j∈F wt j,g(t) . Then the weights corresponding to group g(t) are updated exponentially: wt+1 f,g = wt f,g ·(1−η)ℓt f ·1{g(t)=g}. Theorem 3. For any α > 0 and any ϵ < α such that running separate instances of multiplicative weights for each group with learning rate η = min(ϵ, α/6) guarantees α-fairness in composition and ϵ-approximate regret of at most O(|G| log(d)/ϵ). Proof sketch. The proof is based on the property that multiplicative weights performs not only no worse than the best expert in hindsight but also no better. Therefore the average performance of multiplicative weights at each group is approximately equal to the average performance of the best expert in that group. Since the experts are fair in isolation, the average performance of the best expert in all groups is the same which guarantees the equalized error rates desideratum. We make these arguments formal in the supplementary material. Remark 1. If the instance is instead only approximately fair in isolation with respect to equalized error rates, i.e. the error rates of the two experts are not exactly equal but within some constant κ, the same analysis implies (α + κ)-fairness in composition with respect to equalized error rates. Impossibility results for group-unaware algorithms. In the previous algorithm, it was crucial that the examples of the one group do not interfere with the decisions of the algorithm on the other group. We show that, had we run one multiplicative weights algorithm in a group-unaware way, we would not have accomplished fairness in composition. In fact, this impossibility result holds for any algorithm with vanishing ϵ-approximate regret where the learning dynamic (pt at each round t) is a deterministic function of the difference between the cumumative losses of the experts (without taking into consideration their identity). This is satisfied, for instance by multiplicative weights and follow the perturbed leader with a constant learning rate. Unlike the previous section, the impossibility results for equalized error rates require groups to arrive adversarially (which also occurs in the above positive result). The proof of the following theorem is provided in the supplementary material. 8 Theorem 4. For any α > 0 and for any ϵ > 0, running a single algorithm from the above class in a group-unaware way is α-unfair in composition with respect to equalized error rate. Impossibility results for shifting algorithms. The reader may be also wondering whether it suffices to just run separate learning algorithms in the two groups or whether multiplicative weights has a special property. In the following theorem, we show that the latter is the case. In particular, multiplicative weights has the property of not doing better than the best expert in hindsight. The main representative of algorithms that do not have such a property are the algorithms that achieve low approximate regret compared to a shifting benchmark (tracking the best expert). More formally, approximate regret against a shifting comparator f ⋆= (f ⋆(1), . . . , f ⋆(T)) is defined as: ApxRegϵ,T (f ⋆) = X t pt fℓt f −(1 + ϵ) X t ℓt f ⋆(t), and typical guarantees are E[ApxReg(f ⋆)] = O(K(f ⋆)·ln(dT )/ϵ) where K(f ⋆) = PT t=2 1{f ⋆(t) ̸= f ⋆(t −1)} is the number of switches in the comparator. We show that any algorithm that can achieve such a guarantee even when K(f ⋆) = 2 does not satisfy fairness in composition with respect to equalized error rate. This indicates that, for the fairness with equalized error rates purpose, the algorithm not being too good is essential. This is established in the following theorem whose proof is deferred to the supplementary material. Theorem 5. For any α < 1/2 and ϵ > 0, any algorithm that can achieve the vanishing approximate regret property against shifting comparators f of length K(f) = 2, running separate instances of the algorithm for each group is α-unfair in composition with respect to equalized error rate. 5 Discussion In this paper, we introduce the study of avoiding discrimination towards protected groups in online settings with non-i.i.d. examples. Our impossibility results for equalized odds consist of only two phases, which highlights the challenge in correcting for historical biases in online decision making. Our work also opens up a quest towards definitions that are relevant and tractable in non-i.i.d. online settings for specific tasks. We introduce the notion of equalized error rates that can be a useful metric for non-discrimination in settings where all examples that contribute towards the performance also contribute towards fairness. This is the case in settings that all mistakes are similarly costly as is the case in speech recognition, recommender systems, or online advertising. However, we do not claim that its applicability is universal. For instance, consider college admission with two perfectly balanced groups that correspond to ethnicity (equal size of the two groups and equal number of positive and negatives within any group). A racist program organizer can select to admit all students of the one group and decline the students of the other, while satisfying equalized error rates – this does not satisfy equalized odds. Given the impossibility result we established for equalized odds, it is interesting to identify definitions that work well for different tasks one encounters in online non-i.i.d. settings. Moreover, although our positive results extend to the case where predictors are vetted to be approximately non-discriminatory, they do not say anything about the case where the predictors do not satisfy this property. We therefore view our work only as a first step towards understanding non-discrimination in non-i.i.d. online settings. Acknowledgements The authors would like to thank Manish Raghavan for useful discussions that improved the presentation of the paper. This work was supported by the NSF grants CCF-1800317 and CCF-1563714, as well as a Google Ph.D. Fellowship. References [1] Julia Angwin, Jeff Larson, Surya Mattu, and Lauren Kirchner. Machine bias: There’s software used across the country to predict future criminals. And it’s biased against blacks. ProPublica, 2016. 9 [2] Julia Angwin and Terry Parris Jr. Facebook lets advertisers exclude users by race. ProPublica blog, 28, 2016. [3] Maria-Florina Balcan, Travis Dick, Ritesh Noothigattu, and Ariel Procaccia. Envy-free classification, 2018. [4] Solon Barocas and Andrew D. Selbst. Big Data’s Disparate Impact. California Law Review, 2016. [5] Sarah Bird, Solon Barocas, Kate Crawford, Fernando Diaz, and Hanna Wallach. Exploring or Exploiting? Social and Ethical Implications of Autonomous Experimentation in AI. In Workshop on Fairness, Accountability, and Transparency in Machine Learning (FAT-ML), 2016. [6] Avrim Blum and Yishay Mansour. From external to internal regret. In Proceedings of the 18th Annual Conference on Learning Theory (COLT), 2005. [7] Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Conference on Fairness, Accountability and Transparency, 2018. [8] Toon Calders, Faisal Kamiran, and Mykola Pechenizkiy. Building classifiers with independency constraints. In IEEE International Conference on Data Mining (ICDM), 2009. [9] L. Elisa Celis and Nisheeth K. Vishnoi. Fair personalization. In Workshop on Fairness, Accountability, and Transparency in Machine Learning (FAT-ML), 2017. [10] Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. Big data, 5(2):153–163, 2017. [11] Sam Corbett-Davies and Sharad Goel. The measure and mismeasure of fairness: A critical review of fair machine learning. arXiv preprint arXiv:1808.00023, 2018. [12] Amit Datta, Michael Carl Tschantz, and Anupam Datta. Automated experiments on ad privacy settings. Proceedings on Privacy Enhancing Technologies, 2015. [13] 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 (ITCS), 2012. [14] Eyal Even-Dar, Michael Kearns, Yishay Mansour, and Jennifer Wortman. Regret to the best vs. regret to the average. Journal of Machine Learning (JMLR), 2008. [15] Michael Feldman, Sorelle A. Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian. Certifying and removing disparate impact. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2015. [16] Avi Feller, Emma Pierson, Sam Corbett-Davies, and Sharad Goel. A computer program used for bail and sentencing decisions was labeled biased against blacks. it’s actually not that clear. The Washington Post, 2016. [17] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. J. Comput. Syst. Sci., 1997. [18] Stephen Gillen, Christopher Jung, Michael Kearns, and Aaron Roth. Online learning with an unknown fairness metric. In Advances in Neural Information Processing Systems (NIPS), 2018. [19] Gabriel Goh, Andrew Cotter, Maya Gupta, and Michael P Friedlander. Satisfying real-world goals with dataset constraints. In Advances in Neural Information Processing Systems (NIPS), 2016. [20] Moritz Hardt, Eric Price, and Nati Srebro. Equality of opportunity in supervised learning. In Advances in neural information processing systems (NIPS), 2016. [21] Mark Herbster and Manfred K. Warmuth. Tracking the best linear predictor. Journal of Machine Learning Research, 2001. 10 [22] Matthew Joseph, Michael Kearns, Jamie H Morgenstern, and Aaron Roth. Fairness in learning: Classic and contextual bandits. In Advances in Neural Information Processing Systems (NIPS), 2016. [23] Sampath Kannan, Michael Kearns, Jamie Morgenstern, Mallesh Pai, Aaron Roth, Rakesh Vohra, and Zhiwei Steven Wu. Fairness incentives for myopic agents. In Proceedings of the 2017 ACM Conference on Economics and Computation (EC), 2017. [24] Sampath Kannan, Jamie Morgenstern, Aaron Roth, Bo Waggoner, and Zhiwei Steven Wu. A smoothed analysis of the greedy algorithm for the linear contextual bandit problem. In Advances in Neural Information Processing Systems (NIPS), 2018. [25] Matthew Kay, Cynthia Matuszek, and Sean A Munson. Unequal representation and gender stereotypes in image search results for occupations. In Proceedings of the 33rd Annual ACM Conference on Human Factors in Computing Systems, 2015. [26] Michael Kearns, Seth Neel, Aaron Roth, and Zhiwei Steven Wu. Preventing fairness gerrymandering: Auditing and learning for subgroup fairness. In In Proceedings of the 35th International Conference on Machine Learning (ICML), 2018. [27] Niki Kilbertus, Mateo Rojas Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, and Bernhard Schölkopf. Avoiding discrimination through causal reasoning. In Advances in Neural Information Processing Systems (NIPS), 2017. [28] Jon M. Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent trade-offs in the fair determination of risk scores. In Innovations of Theoretical Computer Science (ITCS), 2017. [29] Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In Advances in Neural Information Processing Systems (NIPS), 2017. [30] Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Inf. Comput., 108(2):212–261, February 1994. [31] Katherine A Liu and Natalie A Dipietro Mager. Women’s involvement in clinical trials: historical perspective and future implications. Pharmacy Practice, 2016. [32] Lydia T. Liu, Sarah Dean, Esther Rolf, Max Simchowitz, and Moritz Hardt. Delayed impact of fair machine learning. 35th International Conference on Machine Learning (ICML), 2018. [33] Yang Liu, Goran Radanovic, Christos Dimitrakakis, Debmalya Mandal, and David C. Parkes. Calibrated fairness in bandits. Workshop on Fairness, Accountability, and Transparency in Machine Learning (FAT-ML), 2017. [34] Haipeng Luo and Robert E. Schapire. Achieving all with no parameters: Adanormalhedge. In Proceedings of The 28th Conference on Learning Theory (COLT), 2015. [35] Thodoris Lykouris, Vasilis Syrgkanis, and Éva Tardos. Learning and efficiency in games with dynamic population. In Proceedings of the Twenty-seventh Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), 2016. [36] Dino Pedreshi, Salvatore Ruggieri, and Franco Turini. Discrimination-aware data mining. In Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2008. [37] Manish Raghavan, Aleksandrs Slivkins, Jennifer Vaughan Wortman, and Zhiwei Steven Wu. The externalities of exploration and how data diversity helps exploitation. In Proceedings of the 31st Conference On Learning Theory (COLT), 2018. [38] Latanya Sweeney. Discrimination in online ad delivery. Commun. ACM, 56(5):44–54, May 2013. [39] Blake Woodworth, Suriya Gunasekar, Mesrob I Ohannessian, and Nathan Srebro. Learning non-discriminatory predictors. In Conference on Learning Theory (COLT), 2017. 11 [40] Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Learning fair classifiers. Proceedings of 30th Neural Information Processing Systems, 2017. [41] Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In International Conference on Machine Learning (ICML), 2013. 12
2018
204
7,369
A Likelihood-Free Inference Framework for Population Genetic Data using Exchangeable Neural Networks Jeffrey Chan University of California, Berkeley chanjed@berkeley.edu Valerio Perrone University of Warwick v.perrone@warwick.ac.uk Jeffrey P. Spence University of California, Berkeley spence.jeffrey@berkeley.edu Paul A. Jenkins University of Warwick p.jenkins@warwick.ac.uk Sara Mathieson Swarthmore College smathie1@swarthmore.edu Yun S. Song University of California, Berkeley yss@berkeley.edu Abstract An explosion of high-throughput DNA sequencing in the past decade has led to a surge of interest in population-scale inference with whole-genome data. Recent work in population genetics has centered on designing inference methods for relatively simple model classes, and few scalable general-purpose inference techniques exist for more realistic, complex models. To achieve this, two inferential challenges need to be addressed: (1) population data are exchangeable, calling for methods that efficiently exploit the symmetries of the data, and (2) computing likelihoods is intractable as it requires integrating over a set of correlated, extremely high-dimensional latent variables. These challenges are traditionally tackled by likelihood-free methods that use scientific simulators to generate datasets and reduce them to hand-designed, permutation-invariant summary statistics, often leading to inaccurate inference. In this work, we develop an exchangeable neural network that performs summary statistic-free, likelihood-free inference. Our framework can be applied in a black-box fashion across a variety of simulation-based tasks, both within and outside biology. We demonstrate the power of our approach on the recombination hotspot testing problem, outperforming the state-of-the-art. 1 Introduction Statistical inference in population genetics aims to quantify the evolutionary events and parameters that led to the genetic diversity we observe today. Population genetic models are typically based on the coalescent [1], a stochastic process describing the distribution over genealogies of a random exchangeable set of DNA sequences from a large population. Inference in such complex models is challenging. First, standard coalescent-based likelihoods require integrating over a large set of correlated, high-dimensional combinatorial objects, rendering classical inference techniques inapplicable. Instead, likelihoods are implicitly defined via scientific simulators (i.e., generative models), which draw a sample of correlated trees and then model mutation as Poisson point processes on the sampled trees to generate sequences at the leaves. Second, inference demands careful treatment 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. of the exchangeable structure of the data (a set of sequences), as disregarding it leads to an exponential increase in the already high-dimensional state space. Current likelihood-free methods in population genetics leverage scientific simulators to perform inference, handling the exchangeable-structured data by reducing it to a suite of low-dimensional, permutation-invariant summary statistics [2, 3]. However, these hand-engineered statistics typically are not statistically sufficient for the parameter of interest. Instead, they are often based on the intuition of the user, need to be modified for each new task, and are not amenable to hyperparameter optimization strategies since the quality of the approximation is unknown. The goal of this work is to develop a general-purpose inference framework for raw population genetic data that is not only likelihood-free, but also summary statistic-free. We achieve this by designing a neural network that exploits data exchangeability to learn functions that accurately approximate the posterior. While deep learning offers the possibility to work directly with genomic sequence data, poorly calibrated posteriors have limited its adoption in scientific disciplines [4]. We overcome this challenge with a training paradigm that leverages scientific simulators and repeatedly draws fresh samples at each training step. We show that this yields calibrated posteriors and argue that, under a likelihood-free inference setting, deep learning coupled with this ‘simulation-on-the-fly’ training has many advantages over the more commonly used Approximate Bayesian Computation (ABC) [2, 5]. To our knowledge, this is the first method that handles the raw exchangeable data in a likelihood-free context. As a concrete example, we focus on the problems of recombination hotspot testing and estimation. Recombination is a biological process of fundamental importance, in which the reciprocal exchange of DNA during cell division creates new combinations of genetic variants. Experiments have shown that many species exhibit recombination hotspots, i.e., short segments of the genome with high recombination rates [6]. The task of recombination hotspot testing is to predict the location of recombination hotspots given genetic polymorphism data. Accurately localizing recombination hotspots would illuminate the biological mechanism that underlies recombination, and could help geneticists map the mutations causing genetic diseases [7]. We demonstrate through experiments that our proposed framework outperforms the state-of-the-art on the hotspot detection problem. Our main contributions are: • A novel exchangeable neural network that respects permutation invariance and maps from the data to the posterior distribution over the parameter of interest. • A simulation-on-the-fly training paradigm, which leverages scientific simulators to achieve calibrated posteriors. • A general-purpose likelihood-free Bayesian inference method that combines the exchangeable neural network and simulation-on-the-fly training paradigm to both discrete and continuous settings. Our method can be applied to many population genetic settings by making straightforward modifications to the simulator and the prior, including demographic model selection, archaic admixture detection, and classifying modes of natural selection. • An application to a single-population model for recombination hotspot testing and estimation, outperforming the model-based state-of-the-art, LDhot. Our approach can be seamlessly extended to more complex model classes, unlike LDhot and other model-based methods. Our software package defiNETti is publicly available at https://github.com/popgenmethods/ defiNETti. 2 Related Work Likelihood-free methods like ABC have been widely used in population genetics [2, 5, 8, 9, 10]. In ABC the parameter of interest is simulated from its prior distribution, and data are subsequently simulated from the generative model and reduced to a pre-chosen set of summary statistics. These statistics are compared to the summary statistics of the real data, and the simulated parameter is weighted according to the similarity of the statistics to derive an empirical estimate of the posterior distribution. However, choosing summary statistics for ABC is challenging because there is a tradeoff between loss of sufficiency and computational tractability. In addition, there is no direct way to evaluate the accuracy of the approximation. 2 Other likelihood-free approaches have emerged from the machine learning community and have been applied to population genetics, such as support vector machines (SVMs) [11, 12], single-layer neural networks [13], and deep learning [3]. Recently, a (non-exchangeable) convolutional neural network method was proposed for raw population genetic data [14]. The connection between likelihood-free Bayesian inference and neural networks has also been studied previously [15, 16]. An attractive property of these methods is that, unlike ABC, they can be applied to multiple datasets without repeating the training process (i.e., amortized inference). However, current practice in population genetics collapses the data to a set of summary statistics before passing it through the machine learning models. Therefore, the performance still rests on the ability to laboriously hand-engineer informative statistics, and must be repeated from scratch for each new problem setting. The inferential accuracy and scalability of these methods can be improved by exploiting symmetries in the input data. Permutation-invariant models have been previously studied in machine learning for SVMs [17] and recently gained a surge of interest in the deep learning literature. Recent work on designing architectures for exchangeable data include [18], [19], and [20], which exploit parameter sharing to encode invariances. We demonstrate these ideas on the discrete and continuous problems of recombination hotspot testing and estimation, respectively. To this end, several methods have been developed (see, e.g., [21, 22, 23] for the hotspot testing problem). However, none of these are scalable to the whole genome, with the exception of LDhot [24, 25], so we limit our comparison to this latter method. LDhot relies on a composite likelihood, which can be seen as an approximate likelihood for summaries of the data. It can be computed only for a restricted set of models (i.e., an unstructured population with piecewise constant population size), is unable to capture dependencies beyond those summaries, and scales at least cubically with the number of DNA sequences. The method we propose in this paper scales linearly in the number of sequences while using raw genetic data directly. 3 Methods 3.1 Problem Setup Likelihood-free methods use coalescent simulators to draw parameters from the prior θ(i) ∼π(θ) and then simulate data according to the coalescent x(i) ∼P(x | θ(i)), where i is the index of each simulated dataset. Each population genetic datapoint x(i) ∈{0, 1}n×d typically takes the form of a binary matrix, where rows correspond to individuals and columns indicate the presence of a Single Nucleotide Polymorphism (SNP), a variable site in a DNA sequence1. Our goal is to learn the posterior P(θ | xobs), where θ is the parameter of interest and xobs is the observed data. For unstructured populations the order of individuals carries no information, hence the rows are exchangeable. More concretely, given data X = (x(1), . . . x(N)) where x(i) := (x(i) 1 , . . . , x(i) n ) ∼P(x | θ(i)) and x(i) j ∈{0, 1}d, we call X exchangeably-structured if, for every i, the distribution over the rows of a single datapoint is permutation-invariant P  x(i) 1 , . . . , x(i) n | θ(i) = P  x(i) σ(1), . . . , x(i) σ(n) | θ(i) , for all permutations σ of the indices {1, . . . , n}. For inference, we propose iterating the following algorithm. 1. Simulation-on-the-fly: Sample a fresh minibatch of θ(i) and x(i) from the prior and coalescent simulator. 2. Exchangeable neural network: Learn the posterior P(θ(i) | x(i)) via an exchangeable mapping with x(i) as the input and θ(i) as the label. This framework can then be applied to learn the posterior of the evolutionary model parameters given xobs. The details on the two building blocks of our method, namely the exchangeable neural network and the simulation-on-the-fly paradigm, are given in Section 3.2 and 3.3, respectively. 1Sites that have > 2 bases are rare and typically removed. Thus, a binary encoding can be used. 3 3.2 Exchangeable Neural Network The goal of the exchangeable neural network is to learn the function f : {0, 1}n×d →PΘ, where Θ is the space of all parameters θ and PΘ is the space of all probability distributions on Θ. We parameterize the exchangeable neural network by applying the same function to each row of the binary matrix, then applying a symmetric function to the output of each row, finally followed by yet another function mapping from the output of the symmetric function to a posterior distribution. More concretely, f(x) := (h ◦g) Φ(x1), . . . , Φ(xn)  , where Φ : {0, 1}d →Rd1 is a function parameterized by a convolutional neural network, g : Rn×d1 →Rd2 is a symmetric function, and h : Rd2 →PΘ is a function parameterized by a fully connected neural network. A variant of this representation is proposed by [18] and [20]. See Figure 1 for an example. Throughout the paper, we choose g to be the mean of the element-wise top decile, such that d1 = d2 in order to allow for our method to be robust to changes in n at test time. Many other symmetric functions such as the element-wise sum, element-wise max, lexicographical sort, or higher-order moments can be employed. This exchangeable neural network has many advantages. While it could be argued that flexible machine learning models could learn the structured exchangeability of the data, encoding exchangeability explicitly allows for faster per-iteration computation and improved learning efficiency, since data augmentation for exchangeability scales as O(n!). Enforcing exchangeability implicitly reduces the size of the input space from {0, 1}n×d to the quotient space {0, 1}n×d/Sn, where Sn is the symmetric group on n elements. A factorial reduction in input size leads to much more tractable inference for large n. In addition, choices of g where d2 is independent of n (e.g., quantile operations with output dimension independent of n) allows for an inference procedure which is robust to differing number of exchangeable variables between train and test time. This property is particularly desirable for performing inference with missing data. 3.3 Simulation-on-the-fly Supervised learning methods traditionally use a fixed training set and make multiple passes over the data until convergence. This training paradigm typically can lead to a few issues: poorly calibrated posteriors and overfitting. While the latter has largely been tackled by regularization methods and large datasets, the former has not been sufficiently addressed. We say a posterior is calibrated if for Xq,A := {x | ˆp(θ ∈A | x) = q}, we have Ex∈Xq,A[p(θ ∈A | x)] = q for all q, A. Poorly calibrated posteriors are particularly an issue in scientific disciplines as scientists often demand methods with calibrated uncertainty estimates in order to measure the confidence behind new scientific discoveries (often leading to reliance on traditional methods with asymptotic guarantees such as MCMC). When we have access to scientific simulators, the amount of training data available is limited only by the amount of compute time available for simulation, so we propose simulating each training datapoint afresh such that there is exactly one epoch over the training data (i.e., no training point is passed through the neural network more than once). We refer to this as simulation-on-the-fly. Note that this can be relaxed to pass each training point a small constant number of times in the case of computational constraints on the simulator. This approach guarantees properly calibrated posteriors and obviates the need for regularization techniques to address overfitting. Below we justify these properties through the lens of statistical decision theory. More formally, define the Bayes risk for prior π(θ) as R∗ π = infT ExEθ∼π[l(θ, T(x)], with l being the loss function and T an estimator. The excess risk over the Bayes risk resulting from an algorithm A with model class F can be decomposed as Rπ( ˜fA) −R∗ π =  Rπ( ˜fA) −Rπ( ˆf)  | {z } optimization error +  Rπ( ˆf) −inf f∈F Rπ(f)  | {z } estimation error +  inf f∈F Rπ(f) −R∗ π  , | {z } approximation error where ˜fA and ˆf are the function obtained via algorithm A and the empirical risk minimizer, respectively. The terms on the right hand side are referred to as the optimization, estimation, and approximation errors, respectively. Often the goal of statistical decision theory is to minimize the excess risk motivating algorithmic choices to control the three sources of error. For example, with 4 supervised learning, overfitting is a result of large estimation error. Typically, for a sufficiently expressive neural network optimized via stochastic optimization techniques, the excess risk is dominated by optimization and estimation errors. Simulation-on-the-fly guarantees that the estimation error is small, and as neural networks typically have small approximation error, we can conclude that the main source of error remaining is the optimization error. It has been shown that smooth population risk surfaces can induce jagged empirical risk surfaces with many local minima [26, 27]. We confirmed this phenomenon empirically in the population genetic setting(Section 5) showing that the risk surface is much smoother in the on-the-fly setting than the fixed training setting. This reduces the number of poor local minima and, consequently, the optimization error. The estimator corresponding to the Bayes risk (for the cross-entropy or KL-divergence loss function) is the posterior. Thus, the simulation-on-the-fly training paradigm guarantees generalization and calibrated posteriors (assuming small optimization error). 4 Statistical Properties The most widely-used likelihood-free inference method is ABC. In this section we briefly review ABC and show that our method exhibits the same theoretical guarantees together with a set of additional desirable properties. Properties of ABC Let xobs be the observed dataset, S be the summary statistic, and d be a distance metric. The algorithm for vanilla rejection ABC is as follows. Denoting by i each simulated dataset, for i = 1 . . . N, 1. Simulate θ(i) ∼π(θ) and x(i) ∼P(x | θ(i)) 2. Keep θ(i) if d(S(x(i)), S(xobs)) ≤ϵ. The output provides an empirical estimate of the posterior. Two key results regarding ABC make it an attractive method for Bayesian inference: (1) Asymptotic guarantee: As ϵ →0, N →∞, and if S is sufficient, the estimated posterior converges to the true posterior (2) Calibration of ABC: A variant of ABC (noisy ABC in [28]) which injects noise into the summary statistic function is calibrated. For detailed proofs as well as more sophisticated variants, see [28]. Note that ABC is notoriously difficult to perform diagnostics on without the ground truth posterior as many factors could contribute to a poor posterior approximation: poor choice of summary statistics, incorrect distance metric, insufficient number of samples, or large ϵ. Properties of Our Method Our method matches both theoretical guarantees of ABC — (1) asymptotics and (2) calibration — while also exhibiting additional properties: (3) amortized inference, (4) no dependence on user-defined summary statistics, and (5) straightforward diagnostics. While the independence of summary statistics and calibration are theoretically justified in Section 3.2 and 3.3, we provide some results that justify the asymptotics, amortized inference, and diagnostics. In the simulation-on-the-fly setting, convergence to a global minimum implies that a sufficiently large neural network architecture represents the true posterior within ϵ-error in the following sense: for any fixed error ϵ, there exist H0 and N0 such that the trained neural network produces a posterior which satisfies min w Ex h KL  P(θ | x) P(N) DL (θ | x; w, H) i < ϵ, (1) for all H > H0 and N > N0, where H is the minimum number of hidden units across all neural network layers, N is the number of training points, w the weights parameterizing the network, and KL the Kullback–Leibler divergence between the population risk and the risk of the neural network. Under these assumptions, the following proposition holds. Proposition 1. For any x, ϵ > 0, and fixed error δ > 0, there exists an H > H0, and N > N0 such that, KL  P(θ | x) P(N) DL (θ | x; w∗, H)  < δ (2) with probability at least 1 −ϵ δ, where w∗is the minimizer of (1). We can get stronger guarantees in the discrete setting common to population genetic data. 5 Figure 1: A cartoon schematic of the exchangeable architecture for population genetics. Corollary 1. Under the same conditions, if x is discrete and P(x) > 0 for all x, the KL divergence appearing in (2) converges to 0 uniformly in x, as H, N →∞. The proofs are given in the supplement. These results exhibit both the asymptotic guarantees of our method and show that such guarantees hold for all x (i.e. amortized inference). Diagnostics for the quality of the approximation can be performed via hyperparameter optimization to compare the relative loss of the neural network under a variety of optimization and architecture settings. 5 Empirical Study: Recombination Hotspot Testing In this section, we study the accuracy of our framework to test for recombination hotspots. As very few hotspots have been experimentally validated, we primarily evaluate our method on simulated data, with parameters set to match human data. The presence of ground truth allows us to benchmark our method and compare against LDhot (additional details on LDhot in the supplement). For the posterior in this classification task (hotspot or not), we use the softmax probabilities. Unless otherwise specified, for all experiments we use the mutation rate, µ = 1.1 × 10−8 per generation per nucleotide, convolution patch length of 5 SNPs, 32 and 64 convolution filters for the first two convolution layers, 128 hidden units for both fully connected layers, and 20-SNP length windows. The experiments comparing against LDhot used sample size n = 64 to construct lookup tables for LDhot quickly. All other experiments use n = 198, matching the size of the CEU population (i.e., Utah Residents with Northern and Western European ancestry) in the 1000 Genomes dataset. All simulations were performed using msprime [29]. Gradient updates were performed using Adam [30] with learning rate 1 × 10−3 × 0.9b/10000, b being the batch count. In addition, we augment the binary matrix, x, to include the distance information between neighboring SNPs in an additional channel resulting in a tensor of size n × d × 2. 5.1 Recombination Hotspot Details Recombination hotspots are short regions of the genome with high recombination rate relative to the background. As the recombination rate between two DNA locations tunes the correlation between their corresponding genealogies, hotspots play an important role in complex disease inheritance patterns. In order to develop accurate methodology, a precise mathematical definition of a hotspot needs to be specified in accordance with the signatures of biological interest. We use the following: Definition 1 (Recombination Hotspot). Let a window over the genome be subdivided into three subwindows w = (wl, wh, wr) with physical distances (i.e., window widths) αl, αh, and αr, respectively, where wl, wh, wr ∈G where G is the space over all possible subwindows of the genome. Let a mean recombination map R : G →R+ be a function that maps from a subwindow of the genome to the mean recombination rate per base pair in the subwindow. A recombination hotspot for a given mean recombination map R is a window w which satisfies the following properties: 1. Elevated local recombination rate: R(wh) > k · max R(wl), R(wr)  2. Large absolute recombination rate: R(wh) > k˜r where ˜r is the median (at a per base pair level) genome-wide recombination rate, and k > 1 is the relative hotspot intensity. The first property is necessary to enforce the locality of hotspots and rule out large regions of high recombination rate, which are typically not considered hotspots by biologists. The second property rules out regions of minuscule background recombination rate in which sharp relative spikes in 6 100 200 300 400 500 80 85 90 95 100 Testing Size %Accuracy Train n = 32 Train n = 64 Train n = 128 Train n = 256 Train n = 512 Figure 2: (Left)Accuracy comparison between exchangeable vs nonexchangeable architectures. (Right)Performance of changing the number of individuals at test time for varying training sample sizes. recombination still remain too small to be biologically interesting. The median is chosen here to be robust to the right skew of the distribution of recombination rates. Typically, for the human genome we use αl = αr = 13 kb, αh = 2 kb, and k = 10 based on experimental findings. 5.2 Evaluation of Exchangeable Neural Network We compare the behavior of an explicitly exchangeable architecture to a nonexchangeable architecture that takes 2D convolutions with varying patch heights. The accuracy under human-like population genetic parameters with varying 2D patch heights is shown in the left panel of Figure 2. Since each training point is simulated on-the-fly, data augmentation is performed implicitly in the nonexchangeable version without having to explicitly permute the rows of each training point. As expected, directly encoding the permutation invariance leads to more efficient training and higher accuracy while also benefiting from a faster per-batch computation time. Furthermore, the slight accuracy decrease when increasing the patch height confirms the difficulty of learning permutation invariance as n grows. Another advantage of exchangeable architectures is the robustness to the number of individuals at test time. As shown in right panel of Figure 2, the accuracy remains above 90% during test time for sample sizes roughly 0.1–20× the train sample size. 5.3 Evaluation of Simulation-on-the-fly Next, we analyze the effect of simulation-on-the-fly in comparison to the standard fixed training set. A fixed training set size of 10000 was used and run for 20000 training batches and a test set of size 5000. For a network using simulation-on-the-fly, 20000 training batches were run and evaluated on the same test set. In other words, we ran both the simulation on-the-fly and fixed training set for the same number of iterations with a batch size of 50, but the simulation-on-the-fly draws a fresh datapoint from the generative model upon each update so that no datapoint is used more than once. The weights were initialized with a fixed random seed in both settings with 20 replicates. Figure 3 (left) shows that the fixed training set setting has both a higher bias and higher variance than simulation-on-the-fly. The bias can be attributed to the estimation error of a fixed training set in which the empirical risk surface is not a good approximation of the population risk surface. The variance can be attributed to an increase in the number of poor quality local optima in the fixed training set case. We next investigated posterior calibration. This gives us a measure for whether there is any bias in the uncertainty estimates output by the neural network. We evaluated the calibration of simulation-onthe-fly against using a fixed training set of 10000 datapoints. The calibration curves were generated by evaluating 25000 datapoints at test time and binning their posteriors, computing the fraction of true labels for each bin. A perfectly calibrated curve is the dashed black line shown in Figure 3 (right). In accordance with the theory in Section 3.3, the simulation-on-the-fly is much better calibrated with an increasing number of training examples leading to a more well calibrated function. On the other hand, the fixed training procedure is poorly calibrated. 5.4 Comparison to LDhot We compared our method against LDhot in two settings: (i) sampling empirical recombination rates from the HapMap recombination map for CEU and YRI (i.e., Yoruba in Ibadan, Nigera) [31] to set the 7 Test Cross Entropy Fixed Training Set Simulation-on-the-Fly 0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 Figure 3: (Left)Comparison between the test cross entropy of a fixed training set of size 10000 and simulation-on-the-fly. (Right)Posterior calibration. The black dashed line is a perfectly calibrated curve. The red and purple lines are for simulation-on-the-fly after 20k and 60k iterations; the blue and green lines for a fixed training set of 10k points, for 20k and 60k iterations. 0 20 40 60 80 100 0 50 100 150 200 True Heat Posterior Mean and 95% Credible Interval Figure 4: (Left) ROC curve in the CEU and YRI setting for the deep learning and LDhot method. The black line represents a random classifier. (Middle) Windows of the HapMap recombination map drawn based on whether they matched up with our hotspot definition. The blue and green line coincide almost exactly. (Right) The inferred posteriors for the continuous case. The circles represent the mean of the posterior and the bars represent the 95% credible interval. The green line shows when the true heat is equal to the inferred heat. background recombination rate, and then using this background to simulate a flat recombination map with 10 – 100× relative hotspot intensity, and (ii) sampling segments of the HapMap recombination map for CEU and YRI and classifying them as hotspot according to our definition, then simulating from the drawn variable map. The ROC curves for both settings are shown in Figure 4. Under the bivariate empirical background prior regime where there is a flat background rate and flat hotspot, both methods performed quite well as shown on the left panel of Figure 4. We note that the slight performance decrease for YRI when using LDhot is likely due to hyperparameters that require tuning for each population size. This bivariate setting is the precise likelihood ratio test for which LDhot tests. However, as flat background rates and hotspots are not realistic, we sample windows from the HapMap recombination map and label them according to a more suitable hotspot definition that ensures locality and rules out neglectable recombination spikes. The middle panel of Figure 4 uses the same hotspot definition in the training and test regimes, and is strongly favorable towards the deep learning method. Under a sensible definition of recombination hotspots and realistic recombination maps, our method still performs well while LDhot performs almost randomly. We believe that the true performance of LDhot is somewhere between the first and second settings, with performance dominated by the deep learning method. Importantly, this improvement is achieved without access to any problem-specific summary statistics. Our approach reached 90% accuracy in fewer than 2000 iterations, taking approximately 0.5 hours on a 64 core machine with the computational bottleneck due to the msprime simulation [29]. For LDhot, the two-locus lookup table for variable population size using the LDpop fast approximation 8 [32] took 9.5 hours on a 64 core machine (downsampling n = 198 from N = 256). The lookup table has a computational complexity of O(n3) while per-iteration training of the neural network scales as O(n), allowing for much larger sample sizes. In addition, our method scales well to large local regions, being able to easily handle 800-SNP windows. 5.5 Recombination Hotspot Intensity Estimation: The Continuous Case To demonstrate the flexibility of our method in the continuous parameter regime, we adapted our method to the problem of estimating the intensity (or heat) of a hotspot. The problem setup fixes the background recombination rate R(wl) = R(wr) = 0.0005 and seeks to estimate the relative hotspot recombination intensity k. The demography is set to that of CEU. The hotspot intensity k was simulated with a uniform distributed prior from 1 to 100. For continuous parameters, arbitrary posteriors cannot be simply parameterized by a vector with dimension in the number of classes as was done in the discrete parameter setting. Instead, an approximate posterior distribution from a nice distribution family is used to get uncertainty estimates of our parameter of interest. This is achieved by leveraging our exchangeable network to output parameter estimates for the posterior distribution as done in [33]. For example, if we use a normal distribution as our approximate posterior, the network outputs estimates of the mean and precision. The corresponding loss function is the negative log-likelihood −log p(k|x) = −log τ(x) 2 + τ(x)(k −µ(x))2 2 + const, (3) where µ and τ are the mean and the precision of the posterior, respectively. More flexible distribution families such as a Gaussian mixture model can be used for a better approximation to the true posterior. We evaluate our method in terms of calibration and quality of the point estimates to check that our method yields valid uncertainty estimates. The right panel of Figure 4 shows the means and 95% credible intervals inferred by our method using log-normal as the approximate posterior distribution. As a measure of the calibration of the posteriors, the true intensity fell inside the 95% credible interval 97% of the time over a grid of 500 equally spaced points between k = 1 to 100. We measure the quality of the point estimates with the Spearman correlation between the 500 equally spaced points true heats and the estimated mean of the posteriors which yielded 0.697. This was improved by using a Gaussian mixture model with 10 components to 0.782. This illustrates that our method can be easily adapted to estimate the posterior distribution in the continuous regime. 6 Discussion We have proposed the first likelihood-free inference method for exchangeable population genetic data that does not rely on handcrafted summary statistics. To achieve this, we designed a family of neural networks that learn an exchangeable representation of population genetic data, which is in turn mapped to the posterior distribution over the parameter of interest. Our simulation-on-the-fly training paradigm produced calibrated posterior estimates. State-of-the-art accuracy was demonstrated on the challenging problem of recombination hotspot testing. The development and application of exchangeable neural networks to fully harness raw sequence data addresses an important challenge in applying machine learning to population genomics. The standard practice to reduce data to ad hoc summary statistics, which are then later plugged into a standard machine learning pipelines, is well recognized as a major shortcoming. Within the population genetic community, our method proves to be a major advance in likelihood-free inference in situations where ABC is too inaccurate. Several works have applied ABC to different contexts, and each one requires devising a new set of summary statistics. Our method can be extended in a black-box manner to these situations, which include inference on point clouds and quantifying evolutionary events. Acknowledgements We thank Ben Graham for helpful discussions and Yuval Simons for his suggestion to use the decile. This research is supported in part by an NSF Graduate Research Fellowship (JC); EPSRC grants EP/L016710/1 (VP) and EP/L018497/1 (PJ); an NIH grant R01-GM094402 (JC, JPS, SM, and YSS); and a Packard Fellowship for Science and Engineering (YSS). YSS is a Chan Zuckerberg Biohub 9 investigator. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan X Pascal GPU used for this research. This research also used resources of the National Energy Research Scientific Computing Center, a DOE Office of Science User Facility supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC02-05CH11231. 10 References [1] J. F. C. Kingman. The coalescent. Stochastic processes and their applications, 13(3):235–248, 1982. [2] M. A. Beaumont, W. Zhang, and D. J. Balding. Approximate Bayesian computation in population genetics. Genetics, 162(4):2025–2035, 2002. [3] S. Sheehan and Y. S. Song. Deep learning for population genetic inference. PLoS Computational Biology, 12(3):e1004845, 2016. [4] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. arXiv:1706.04599, 2017. [5] J K Pritchard, M T Seielstad, A Perez-Lezaun, and M W Feldman. Population growth of human Y chromosomes: a study of Y chromosome microsatellites. Mol Biol Evol, 16(12):1791–8, 1999. [6] T. D. Petes. Meiotic recombination hot spots and cold spots. Nature Reviews Genetics, 2(5):360– 369, 2001. [7] J. Hey. What’s so hot about recombination hotspots? PLoS Biol, 2(6):e190, 2004. [8] S. Boitard, W. Rodríguez, F. Jay, S. Mona, and F. Austerlitz. Inferring population size history from large samples of genome-wide molecular data-an approximate bayesian computation approach. PLoS genetics, 12(3):e1005877, 2016. [9] D. Wegmann, C. Leuenberger, and L. Excoffier. Efficient Approximate Bayesian Computation coupled with Markov chain Monte Carlo without likelihood. Genetics, 182(4):1207–1218, 2009. [10] V. C. Sousa, M. Fritz, M. A. Beaumont, and L. Chikhi. Approximate Bayesian computation without summary statistics: The case of admixture. Genetics, 181(4):1507–1519, 2009. [11] D. R. Schrider and A. D. Kern. Inferring selective constraint from population genomic data suggests recent regulatory turnover in the human brain. Genome biology and evolution, 7(12):3511– 3528, 2015. [12] P. Pavlidis, J. D. Jensen, and W. Stephan. Searching for footprints of positive selection in whole-genome snp data from nonequilibrium populations. Genetics, 185(3):907–922, 2010. [13] MGB Blum and O François. Non-linear regression models for Approximate Bayesian Computation. Statistics and Computing, 20(1):63–73, 2010. [14] Lex Flagel, Yaniv J Brandvain, and Daniel R Schrider. The unreasonable effectiveness of convolutional neural networks in population genetic inference. bioRxiv, page 336073, 2018. [15] B. Jiang, T.-y. Wu, C. Zheng, and W.H. Wong. Learning summary statistic for approximate Bayesian computation via deep neural network. arXiv:1510.02175, 2015. [16] G. Papamakarios and I. Murray. Fast ϵ-free inference of simulation models with Bayesian conditional density estimation. arXiv:1605.06376, 2016. [17] P. K. Shivaswamy and T. Jebara. Permutation invariant svms. In International Conference on Machine Learning, pages 817–824, 2006. [18] S. Ravanbakhsh, J. Schneider, and B. Poczos. Deep learning with sets and point clouds. arXiv:1611.04500, 2016. [19] N. Guttenberg, N. Virgo, O. Witkowski, H. Aoki, and R. Kanai. Permutation-equivariant neural networks applied to dynamics prediction. arXiv:1612.04530, 2016. [20] M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. Salakhutdinov, and A. Smola. Deep sets. Neural Information Processing Systems, 2017. 11 [21] P. Fearnhead. SequenceLDhot: detecting recombination hotspots. Bioinformatics, 22:3061–3066, 2006. [22] J. Li, M. Q. Zhang, and X. Zhang. A new method for detecting human recombination hotspots and its applications to the hapmap encode data. The American Journal of Human Genetics, 79(4):628–639, 2006. [23] Y. Wang and B. Rannala. Population genomic inference of recombination rates and hotspots. Proceedings of the National Academy of Sciences, 106(15):6215–6219, 2009. [24] A. Auton, S. Myers, and G. McVean. Identifying recombination hotspots using population genetic data. arXiv: 1403.4264, 2014. [25] J. D. Wall and L. S. Stevison. Detecting recombination hotspots from patterns of linkage disequilibrium. G3: Genes, Genomes, Genetics, 2016. [26] Alon Brutzkus and Amir Globerson. Globally optimal gradient descent for a convnet with gaussian inputs. arXiv preprint arXiv:1702.07966, 2017. [27] Chi Jin, Lydia T Liu, Rong Ge, and Michael I Jordan. Minimizing nonconvex population risk from rough empirical risk. arXiv preprint arXiv:1803.09357, 2018. [28] P. Fearnhead and D. Prangle. Constructing summary statistics for approximate Bayesian computation: semi-automatic approximate Bayesian computation. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74(3):419–474, 2012. [29] J. Kelleher, A. M. Etheridge, and G. McVean. Efficient coalescent simulation and genealogical analysis for large sample sizes. PLoS computational biology, 12(5):e1004842, 2016. [30] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv:1412.6980, 2014. [31] R. A. Gibbs, J. W. Belmont, P. Hardenbol, T. D. Willis, F. Yu, H. Yang, L.-Y. Ch’ang, W. Huang, B. Liu, Y. Shen, et al. The international hapmap project. Nature, 426(6968):789–796, 2003. [32] J. A. Kamm, J. P. Spence, J. Chan, and Y. S. Song. Two-locus likelihoods under variable population size and fine-scale recombination rate estimation. Genetics, 203(3):1381–1399, 2016. [33] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pages 6402–6413, 2017. 12
2018
205
7,370
The Price of Privacy for Low-rank Factorization Jalaj Upadhyay Johns Hopkins University Baltimore, MD - 21201, USA. jalaj@jhu.edu Abstract In this paper, we study what price one has to pay to release differentially private low-rank factorization of a matrix. We consider various settings that are close to the real world applications of low-rank factorization: (i) the manner in which matrices are updated (row by row or in an arbitrary manner), (ii) whether matrices are distributed or not, and (iii) how the output is produced (once at the end of all updates, also known as one-shot algorithms or continually). Even though these settings are well studied without privacy, surprisingly, there are no private algorithm for these settings (except when a matrix is updated row by row). We present the first set of differentially private algorithms for all these settings. Our algorithms when private matrix is updated in an arbitrary manner promise differential privacy with respect to two stronger privacy guarantees than previously studied, use space and time comparable to the non-private algorithm, and achieve optimal accuracy. To complement our positive results, we also prove that the space required by our algorithms is optimal up to logarithmic factors. When data matrices are distributed over multiple servers, we give a non-interactive differentially private algorithm with communication cost independent of dimension. In concise, we give algorithms that incur optimal cost across all parameters of interest. We also perform experiments to verify that all our algorithms perform well in practice and outperform the best known algorithm until now for large range of parameters. 1 Introduction Low-rank factorization (LRF) of matrices is a fundamental component used in many applications, such as clustering [15, 19, 43], data mining [5], recommendation systems [20], information retrieval [49, 53], learning distributions [2, 34], and web search [1, 36]. In these applications, given an m × n matrix A, a common approach is to first compute three matrices: a diagonal positive semidefinite matrix eΣk ∈Rk×k and two matrices, eUk ∈Rm×k and eVk ∈Rn×k, with orthonormal columns. The requirement then is that the product B := eUeΣ eVT is as close to A as possible. More formally, Problem 1. (α, β, γ, k)-LRF. Given parameters 0 < α, β < 1, γ, a matrix A ∈Rm×n matrix, the target rank k, compute a rank-k matrix factorization eUk, eΣk, and eVk such that Pr h ∥A −eUk eΣk eVT k∥F ≤(1 + α)∥A −[A]k∥F + γ i ≥1 −β, where ∥· ∥F denotes the Frobenius norm, and [A]k is the best rank-k approximation of A. We refer to the parameter γ as the additive error and to α as the multiplicative error. Practical matrices are often large, distributed over many servers and are dynamically updated [41, 42] and hence many works have considered these settings in order to reduce latency, synchronization issues and resource overhead [6, 9, 16, 13, 14, 17, 27, 40, 44, 48, 52]. Moreover, these applications use confidential dataset and use of ad hoc mechanism can lead to serious privacy leaks [47]. Therefore, 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Updates Comments Privacy Additive Error Reference Turnstile One-shot A −A′ = uvT eO(( √ mkα−1 + √ kn)ε−1) Theorem 1 Turnstile One-shot ∥A −A′∥F = 1 eO(( √ mkα−2 + √ kn)ε−1) Theorem 2 Turnstile Continually A −A′ = uvT eO(( √ mkα−1 + √ kn)ε−1 log T) Theorem 4 Turnstile Continually ∥A −A′∥F = 1 eO(( √ mkα−1 + √ kn)ε−1 log T) Theorem 4 Row wise One-shot ∥A −A′∥F = 1 eO  (αε)−1 √ nk  Corollary 1 − Local ∥A −A′∥F = 1 eO kα−2ϵ−1√m  Theorem 5 Table 1: Our Results for (ε, Θ(n−log n))-Differentially Private Algorithms (T: stream length, m ≥n). for any practical deployment [3, 25], one would like to simultaneously maintain strong privacy guarantee and minimize space requirements, communication and computational costs. Unfortunately, existing private algorithm for LRF do not consider these settings (except in central model when matrices are received row by row [24]). For example, known algorithms either use multiple pass over the data matrix [29, 30, 31, 35] or cannot handle arbitrary updates [24]. Similarly, known algorithms that continually release output are for monotonic functions [23], thereby excluding Problem 1. Private algorithms like [24, 30] that can be extended to distributed setting use multiple rounds of interaction, large communication cost, and/or result in trivial error bounds. Moreover, known private algorithms are inefficient compared to non-private algorithms: O(mnk) time and O(mn) space compared to time linear in the sparsity of the matrix and O((m+ n)k/α) space [9, 13]. In fact, for rank-k matrices, Musco and Woodruff [45] state that Problem 1 is equivalent to the well studied matrix completion for which one can have eO(n · poly(k)) time non private algorithm [32]. Under same assumptions, private algorithm takes O(mnk) time [30]. This motivates the central thesis of this paper: What is the price of privacy for non-trivial private algorithms? 1.1 Overview of the Results We give a unified approach and first set of algorithms for solving Problem 1 in various settings: (i) when private matrix is updated row by row or in arbitrary manner, (ii) when private matrix is distributed or not, and (iii) when the output is produced once at the end of all updates, also known as one-shot algorithms or continually. We show that one does not have to pay the price of privacy (more than what is required in terms of additive error and space). On a high level, we show the following: 1. When a private matrix is streamed, we propose differentially private algorithms with respect to two stronger privacy guarantees than previously studied. We also show that these algorithms can be extended to continual release model. Our algorithms uses basic linear algebra. This makes them easy to code, and therefore, optimize. 2. We complement our positive results with a matching lower bound on the space required. Our algorithms are also time efficient and achieve optimal accuracy. 3. In the distributed setting, we give a non-interactive differentially private algorithm with communication cost independent of dimension. All our results are summarized in Table 1. 2 Preliminaries In this paper, we give algorithms that are private under the notion of differential privacy. Differential privacy has emerged as a de facto notion of privacy over the last few years. Formally, it is defined as follows: Definition 1 ((ϵ, δ)-differential privacy). A randomized algorithm M gives (ε, δ)-differential privacy, if for all neighboring datasets A and A′, and all measurable sets S in the range of M, Pr[M(A) ∈ S] ≤exp(ε)Pr[M(A′) ∈S] + δ, where the probability is over the coin tosses of M. We consider two stronger privacy guarantees than previously studied: Priv1 and Priv2. In Priv1, we call two matrices A and A′ neighboring if A −A′ = uvT for some unit vectors u and v. In Priv2, we consider two matrices A and A′ neighboring if ∥A −A′∥F ≤1. 2 Our algorithm relies heavily on some results from the theory of random projections. Definition 2. A distribution DR of t×m matrices satisfies (α, δ)-subspace embedding for generalized regression if it has the following property: for any matrices P ∈Rm×n and Q ∈Rm×n′ such that rank(P) ≤r, with probability 1 −δ over Φ ∼DR, if eX = argminX ∥Φ(PX −Q)∥F and bX = argminX∈Rn×n′ ∥PX −Q∥F , then ∥P eX −Q∥F ≤(1 + α)∥P bX −Q∥F . Definition 3. A distribution DA over v × m matrices satisfies (α, δ)-affine subspace embedding if it has the following property: for any matrices D ∈Rm×n and E ∈Rm×n′ such that rank(D) ≤r, with probability 1 −δ over S ∼DA, simultaneously for all X ∈Rn×n′, ∥S(DX −E)∥2 F = (1 ± α)∥DX −E∥2 F . An example distribution DR with t = O(α−2 log(1/δ)) is the distribution of random matrices whose entries are sampled i.i.d. from N(0, 1/t). 3 A Meta Low Space Differentially Private Algorithm Our aim in this section is to present a unified algorithmic approach in the form of meta algorithm (see, Algorithm 1). This serves the purpose of illustrating the key ideas. For example, since one of our goals is private algorithms under turnstile model, we are restricted to only use linear sketches [38], but what we show is that advance yet inexpensive post-processing combined with careful analysis can lead to a small error differentially private LRF. Our Techniques. Our algorithm is based on two observations: (i) there is a way to maintain differentially private sketches of A (henceforth, we call such sketches noisy sketches) that incurs sub-optimal accuracy in terms of additive error and (ii) one can apply post-processing to these noisy sketches to obtain optimal additive error. To illustrate point (i) and why we need post-processing, consider the following vanilla algorithm for approximating the right singular vector: compute B = ΦA + N1, where Φ satisfies certain embedding property (for example, [44, Theorem 1]) and N1 ∼N(0, ρ2 1) e O(n2)×n for ρ1 as defined in Figure 1. The output is [B]k, the best rank-k approximation of B. This already gives a good approximation. Let m ≫n2 and let [ eU]k[eΣ]k[ eV]T k be the singular value decomposition of [B]k. Then by embedding property of Φ [44, Theorem 1], ∥A −A[ eV]k[ eV]T k∥F ≤∥(A + Φ†N1) −(A + Φ†N1)[ eV]k[ eV]T k∥F + ∥Φ†N1 + Φ†N1[ eV]k[ eV]T k∥F ≤(1 −α)−1 ∥B(I −[ eV]k[ eV]T k)∥F + O(∥Φ†N1 + Φ†N1[ eV]k[ eV]T k∥F ) ≤(1 −α) ∥B(I −[V]k[V]T k)∥F + O(∥Φ†N1 + Φ†N1[ eV]k[ eV]T k∥F ) ≤(1 + α) (1 −α)−1∥A −[A]k∥F + O(∥Φ†N1∥F + ∥Φ†N1[ eV]k[ eV]T k∥F ). The term in O(·) can be bounded using the embedding property of Φ, but this incurs large error. The question is whether we can further improve it to get optimal additive error. We show that it is possible using careful post-processing (point (ii) above). That is, we can extract top-k singular components of the input matrix A from sketches that are appropriately perturbed to preserve differential privacy. The underlying idea is as follows: suppose we know the singular value decomposition of [A]k := [U]k[Σ]k[V]T k. Then for finding a matrix B such that B ≈A, it suffices to compute eU that approximates [U]k, eΣ that approximates [Σ]k, and eV that approximates [V]k, and set B := eUeΣ eVT. However, this over simplistic overview does not guarantee privacy. In the rest of this exposition, we give a brief overview of how we turn this simplistic overview to a private algorithm. Challenges in computing differentially private low-rank factorization. The two traditional methods to preserve privacy—input perturbation and output perturbation—do not provide both privacy and small additive error. For example, if we use output perturbation to compute the sketches, Yc = AΦ + N and Yr = ΨA + N′ for appropriate sketching matrices Φ and Ψ and noise matrices N and N′, and use known random projection results, then we get an additive error term that can be arbitrarily large (more specifically, depends on the Frobenius norm of A and has the form ∥NLAN′∥F for some linear function LA of A). More precisely, we can show that minr(X)≤k ∥YcXYr −A∥F ≤∥A −[A]k∥F + ∥NLAN′∥F + ∥NLAΨA∥F + ∥AΦLAN′∥F . 3 Algorithm 1 PRIVATE-OPTIMAL-LRF(A; (ϵ, δ); α; k) 1: Set η = max  k, α−1 , t = O(ηα−1 log(k/δ)), v = O(ηα−2 log(k/δ)) and σmin = 16 log(1/δ) p t(1 + α)(1 −α)−1 ln(1/δ)/ε, ρ1 = p (1 + α) ln(1/δ)/ε, ρ2 = p (1 + α)ρ1. Sample Φ ∼ N(0, 1/t)(m+n)×m, Ψ ∼ N(0, 1/t)t×m, S ∼ N(0, 1/v)v×m, T ∼ N(0, 1/v)v×(m+n) with every entry sampled i.i.d. from N(0, 1). Sample N1 ∼ N(0, ρ2 1)t×(m+n) and N2 ∼N(0, ρ2 2)v×v. Keep N1, N2, Φ private. 2: Set bA = (A σminIm) by padding σminIm to the columns of A, where Im denotes an m × m identity matrix. Compute Yc = bAΦ, Yr = Ψ bA + N1, and Z = S bATT + N2. 3: Compute: U ∈Rm×t whose columns are orthonormal basis for the column space of Yc and matrix V ∈Rt×(m+n) whose rows are the orthonormal basis for the row space of Yr. 4: Compute: SVD of SU := eUs eΣs eVT s ∈Rv×t and a SVD of VTT := eUt eΣt eVT t ∈Rt×v. 5: Compute: SVD of eVs eΣ† s[ eUT s Z eVt]k eΣ† t eUT t . Let it is be U′Σ′V′T. 6: Output: eU = UU′, diagonal matrix eΣ = Σ′, and eV = VTV′. While minr(X)≤k ∥YcXYr −A∥F can be lower bounded using the techniques we use in this paper, the additive term ∥NLAN′∥F can have large Frobenius norm. On the other hand, input perturbation of A followed by a multiplication by Gaussian matrices Ω1 and Ω2 as in [8, 57, 58] can leak private data due to a subtle reason. Every row of Ω1A (and columns of AΩ2) has a multivariate Gaussian distribution if the determinant of ATA (AAT, respectively) is non zero. If m < n, one can prove that computing AΩ1 preserves privacy, but, since, A is not a full-column rank matrix, the multivariate Gaussian distribution is not defined. The trick to consider the subspace orthogonal to the kernel space of A [8] does not work because span of A and A′ may not coincide for neighboring matrices A and A′. If the span do not coincide, then one can easily differentiate the two cases with high probability, violating differential privacy. In fact, until this work, it was not even clear whether using input perturbation yields low rank approximation (see the comment after Theorem IV.2 and discussion in Section V in Blocki et al. [8])! Our Algorithm. We use input perturbation with a careful choice of parameter to one of the sketches and output perturbation to the other two sketches and show that it incur optimal additive error and preserve privacy. The intuitive reason why this incurs small additive error is the fact that only one of the sketches, Yr or Yc, undergoes output perturbation, so there is no term like ∥NLAN′∥F as above. This allows us to show that Yc and Yr (or equivalently, their orthonormal bases U and V as formed in Algorithm 1) approximates the span of [U]k and [V]k up to a small additive error. Once we have extracted a "good enough" U and V, our problem reduces to computing argminrk(X)≤k ∥A −UXV∥F . This would require storing the whole matrix A, something that we wish to avoid. To avoid storing the whole A, we use the fact that S and T are sampled from a distribution of random matrices with a property that, for all appropriate X, ∥A −UXV∥F ≈ ∥S(A −UXV)TT∥F . In other words, without privacy, argminrk(X)≤k ∥S(A −UXV)TT∥F can be used to get a “good" approximation of [Σ]k. The exact method to perform and analyze the approximation of [Σ]k is slightly more involved because we only have access to the noisy version of SAT, i.e., Z (in fact, this is one of the places we need careful post processing to output an approximation to Σk under a rotation and a small additive error).Finally, we arrive at the main result stated below for the case when m ≤n (the result when m > n can be derived by just swapping m and n). Theorem 1 (Main result). Let m, n, k ∈N and α, ε, δ be the input parameters (with m ≤n). Let κ, η, and σmin be as defined in Algorithm 1. Given an m × n matrix A with nn(A) non-zero entries, let (A 0) be a matrix formed by appending an all zero m × m matrix to A. Then PRIVATE-OPTIMALLRF (Algorithm 1) is (3ε, 3δ) differentially private under Priv1 and outputs a factorization eU, eΣ, eV such that 1. With probability 9/10 over the random coins of PRIVATE-SPACE-OPTIMAL-LRF, ∥(A 0) −eUeΣ eVT∥F ≤(1 + α)∥A −[A]k∥F + O(σmin √m + ε−1p kn ln(1/δ)). 2. The space used by PRIVATE-SPACE-OPTIMAL-LRF is O((m + n)ηα−1 log(k/δ)). Proof Sketch. The proof of Theorem 1 is presented in the supplementary material. Here, we give a brief sketch of part 1 (for m ≤n) to illustrate the key points. The intuition that there is no term like 4 ∥NLAN′∥F does not directly yield optimal additive error. This is because, even if we do not get an additive error term with large value like ∥NLAN′∥F , if not analyzed precisely, one can either get a non-analytic expression for the error terms or one that is difficult to analyze. To get analytic expressions for all the error terms that are also easier to analyze, we introduce two carefully chosen optimization problems (equation (3)) so that the intermediate terms in our analysis satisfy certain properties (see the proof sketch below for exact requirements). Let bA be as defined in Figure 1. Part 1 follows from the following chain of inequalities and bounding ∥bAΦLAN1∥F : ∥Mk −(A 0) ∥F ≤∥Mk −bA∥F + O(σmin √m) ≤(1 + α)∥bA −[ bA]k∥F + ∥bAΦLAN1∥F + O(σmin √m) ≤(1 + α)∥A −[A]k∥F + ∥bAΦLAN1∥F + O(σmin √m), (1) where the matrix LA satisfies the following properties: (a) ∥bAΦLAΨ bA −bA∥F ≤(1 + α)∥bA − [ bA]k∥F , (b) LA has rank at most k, and (c) ΨAΦLA is a rank-k projection matrix. We use subadditivity of norm to prove the first inequality and Weyl’s perturbation theorem [7] to prove the third inequality. Proving the second inequality is the technically involved part. For this, we need to find a candidate LA. We first assume we have such a candidate LA with all the three properties. Once we have such an LA, we can prove part (b) as follows: min rk(X)≤k ∥UXV −B∥F ≤∥bAΦLAΨ bA −bA∥F + ∥bAΦLAN1∥F + ∥S†N1(T†)T∥F ≤(1 + α)∥bA −[ bA]k∥F + ∥bAΦLAN1∥F + ∥S†N2(TT)†∥F , (2) where B = A + S†N1(T†)T. The first inequality follows from the subadditivity of Frobenius norm, the fact that U and V are orthonormal bases of Yc and Yr, and property (b) to exploit that minimum on the left hand side is over rank-k matrices. We then use the approximation guarantee of property (a) to get the second inequality. Using the fact that S and T are Gaussian matrices, we can lower bound the left hand side of equation (2) up to an additive term as follows: ∥(A 0) −eUeΣ eVT∥F −∥S†N1(TT)†∥F ≤(1 + α)3 min rk(X)≤k ∥UXV −B∥F , where eU, eΣ, and eV are as in Algorithm 1. We upper bound the right hand side of equation (2) by using Markov’s inequality combined with the fact that both S and T are Gaussian matrices and LA satisfies property (c). Scaling the value of α by a constant gives part 1. So all that remains is to find a candidate matrix LA. We construct such an LA using the following two optimization problems: Prob1 : min X ∥Ψ( bAΦ([ bA]kΦ)†X −bA)∥F and Prob2 : min X ∥bAΦ([ bA]kΦ)†X −bA∥F . (3) We prove that a solution to Prob1 gives us a candidate LA. This completes the proof. From Priv1 to Priv2. If we try to use the idea described above to prove differential privacy under Priv2, we end up with an additive error that depends linearly on min {m, n}. This is because we need to perturb the input matrix by a noise proportional to min{ √ km, √ kn} to preserve differential privacy under Priv2. We show that by maintaining noisy sketches Y = AΦ + N1 and Z = SA + N2 for appropriately chosen noise matrices N1 and N2 and sketching matrices Φ and S, followed by some post processing, we can have an optimal error differentially private algorithm under Priv2. Here, we require S to satisfy the same property as in the case of Priv1. However, the lack of symmetry between S and Φ requires us to decouple the effects of noise matrices to get a tight bound on the additive error. In total, we get an efficient (ϵ, δ)-differentially private algorithm that uses O((mα−1 + n)kα−1) space and outputs (α, 99/100, γ, k)-LRF for γ = eO(( √ kmα−2 + √ kn) p log(1/δ)/ϵ−2). 4 Differentially Private Algorithms for Streaming Matrices We next give more details of our result when matrices are streamed. Unless specified, for the ease of presentation, we assume that k ≥1/α, δ = Θ(n−log n), and eO(·) hides a poly log n factor. To capture the scenarios where data matrices are constantly updated, we consider the turnstile update model (see the survey [46] for further motivations). Formally, in a turnstile update model, a matrix 5 Privacy Notion Additive Error Space Required Streaming This work A −A′ = uvT eO(( √ kmα−1 + √ kn)ε−1) eO((m + n)kα−1) Turnstile This work ∥A −A′∥F = 1 eO(( √ kmα−2 + √ kn)ε−1) eO((mα−1 + n)kα−1) Turnstile Hardt-Roth [30] A −A′ = esvT eO √ km + kc√n  ε−1 O(mn) × Upadhyay [57] A −A′ = esvT eO k2√n + m  ε−1 eO((m + n)kα−1) Row-wise Lower Bounds All of the above Ω √ km + √ kn  [30] Ω((m + n)kα−1) Turnstile Table 2: Comparison of Results (∥u∥2, ∥v∥2 = 1, es: standard basis, k ≤1/α). A ∈Rm×n is initialized to an all zero-matrix and is updated by a sequence of triples {i, j, ∆}, where 1 ≤i ≤m, 1 ≤j ≤n, and ∆∈R. Each update results in a change in the (i, j)-th entry of A as follows: Ai,j ←Ai,j + ∆. An algorithm is differentially private under turnstile update model if, for all possible matrices updated in the turnstile update model and runs of the algorithm, the output of the algorithm is (ε, δ)-differentially private. A straightforward application of known privacy techniques to make known space-optimal non-private algorithms [9] differentially private incurs a large additive error. In other words, it is an open question whether we can solve Problem 1 with good accuracy while preserving differential privacy and receiving the matrix in the turnstile update model? We resolve this question positively. We say two data streams are neighboring if they are formed by neighboring matrices. We show the following: Theorem 2. Let A be an m × n matrix streamed in a turnstile update model. Then there is an efficient (ε, δ)-differentially private algorithm under Priv1 that uses eO((m + n)kα−1) space and computes (α, 99/100, γ, k)-LRF, where γ = eO(( √ mkα−1 + √ kn)/ε). There is also an efficient (ϵ, δ)-differentially private algorithm under Priv2 that computes an (α, 99/100, γ, k)-LRF, where γ = eO(( √ mkα−2 + √ kn)/ε). Before we argue the tightness of Theorem 2 with respect to both space and additive error, we compare our result with previous works. All the private algorithms prior to this work compute a low rank approximation of either the matrix A or its covariance ATA. One can compute a factorization from their output at the expense of an extra O(mn2) time and O(mn) space (Dwork et al. [24] requires an extra O(n3) time and O(n2) space to output an LRF of ATA). Some works like [11, 35, 30, 29] compute LRF under the spectral norm instead of Frobenius norm. In other words, Hardt and Roth [30] and Upadhyay [57] study a problem closest to ours (the differences being that they do not consider turnstile updates and output a low rank matrix). Therefore, we compare Theorem 2 only with these two results. We do not make any assumptions on the private matrix. This allows us to cover matrices of all form and relaxations in an unified manner. We next compare the accuracy, privacy guarantees, space, and time required in more detail (see Table 2). Both Hardt and Roth [30] and Upadhyay [57] give rank-O(k) approximation instead of rank-k approximation, incur a multiplicative error of p 1 + k/p, where p is an oversampling parameter (typically, p = Θ(k)), and m ≤n. Therefore, for a reasonable comparison, we consider Theorem 2 when α = Θ(1) and m ≤n. Our additive error is smaller than Upadhyay [57] by a factor of eO(k3/2). To make a reasonable comparison with Hardt and Roth [30], we consider their result without incoherence assumption: which roughly says that no single row of the matrix is significantly correlated with any of the right singular vectors of the matrix. Then Hardt and Roth [30, Theorem 4.2 and 4.7] results in an additive error eO(( √ km + ck√n)ε−1), where c is the maximum entry in their projection matrix. In other words, we improve Hardt and Roth [30] by an eO(c √ k) factor. Our algorithms are more efficient than previous algorithms in terms of space and time even though earlier algorithms output a rank-O(k) matrix and cannot handle updates in the turnstile model. Upadhyay [57] takes more time than Hardt and Roth [30]. The algorithm of Hardt and Roth [30] uses O(mn) space since it is a private version of Halko et al. [28] and has to store the entire matrix: both the stages of Halko et al. [28] require the matrix explicitly. One of the motivations mentioned in Hardt and Roth [30] is sparse private incoherent matrices (see the discussion in Hardt and Roth [30, Sec 1.1]), but their algorithm uses this only to reduce the additive error and not the running time. 6 On the other hand, our algorithms use sublinear space and almost matches the running time of most efficient non-private algorithm in the turnstile model [9, 13]. Our privacy guarantees are also more general than previous works, who consider two matrices A and A′ neighboring either if A −A′ = eieT j [29, 31, 33] or A −A′ = eivT for some unit vector v [24, 30, 57], depending on whether a user’s data is an entry of the matrix or a row of the matrix. It is easy to see that these privacy guarantees are special case of Priv1 and Priv2. Tightness of Additive Error. Hardt and Roth [30] showed a lower bound of Ω( √ kn + √ km) on additive error by showing a reduction to the linear reconstruction attack [18]. In other words, any algorithm that outputs a low rank matrix with additive error o( √ kn + √ km) cannot be differentially private! This lower bound holds even when the private algorithm can access the private matrix any number of times. Our results show that one can match the lower bound for constant α, a setting considered in Hardt and Roth [30], up to a small logarithmic factor, while allowing access to the private matrix only in the turnstile model. Space Lower Bound and Optimality of the Algorithm Under Priv1. Our algorithms use same space as non-private algorithm up to a logarithmic factor, which is known to be optimal for γ = 0 [12]. However, we incur a non-zero additive error, γ, which is inevitable [30], and it is not clear if we can achieve better space algorithm when γ ̸= 0. We complement Theorem 2 with a lower bound on the space required for low-rank approximation with non-trivial additive error. Our result holds for any randomized algorithm; therefore, also hold for any private algorithm. This we believe makes our result of independent interest. Theorem 3. The space required by any randomized algorithm to solve (α, 1/6, O(m + n), k)-LRF in the turnstile update model is Ω((n + m)kα−1). Any differentially private incurs an additive error Ω( √ km + √ kn). Moreover, known differentially private low-rank approximation [30] set α = √ 2 −1. This thus prove optimality for all k ≥3. Under Bounded Norm Assumptions. In some practical applications, matrices are more structured. One such special case is when the rows of private matrix A have bounded norm and one would like to approximate ATA. This problem was studied by Dwork et al. [24]. We consider the matrices are updated by row-wise: all the updates at time τ ≤T are of the form  iτ, A(τ) , where 1 ≤iτ ≤m, A(τ) ∈Rn, and iτ ̸= iτ ′ for all τ ̸= τ ′. We show the following by using ATA as the input matrix: Corollary 1. Given an A ∈Rm×n updated by inserting one row at a time such that every row has a bounded norm 1 and m > n. Then there is an (ε, δ)-differentially private algorithm under Priv2 that uses eO(nkα−2) space, and outputs a rank-k matrix B such that ∥ATA −B∥F ≤ (1 + α)∥ATA −[ATA]k∥F + eO( √ nk/(αε)). We do not violate the lower bound of Dwork et al. [24] because their lower bound is valid when α = 0, which is not possible for low space algorithms due to Theorem 3. Dwork et al. [24] bypassed their lower bounds under a stronger assumption known as singular value separation: the difference between k-th singular value and all k′-th singular values for k′ > k is at least ω(√n). In other words, our result shows that we do not need singular value separation while using significantly less space— eO(nk/α2) as compared to O(n2)—if we are ready to pay for a small multiplicative error. Adapting to Continual Release Model. Until now, we gave algorithms that produce the output only at the end of the stream. There is a related model called (ε, δ)-differential privacy under T-continual release [23]. In this model, the server receives a stream of length T and produces an output after every update, such that every output is (ε, δ)-differentially private. We modify our meta algorithm to work in this model by using the fact that we only store noisy linear sketches of the private matrix during the updates and low-rank factorization is computed through post-processing on only the noisy sketches. That is, we can use the generic transformation [23] to maintain the sketch of the updates. A factorization for any time range can be done by aggregating the sketches for the specified range using range queries. This gives the first instance of algorithm that provides differentially private continual release of LRF. We show the following. Theorem 4. Let A ∈Rm×n be the private matrix streamed over T time epochs. Then there is an (ε, δ)-differentially private algorithm under Priv1 that outputs a rank-k factorization under the continual release for T time epochs such that γ = eO(ε−1( √ mkα−1 + √ kn) log T). 7 5 Noninteractive Local Differentially Private PCA Till now, we have considered a single server that receives the private matrix in a streamed manner. We next consider another variant of differential privacy known as local differential privacy (LDP) [21, 22, 26, 59]. In the local model, each individual applies a differentially private algorithm locally to their data and shares only the output of the algorithm—called a report—with a server that aggregates users’ reports. A multi-player protocol is ε-LDP if for all possible inputs and runs of the protocol, the transcript of player i’s interactions with the server is ε-LDP. One can study two variants of local differential privacy depending on whether the server and the users interact more than once or not. In the interactive variant, the server sends several messages, each to a subset of users. In the noninteractive variant, the server sends a single message to all the users at the start of the protocol and sends no message after that. Smith, Thakurta, and Upadhyay [54] argued that noninteractive locally private algorithms are ideal for implementation. The natural extension of Problem 1 in the local model is when the matrix is distributed among the users such that every user has one row of the matrix and users are responsible for the privacy of their row vector. Unfortunately, known private algorithms (including the results presented till now) do not yield non trivial additive error in the local model. For example, if we convert Theorem 2 to the local model, we end up with an additive error eO( √ kmn). This is worse than the trivial bound of O(√mn), for example, when A ∈{0, 1}m×n, a trivial output of all zero matrix incurs an error at most O(√mn). In fact, existing lower bounds in the local model suggests that one is likely to incur an error which is O(√m) factor worse than in the central model, where m is the number of users. However, owing to the result of Dwork et al. [24], we can hope to achieve non-trivial result for differentially private principal component analysis. This problem has been studied without privacy under the row-partition model [6, 39, 37, 9, 27, 50, 51, 55]). We exploit the fact that our meta algorithm only stores differentially private sketches of the input matrix to give a noninteractive algorithm for low-rank principal component analysis (PCA) under local differential privacy. This produces an (ϵ, δ)-locally differentially private algorithm; however, it is non-interactive. We then use the generic transformation of Bun et al. [10] to get the following result. Theorem 5. Let m, n ∈N and α, ε, δ be the input parameters. Let k be the desired rank of the factorization and η = max  k, α−1 . Let v = O(ηα−2 log(k/δ)). Given a private input matrix A ∈Rm×n distributed in a row-wise manner amongst m users, there is an efficient ε-local differentially private algorithm under Priv2 that uses O(v2) words of communications from users to central server and outputs a rank-k orthonormal matrix U such that with probability 9/10, ∥A −UUTA∥F ≤(1 + O(α))∥A −[A]k∥F + O  v p m log(1/δ)/ϵ  . 6 Discussion on Neighboring Relation The two privacy guarantees considered in this paper have natural reasons to be considered. Priv1 generalizes the earlier privacy guarantees and captures the setting where any two matrices differ in only one spectrum. Since Priv1 is defined in terms of the spectrum of matrices, Priv1 captures one of the natural privacy requirements in all the applications of LRF. Priv2 is stronger than Priv1. To motivate the definition of Priv2, consider a graph, G := (V, E) that stores career information of people in a set P since their graduation. The vertex set V is the set of all companies. An edge e = (u, v) ∈E has weight P p∈P(tp,e/tp), where tp,e is the time for which the person p held a job at v after leaving his/her job at u, and tp is the total time lapsed since his/her graduation. Graphs like G are useful because the weight on every edge e = (u, v) depends on the number of people who changed their job status from u to v (and the time they spent at v). Therefore, data analysts might want to mine such graphs for various statistics. In the past, graph statistics have been extensively studied for static graph under edge-level privacy (see, for e.g., [24, 30, 29, 56, 57]): the presence or absence of a person corresponds to a change in a single edge. On the other hand, in graphs like G, presence or absence of a person would be reflected on many edges. If we use earlier results on edge-level privacy to such graphs, it would lead to either a large additive error or a loss in privacy parameters ε, δ. Priv2 is an attempt to understand whether we can achieve any non-trivial guarantee on the additive error without depreciating the privacy parameters. 8 Figure 1: Empirical Evaluation of Additive Error of Our Algorithm. 7 Empirical Evaluation of Our Algorithms In this section, we give a glimpse of our experimental evaluations of additive error and compare it with the best known results. The details and discussion of our empirical evaluations is in supplementary materials. Two important parameters in our bounds are k and α – Hardt and Roth [30] consider a constant α. Therefore, we analyze the additive error with respect to the change in α in order to better understand the effect of differential privacy on low space low-rank approximation of matrices. The result of our experiment is presented in Figure 1 ((a)-(d)) with the scale of y-axis (accuracy) in logarithmic to better illustrate the accuracy improvement shown by our algorithm. In both these experiments, we see that the additive error incurred by our algorithm is less than the additive error incurred by Hardt and Roth [30]. We note that the matrices are highly incoherent as all the entries are sampled i.i.d. We also consider the role of k in our locally-private algorithm. The results of our experiment in presented in Figure 1 ((e)-(f)). The error of our algorithm is consistently less than the expected error. 8 Conclusion In this paper, we study differentially private low-rank approximation in various settings of practical importance. We give first algorithms with optimal accuracy, space requirements, and runtime for all of these settings. Our results relies crucially on careful analysis and our algorithms heavily exploit advance yet inexpensive post-processing. Prior to this work, only two known private algorithms for Problem 1 use any form of post-processing for LRF: Hardt and Roth [30] uses simple pruning of entries of a matrix formed in the intermediate step, while Dwork et al. [24] uses best rank-k approximation of the privatized matrix. These post-processing either make the algorithm suited only for static matrices or are expensive. There are few key take aways from this paper: (i) maintaining a differentially private sketches of row space and column space of a matrix already give a sub-optimal accuracy, but this can be significantly improved by careful inexpensive post-processing, and (ii) the structural properties of linear sketches can be carefully exploited to get tight bound on the error. Prior to this work, it was not clear whether the techniques we use in this paper yields low rank approximation (see the comment after Theorem IV.2 and discussion in Section V in Blocki et al. [8]). Therefore, we believe our techniques will find use in many related private algorithms as evident by the recent result of Arora et al. [4]. Acknowledgements. The author would like to thank Adam Smith for useful feedback on this paper. This research was supported in part by NSF BIGDATA grant IIS-1447700, NSF BIGDATA grant IIS-154648, and NSF BIGDATA grant IIS-1838139. 9 References [1] Dimitris Achlioptas, Amos Fiat, Anna R Karlin, and Frank McSherry. Web search via hub synthesis. In FOCS, pages 500–509. IEEE, 2001. [2] Dimitris Achlioptas and Frank McSherry. On spectral learning of mixtures of distributions. In Learning Theory, pages 458–469. Springer, 2005. [3] Apple. Apple tries to peek at user habits without violating privacy. The Wall Street Journal, 2016. [4] Raman Arora, Vladimir Braverman, and Jalaj Upadhyay. Differentially private robust low-rank approximation. In Advances in Neural Information Processing Systems, pages 4141–4149, 2018. [5] Yossi Azar, Amos Fiat, Anna Karlin, Frank McSherry, and Jared Saia. Spectral analysis of data. In STOC, pages 619–626. ACM, 2001. [6] Zheng-Jian Bai, Raymond H Chan, and Franklin T Luk. Principal component analysis for distributed data sets with updating. In International Workshop on Advanced Parallel Processing Technologies, pages 471–483. Springer, 2005. [7] Rajendra Bhatia. Matrix analysis, volume 169. Springer Science &amp; Business Media, 2013. [8] Jeremiah Blocki, Avrim Blum, Anupam Datta, and Or Sheffet. The Johnson-Lindenstrauss Transform Itself Preserves Differential Privacy. In FOCS, pages 410–419, 2012. [9] Christos Boutsidis, David P. Woodruff, and Peilin Zhong. Optimal principal component analysis in distributed and streaming models. In STOC, pages 236–249, 2016. [10] Mark Bun, Jelani Nelson, and Uri Stemmer. Heavy hitters and the structure of local privacy. arXiv preprint arXiv:1711.04740, 2017. [11] Kamalika Chaudhuri, Anand D Sarwate, and Kaushik Sinha. Near-optimal differentially private principal components. In NIPS, pages 998–1006, 2012. [12] Kenneth L. Clarkson and David P. Woodruff. Numerical linear algebra in the streaming model. In STOC, pages 205–214, 2009. [13] Kenneth L Clarkson and David P Woodruff. Low rank approximation and regression in input sparsity time. In STOC, pages 81–90. ACM, 2013. [14] Kenneth L Clarkson and David P Woodruff. Low-rank psd approximation in input-sparsity time. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2061–2072. SIAM, 2017. [15] Michael B Cohen, Sam Elder, Cameron Musco, Christopher Musco, and Madalina Persu. Dimensionality reduction for k-means clustering and low rank approximation. In STOC, pages 163–172. ACM, 2015. [16] Michael B Cohen, Cameron Musco, and Christopher Musco. Input sparsity time low-rank approximation via ridge leverage score sampling. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1758–1777. SIAM, 2017. [17] Amit Deshpande and Santosh Vempala. Adaptive sampling and fast low-rank matrix approximation. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, pages 292–303. Springer, 2006. [18] Irit Dinur and Kobbi Nissim. Revealing information while preserving privacy. In PODS, pages 202–210. ACM, 2003. [19] Petros Drineas, Alan Frieze, Ravi Kannan, Santosh Vempala, and V Vinay. Clustering large graphs via the singular value decomposition. Machine learning, 56(1-3):9–33, 2004. [20] Petros Drineas, Iordanis Kerenidis, and Prabhakar Raghavan. Competitive recommendation systems. In STOC, pages 82–90. ACM, 2002. 10 [21] John C Duchi, Michael I Jordan, and Martin J Wainwright. Local privacy and statistical minimax rates. In Foundations of Computer Science (FOCS), 2013 IEEE 54th Annual Symposium on, pages 429–438. IEEE, 2013. [22] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating Noise to Sensitivity in Private Data Analysis. In Shai Halevi and Tal Rabin, editors, TCC, volume 3876 of Lecture Notes in Computer Science, pages 265–284. Springer, 2006. [23] Cynthia Dwork, Moni Naor, Toniann Pitassi, and Guy N. Rothblum. Differential privacy under continual observation. In STOC, pages 715–724, 2010. [24] Cynthia Dwork, Kunal Talwar, Abhradeep Thakurta, and Li Zhang. Analyze Gauss: Optimal Bounds for Privacy-Preserving Principal Component Analysis. In STOC, pages 11–20, 2014. [25] Úlfar Erlingsson, Vasyl Pihur, and Aleksandra Korolova. Rappor: Randomized aggregatable privacy-preserving ordinal response. In Proceedings of the 2014 ACM SIGSAC conference on computer and communications security, pages 1054–1067. ACM, 2014. [26] Alexandre Evfimievski, Johannes Gehrke, and Ramakrishnan Srikant. Limiting privacy breaches in privacy preserving data mining. In PODS, pages 211–222. ACM, 2003. [27] Dan Garber, Ohad Shamir, and Nathan Srebro. Communication-efficient algorithms for distributed stochastic principal component analysis. arXiv preprint arXiv:1702.08169, 2017. [28] Nathan Halko, Per-Gunnar Martinsson, and Joel A Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM review, 53(2):217–288, 2011. [29] Moritz Hardt and Eric Price. The noisy power method: A meta algorithm with applications. In Z. Ghahramani, M. Welling, C. Cortes, N.d. Lawrence, and K.q. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 2861–2869. Curran Associates, Inc., 2014. [30] Moritz Hardt and Aaron Roth. Beating randomized response on incoherent matrices. In STOC, pages 1255–1268, 2012. [31] Moritz Hardt and Aaron Roth. Beyond worst-case analysis in private singular vector computation. In STOC, pages 331–340, 2013. [32] Prateek Jain, Praneeth Netrapalli, and Sujay Sanghavi. Low-rank matrix completion using alternating minimization. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pages 665–674. ACM, 2013. [33] Wuxuan Jiang, Cong Xie, and Zhihua Zhang. Wishart mechanism for differentially private principal components analysis. arXiv preprint arXiv:1511.05680, 2015. [34] Ravindran Kannan, Hadi Salmasian, and Santosh Vempala. The spectral method for general mixture models. In Learning Theory, pages 444–457. Springer, 2005. [35] Michael Kapralov and Kunal Talwar. On differentially private low rank approximation. In SODA, volume 5, page 1. SIAM, 2013. [36] Jon M Kleinberg. Authoritative sources in a hyperlinked environment. Journal of the ACM (JACM), 46(5):604–632, 1999. [37] Yann-Aël Le Borgne, Sylvain Raybaud, and Gianluca Bontempi. Distributed principal component analysis for wireless sensor networks. Sensors, 8(8):4821–4850, 2008. [38] Yi Li, Huy L. Nguyen, and David P. Woodruff. Turnstile streaming algorithms might as well be linear sketches. In Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014, pages 174–183, 2014. [39] Yingyu Liang, Maria-Florina F Balcan, Vandana Kanchanapally, and David Woodruff. Improved distributed principal component analysis. In Advances in Neural Information Processing Systems, pages 3113–3121, 2014. 11 [40] Avner Magen and Anastasios Zouzias. Low rank matrix-valued chernoff bounds and approximate matrix multiplication. In SODA, pages 1422–1436. SIAM, 2011. [41] Michael W Mahoney. Randomized algorithms for matrices and data. Foundations and Trends R⃝ in Machine Learning, 3(2):123–224, 2011. [42] Ivan Markovsky. Structured low-rank approximation and its applications. Automatica, 44(4):891– 909, 2008. [43] Frank McSherry. Spectral partitioning of random graphs. In FOCS, pages 529–537. IEEE, 2001. [44] Xiangrui Meng and Michael W Mahoney. Low-distortion subspace embeddings in input-sparsity time and applications to robust linear regression. In STOC, pages 91–100. ACM, 2013. [45] Cameron Musco and David P Woodruff. Sublinear time low-rank approximation of positive semidefinite matrices. arXiv preprint arXiv:1704.03371, 2017. [46] Shanmugavelayutham Muthukrishnan. Data streams: Algorithms and applications. Now Publishers Inc, 2005. [47] Arvind Narayanan and Vitaly Shmatikov. Robust de-anonymization of large sparse datasets. In Security and Privacy, 2008. SP 2008. IEEE Symposium on, pages 111–125. IEEE, 2008. [48] Nam H Nguyen, Thong T Do, and Trac D Tran. A fast and efficient algorithm for low-rank approximation of a matrix. In STOC, pages 215–224. ACM, 2009. [49] Christos H Papadimitriou, Hisao Tamaki, Prabhakar Raghavan, and Santosh Vempala. Latent semantic indexing: A probabilistic analysis. In Proceedings of the seventeenth ACM SIGACTSIGMOD-SIGART symposium on Principles of database systems, pages 159–168. ACM, 1998. [50] Jack Poulson, Bryan Marker, Robert A Van de Geijn, Jeff R Hammond, and Nichols A Romero. Elemental: A new framework for distributed memory dense matrix computations. ACM Transactions on Mathematical Software (TOMS), 39(2):13, 2013. [51] Yongming Qu, George Ostrouchov, Nagiza Samatova, and Al Geist. Principal component analysis for dimension reduction in massive distributed data sets. In Proceedings of IEEE International Conference on Data Mining (ICDM), 2002. [52] Tamas Sarlos. Improved approximation algorithms for large matrices via random projections. In FOCS, pages 143–152. IEEE, 2006. [53] John Shawe-Taylor and Nello Cristianini. Kernel methods for pattern analysis. Cambridge university press, 2004. [54] A. Smith, A. Thakurata, and J. Upadhyay. Is Interaction Necessary for Distributed Private Learning? To Appear in IEEE Symposium for Security & Privacy, 2017. [55] Françoise Tisseur and Jack Dongarra. A parallel divide and conquer algorithm for the symmetric eigenvalue problem on distributed memory architectures. SIAM Journal on Scientific Computing, 20(6):2223–2236, 1999. [56] Jalaj Upadhyay. Random Projections, Graph Sparsification, and Differential Privacy. In ASIACRYPT (1), pages 276–295, 2013. [57] Jalaj Upadhyay. Differentially private linear algebra in the streaming model. arXiv preprint arXiv:1409.5414, 2014. [58] Jalaj Upadhyay. Randomness efficient fast-johnson-lindenstrauss transform with applications in differential privacy and compressed sensing. arXiv preprint arXiv:1410.2470, 2014. [59] Stanley L. Warner. Randomized response: A survey technique for eliminating evasive answer bias. Journal of the American Statistical Association, 60(309):63–69, 1965. 12
2018
206
7,371
Efficient Formal Safety Analysis of Neural Networks Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, Suman Jana Columbia University, NYC, NY 10027, USA {tcwangshiqi, kpei, jaw2228, junfeng, suman}@cs.columbia.edu Abstract Neural networks are increasingly deployed in real-world safety-critical domains such as autonomous driving, aircraft collision avoidance, and malware detection. However, these networks have been shown to often mispredict on inputs with minor adversarial or even accidental perturbations. Consequences of such errors can be disastrous and even potentially fatal as shown by the recent Tesla autopilot crashes. Thus, there is an urgent need for formal analysis systems that can rigorously check neural networks for violations of different safety properties such as robustness against adversarial perturbations within a certain L-norm of a given image. An effective safety analysis system for a neural network must be able to either ensure that a safety property is satisfied by the network or find a counterexample, i.e., an input for which the network will violate the property. Unfortunately, most existing techniques for performing such analysis struggle to scale beyond very small networks and the ones that can scale to larger networks suffer from high false positives and cannot produce concrete counterexamples in case of a property violation. In this paper, we present a new efficient approach for rigorously checking different safety properties of neural networks that significantly outperforms existing approaches by multiple orders of magnitude. Our approach can check different safety properties and find concrete counterexamples for networks that are 10× larger than the ones supported by existing analysis techniques. We believe that our approach to estimating tight output bounds of a network for a given input range can also help improve the explainability of neural networks and guide the training process of more robust neural networks. 1 Introduction Over the last few years, significant advances in neural networks have resulted in their increasing deployments in critical domains including healthcare, autonomous vehicles, and security. However, recent work has shown that neural networks, despite their tremendous success, often make dangerous mistakes, especially for rare corner case inputs. For example, most state-of-the-art neural networks have been shown to produce incorrect outputs for adversarial inputs specifically crafted by adding minor human-imperceptible perturbations to regular inputs [36, 14]. Similarly, seemingly minor changes in lighting or orientation of an input image have been shown to cause drastic mispredictions by the state-of-the-art neural networks [29, 30, 37]. Such mistakes can have disastrous and even potentially fatal consequences. For example, a Tesla car in autopilot mode recently caused a fatal crash as it failed to detect a white truck against a bright sky with white clouds [3]. A principled way of minimizing such mistakes is to ensure that neural networks satisfy simple safety/security properties such as the absence of adversarial inputs within a certain L-norm of a given image or the invariance of the network’s predictions on the images of the same object under different lighting conditions. Ideally, given a neural network and a safety property, an automated checker should either guarantee that the property is satisfied by the network or find concrete counterexamples demonstrating violations of the safety property. The effectiveness of such automated checkers hinges on how accurately they can estimate the decision boundary of the network. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. However, strict estimation of the decision boundary of a neural network with piecewise linear activation functions such as ReLU is a hard problem. While the linear pieces of each ReLU node can be partitioned into two linear constraints and efficiently check separately, the total number of linear pieces grow exponentially with the number of nodes in the network [25, 27]. Therefore, exhaustive enumeration of all combinations of these pieces for any modern network is prohibitively expensive. Similarly, sampling-based inference techniques like blackbox Monte Carlo sampling may need an enormous amount of data to generate tight accurate bounds on the decision boundary [11]. In this paper, we propose a new efficient approach for rigorously checking different safety properties of neural networks that significantly outperform existing approaches by multiple orders of magnitude. Specifically, we introduce two key techniques. First, we use symbolic linear relaxation that combines symbolic interval analysis and linear relaxation to compute tighter bounds on the network outputs by keeping track of relaxed dependencies across inputs during interval propagation when the actual dependencies become too complex to track. Second, we introduce a novel technique called directed constraint refinement to iteratively minimize the errors introduced during the relaxation process until either a safety property is satisfied or a counterexample is found. To make the refinement process efficient, we identify the potentially overestimated nodes, i.e., the nodes where inaccuracies introduced during relaxation can potentially affect the checking of a given safety property, and use off-the-shelf solvers to focus only on those nodes to further tighten their output ranges. We implement our techniques as part of Neurify, a system for rigorously checking a diverse set of safety properties of neural networks 10× larger than the ones that can be handled by existing techniques. We used Neurify to check six different types of safety properties of nine different networks trained on five different datasets. Our experimental results show that on average Neurify is 5, 000× faster than Reluplex [17] and 20× than ReluVal [39]. Besides formal analysis of safety properties, we believe our method for efficiently estimating tight and rigorous output ranges of a network will also be useful for guiding the training process of robust networks [42, 32] and improving explainability of the decisions made by neural networks [34, 20, 23]. Related work. Several researchers have tried to extend and customize Satisfiability Modulo Theory (SMT) solvers for estimating decision boundaries with strong guarantees [17, 18, 15, 10, 31]. Another line of research has used Mixed Integer Linear Programming (MILP) solvers for such analysis [38, 12, 7]. Unfortunately, the efficiency of both of these approaches is severely limited by the high nonlinearity of the resulting formulas. Different convex or linear relaxation techniques have also been used to strictly approximate the decision boundary of neural networks. While these techniques tend to scale significantly better than solver-based approaches, they suffer from high false positive rates and struggle to find concrete counterexamples demonstrating violations of safety properties [42, 32, 13, 9]. Similarly, existing works on finding lower bounds of adversarial perturbations to fool a neural network also suffer from the same limitations [28, 41]. Note that concurrent work of Weng et al. [40] uses similar linear relaxation method as ours but it alone struggles to solve such problems as shown in Table 6. Also, their follow-up work [44] that provides a generic relaxation method for general activation functions does not address this issue either. In contrast, we mainly use our relaxation technique to identify crucial nodes and iteratively refine output approximations over these nodes with the help of linear solver. Another line of research has focused on strengthening network robustness either by incorporating these relaxation methods into training process [43, 8, 24] or by leveraging techniques like differential privacy [22]. Our method, essentially providing a more accurate formal analysis of a network, can potentially be incorporated into training process to further improve network robustness. Recently, ReluVal, by Wang et al. [39], has used interval arithmetic [33] for rigorously estimating a neural network’s decision boundary by computing tight bounds on the outputs of a network for a given input range. While ReluVal achieved significant performance gain over the state-of-the-art solver-based methods [17] on networks with a small number of inputs, it struggled to scale to larger networks (see detailed discussions in Section 2). 2 Background We build upon two prior works [10, 39] on using interval analysis and linear relaxations for analyzing neural networks. We briefly describe them and refer interested readers to [10, 39] for more details. 2 Symbolic interval analysis. Interval arithmetic [33] is a flexible and efficient way of rigorously estimating the output ranges of a function given an input range by computing and propagating the output intervals for each operation in the function. However, naive interval analysis suffers from large overestimation errors as it ignores the input dependencies during interval propagation. To minimize such errors, Wang et al. [39] used symbolic intervals to keep track of dependencies by maintaining linear equations for upper and lower bounds for each ReLU and concretizing only for those ReLUs that demonstrate non-linear behavior for the given input intervals. Specifically, consider an intermediate ReLU node z = Relu(Eq), (l, u) = (Eq, Eq), where Eq denotes the symbolic representation (i.e., a closed-form equation) of the ReLU’s input in terms of network inputs X and (l, u) denote the concrete lower and upper bounds of Eq, respectively. There are three possible output intervals that the ReLU node can produce depending on the bounds of Eq: (1) z = [Eq, Eq] when l ≥0, (2) z = [0, 0] when u ≤0, or (3) z = [l, u] when l < 0 < u. Wang et al. will concretize the output intervals for this node only if the third case is feasible as the output in this case cannot be represented using a single linear equation. Bisection of input features. To further minimize overestimation, [39] also proposed an iterative refinement strategy involving repeated input bisection and output reunion. Consider a network F taking d-dimensional input, and the i-th input feature interval is Xi and network output interval is F(X) where X = {X1, ..., Xd}. A single bisection on Xi will create two children: X′ = {X1, ..., [Xi, Xi+Xi 2 ], ..., Xd} and X′′ = {X1, ..., [ Xi+Xi 2 , Xi], ..., Xd}. The reunion of the corresponding output intervals F(X′) ! F(X′′), will be tighter than the original output interval, i.e., F(X′) ! F(X′′) ⊆F(X), as the Lipschitz continuity of the network ensures that the overestimation error decreases as the width of input interval becomes smaller. However, the efficiency of input bisection decreases drastically as the number of input dimensions increases. Figure 1: Linear relaxation of a ReLU node. Linear relaxation. Ehlers et al. [10] used linear relaxation of ReLU nodes to strictly overapproximate the non-linear constraints introduced by each ReLU. The generated linear constraints can then be efficiently solved using a linear solver to get bounds on the output of a neural network for a given input range. Consider the simple ReLU node taking input z′ with an upper and lower bound u and l respectively and producing output z as shown in Figure 1. Linear relaxation of such a node will use the following three linear constraints: (1) z ≥0, (2) z ≥z′, and (3) z ≤u(z′−l) u−l to expand the feasible region to the green triangle from the two original piecewise linear components. The effectiveness of this approach heavily depends on how accurately u and l can be estimated. Unfortunately, Ehlers et al. [10] used naive interval propagation to estimate u and l leading to large overestimation errors. Furthermore, their approach cannot efficiently refine the estimated bounds and thus cannot benefit from increasing computing power. 3 Approach In this paper, we make two major contributions to scale formal safety analysis to networks significantly larger than those evaluated in prior works [17, 10, 42, 39]. First, we combine symbolic interval analysis and linear relaxation (described in Section 2) in a novel way to create a significantly more efficient propagation method–symbolic linear relaxation–that can achieve substantially tighter estimations (evaluated in Section 4). Second, we present a technique for identifying the overestimated intermediate nodes, i.e., the nodes whose outputs are overestimated, during symbolic linear relaxation and propose directed constraint refinement to iteratively refine the output ranges of these nodes. In Section 4, we also show that this method mitigates the limitations of input bisection [39] and scales to larger networks. Figure 2 illustrates the high-level workflow of Neurify. Neurify takes in a range of inputs X and then determines using linear solver whether the output estimation generated by symbolic linear relaxation satisfies the safety proprieties. A property is proven to be safe if the solver find the relaxed constraints unsatisfiable. Otherwise, the solver returns potential counterexamples. Note that the returned counterexamples found by the solver might be false positives due to the inaccuracies 3 introduced by the relaxation process. Thus Neurify will check whether a counterexample is a false positive. If so, Neurify will use directed constraint refinement guided by symbolic linear relaxation to obtain a tighter output bound and recheck the property with the solver. 3.1 Symbolic Linear Relaxation Symbolic linear relaxation Refine overest. node Constraints Concrete sample Violated Unsat Linear solver Check for violation Input intervals Timeout Unsafe Safe False positive Split target node Safety property DNN Figure 2: Workflow of Neurify to formally analyze safety properties of neural networks. The symbolic linear relaxation of the output of each ReLU z = Relu(z′) leverages the bounds on z′, Eqlow and Equp (Eqlow ≤Eq∗(x) ≤Equp). Here Eq∗denotes the closed-form representation of z′. Specifically, Equation 1 shows the symbolic linear relaxation where %→denotes “relax to”. In addition, [llow, ulow] and [lup, uup] denote the concrete lower and upper bounds for Eqlow and Equp, respectively. In supplementary material Section 1.2, we give a detailed proof showing that this relaxation is the tightest achievable due to its least maximum distance from Eq∗. In the following discussion, we simplify Eqlow and Equp as Eq and the corresponding lower and upper bounds as [l, u]. Figure 3 shows the difference between our symbolic relaxation process and the naive concretizations used by Wang et al. [39]. More detailed discussions can be found in supplementary material Section 2. Relu(Eqlow) %→ ulow ulow −llow (Eqlow) Relu(Equp) %→ uup uup −lup (Equp −lup) (1) z z′ u (a) Naive concretizaion z z′ 0 l z ≤u z ≥0 l u 0 z ≥ u u - lEq z ≤ u u - l(Eq - l) (b) Symbolic linear relaxation Figure 3: An illustration of symbolic linear relaxation for an intermediate node. (a) Original symbolic interval analysis [39] used naive concretization. (b) Symbolic linear relaxation leverages the knowledge of concrete bounds for z′ and computes relaxed symbolic interval. Eq is the symbolic representation of z′. In practice, symbolic linear relaxation can cut (on average) 59.64% more overestimation error than symbolic interval analysis (cf. Section 2) and saves the time needed to prove a property by several orders of magnitude (cf. Section 4). There are three key reasons behind such significant performance improvement. First, the maximum possible error after introducing relaxations is −lup∗uup uup−lup for upper bound and −llow∗ulow ulow−llow for lower bound in Figure 3(b) (the proof is in supplementary material Section 1.2). These relaxations are considerably tighter than naive concretizations shown in Figure 3(a), which introduces a larger error uup. Second, symbolic linear relaxation, unlike naive concretization, partially keeps the input dependencies during interval propagation ([ u u−lEq, u u−l(Eq −l)] by maintaining symbolic equations. Third, as the final output error is exponential to the error introduced at each node (proved in supplementary 1.2), tighter bounds on earlier nodes produced by symbolic relaxation significantly reduce the final output error. 3.2 Directed Constraint Refinement Besides symbolic linear relaxation, we also develop another generic approach, directed constraint refinement, to further improve the overall performance of property checking. Our empirical results in Section 4 shows the substantial improvement from using this approach combined with symbolic linear relaxation. In the following, we first define overestimated nodes before describing the directed constraint refinement process in detail. Overestimated nodes. We note that, for most networks, only a small proportion of intermediate ReLU nodes operate in the non-linear region for a given input range X. These are the only nodes that 4 need to be relaxed (cf. Section 2). We call these nodes overestimated as they introduce overestimation error during relaxation. We include other useful properties and proofs regarding overestimated nodes in supplementary material Section 1.1. Based on the definition of overestimated nodes, we define one step of directed constraint refinement as computing the refined output range F ′(X): F ′(X) = F(x ∈X|Eq(x) ≤0) ∪F(x ∈X|Eq(x) > 0) (2) where X denotes the input intervals to the network, F is the corresponding network, and Eq is the input equation of an overestimated node. Note that here we are showing the input of a node as a single equation for simplicity instead of the upper and lower bounds shown in Section 3.1. We iteratively refine the bounds by invoking a linear solver, allowing us to make Neurify more scalable for difficult safety properties. The convergence analysis is given in supplementary material Section 1.3. The refinement includes the following three steps: Locating overestimated nodes. From symbolic linear relaxations, we can get the set of overestimated nodes within the network. We then prioritize the overestimated nodes with larger output gradient and refine these influential overestimated nodes first. We borrow the idea from [39] of computing the gradient of network output with respect to the input interval of the overestimated node. A larger gradient value of a node signifies that the input of that node has a greater influence towards changing the output than than the inputs of other nodes. Splitting. After locating the target overestimated node, we split its input ranges into two independent cases, Eqt > 0 and Eqt ≤0 where Eqt denotes the input of the target overestimated node. Now, unlike symbolic linear relaxation where Relu([Eqt, Eqt]) %→[ u u−lEqt, u u−l(Eqt −l)], neither of the two split cases requires any relaxation (Section 2) as the input interval no longer includes 0. Therefore, splitting creates two tighter approximations of the output F(x ∈X|Eqt(x) > 0) and F(x ∈X|Eqt(x) ≤0). Solving. We solve the resulting linear constraints, along with the constraints defined in safety properties, by instantiating an underlying linear solver. In particular, we define safety properties that check that the confidence value of a target output class F t is always greater than the outputs of other classes F o (e.g., outputs other than 7 for an image of a hand-written 7). We thus define the constraints for safety properties as Eqt low −Eqo up < 0. Here, Eqt low and Eqo up are the lower bound equations for F t and the upper bound equations for F o derived using symbolic linear relaxation. Each step of directed constraint refinement of an overestimated node results in two independent problems as shown in Equation 3 that can be checked with a linear solver. Check Satifiability: Eqt low1 −Eqo up1 < 0; Eqt ≤0; xi −ϵ ≤xi ≤xi + ϵ (i = 1 . . . d) Check Satifiability: Eqt low2 −Eqo up2 < 0; Eqt > 0; xi −ϵ ≤xi ≤xi + ϵ (i = 1 . . . d) (3) In this process, we invoke the solver in two ways. (1) If the solver tells that both cases are unsatisfiable, then the property is formally proved to be safe. Otherwise, further iterative refinement steps can be applied. (2) If either case is satisfiable, we treat the solutions returned by the linear solver as potential counterexamples violating the safety properties. Note that these solutions might be false positives due to the inaccuracies introduced during the relaxation process. We thus resort to directly executing the target network with the solutions returned from the solver as input. If the solution does not violate the property, we repeat the above process for another overestimated node (cf. Figure 2). 3.3 Safety Properties In this work, we support checking diverse safety properties of networks including five different classes of properties based on the input constraints. Particularly, we specify the safety properties of neural network based on defining constraints on its input-output. For example, as briefly mentioned in Section 3.1, we specify that the output of the network on input x should not change (i.e., remain invariant) when x is allowed to vary within a certain range X. For output constraints, taking an arbitrary classifier as an example, we define the output invariance by specifying the difference greater than 0 between lower and upper bound of confidence value of the original class of the input and other classes. For specifying input constraints, we consider three popular bounds, i.e., L∞, 5 L1, and L2, which are widely used in the literature of adversarial machine learning [14]. These three bounds allow for arbitrary perturbations of the input features as long as the corresponding norms of the overall perturbation are within a certain threshold. In addition to these arbitrary perturbations, we consider two specific perturbations that change brightness and contrast of the input images as discussed in [30]. Properties specified using L∞naturally fit into our symbolic linear relaxation process where each input features are bounded by an interval. For properties specified in L1 ≤ϵ or L2 ≤ϵ, we need to add more constraints, i.e., "d i=1 |xi| ≤ϵ for L1, or "d i=1 xi2 ≤ϵ for L2, which are no longer linear. We handle such cases by using solvers that support quadratic constraints (see details in Section 4). The safety properties involving changes in brightness and contrast can be efficiently checked by iteratively bisecting the input nodes simultaneously as minx∈[x−ϵ,x+ϵ](F(x)) = min(minx∈[x,x+ϵ](F(x)), minx∈[x−ϵ,x](F(x))) where F represents the computation performed by the target network . 4 Experiments Implementation. We implement Neurify with about 26,000 lines of C code. We use the highly optimized OpenBLAS1 library for matrix multiplications and lp_solve 5.52 for solving the linear constraints generated during the directed constraint refinement process. We further use Gurobi 8.0.0 solver for L2-bounded safety properties. All our evaluations were performed on a Linux server running Ubuntu 16.04 with 8 CPU cores and 256GB memory. Besides, Neurify uses optimization like thread rebalancing for parallelization and outward rounding to avoid incorrect results due to floating point imprecision. Details of such techniques can be found in Section 3 of the supplementary material. Table 1: Details of the evaluated networks and corresponding safety properties. The last three columns summarize the number of safety properties that are satisfied, violated, and timed out, respectively as found by Neurify with a timeout threshold of 1 hour. Dataset Models # of ReLUs Architecture Safety Property Safe Violated Timeout ACAS Xu [16] ACAS Xu 300 <5, 50, 50, 50, 50, 50, 50, 5># C.P.∗ in [39] 141 37 0 MNIST [21] MNIST_FC1 48 <784, 24, 24, 10># L∞ 267 233 0 MNIST_FC2 100 <784, 50, 50, 10># L∞ 271 194 35 MNIST_FC3 1024 <784, 512, 512, 10># L∞ 322 41 137 MNIST_CN 4804 <784, k:16*4*4 s:2, k:32*4*4 s:2, 100, 10>+ L∞ 91 476 233 Drebin [5] Drebin_FC1 100 <545334, 50, 50, 2># C.P.∗ in [29] 458 21 21 Drebin_FC2 210 <545334, 200, 10, 2># 437 22 41 Drebin_FC3 400 <545334, 200, 200, 2># 297 27 176 Car [2] DAVE 10276 <30000, k:24*5*5 s:5, k:36*5*5 s:5, 100, 10>+ L∞,L1, Brightness, Contrast 80 82 58 * Custom properties. # <x, y, ...> denotes hidden layers with x neurons in first layer, y neurons in second layer, etc. + k:c*w*h s:stride denotes the output channel (c), kernel width (w), height (h) and stride (stride). 4.1 Properties Checked by Neurify for Each Model Summary. To evaluate the performance of Neurify, we test it on nine models trained over five datasets for different tasks where each type of model includes multiple architectures. Specifically, we evaluate on fully connected ACAS Xu models [16], three fully connected Drebin models [5], three fully connected MNIST models [21], one convolutional MNIST model [42], and one convolutional self-driving car model [2]. Table 1 summarizes the detailed structures of these models. We include more detailed descriptions in supplementary material Section 4. All the networks closely follow the publicly-known settings and are either pre-trained or trained offline to achieve comparable performance to the real-world models on these datasets. 1https://www.openblas.net/ 2http://lpsolve.sourceforge.net/5.5/ 6 We also summarize the safety properties checked by Neurify in Table 1 with timeout threshold set to 3,600 seconds. Here we report the result of the self-driving care model (DAVE) to illustrate how we define the safety properties and the numbers of safe and violated properties found by Neurify. We report the other results in supplementary material Section 5. Table 2: Different safety properties checked by Neurify out of 10 random images on Dave within 3600 seconds. (a) ||X′ −X||∞≤ϵ ϵ 1 2 5 8 10 Safe(%) 50 10 0 0 0 Violated(%) 0 20 70 100 100 Timeout(%) 50 70 30 0 0 (b) ||X′ −X||1 ≤ϵ ϵ 100 200 300 500 700 Safe(%) 100 100 10 10 0 Violated(%) 0 0 40 50 60 Timeout(%) 0 0 50 40 40 (c) Brightness: X −ϵ ≤X′ ≤X + ϵ ϵ 10 70 80 90 100 Safe(%) 100 30 20 10 10 Violated(%) 0 30 50 60 70 Timeout(%) 0 40 30 30 20 (d) Contrast: ϵX ≤X′ ≤X or X ≤X′ ≤ϵX ϵ 0.2 0.5 0.99 1.01 2.5 Safe(%) 0 10 100 100 0 Violated(%) 70 20 0 0 50 Timeout(%) 30 70 0 0 50 Dave. We show that Neurify is the first formal analysis tool that can systematically check different safety properties for a large (over 10,000 ReLUs) convolutional self-driving car network, Dave [2, 6]. We use the dataset from Udacity self-driving car challenge containing 101,396 training and 5,614 testing samples [4]. Our model’s architecture is similar to the DAVE-2 self-driving car architecture from NVIDIA [6, 2] and it achieves similar 1-MSE as models used in [29]. We formally analyze the network with inputs bounded by L∞, L1, brightness, and contrast as described in Section 3.3. We define the safe range of deviation of the output steering direction from the original steering angle to be less than 30 degrees. The total number of cases Neurify can verify are shown in Table 2. Table 3: Total cases that can be verified by Neurify on three Drebin models out of 100 random malware apps. The timeout setting here is 3600 seconds. Models Cases(%) 10 50 100 150 200 Drebin_FC1 Safe 0 1 3 5 12 Violated 100 98 97 86 77 Total 100 99 100 91 89 Drebin_FC2 Safe 0 4 4 6 8 Violated 100 96 90 81 70 Total 100 100 94 87 78 Drebin_FC3 Safe 0 4 4 4 15 Violated 100 89 74 23 11 Total 100 93 78 33 26 DREBIN. We also evaluate Neurify on three different Drebin models containing 545,334 input features. The safety property we check is that simply adding app permissions without changing any functionality will not cause the models to misclassify malware apps as benign. Here we show in Table 3 that Neurify can formally verify safe and unsafe cases for most of the apps within 3,600 seconds. 4.2 Comparisons with Other Formal Checkers ACAS Xu. Unmanned aircraft alert systems (ACAS Xu) [19] are networks advising steering decisions for aircrafts, which is on schedule to be installed in over 30,000 passengers and cargo aircraft worldwide [26] and US Navy’s fleets [1]. It is comparably small and only has five input features so that ReluVal [39] can efficiently check different safety properties. However, its performance still suffers from the over-approximation of output ranges due to the concretizations introduced during symbolic interval analysis. Neurify leverages symbolic linear relaxation and achieves on average 20× better performance than ReluVal [39] and up to 5,000× better performance than Reluplex [17]. In Table 4, we summarize the time and speedup of Neurify compared to ReluVal and Reluplex for all the properties tested in [17, 39]. 7 6 Acknowledgements We thank the anonymous reviewers for their constructive and valuable feedback. This work is sponsored in part by NSF grants CNS-16-17670, CNS-15-63843, and CNS-15-64055; ONR grants N00014-17-1-2010, N00014-16-1- 2263, and N00014-17-1-2788; and a Google Faculty Fellowship. Any opinions, findings, conclusions, or recommendations expressed herein are those of the authors, and do not necessarily reflect those of the US Government, ONR, or NSF. References [1] NAVAIR plans to install ACAS Xu on MQ-4C fleet. https://www.flightglobal.com/news/ articles/navair-plans-to-install-acas-xu-on-mq-4c-fleet-444989/. [2] Nvidia-Autopilot-Keras. https://github.com/0bserver07/Nvidia-Autopilot-Keras. [3] Tesla’s autopilot was involved in another deadly car crash. https://www.wired.com/story/teslaautopilot-self-driving-crash-california/. [4] Using Deep Learning to Predict Steering Angles. https://github.com/udacity/self-driving-car. [5] D. Arp, M. Spreitzenbarth, M. Hubner, H. Gascon, K. Rieck, and C. Siemens. Drebin: Effective and explainable detection of android malware in your pocket. In Proceedings of the Network and Distributed System Security Symposium, volume 14, pages 23–26, 2014. [6] M. Bojarski, D. Del Testa, D. Dworakowski, B. Firner, B. Flepp, P. Goyal, L. D. Jackel, M. Monfort, U. Muller, J. Zhang, et al. End to end learning for self-driving cars. IEEE Intelligent Vehicles Symposium, 2017. [7] S. Dutta, S. Jha, S. Sankaranarayanan, and A. Tiwari. Output range analysis for deep feedforward neural networks. In NASA Formal Methods Symposium, pages 121–138. Springer, 2018. [8] K. Dvijotham, S. Gowal, R. Stanforth, R. Arandjelovic, B. O’Donoghue, J. Uesato, and P. Kohli. Training verified learners with learned verifiers. arXiv preprint arXiv:1805.10265, 2018. [9] K. Dvijotham, R. Stanforth, S. Gowal, T. Mann, and P. Kohli. A dual approach to scalable verification of deep networks. The Conference on Uncertainty in Artificial Intelligence, 2018. [10] R. Ehlers. Formal verification of piece-wise linear feed-forward neural networks. 15th International Symposium on Automated Technology for Verification and Analysis, 2017. [11] R. Eldan. A polynomial number of random points does not determine the volume of a convex body. Discrete & Computational Geometry, 46(1):29–47, 2011. [12] M. Fischetti and J. Jo. Deep neural networks as 0-1 mixed integer linear programs: A feasibility study. arXiv preprint arXiv:1712.06174, 2017. [13] T. Gehr, M. Mirman, D. Drachsler-Cohen, P. Tsankov, S. Chaudhuri, and M. Vechev. Ai 2: Safety and robustness certification of neural networks with abstract interpretation. In IEEE Symposium on Security and Privacy, 2018. [14] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. International Conference on Learning Representations, 2015. [15] X. Huang, M. Kwiatkowska, S. Wang, and M. Wu. Safety verification of deep neural networks. In International Conference on Computer Aided Verification, pages 3–29. Springer, 2017. [16] K. D. Julian, J. Lopez, J. S. Brush, M. P. Owen, and M. J. Kochenderfer. Policy compression for aircraft collision avoidance systems. In 35th Digital Avionics Systems Conference, pages 1–10. IEEE, 2016. [17] G. Katz, C. Barrett, D. Dill, K. Julian, and M. Kochenderfer. Reluplex: An efficient smt solver for verifying deep neural networks. International Conference on Computer Aided Verification, 2017. [18] G. Katz, C. Barrett, D. L. Dill, K. Julian, and M. J. Kochenderfer. Towards proving the adversarial robustness of deep neural networks. 1st Workshop on Formal Verification of Autonomous Vehicles, 2017. [19] M. J. Kochenderfer, J. E. Holland, and J. P. Chryssanthacopoulos. Next-generation airborne collision avoidance system. Technical report, Massachusetts Institute of Technology-Lincoln Laboratory Lexington United States, 2012. 10 [20] P. W. Koh and P. Liang. Understanding black-box predictions via influence functions. International Conference on Machine Learning, 2017. [21] Y. LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998. [22] M. Lecuyer, V. Atlidakis, R. Geambasu, H. Daniel, and S. Jana. Certified robustness to adversarial examples with differential privacy. arXiv preprint arXiv:1802.03471, 2018. [23] J. Li, W. Monroe, and D. Jurafsky. Understanding neural networks through representation erasure. arXiv preprint arXiv:1612.08220, 2016. [24] M. Mirman, T. Gehr, and M. Vechev. Differentiable abstract interpretation for provably robust neural networks. In International Conference on Machine Learning, pages 3575–3583, 2018. [25] G. F. Montufar, R. Pascanu, K. Cho, and Y. Bengio. On the number of linear regions of deep neural networks. In Advances in neural information processing systems, pages 2924–2932, 2014. [26] M. T. Notes. Airborne collision avoidance system x. MIT Lincoln Laboratory, 2015. [27] R. Pascanu, G. Montufar, and Y. Bengio. On the number of response regions of deep feed forward networks with piece-wise linear activations. Advances in neural information processing systems, 2013. [28] J. Peck, J. Roels, B. Goossens, and Y. Saeys. Lower bounds on the robustness to adversarial perturbations. In Advances in Neural Information Processing Systems, pages 804–813, 2017. [29] K. Pei, Y. Cao, J. Yang, and S. Jana. Deepxplore: Automated whitebox testing of deep learning systems. In 26th Symposium on Operating Systems Principles, pages 1–18. ACM, 2017. [30] K. Pei, Y. Cao, J. Yang, and S. Jana. Towards practical verification of machine learning: The case of computer vision systems. arXiv preprint arXiv:1712.01785, 2017. [31] L. Pulina and A. Tacchella. An abstraction-refinement approach to verification of artificial neural networks. In International Conference on Computer Aided Verification, pages 243–257. Springer, 2010. [32] A. Raghunathan, J. Steinhardt, and P. Liang. Certified defenses against adversarial examples. International Conference on Learning Representations, 2018. [33] M. J. C. Ramon E. Moore, R. Baker Kearfott. Introduction to Interval Analysis. SIAM, 2009. [34] A. Shrikumar, P. Greenside, and A. Kundaje. Learning important features through propagating activation differences. International Conference on Machine Learning, 2017. [35] M. Spreitzenbarth, F. Freiling, F. Echtler, T. Schreck, and J. Hoffmann. Mobile-sandbox: having a deeper look into android applications. In 28th Annual ACM Symposium on Applied Computing, pages 1808–1815. ACM, 2013. [36] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. International Conference on Learning Representations, 2013. [37] Y. Tian, K. Pei, S. Jana, and B. Ray. DeepTest: Automated testing of deep-neural-network-driven autonomous cars. In 40th International Conference on Software Engineering, 2018. [38] V. Tjeng, K. Xiao, and R. Tedrake. Evaluating robustness of neural networks with mixed integer programming. arXiv preprint arXiv:1711.07356, 2017. [39] S. Wang, K. Pei, W. Justin, J. Yang, and S. Jana. Formal security analysis of neural networks using symbolic intervals. 27th USENIX Security Symposium, 2018. [40] T.-W. Weng, H. Zhang, H. Chen, Z. Song, C.-J. Hsieh, D. Boning, I. S. Dhillon, and L. Daniel. Towards fast computation of certified robustness for relu networks. arXiv preprint arXiv:1804.09699, 2018. [41] T.-W. Weng, H. Zhang, P.-Y. Chen, J. Yi, D. Su, Y. Gao, C.-J. Hsieh, and L. Daniel. Evaluating the robustness of neural networks: An extreme value theory approach. International Conference on Learning Representations, 2018. [42] E. Wong and J. Z. Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. International Conference on Machine Learning, 2018. [43] E. Wong, F. Schmidt, J. H. Metzen, and J. Z. Kolter. Scaling provable adversarial defenses. Advances in Neural Information Processing Systems, 2018. [44] H. Zhang, T.-W. Weng, P.-Y. Chen, C.-J. Hsieh, and L. Daniel. Efficient neural network robustness certification with general activation functions. Advances in Neural Information Processing Systems, 2018. 11
2018
207
7,372
Inferring Networks From Random Walk-Based Node Similarities Jeremy G. Hoskins Department of Mathematics Yale University New Haven, CT jeremy.hoskins@yale.edu Cameron Musco Microsoft Research Cambridge, MA camusco@microsoft.com Christopher Musco Department of Computer Science Princeton University Princeton, NJ cmusco@cs.princeton.edu Charalampos E. Tsourakakis Department of Computer Science Boston University & Harvard University Boston, MA ctsourak@bu.edu Abstract Digital presence in the world of online social media entails significant privacy risks [31, 56]. In this work we consider a privacy threat to a social network in which an attacker has access to a subset of random walk-based node similarities, such as effective resistances (i.e., commute times) or personalized PageRank scores. Using these similarities, the attacker seeks to infer as much information as possible about the network, including unknown pairwise node similarities and edges. For the effective resistance metric, we show that with just a small subset of measurements, one can learn a large fraction of edges in a social network. We also show that it is possible to learn a graph which accurately matches the underlying network on all other effective resistances. This second observation is interesting from a data mining perspective, since it can be expensive to compute all effective resistances or other random walk-based similarities. As an alternative, our graphs learned from just a subset of effective resistances can be used as surrogates in a range of applications that use effective resistances to probe graph structure, including for graph clustering, node centrality evaluation, and anomaly detection. We obtain our results by formalizing the graph learning objective mathematically, using two optimization problems. One formulation is convex and can be solved provably in polynomial time. The other is not, but we solve it efficiently with projected gradient and coordinate descent. We demonstrate the effectiveness of these methods on a number of social networks obtained from Facebook. We also discuss how our methods can be generalized to other random walk-based similarities, such as personalized PageRank scores. Our code is available at https://github.com/cnmusco/graph-similarity-learning. 1 Introduction In graph mining and social network science, a variety of measures are used to quantify the similarity between nodes in a graph, including the shortest path distance, Jaccard’s coefficient between node neighborhoods, the Adamic-Adar coefficient [2], and hub-authority-based metrics [30, 9]. An important family of similarity measures are based on random walks, including SimRank [23], random walks with restarts [50], commute times [18], personalized PageRank [39, 24], and DeepWalk embeddings [40]. These measures capture both local and global graph structure and hence are widely used in graph clustering and community detection [4, 44], anomaly detection [42], collaborative filtering [18, 45, 55], link prediction [35], computer vision [20], and many other applications. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In this work we focus on these random walk-based similarity metrics. We initiate the study of a fundamental question: How much information about a network can be learned given access to a subset of potentially noisy estimates of pairwise node similarities? This question is important from a privacy perspective. A common privacy breach is social link disclosure [6, 56], in which an attacker attempts to learn potentially sensitive links between nodes in a network. Such attacks are very common; fake accounts are used to infiltrate social groups, potential employers may want to inspect a job candidate’s social network, and advertisers may wish to probe a user’s information to offer targeted ads. Thus, studying the ability of an attacker to reveal link information using node similarities is important in understanding the privacy implications of releasing similarities, or information that can be used to compute them. There are many scenarios in which node similarities may be released, either directly or indirectly, with the potential to reveal private link information. For example, when searching for users on a social network platform, node similarity is indirectly revealed since similar users (in terms of social connections) are often displayed together in search results. As a second example, random walk-based graph embeddings (e.g. PageRank or DeepWalk embeddings) may be released publicly for research purposes since, naively, they appear to contain no identifying information. From a data mining perspective, computing all pairwise node similarities can be infeasible for large networks since the number of similarities grows quadratically in the number of nodes. Additionally, when the network cannot be accessed in full but can only be probed via crawling [28], we may only have access to similarity estimates rather than their exact values. Thus, understanding what information can be learned from a partial, potentially noisy, set of node similarities is important when using these metrics in large scale graph mining. Finally, in some scenarios, it may be possible to measure node similarities for an underlying graph, which we cannot directly access but wish to recover. For example, in evolutionary ecology, effective resistance distances in planar “environment graphs” have been shown to correlate with genetic differentiation in geographically distributed populations [36, 37, 41]. In this context, measurements of geographic genetic variation give incomplete and noisy measurements of effective resistances. Recovering an underlying graph from these measurements corresponds to recovering plausible limitations on migration and movement that could have led to the observed genetic variations. 1.1 Learning from Effective Resistances In this paper, we focus on commute times, which are one of the most widely used random walk-based similarities. Commute times are a scaled version of effective resistances, they form a metric, and have many algorithmic applications [47]. Our ideas can be extended to related similarity measures, such as personalized PageRank, which we discuss in Appendix E. It was shown in the seminal work of Liben-Nowell and Kleinberg that effective resistances can be used to predict a significant fraction of future links appearing in networks from existing links, typically ranging from 5% up to 33% [35]. A difficulty associated with this task is that, in contrast to local similarity measures such as the number of common neighbors or the Adamic-Adar coefficient [2], node similarity under the effective resistance metric does not necessarily imply local connectivity. For example, two nodes connected by many long paths may be more similar than two nodes directly connected by a single edge. Furthermore, in certain cases, the effective resistance between two nodes u, v tends to correlate well with a simple function of the degree sequence (specifically, 1 d(u) + 1 d(v)) [52, 53], and it is known that there are many graphs with the same degree sequence but very different global structures. Nevertheless, considered in aggregate, effective resistances encode global structure in a very strong way. For any graph, given all pairs effective resistances, it is possible to provably recover the full graph in polynomial time [46, 54]! This contrasts with purely local similarity metrics, which can be used heuristically for link prediction, but do not give network reconstruction in general. For instance, all-pairwise counts of common neighbors in any triangle free graph equal 0, and thus they reveal no information about graph structure. While the full information case is well understood, when all exact effective resistances are not available, little is known about what graph information can be learned. Some work considers 2 reconstruction of trees based on a subset of effective resistances [15, 7, 48]. However outside of this special case, essentially nothing is known. Related Work. Our work is closely related to work on link prediction, graph reconstruction, and phylogenetic tree reconstruction from pairwise distances. We give an overview in Appendix A. 1.2 Our Contributions We study theoretically and empirically what can be learned about a graph given a subset of potentially noisy effective resistance estimates. Our main contributions are: Mathematical formulation. We provide an optimization-based formulation of the problem of learning a graph from effective resistances. Specifically, given a set of effective resistance measurements, we seek a graph whose effective resistances match the given resistances as closely as possible. In general, there may be many different graphs which match any subset of all pairs effective resistances, and hence many minimizers to our optimization problem. If the resistances additionally have some noise, there may be no graph which matches them exactly but many which match them approximately. Nevertheless, as we show empirically, the graph obtained via our optimization approach typically recovers significant information about the underlying graph, including a large fraction of its edges, its global structure, and good approximations to all of its effective resistances. Algorithms. We prove that, in some cases, the optimization problem we present can be solved exactly, in polynomial time. However, in general, the problem is non-convex and does not admit an obvious polynomial time solution. We show that it can be solved via iterative methods along with a powerful initialization strategy that allows us to find high quality solutions in most instances. We also show that the problem can be relaxed to a convex formulation. Instead of searching for a graph that matches all given effective resistance measurements, we just find a graph whose effective resistances are upper bounded by those given and which has minimum total edge weight. This modified problem is convex and can be solved via an SDP. Experimental Results. We evaluate our algorithms on synthetic graphs and real Facebook ego networks, which contain all nodes in the social circle of a user. Ego networks are important in many applications and allow us to effectively test our ability to recover local graph structure. We show that, given a small randomly selected fraction of all effective resistance pairs (10%-25%), we can learn a large fraction of a network – typically between 20% and 60% of edges, even after adding noise to the given effective resistances. We also show that by finding a graph which closely matches the given set of effective resistances (via our optimization approach), we in fact find a graph which closely matches the underlying network on all effective resistance pairs. This indicates that significant information contained in all pairs effective resistances can be learned from just a small subset of these pairs, even when corrupted by noise. 2 Proposed Method 2.1 Notation and Preliminaries For an undirected, weighted graph G = (V, E, w) with n nodes, we let A be the n ⇥n adjacency matrix. L denotes the graph Laplacian: L = D −A, where D is a diagonal matrix with Di,i equal to the weighted degree of node i. For an integer n > 0, [n] denotes the set {1, 2, ..., n}. ei denotes the ith standard basis vector. For a matrix M, Mi,j denotes the entry in its ith row and jth column. Commute time and effective resistance. For two nodes u, v 2 V , the hitting time hG(u, v) is the expected time it takes a random walk to travel from u to v. The commute time is its symmetrized version cG(u, v) = hG(u, v) + hG(v, u), i.e., the time to move from u to v and then back to u. For connected graphs, the effective resistance between u, v is a scaling of the commute time: rG(u, v) = cG(u,v) vol(G) where vol(G) = 2 P e2E we. Effective resistance has a natural electrical interpretation. When G is viewed as an electrical network on n nodes where each edge e corresponds to a link of conductance we (equivalently to a resistor of resistance 1 we ), the effective resistance is the 3 voltage difference that appears across u, v when a unit current source is applied to them. Effective resistances (and hence commute times) always form a metric [29]. Let χu,v = eu −ev. The effective resistance between nodes u and v in a graph G with Laplacian L is rG(u, v) = χT u,vL+χu,v. (1) Here L+ denotes the Moore-Penrose pseudoinverse of L. 2.2 Problem Definition We begin by providing a mathematical formulation of the problem introduced in Section 1 – that of learning the structure of a graph from partial and possibly noisy measurements of pairwise effective resistances. An analogous problem can be defined for other random walk-based similarities, such as personalized PageRank. We discuss initial results in this direction in supplementary Appendix E. Problem 1 (Graph Reconstruction From Effective Resistances). Reconstruct an unknown graph G given a set of noisy effective resistance measurements, ¯r(u, v) = rG(u, v) + nuv for each (u, v) 2 S, where S ✓[n] ⇥[n] is a set of node pairs and nuv is a random noise term. We focus on three interesting cases of Problem 1: Problem 1.1 S = [n] ⇥[n] and nuv = 0 for all (u, v) 2 S. This is the full information setting. Problem 1.2 S is a subset of [n] ⇥[n] and nuv = 0 for all (u, v) 2 S. In this setting we must learn G from a limited number of exact effective resistances. Problem 1.3 S is a subset of [n] ⇥[n] and nuv is a random term, e.g. a mean 0 normal random variable with variance σ2: nuv ⇠N(0, σ2). It is known that there in a unique graph consistent with any full set of effective resistance measurements (see e.g., [46, 54]). Additionally, this graph can be computed by solving a fully determined linear system. So, we can solve Problem 1.1 exactly in polynomial time (see Section 3.1). From a privacy and data mining perspective, the limited information settings of Problems 1.2 and 1.3 are more interesting. In Section 3.1 we show that, when G is a tree, exact recovery is possible for Problem 1.2 when S is a superset of G’s edges. However, in general, there is no closed form solution to these problems, and exact recovery of G is typically impossible – several graphs may be consistent with the measurements given. We address these cases by reposing Problem 1 as an optimization problem, in which we attempt to recover a graph matching the given resistances as best as possible. 2.3 Optimization Formulation A natural formalization of Problem 1 is as a least squares problem. Problem 2. Given a set of vertex pairs S ✓[n] ⇥[n] and a target effective resistance ¯r(u, v) for each (u, v) 2 S: minimize graph H F(H) def = X (u,v)2S [rH(u, v) −¯r(u, v)]2 . (2) Using formula (1) for effective resistances, Problem 2 can equivalently be viewed as an optimization problem over the set of graph Laplacians: minimize P (u,v)2S ⇥ χT u,vL+χu,v −¯r(u, v) ⇤2. While this set is convex, the objective function is not and it is unclear if it can be minimized provably in polynomial time. Nevertheless, we show in Section 3.2 that it is possible to solve the problem approximately by combining projected gradient and coordinate descent algorithms with a powerful initialization heuristic. This approach quickly converges to near global minimums for many networks. For Problem 1.2, where ¯r(u, v) comprise a subset of the exact effective resistances for some graph G, minH F(H) = 0. This minimum may be achieved by multiple graphs (including G) if S does not 4 contain all effective resistance pairs. Nevertheless, we show experimentally in Section 4 that even when S contains a small fraction of these pairs, an approximate solution to Problem 2 often recovers significant information about G, including a large fraction of its edges. Interestingly, while Problem 2 only minimizes over the subset S, the recovered graph typically matches G on all effective resistances, explaining why it contains so much structural information. For Problem 1.3, if S = [n] ⇥[n] and the noise terms nuv are distributed as i.i.d. Gaussians, Problem 2 gives the maximum likelihood estimator for G. We again show that an approximate solution can recover many of G’s edges. We note that while we can solve Problem 2 quickly via iterative methods, we leave open provable polynomial time algorithms in the settings of both Problems 1.2 and 1.3. Convex relaxation. As an alternative to Problem 2, we give an optimization formulation of Problem 1 that is convex. Here we optimize over the convex set of graph Laplacians. Problem 3. Let L be the convex set of n ⇥n graph Laplacians. Given a set of vertex pairs S ✓[n] ⇥[n] and a target effective resistance ¯r(u,v) for every (u, v) 2 S, minimize L2L Tr(L) subject to χT u,vL+χu,v ¯r(u, v) 8(u, v) 2 S By Rayleigh’s monotonicity law, decreasing the weight on edges in L increases effective resistances. Tr(L) is equal to the total degree of the graph corresponding to L, so the problem asks us to find a graph with as little total edge weight as possible that still satisfies the effective resistance constraints. The disadvantage of Problem 3 is that it only encodes the target resistances ¯r(u, v) as upper bounds on the resistances of L. The advantage is that we can solve it provably in polynomial time via semidefinite programming (see supplemental Appendix C). In practice, we find that it can sometimes effectively learn graph edges and structure from limited measurements. Problem 3 is related to work on convex methods for minimizing total effective resistance or relatedly, mixing time in graphs [10, 49, 19]. However, prior work does not consider pairwise resistance constraints and so is not suited to graph learning. 3 Analytical Results and Algorithms 3.1 Full Graph Reconstruction – Problem 1 Problem 1 can be solved exactly in polynomial time when S contains all resistance pairs of some graph G (i.e. Problem 1.1). In this case, there is a closed form solution for G’s Laplacian L and the solution is unique. This was pointed out in [46], however we include our own proof in the supplementary Appendix B for completeness. Theorem 1 (Lemma 9.4.1. of [46]). If there is a feasible solution to Problem 1.1 , it is unique and can be found in O(n3) time. Let R be a matrix with Ru,v = rG(u, v) for all u, v 2 [n]. The Laplacian L of the solution G is −2 · ✓ I −J n ◆ R ✓ I −J n ◆(+ . (3) Here I is the n ⇥n identity matrix and J is the n ⇥n all ones matrix. Reconstruction from hitting times. The above immediately generalizes to graph reconstruction from hitting times since, as discussed, for connected G, the effective resistance between u, v can be written as rG(u, v) = cG(u,v) vol(G) = hG(u,v)+hG(v,u) vol(G) . Thus, by Theorem 1, we can recover G up to a scaling from all pairs hitting times. This recovers a result in [54]. Reconstruction from other similarity measures. An analogous result to Theorem 1 holds for graph recovery from all pairs personalized PageRank scores, and for related measures such as Katz similarity scores [27]. We discuss this direction in supplementary Appendix E. Are all pairs always necessary for perfect reconstruction? For general graphs, Problem 1 can only be solved exactly when S contains all )n 2 * true effective resistances. However, given additional 5 constraints on G, recovery is possible with much less information. In particular, we show in Appendix B that when G is a tree, we can recover it (i.e., solve Problem 1.2) if S is a superset of its edge set. The problem of recovering trees from pairwise distances is a central problem in phylogenetics. 3.2 Graph Learning via Least Squares Minimization – Problem 2 When Problem 1 cannot be solved exactly, e.g. in the settings of Problems 1.2 and 1.3, an effective surrogate is to solve Problem 2 to find a graph with effective resistances close to the given target resistances. As we demonstrate experimentally in Section 4, this yields good solutions to Problems 1.2 and 1.3 in many cases. Problem 2 is non-convex, however we show that a good solution can often be found efficiently via projected gradient descent. Optimizing over edge weights. Let m = )n 2 * . We write the Laplacian of the graph H as L(w) def = BT diag(w)B, where w 2 Rm is a non-negative vector whose entries correspond to the edge weights in H, diag(w) is the m ⇥m matrix with w as its diagonal, and B 2 Rm⇥n is the vertex edge incidence matrix with a row equal to χu,v = eu −ev for every possible edge (u, v) 2 [n] ⇥[n]. Optimizing the objective function F(H) in Problem 2 is equivalent to optimizing F(w) over the edge weight vector w, where we define F(w) = F(H) for the unique H with Laplacian equal to L(w). We restrict wi ≥0 for all i and project to this constraint after each gradient step by setting wi := max(wi, 0). The gradient of F(w) can be computed in closed form. We first define the variable, R(w) 2 Rm⇥m, whose diagonal contains all effective resistances of H with weight vector w: Definition 1. For w 2 Rm with wi ≥0 for all i, define R(w) = BL(w)+BT . Using R(w) we can compute the gradient of F(w) by: Proposition 1. Let ◦denote the Hadamard (entrywise) product for matrices. Define the error vector ∆(w) 2 Rm as having ∆(w)i = ¯r(i) −[R(w)]i,i for all i 2 S and 0s elsewhere. We have: rF(w) = 2 (R(w) ◦R(w)) ∆(w). We give a proof in Appendix B, along with a formula for the Hessian of F(w). Acceleration via coordinate descent. Naively computing the gradient rF(w) via Proposition 1 requires computing the full m ⇥m matrix R(w), which can be prohibitively expensive for large graphs – recall that m = )n 2 * = O(n2). Note however, that the error vector ∆(w) only has nonzero entries at positions corresponding to the node pairs in S. Thus, it suffices to compute just |S| columns of R(w) corresponding to these pairs, which can give a significant savings. We obtain further savings using block coordinate descent. At each step we restrict our updates to a random subset of edges B ✓[n] ⇥[n], and so only form the rows of R(w) corresponding to these edges. Initialization. A good initialization can significantly accelerate the solution of Problem 2. We use a strategy based on the exact solution to Problem 1.1 in Theorem 1. Since effective resistances form a metric, by triangle inequality, for any u, v, w 2 [n], rH(u, v)  rH(u, w) + rH(w, v). Guided by this fact, given targets ¯r(u, v) for (u, v) 2 S, we first “fill in” the constraint set. For (w, z) /2 S, we set ¯r(w, z) equal to the shortest path distance in the graph ¯G which has an edge for each pair in S with length ¯r(u, v). We thus obtain a full set of target effective resistances. We can form R with Ru,v = ¯r(u, v) and initialize the Laplacian of H using the formula given in (3) in Theorem 1. However, this formula is quite unstable and generally yields an output which is far from a Laplacian even when R is corrupted by a small amount of noise. So we instead compute for some λ > 0, a regularized estimate, ˜L = −2 · ⇥) I −J n * R ) I −J n * + λI ⇤+ . Generally, ˜L will not be a valid graph Laplacian, so we remove any negative edge weights to obtain our initialization. 4 Empirical results We next present an experimental study of how well our methods can learn a graph given a set of (noisy) effective resistance measurements. We focus on two key questions: 6 1. Given a set of effective resistance measurements, can we find a graph matching these measurements via the optimization formulations of Problems 2 and 3 and the algorithms of Section 3.2? 2. What structure does the graph we learn share with the underlying network that produced the resistance measurements? Can it be used to uncover links? Does it approximately match the network on effective resistances outside the measurement set, or share other global structure? 4.1 Experimental Setup We address these questions by examining a variety of graphs. We study two synthetic examples: an 8 ⇥8 grid graph and a k-nearest neighbor graph constructed for vectors drawn from a Gaussian mixture model with two clusters. We also consider Facebook ‘ego networks’ obtained from the Stanford Network Analysis Project (SNAP) collection [33, 34]. Each of these networks is formed by taking the largest connected component in the social circle of a specific user. Details on the networks studied are shown in Table 2 in supplemental Appendix D. For all experiments, we provide our algorithms with effective resistances uniformly sampled from the set of all )n 2 * effective resistances. We sample a fixed fraction f def= ) |S|/ )n 2 ** ⇥100% of all possible measurements. We typically use f 2 {10, 25, 50, 100}%. In some cases, these resistances are corrupted with i.i.d. Gaussian noise ⌘⇠N(0, σ2). We experiment with different values of σ2. For Problem 2 we implemented gradient decent based on the closed-from gradient calculation in Proposition 1. Line search was used to optimize step size at each iteration. For larger problems, block coordinate descent was used as described in Section 3.2, with the coordinate set chosen uniformly at random in each iteration. We set the block size |B| = 5000. For Problem 3 we used the MOSEK convex optimization software, accessed through the CVX interface [38, 21]. All experiments were run on a laptop with a 2.6 GHz Intel Core i7 processor and 16 GB of main memory. 4.2 Learning Synthetic Graphs We first evaluate our algorithms on GRID and K-NN, which are simple graphs with clear structure. Least squares formulation. We first observe that gradient descent effectively minimizes the objective function of Problem 2 on the GRID and K-NN graphs. We consider the normalized objective for constraints S and output graph H: bF(H) = P (u,v)2S [rH(u, v) −¯r(u, v)]2 P (u,v)2S ¯r(u, v)2 . (4) For noise variance 0, minH bF(H) = 0 and in Figure 2 we see that for GRID we in fact find H with bF(H) ⇡0 for varying sizes of S. Convergence is faster when 100% of effective resistances are included in S, but otherwise does not correlate strongly with the number of constraints. Figure 1: Graphs learned by solving Problem 2 with gradient descent for uniformly sampled effective resistances with varying levels of Gaussian noise. Edge width in plots is proportional to edge weight. In Figure 2 we also plot the generalization error: Fgen(H) = P (u,v)2[n]⇥[n] [rH(u, v) −rG(u, v)]2 P (u,v)2[n]⇥[n] r2 G(u, v) , (5) 7 where rG(u, v) is the true effective resistance, uncorrupted by noise. Fgen(H) measures how well the graph obtained by solving Problem 2 matches all effective resistances of the original network. We confirm that generalization decreases with improved objective function performance, indicating that optimizing Problem 2 effectively extracts network structure from a small set of effective resistances. We observe that the generalization error is small even when f = 10%, and becomes negligible as we increase the fraction f of measurements, even in the presence of noise. 0 2000 4000 6000 8000 10000 10-14 10-12 10-10 10-8 10-6 10-4 10-2 100 0 2000 4000 6000 8000 10000 10-14 10-12 10-10 10-8 10-6 10-4 10-2 100 0 2000 4000 6000 8000 10000 10-4 10-3 10-2 10-1 100 0 2000 4000 6000 8000 10000 10-4 10-3 10-2 10-1 100 Figure 2: Objective and generalization error for Problem 2 – see (5). For details, see Section 4.2. We repeat the same experiments with Gaussian noise added to each resistance measurement. The variance of the noise, σ2, is scaled relatively to the mean effective resistance in the graph, i.e., we set ¯r(u, v) = rG(u, v) + N(0, ¯σ2) where: ¯σ2 = σ2 ( n 2) · P (u,v)2[n]⇥[n] rG(u, v). While generally minH bF(H) > 0 when ¯r(u, v) is noisy (since there is no graph consistent with these noisy measurements), the objective value and generalization error still decrease steadily with more iterations. We obtain similar results by applying Problem 2 to the K-NN graph (see Figure 4 in supplemental Appendix D). Again, gradient descent converges for a variety of noise levels and constraint sets. Convergence leads to improved generalization error. Figure 1 shows the graphs obtained from solving the problem for varying σ2 and f. For both graphs, when σ2 = 0 and f = 100%, the original network is recovered exactly. Reconstruction accuracy decreases with increasing noise and a decreasing number of constraints. For GRID, even with 25% of constraints, nearly full recovery is possible for σ2 = 0 and recovery of approximately half of true edges is possible for σ2 = 0.1. For K-NN, for σ2 = 0 and σ2 = 0.1 we observe that cluster structure is recovered. Detailed quantitative results for both networks are given in Table 1. Convex formulation. We next evaluate the performance of the convex Problem 3. In this case, we do not focus on convergence as we solve the problem directly using semidefinite programming. Unlike for Problem 2, solving Problem 3 does not recover the exact input graph, even in the noiseless all pairs effective resistance case. This is because the input graph does not necessarily minimize the objective – there can be graphs with smaller total edge weight and lower effective resistances. However, the learned graphs do capture information about edges in the original: their heaviest edges typically align with true edges in the target graph. We show quantitative results in Table 1 and qualitative results for GRID in Figure 3. We mark the 224 heaviest edges in the learned graph in red and see that this set converges exactly on the grid. The convex formulation never significantly outperforms the least squares formulation of Problem 2, and often significantly underperforms. However, we believe there is further opportunity for exploring Problem 3, especially given its provable runtime guarantees. 4.3 Learning Social Network Graphs We conclude by demonstrating the effectiveness of the least squares formulation of Problem 2 in learning Facebook ego networks from limited effective resistance measurements. We consider three metrics of performance, shown in Table 1 for a number of networks learned from randomly sampled subsets of effective resistances, corrupted with noise. Objective Function Value: the value of the normalized objective function (4) of Problem 2. Generalization Error: the error in reconstructing all effective resistances of the true graph (5). 8 Figure 3: Graphs learned from solving the convex program in Problem 3 for uniformly sampled effective resistances from GRID with varying f, σ2. Heaviest edges marked in red. Edges Learned: the rate of recovery for edges in the true graph. We utilize a standard metric from the link prediction literature [30]: given underlying graph G with m edges and learned graph H, we consider the m heaviest edges of H and compute the percentage of G’s edges contained in this set. Results. We find that as for the synthetic GRID and K-NN graphs, we can effectively minimize the objective function of Problem 2 for the Facebook ego networks. Moreover, this minimization leads to very good generalization error in nearly all cases. i.e., we can effectively learn a graph matching our input on all effective resistances, even when we consider just a small subset. For all graphs, we are able to recover a significant fraction of edges (typically over 20% ), even when just considering 10% or 25% of effective resistance pairs. We obtain the best recovery for small graphs, learning over half of the true edges in FB SMALL A and FB SMALL C. Typically, the number of edges learned increases as we increase the number of constraints and decrease the noise variance. However, occasionally, considering fewer effective resistances in fact improves learning, possibly because we more effectively solve the underlying optimization problem. Table 1: Graph recovery results. All results use a randomly sampled subset of f = 10% or 25% of all effective resistances. For “Algorithm”, GD denotes gradient descent. CD denotes block coordinate descent with random batches of size 5000. “Noise level, σ2” indicates that the target resistances were set to ¯r(u, v) = rG(u, v) + N(0, σ2meanu,v(rG(u, v))). “% Edges baseline”, is the edge density of the network, equivalent to the expected edge prediction accuracy achieved with random guessing. Network Algorithm σ2 Objective function error Effect. resistance generalization error % Edges learned baseline % Edges learned f = 10% f = 25% f = 10% f = 25% f = 10% f = 25% GRID GD 0 .00001 .00001 .06559 .00099 5.56 20.54 88.39 GD .1 .00090 .00514 .08129 .01336 25.89 50.00 SDP 0 na na .08758 .07422 16.07 25.00 SDP .1 na na .09549 .09343 12.50 26.79 K-NN GD 0 .00001 .00002 .01122 .00117 11.58 44.54 72.68 GD .1 .00197 .00447 .05536 .00709 25.96 41.53 SDP 0 na na .09314 .10399 27.05 48.36 SDP .1 na na .11899 .14097 24.32 39.89 FB SMALL A GD 0 .01345 .00001 .21097 .00984 28.20 44.54 75.00 GD .1 .00017 .00204 .07964 .01687 53.64 60.00 FB SMALL B GD 0 .00002 .00003 .01515 .00623 14.59 42.75 48.55 GD .1 .00032 .00206 .02229 .01291 36.23 43.48 FB SMALL C GD 0 .00162 .00166 .00217 .00203 15.55 57.03 59.51 GD .1 .00532 .00644 .01542 .00218 52.66 57.51 FB SMALL D GD 0 .00335 .00434 .00821 .00830 11.80 21.92 24.52 GD .1 .00610 .18384 .00923 .21426 21.38 21.20 FB MEDIUM A GD 0 .00447 .00665 .02910 .01713 12.78 23.50 25.59 FB MEDIUM B CD 0 .00224 .01255 .00862 .01471 4.80 18.97 22.15 CD .1 .01174 .03182 .01687 .03295 17.50 16.03 FB LARGE A CD 0 .00516 .00796 .00682 .00862 3.41 10.52 12.45 FB LARGE B CD 0 .00524 .00440 .00635 .00580 9.51 20.26 24.95 CD .1 .12745 .34646 .14532 .36095 19.43 16.97 9 References [1] Rediet Abebe and Vasileios Nakos. Private link prediction in social networks. 2014. [2] Lada A. Adamic and Eytan Adar. Friends and neighbors on the web. Social Networks, 25(3):211–230, 2003. [3] Mohammad Al Hasan and Mohammed J. Zaki. A survey of link prediction in social networks. In Social Network Data Analytics, pages 243–275. Springer, 2011. [4] Reid Andersen, Fan Chung, and Kevin Lang. Local graph partitioning using PageRank vectors. In 47th Annual Symposium on Foundations of Computer Science, 2006. [5] Dana Angluin and Jiang Chen. Learning a hidden graph using o(logn) queries per edge. Journal of Computer and System Sciences, 74(4):546–556, 2008. [6] Lars Backstrom, Cynthia Dwork, and Jon Kleinberg. Wherefore art thou?: Anonymized social networks, hidden patterns, and structural steganography. In Proceedings of the 16th International Conference on World Wide Web, pages 181–190. ACM, 2007. [7] Vladimir Batagelj, Tomaž Pisanski, and J. M. S. Sim os Pereira. An algorithm for treerealizability of distance matrices. International Journal of Computer Mathematics, 34(3-4):171– 176, 1990. [8] Anna Ben-Hamou, Roberto I. Oliveira, and Yuval Peres. Estimating graph parameters via random walks with restarts. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, 2018. [9] Vincent D Blondel, Anahí Gajardo, Maureen Heymans, Pierre Senellart, and Paul Van Dooren. A measure of similarity between graph vertices: Applications to synonym extraction and web searching. SIAM Review, 46(4):647–666, 2004. [10] Stephen Boyd, Persi Diaconis, and Lin Xiao. Fastest mixing Markov chain on a graph. SIAM Review, 2004. [11] Rui Castro, Mark Coates, Gang Liang, Robert Nowak, and Bin Yu. Network tomography: Recent developments. Statistical Science, pages 499–517, 2004. [12] Ashok K Chandra, Prabhakar Raghavan, Walter L Ruzzo, Roman Smolensky, and Prasoon Tiwari. The electrical resistance of a graph captures its commute and cover times. Computational Complexity, 6(4):312–340, 1996. [13] Daniel Chen, Leonidas J. Guibas, John Hershberger, and Jian Sun. Road network reconstruction for organizing paths. In Proceedings of the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1309–1320. Society for Industrial and Applied Mathematics, 2010. [14] Colin Cooper, Tomasz Radzik, and Yiannis Siantos. Estimating network parameters using random walks. Social Network Analysis and Mining, 4(1):168, 2014. [15] Joseph C. Culberson and Piotr Rudnicki. A fast algorithm for constructing trees from distance matrices. Information Processing Letters, 30(4):215 – 220, 1989. [16] Richard Desper, Feng Jiang, Olli-P Kallioniemi, Holger Moch, Christos H Papadimitriou, and Alejandro A Schäffer. Inferring tree models for oncogenesis from comparative genome hybridization data. Journal of Computational Biology, 6(1):37–51, 1999. [17] Joseph Felsenstein. Confidence limits on phylogenies: an approach using the bootstrap. Evolution, 39(4), 1985. [18] Francois Fouss, Alain Pirotte, Jean-Michel Renders, and Marco Saerens. Random-walk computation of similarities between nodes of a graph with application to collaborative recommendation. IEEE Transactions on Knowledge and Data Engineering, 19(3):355–369, 2007. [19] Arpita Ghosh, Stephen Boyd, and Amin Saberi. Minimizing effective resistance of a graph. SIAM Review, 50(1):37–66, 2008. 10 [20] Leo Grady. Random walks for image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(11):1768–1783, 2006. [21] Michael Grant and Stephen Boyd. CVX: Matlab software for disciplined convex programming, Version 2.1, 2014. [22] Taher H. Haveliwala. Topic-sensitive PageRank: A context-sensitive ranking algorithm for web search. IEEE Transactions on Knowledge and Data Engineering, 2003. [23] 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. ACM, 2002. [24] Glen Jeh and Jennifer Widom. Scaling personalized web search. In Proceedings of the 12th International Conference on World Wide Web, pages 271–279. ACM, 2003. [25] Vassilis Kalofolias. How to learn a graph from smooth signals. In The 19th International Conference on Artificial Intelligence and Statistics (AISTATS 2016). Journal of Machine Learning Research (JMLR), 2016. [26] Sampath Kannan, Claire Mathieu, and Hang Zhou. Near-linear query complexity for graph inference. In International Colloquium on Automata, Languages, and Programming. Springer, 2015. [27] Leo Katz. A new status index derived from sociometric analysis. Psychometrika, 18(1):39–43, 1953. [28] Liran Katzir, Edo Liberty, and Oren Somekh. Estimating sizes of social networks via biased sampling. In Proceedings of the 20th International Conference on World Wide Web. ACM, 2011. [29] Douglas J. Klein and Milan Randi´c. Resistance distance. Journal of Mathematical Chemistry, 12(1):81–95, 1993. [30] Jon Kleinberg, Ravi Kumar, Prabhakar Raghavan, Sridhar Rajagopalan, and Andrew Tomkins. The web as a graph: measurements, models, and methods. Computing and Combinatorics, pages 1–17, 1999. [31] Aleksandra Korolova, Rajeev Motwani, Shubha U Nabar, and Ying Xu. Link privacy in social networks. In Proceedings of the 17th ACM Conference on Information and Knowledge Management, pages 289–298. ACM, 2008. [32] Jure Leskovec, Daniel Huttenlocher, and Jon Kleinberg. Predicting positive and negative links in online social networks. In Proceedings of the 19th International Conference on World Wide Web (WWW). ACM, 2010. [33] Jure Leskovec and Andrej Krevl. SNAP Datasets: Stanford large network dataset collection. http://snap.stanford.edu/data, June 2014. [34] Jure Leskovec and Julian J Mcauley. Learning to discover social circles in ego networks. In Advances in Neural Information Processing Systems, pages 539–547, 2012. [35] David Liben-Nowell and Jon Kleinberg. The link-prediction problem for social networks. Journal of the Association for Information Science and Technology, 58(7):1019–1031, 2007. [36] Brad H McRae. Isolation by resistance. Evolution, 60(8):1551–1561, 2006. [37] Brad H McRae, Brett G Dickson, Timothy H Keitt, and Viral B Shah. Using circuit theory to model connectivity in ecology, evolution, and conservation. Ecology, 89(10):2712–2724, 2008. [38] MOSEK ApS. The MOSEK Optimization Suite, 2017. [39] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The PageRank citation ranking: Bringing order to the web. Technical report, Stanford InfoLab, 1999. 11 [40] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. DeepWalk: Online learning of social representations. In Proceedings of the 20th ACM International Conference on Knowledge Discovery and Data Mining, 2014. [41] David Pilliod, Robert Arkle, Jeanne Robertson, Melanie Murphy, and W. Chris Funk. Effects of changing climate on aquatic habitat and connectivity for remnant populations of a wide-ranging frog species in an arid landscape. 5, 08 2015. [42] Matthew J Rattigan and David Jensen. The case for anomalous link discovery. ACM SIGKDD Explorations Newsletter, 7(2):41–47, 2005. [43] Lev Reyzin and Nikhil Srivastava. On the longest path algorithm for reconstructing trees from distance matrices. Information Processing Letters, 101(3):98–100, 2007. [44] Marco Saerens, Francois Fouss, Luh Yen, and Pierre Dupont. The principal components analysis of a graph, and its relationships to spectral clustering. In ECML, volume 3201, pages 371–383, 2004. [45] Purnamrita Sarkar and Andrew Moore. A tractable approach to finding closest truncatedcommute-time neighbors in large graphs. In Proceedings of the Twenty-Third Conference Annual Conference on Uncertainty in Artificial Intelligence (UAI-07), pages 335–343, 2007. [46] Daniel A. Spielman. Trees and distances. University Lecture, 2012. [47] Daniel A. Spielman and Nikhil Srivastava. Graph sparsification by effective resistances. SIAM Journal on Computing, 40(6):1913–1926, 2011. [48] Eric A. Stone and Alexander R. Griffing. On the Fiedler vectors of graphs that arise from trees by Schur complementation of the Laplacian. Linear Algebra and its Applications, 431(10):1869 – 1880, 2009. [49] Jun Sun, Stephen Boyd, Lin Xiao, and Persi Diaconis. The fastest mixing Markov process on a graph and a connection to a maximum variance unfolding problem. SIAM Review, 48(4):681– 699, 2006. [50] Hanghang Tong, Christos Faloutsos, and Jia-Yu Pan. Fast random walk with restart and its applications. 2006. [51] Charalampos E Tsourakakis, Michael Mitzenmacher, Jarosław Błasiok, Ben Lawson, Preetum Nakkiran, and Vasileios Nakos. Predicting positive and negative links with noisy queries: Theory & practice. arXiv preprint arXiv:1709.07308, 2017. [52] Ulrike Von Luxburg, Agnes Radl, and Matthias Hein. Getting lost in space: Large sample analysis of the resistance distance. In Advances in Neural Information Processing Systems, 2010. [53] Ulrike Von Luxburg, Agnes Radl, and Matthias Hein. Hitting and commute times in large random neighborhood graphs. Journal of Machine Learning Research, 15(1):1751–1798, 2014. [54] Dominik M. Wittmann, Daniel Schmidl, Florian Blöchl, and Fabian J. Theis. Reconstruction of graphs based on random walks. Theoretical Computer Science, 2009. [55] Luh Yen, Francois Fouss, Christine Decaestecker, Pascal Francq, and Marco Saerens. Graph nodes clustering based on the commute-time kernel. Advances in Knowledge Discovery and Data Mining, 2007. [56] Elena Zheleva, Evimaria Terzi, and Lise Getoor. Privacy in social networks. Synthesis Lectures on Data Mining and Knowledge Discovery, 3(1):1–85, 2012. 12
2018
208
7,373
Unsupervised Learning of View-invariant Action Representations Junnan Li Grad. School for Integrative Sciences and Engineering National University of Singapore Singapore lijunnan@u.nus.edu Yongkang Wong School of Computing National University of Singapore Singapore yongkang.wong@nus.edu.sg Qi Zhao Dept. of Computer Science and Engineering University of Minnesota Minneapolis, USA qzhao@cs.umn.edu Mohan S. Kankanhalli School of Computing National University of Singapore Singapore mohan@comp.nus.edu.sg Abstract The recent success in human action recognition with deep learning methods mostly adopt the supervised learning paradigm, which requires significant amount of manually labeled data to achieve good performance. However, label collection is an expensive and time-consuming process. In this work, we propose an unsupervised learning framework, which exploits unlabeled data to learn video representations. Different from previous works in video representation learning, our unsupervised learning task is to predict 3D motion in multiple target views using video representation from a source view. By learning to extrapolate cross-view motions, the representation can capture view-invariant motion dynamics which is discriminative for the action. In addition, we propose a view-adversarial training method to enhance learning of view-invariant features. We demonstrate the effectiveness of the learned representations for action recognition on multiple datasets. 1 Introduction Recognizing human action in videos is a long-standing research problem in computer vision. Over the past years, Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) have emerged as the state-of-the-art learning framework for action recognition [3, 6, 35, 51]. However, the success of existing supervised learning methods is primarily driven by significant amount of manually labeled data, which is expensive and time-consuming to collect. To tackle this problem, a stream of unsupervised methods have recently been proposed [8, 23, 33, 34, 53], which leverage free unlabeled data for representation learning. The key idea is to design a surrogate task that exploits the inherent structure of raw videos, and formulate a loss function to train the network. Some works design the surrogate task as constructing future frames [53] or future motion [33], while others use the temporal order of video frames to learn representations in a self-supervised manner [8, 23, 34]. Although they show promising results, the learned representations are often view-specific, which makes them less robust to view changes. Generally, human action can be observed from multiple views, where the same action appears quite different. Therefore, it is important to learn discriminative view-invariant features, especially for action recognition from unknown or unseen views. Humans have the ability to visualize what 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. an action looks like from different views, because human brains can build view-invariant action representations immediately [18]. We hypothesize that enabling a deep network with the ability to extrapolate action across different views can encourage it to learn view-invariant representations. In this work, we propose an unsupervised learning framework, where the task is to construct the 3D motions for multiple target views using the video representation from a source view. We argue that in order for the network to infer cross-view motion dynamics, the learned representations should reside in a view-invariant discriminative space for action recognition. View-invariant representation learning for cross-view action recognition has been widely studied [21, 28, 44, 45, 59, 64]. However, most of the existing methods require access to 3D human pose information during training, while others compromise discriminative power to achieve view invariance. We focus on inferring motions rather than tracking body keypoints over space and time. Our method learns a recurrent encoder which extracts motion dynamics insensitive to viewpoint changes. We represent motion as 3D flow calculated using RGB-D data only. The contributions of our work are as follows: • We propose an unsupervised framework to effectively learn view-invariant video representation that can predict motion sequences for multiple views. The learned representation is extracted from a CNN+RNN based encoder, and decoded into multiple sequences of 3D flows by CNN decoders. The framework is trained by jointly minimizing several losses. • We propose a view-adversarial training to encourage view-invariant feature learning. Videos from different views are mapped to a shared subspace where a view classifier cannot discriminate them. The shared representation is enforced to contain meaningful motion information by the use of flow decoders. • We demonstrate the effectiveness of our learned representation on cross-subject and cross-view action recognition tasks. We experiment with various input modalities including RGB, depth and flow. Our method outperforms state-of-the-art unsupervised methods across multiple datasets. 2 Related Work 2.1 Unsupervised Representation Learning While deep networks have shown dominant performance in various computer vision tasks, the fully supervised training paradigm requires vast amount of human-labeled data. The inherent limitation highlights the importance of unsupervised learning, which leverages unlabeled data to learn feature representations. Over the past years, unsupervised learning methods have been extensively studied for deep learning methods, such as Deep Boltzmann Machines [47] and auto-encoders [1, 2, 22, 55]. Unsupervised representation learning has proven to be useful for several supervised tasks, such as pedestrian detection, object detection and image classification [5, 11, 36, 48, 61]. In the video domain, there are two lines of recent works on unsupervised representation learning. The first line of works exploit the temporal structure of videos to learn visual representation with sequence verification or sequence sorting task [8, 23, 34]. The second line of works are based on frame reconstruction. Ranzato et al. [46] proposed a RNN model to predict missing frames or future frames from an input video sequence. Srivastava et al. [53] extended this framework with LSTM encoder-decoder model to reconstruct input sequence and predict future sequence. While the above representation learning mostly capture semantic features, Luo et al. [33] proposed an unsupervised learning framework that predicts future 3D motions from a pair of consecutive frames. Their learned representations show promising results for supervised action recognition. However, previous works often learn view-specific representations which are sensitive to viewpoint changes. 2.2 Action Recognition RGB Action Recognition. Action recognition from RGB videos is a long-standing problem. A detailed survey can be found in [4]. Recent approaches have shown great progress in this field, which can be generally divided into two categories. The first category focuses on designing handcrafted features for video representation, where the most successful example is improved dense trajectory features [56] combined with Fisher vector encoding [38]. The second category uses deep networks to jointly learn feature representation and classifier. Simonyan and Zisserman [51] proposed two-stream 2 !(#$ %) Conv BiLSTM '$ % Conv BiLSTM '$() % Conv BiLSTM '$*) % +$ , CNN Deconv -.$ , /01234 Encoder Cross-view Decoder Deconv -.$ % Reconstruction Decoder /53678 !(#$*) % ) !(#$() % ) View Classifier GRL /69: ;$ …… …… Figure 1: The proposed unsupervised representation learning framework. For a sequence of input frames, the encoder generates a sequence of feature representations. At each timestep, the representation is used by the cross-view decoder, reconstruction decoder and view classifier, where multiple loss terms are jointly minimized. The encoder can learn to generate view-invariant representations that capture motion dynamics. CNNs, which extracts spatial and motion representation from video frames and optical flows. RNN based architectures have also been proposed to model the temporal information [6, 35]. However, deep networks training requires large amount of human-labeled data. CNNs pre-trained with ImageNet are commonly adopted as backbone [3, 6, 35, 51, 27, 26], to facilitate training and avoid overfitting. RGB-D Action Recognition. Since the first work on action recognition using depth maps [29], researchers have proposed methods for action recognition that extract features from multi-modal data, including depth, RGB, and skeleton [7, 13, 16, 30, 31, 32, 39, 44, 45, 50, 57, 59]. Recently, Wang et al. [60] used 3D scene flow [19] calculated with RGB-D data as input for action recognition. State-ofthe-art methods for RGB-D action recognition report human level performance on well-established datasets such as MSR-DailyActivity3D [57].However, [49] shows that there is a big performance gap between human and existing methods on the more challenging NTU-RGBD dataset [49], which contains significantly more subjects, viewpoints, action classes and backgrounds. View-invariant Feature Representation. One particularly challenging aspect of action recognition is to recognize actions from varied unknown and unseen views, referred to as cross-view action recognition in the literature. The performance of most existing methods [6, 32, 35, 38, 39, 51, 56] drop sharply as the viewpoint changes due to the inherent view dependence of the features used by these methods. To tackle this problem, researchers have proposed methods to learn representations invariant to viewpoint changes. Some methods create spatial-temporal representations that are insensitive to view variations [25, 40, 59], while other methods find a view independent latent space in which features extracted from different views are directly comparable [28, 45, 64]. For example, Rahmani et al. [45] used a deep network to project dense trajectory features from different views into a canonical view. However, most of the previous methods require access to 3D human pose information (e.g. mocap data [45], skeleton [59]) during training, while others are limited by their discriminative power. Moreover, existing methods other than skeleton based methods [30, 31, 24, 42, 63] have not shown effective performance on the cross-view evaluation for NTU-RGBD dataset. 3 Method The goal of our unsupervised learning method is to learn video representations that capture viewinvariant motion dynamics. We achieve this by training a model that uses the representation to predict sequences of motion for multiple views. The motions are represented as 3D dense scene flows, calculated using the primal-dual method [19] with RGB-D data. The learned representation can then be used as a discriminative motion feature for action recognition. In this section, we first present the unsupervised learning framework, followed by the action recognition method. 3 3.1 Learning Framework An overview of the learning framework is illustrated in Figure 1. It is an end-to-end deep network that consists of four components: encoder, cross-view decoder, reconstruction decoder, and view classifier, parameterized by {θe, θd, θr, θg} respectively. The goal is to minimize the following loss: L = Lxview + αLrecon + βLcls, (1) where α and β are weights to balance the interaction of the loss terms. Lxview is the cross-view flow prediction loss, Lrecon is the flow reconstruction loss, and Lcls is the view classification loss applied in an adversarial setting to enhance view invariance. Each loss term involves the encoder and one other component. Next we explain each component in detail. Encoder. Let V denote all the available views of an captured action. The encoder, parameterized by θe, takes as input a sequence of frames for view i ∈V , denoted as Xi = {xi 1, xi 2...xi T }, and encodes them into a sequence of low-dimensionality feature embeddings E(Xi; θe) = {E(xi 1), E(xi 2)...E(xi T )}. Specifically, for each frame, we first use a downsampling CNN (denoted as “Conv”) to extract a low-dimensionality feature of size h×w×k. Then, a bi-directional convolutional LSTM (denoted as “BiLSTM”) runs through the sequence of extracted Conv features. At each timestep t, the BiLSTM generates two feature maps of size h × w × k, one through forward pass and the other through backward pass. The two feature maps are concatenated channel-wise to form the encoding E(xi t) of size h × w × 2k. In this work, we set h = w = 7 and k = 64. Compared with vanilla LSTMs, convolutional LSTMs [41] replace the fully connected transformations with spatial convolutions, which can preserve spatial information in intermediate representations. We find it to perform much better than vanilla LSTMs. Moreover, our bi-directional LSTM aggregates information from both previous frames and future frames, which helps to generate richer representations. Compared with the LSTM encoder in [33] that only encodes 2 frames, the proposed encoder can generate encodings for longer sequences, which embodies more discriminative motion dynamics for the action. In this work, we set the sequence length T = 6. Cross-view decoder. The goal of the cross-view decoder is to predict the 3D flow yj t for view j (j ∈V ; j ̸= i), given the encoding E(xi t) for view i, at timestep t. Inferring yj t directly from E(xi t) is too difficult, because the decoder has zero information about view j. Therefore, we give an additional input to the decoder that contains view-specific information. This input is the depth map dj t for view j at timestep t, which serves as an anchor to inform the decoder about the spatial configuration of view j. The decoder still requires view-invariant motion dynamics from E(xi t) in order to predict yj t. Specifically, we first use a CNN to extract a feature of size h × w × k from dj t. The extracted feature is concatenated with E(xi t) channel-wise into a feature of size h × w × 3k. Then we use an upsampling CNN (denoted as “Deconv”) to perform spatial upsampling. Deconv consists of four fractionally-strided convolutional layers [52] with batch normalization layer [17] and ReLU activation in between. We observe that the batch normalization is critical to optimize the network. Let ˆyj t = D(E(xi t), dj t; θd) denote the output of the cross-view decoder for timestep t. We want to minimize the mean squared error between ˆyj t and yj t for t = 1, 2...T: Lj xview(E(Xi), Dj, Y j) = T X t=1 yj t −ˆyj t 2 2, (2) where Dj = {dj 1, dj 2...dj T } is the sequence of anchor depth frames, and Y j = {yj 1, yj 2...yj T } is the sequence of flows. Since we want to learn a video representation that can be used to predict motions for multiple views, we deploy multiple cross-view decoders with shared parameters to all views other then i. Therefore, the cross-view flow prediction loss for Xi is: Lxview(Xi) = X j Lj xview(E(Xi), Dj, Y j) for j ∈V ; j ̸= i (3) Reconstruction decoder. The goal of the this decoder is to reconstruct the 3D flow yi t given the encoding for the same view E(xi t). Learning flow reconstruction helps the encoder to extract basic motions, and when used together with cross-view decoders, enhances learning of view-invariant 4 motion dynamics. The architecture of the reconstruction decoder is a Deconv module similar as crossview decoder, with the number of input channels in the first layer adapted to 2k. Let ˆyi t = R(E(xi t); θr) be the output of the reconstruction decoder at timestep t, the flow reconstruction loss is: Lrecon(Xi, Y i) = T X t=1 yi t −ˆyi t 2 2 (4) View classifier. We propose a view-adversarial training that encourages the encoder to learn video representations invariant to view changes. We draw inspiration from the domain-adversarial training [9, 10], which aims at learning features that are indiscriminate with respect to shift between domains. The proposed view-adversarial training is achieved by adding a view classifier connected to the encoder through a Gradient Reversal Layer (GRL). The view classifier tries to predict which view the encoded representation belongs to, whereas the encoder tries to confuse the view classifier by generating view-invariant representations. More formally, the view classifier G(E(xi t); θg) →pt maps an encoding at timestep t to a probability distribution over possible views V . Learning with GRL is adversarial in that θg is optimized to increase G’s ability to discriminate encodings from different views, while GRL reverses the sign of the gradient that flows back to E, which results in the encoder parameters θe learning representations that reduces the view classification accuracy. Essentially, we minimize the cross-entropy loss for the view classification task with respect to θg, while maximize it with respect to θe. Therefore, we define the view classification loss as the sum of the cross-entropy loss for the entire sequence: Lcls(Xi) = T X t=1 −log pi t  , (5) where i is the ground-truth view of the input. The view classifier consists of two fully connected layers and a softmax layer. Since the encoding E(xi t) is a convolutional feature, it is first flattened into a vector before it goes into the view classifier. 3.2 Action Recognition We use the encoder from unsupervised learning for action recognition. Given the learned representations for a sequence of frames E(X) = {E(xt)|t = 1, 2...T}, we apply an action classifier to each E(xt). The action classifier is a simple fully-connected layer, which takes the flattened vector of E(xt) as input, and outputs a score st over possible action classes. The final score of the sequence is the average score for each timestep: s = 1 T PT t=1 st. The action classifier is trained with cross-entropy loss. During training, we consider three scenarios: (a) scratch: Randomly initialize the weights of encoder and train the entire model from scratch. (b) fine-tune: Initialize the encoder with learned weights and fine-tune it for action recognition. (c) fix: Keep the pre-trained encoder fixed and only train the action classifier. At test time, we uniformly sample 10 sequences from each video with sequence length T = 6, and average the scores across the sampled sequences to get the class score of the video. 4 Experiments 4.1 Unsupervised Representation Learning Implementation details. For Conv in encoder and depth CNN in cross-view decoder, we employ the ResNet-18 architecture [15] up until the final convolution layer, and add a 1×1×64 convolutional layer to reduce the feature size. The number of input channels in the first convolutional layer is adapted according to input modality. Note that our CNN has not been pre-trained on ImageNet. For BiLSTM, we use convolutional filters of size 7 × 7 × 64 for convolution with input and hidden state. We initialize all weights following the method in [14]. During training, we use a mini-batch of size 8. We train the model using the Adam optimizer [20], with an initial learning rate of 1e−5 and a weight decay of 5e−4. We decrease the learning rate by half every 20000 steps (mini-batches). To avoid 5 Table 1: Cross-view flow prediction error on NTU RGB+D dataset. Method Cross-subject Cross-view RGB Depth Flow RGB Depth Flow proposed method w/o Lrecon & Lcls 0.0267 0.0244 0.0201 0.0265 0.0238 0.0199 proposed method w/o Lcls 0.0259 0.0235 0.0198 0.0252 0.0223 0.0194 proposed method 0.0254 0.0229 0.0193 0.0248 0.0220 0.0193 (a) walking towards each other. (b) sitting down. Figure 2: Example of flow sequences with depth input. 3D flows are visualized as RGB images. Upper rows are ground-truth flows, and lower rows are predicted flows. Blue box denotes source view flow reconstruction, whereas red box denotes cross-view flow prediction. The model can estimate raw motions for multiple views. distracting the flow prediction task, we activate the view adversarial training after 5000 steps. The weights of the loss terms are set as α = 0.5 and β = 0.05, which is determined via cross-validation. In order to effectively predict the motions, we want to describe the motion as low-dimensional signal. Hence, we apply spatial downsampling to the 3D flows by calculating the mean of each non-overlapping 8 × 8 patch. The resulting 28 × 28 × 3 flow maps are multiplied by 50 to keep a proper scale, which become the ground-truth Y . Dataset. We use the NTU RGB+D dataset [49] for unsupervised representation learning. The dataset consists of 57K videos for 60 action classes, captured from 40 subjects in 80 camera viewpoints. The 80 viewpoints can be divided into five main views based on the horizontal angle of the camera with respect to the subject: front view, left side view, right side view, left side 45 degrees view and right side 45 degrees view. These five views form the view set used in our experiments. Each action sequence is simultaneously captured by three cameras from three of the five views at a time. Evaluation. There are two sets of standard evaluation protocols for action recognition on NTU RGB+D dataset: cross-subject evaluation and cross-view evaluation. Following it, we conduct two unsupervised learning experiments, where in each experiment we ensure that the encoder will not be trained on any test samples in supervised learning setting. For cross-subject evaluation, we follow the same training and testing split as in [49]. For cross-view evaluation, samples of cameras 2 and 3 are used for training while those of camera 1 for testing. Since we need at least two cameras for our unsupervised task, we randomly divide the supervised training set with ratio of 8:1 for unsupervised training and test. We use the cross-view flow prediction loss Lxview as the evaluation metric, which 6 Table 2: Action recognition accuracy (%) on NTU RGB+D dataset. Method Cross-subject Cross-view RGB Depth Flow RGB Depth Flow scratch 36.6 42.3 70.2 29.2 37.7 72.6 fix 48.9 60.8 77.0 40.7 53.9 78.8 fine-tune w/o Lrecon & view-adversarial 51.1 63.5 79.7 42.9 57.0 79.9 fine-tune w/o view-adversarial 53.4 66.0 80.3 46.2 60.1 81.9 fine-tune 55.5 68.1 80.9 49.3 63.9 83.4 Table 3: Comparison with state-of-the-art methods for action recognition on NTU RGB+D dataset. Method Modality Cross-subject Cross-view HOG [37] Depth 32.24 22.27 Super Normal Vector [62] 31.82 13.61 HON4D [39] 30.56 7.26 Shuffle and Learn [34] 46.2 40.9 Luo et al. [33] 61.4 53.2 Ours 68.1 63.9 Lie Group [54] Skeleton 50.08 52.76 FTP Dynamic Skeletons [16] 60.23 65.22 HBRNN-L [7] 59.07 63.97 2 Layer P-LSTM [49] 62.93 70.27 ST-LSTM [30] 69.2 77.7 GCA-LSTM [31] 74.4 82.8 Ensemble TS-LSTM [24] 74.60 81.25 Depth+Skeleton [42] 75.2 83.1 VA-LSTM [63] 79.4 87.6 Ours Flow 80.9 83.4 quantifies the performance of the model to predict motions across different views. We experiment with three input modalities: RGB, depth and 3D flow. Results. Table 1 shows the quantitative results for the unsupervised flow prediction task. In order to demonstrate the effect of different components and loss terms, we evaluate different variants of the proposed framework. First, we only train the encoder with cross-view decoder (denoted as proposed method w/o Lrecon&Lcls). Then we add the reconstruction decoder with flow reconstruction loss (denoted as proposed method w/o Lcls). Finally we add view adversarial training with view classification loss to form the proposed method. Across all input modalities, flow reconstruction and view adversarial training both can improve the cross-view flow prediction performance. Comparing between different input modalities, flow achieves the lowest Lxview. This is expected because flow contains more view-invariant motion information. Figure 2 shows qualitative examples of flow prediction with depth input. For each pair of rows, the upper rows are ground-truth flows, whereas the lower rows are flows predicted by the decoders. The model shows the ability to estimate raw motions for multiple views with the encoded representations. 4.2 Action Recognition on NTU RGB+D Implementation details. We experiment with the three settings described in Section 3.2. We train the model using Adam optimizer [20], with the mini-batch size as 16, learning rate as 1e−4 and weight decay as 5e−4. We set the learning rate of the encoder to be 1e−5 for fine-tune. For scratch, we decay the learning rate by half every 20000 steps. For fine-tune and fix, since training converges faster, we half the learning rate every 10000 steps. Results. Table 2 shows the classification accuracy for both cross-subject and cross-view action recognition with three input modalities. Across all modalities, supervised learning from scratch 7 Table 4: Cross-subject action recognition accuracy (%) on MSRDailyActivity3D dataset. Method Accuracy Actionlet Ensemble [58] (S) 85.8 HON4D [39] (D) 80.0 MST-AOG [59] (D) 53.8 SNV [62] (D) 86.3 HOPC [43] (D) 88.8 Luo et al. [33] (D) 75.2 Ours (scratch) 42.5 Ours (fine-tune) 82.3 Table 5: Cross-view action recognition accuracy (%) on Northwestern-UCLA dataset. Method Accuracy Actionlet Ensemble [58] (S) 69.9 Hankelets [25] 45.2 MST-AOG [59] (D) 53.6 HOPC [43] (D) 71.9 R-NKTM [45] (S) 78.1 Luo et al. [33] (D) 50.7 Ours (scratch) 35.8 Ours (fine-tune) 62.5 has the lowest accuracy. Using the unsupervised learned representations and training only a linear action classifier (fix) significantly increases accuracy. Fine-tuning the encoder can further improve performance. If we remove the view-adversarial training in the unsupervised framework, the accuracy would decrease, especially for cross-view recognition. Among the three input modalities, flow input achieves the highest accuracy, which agrees with our unsupervised learning result. Flow is also the only input modality that has a higher accuracy for cross-view recognition compared with cross-subject recognition. This supports our observation that flow is more view-invariant than the other two modalities. Comparison with state-of-the-art. In Table 3 we compare our method against state-of-the-art methods on NTU RGB+D dataset. The first group of methods use depth as input, and the second group of methods use skeleton as input. We re-implement two unsupervised learning methods [33, 34] (in italic) and report their classification accuracy. We do not directly cite the results in [33] because [33] reports mAP rather than accuracy. Our re-implementation achieve similar mAP as in [33]. Using depth input, the proposed method outperforms all previous methods. The increase in accuracy is more significant for cross-view recognition, which shows that the learned representation is invariant to viewpoint changes. Using flow input, our method achieves comparable performance to skeleton-based methods. However, skeleton is a higher level feature that is more robust to viewpoint change. Moreover, the method [63] with higher cross-view accuracy uses explicit coordinate system transformation to achieve view invariance. 4.3 Transfer Learning for Action Recognition In this section, we perform transfer learning tasks, where we use the unsupervised learned representations for action recognition on two other datasets in new domains (different subjects, environments and viewpoints). We perform cross-subject evaluation on MSR-DailyActivity3D Dataset, and crossview evaluation on Northwestern-UCLA MultiviewAction3D Dataset. We experiment with scratch and fine-tune settings, using depth modality as input. MSR-DailyActivity3D Dataset. This dataset contains 320 videos of 16 actions performed by 10 subjects. We follow the same experimental setting as [57], using videos of half of the subjects as training data, and videos of the rest half as test data. Northwestern-UCLA MultiviewAction3D Dataset. This dataset contains 1493 videos of 10 actions performed by 10 subjects, captured by 3 cameras from 3 different views. We follow [59] and use videos from the first two views for training and videos from the third view for test. Results. Table 4 and 5 show our results in comparison with state-of-the-art methods. On both datasets, training a deep model from scratch gives poor performance. Using the unsupervised learned representations increases the accuracy by a large margin. Our method outperforms previous unsupervised method [33], and achieves comparable performance with skeleton-based methods (marked by S) and depth-based methods (marked by D) that use carefully hand-craft features. This demonstrates that the learned representations can generalize across domains. 8 5 Conclusion In this work, we propose an unsupervised learning framework that leverages unlabeled video data from multiple views to learn view-invariant video representations that capture motion dynamics. We learn the video representations by using the representations for a source view to predict the 3D flows for multiple target views. We also propose a view-adversarial training to enhance view-invariance of the learned representations. We train our unsupervised framework on NTU RGB+D dataset, and demonstrate the effectiveness of the learned representations on both cross-subject and cross-view action recognition tasks across multiple datasets. The proposed unsupervised learning framework can be naturally extended beyond actions. For future work, we intend to extend our framework for view-invariant representation learning in other tasks such as gesture recognition and person re-identification. In addition, we can consider generative adversarial network (GAN) [12] for multi-view data generation. Acknowledgments This research is supported by the National Research Foundation, Prime Minister’s Office, Singapore under its Strategic Capability Research Centres Funding Initiative. References [1] Y. Bengio, P. Lamblin, D. Popovici, and H. Larochelle. Greedy layer-wise training of deep networks. In NIPS, pages 153–160, 2006. [2] Y. Bengio, E. Laufer, G. Alain, and J. Yosinski. Deep generative stochastic networks trainable by backprop. In ICML, pages 226–234, 2014. [3] J. Carreira and A. Zisserman. Quo vadis, action recognition? A new model and the kinetics dataset. In CVPR, pages 4724–4733, 2017. [4] G. Cheng, Y. Wan, A. N. Saudagar, K. Namuduri, and B. P. Buckles. Advances in human action recognition: A survey. arXiv preprint arXiv:1501.05964, 2015. [5] C. Doersch, A. Gupta, and A. A. Efros. Unsupervised visual representation learning by context prediction. In ICCV, pages 1422–1430, 2015. [6] J. Donahue, L. A. Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, T. Darrell, and K. Saenko. Long-term recurrent convolutional networks for visual recognition and description. In CVPR, pages 2625–2634, 2015. [7] Y. Du, W. Wang, and L. Wang. Hierarchical recurrent neural network for skeleton based action recognition. In CVPR, pages 1110–1118, 2015. [8] B. Fernando, H. Bilen, E. Gavves, and S. Gould. Self-supervised video representation learning with odd-one-out networks. In CVPR, pages 5729–5738, 2017. [9] Y. Ganin and V. S. Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, pages 1180–1189, 2015. [10] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. JMLR, 17(1):2096–2030, 2016. [11] S. Gidaris, P. Singh, and N. Komodakis. Unsupervised representation learning by predicting image rotations. In ICLR, 2018. [12] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, pages 2672–2680, 2014. [13] A. Haque, B. Peng, Z. Luo, A. Alahi, S. Yeung, and F. Li. Towards viewpoint invariant 3d human pose estimation. In ECCV, pages 160–177, 2016. [14] K. He, X. Zhang, S. Ren, and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In ICCV, pages 1026–1034, 2015. [15] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016. [16] J. Hu, W. Zheng, J. Lai, and J. Zhang. Jointly learning heterogeneous features for RGB-D activity recognition. In CVPR, pages 5344–5352, 2015. [17] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448–456, 2015. [18] L. Isik, A. Tacchetti, and T. Poggio. A fast, invariant representation for human action in the visual system. Journal of neurophysiology, 119(2):631–640, 2017. [19] M. Jaimez, M. Souiai, J. G. Jiménez, and D. Cremers. A primal-dual framework for real-time dense RGB-D scene flow. In ICRA, pages 98–104, 2015. [20] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 9 [21] Y. Kong, Z. Ding, J. Li, and Y. Fu. Deeply learned view-invariant features for cross-view action recognition. IEEE Trans. Image Processing, 26(6):3028–3037, 2017. [22] Q. V. Le. Building high-level features using large scale unsupervised learning. In ICASSP, pages 8595– 8598, 2013. [23] H. Lee, J. Huang, M. Singh, and M. Yang. Unsupervised representation learning by sorting sequences. In ICCV, pages 667–676, 2017. [24] I. Lee, D. Kim, S. Kang, and S. Lee. Ensemble deep learning for skeleton-based action recognition using temporal sliding LSTM networks. In ICCV, pages 1012–1020, 2017. [25] B. Li, O. I. Camps, and M. Sznaier. Cross-view activity recognition using hankelets. In CVPR, pages 1362–1369, 2012. [26] J. Li, Y. Wong, Q. Zhao, and M. S. Kankanhalli. Attention transfer from web images for video recognition. In ACM Multimedia, pages 1–9, 2017. [27] J. Li, Y. Wong, Q. Zhao, and M. S. Kankanhalli. Dual-glance model for deciphering social relationships. In ICCV, pages 2669–2678, 2017. [28] R. Li and T. Zickler. Discriminative virtual views for cross-view action recognition. In CVPR, pages 2855–2862, 2012. [29] W. Li, Z. Zhang, and Z. Liu. Action recognition based on a bag of 3d points. In CVPR, pages 9–14, 2010. [30] J. Liu, A. Shahroudy, D. Xu, and G. Wang. Spatio-temporal LSTM with trust gates for 3D human action recognition. In ECCV, pages 816–833, 2016. [31] J. Liu, G. Wang, P. Hu, L. Duan, and A. C. Kot. Global context-aware attention LSTM networks for 3d action recognition. In CVPR, pages 3671–3680, 2017. [32] C. Lu, J. Jia, and C. Tang. Range-sample depth feature for action recognition. In CVPR, pages 772–779, 2014. [33] Z. Luo, B. Peng, D. Huang, A. Alahi, and L. Fei-Fei. Unsupervised learning of long-term motion dynamics for videos. In CVPR, pages 7101–7110, 2017. [34] I. Misra, C. L. Zitnick, and M. Hebert. Shuffle and learn: Unsupervised learning using temporal order verification. In ECCV, pages 527–544, 2016. [35] J. Y. Ng, M. J. Hausknecht, S. Vijayanarasimhan, O. Vinyals, R. Monga, and G. Toderici. Beyond short snippets: Deep networks for video classification. In CVPR, pages 4694–4702, 2015. [36] M. Noroozi, H. Pirsiavash, and P. Favaro. Representation learning by learning to count. In ICCV, pages 5899–5907, 2017. [37] E. Ohn-Bar and M. M. Trivedi. Joint angles similarities and HOG2 for action recognition. In CVPR workshops, pages 465–470, 2013. [38] D. Oneata, J. J. Verbeek, and C. Schmid. Action and event recognition with fisher vectors on a compact feature set. In ICCV, pages 1817–1824, 2013. [39] O. Oreifej and Z. Liu. HON4D: histogram of oriented 4d normals for activity recognition from depth sequences. In CVPR, pages 716–723, 2013. [40] V. Parameswaran and R. Chellappa. View invariance for human action recognition. IJCV, 66(1):83–101, 2006. [41] V. Patraucean, A. Handa, and R. Cipolla. Spatio-temporal video autoencoder with differentiable memory. In ICLR workshops, 2016. [42] H. Rahmani and M. Bennamoun. Learning action recognition model from depth and skeleton videos. In ICCV, pages 5833–5842, 2017. [43] H. Rahmani, A. Mahmood, D. Q. Huynh, and A. S. Mian. Histogram of oriented principal components for cross-view action recognition. IEEE TPAMI, 38(12):2430–2443, 2016. [44] H. Rahmani and A. S. Mian. 3d action recognition from novel viewpoints. In CVPR, pages 1506–1515, 2016. [45] H. Rahmani, A. S. Mian, and M. Shah. Learning a deep model for human action recognition from novel viewpoints. IEEE TPAMI, 40(3):667–681, 2018. [46] M. Ranzato, A. Szlam, J. Bruna, M. Mathieu, R. Collobert, and S. Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv preprint arXiv:1412.6604, 2014. [47] R. Salakhutdinov and G. E. Hinton. Deep boltzmann machines. In AISTATS, pages 448–455, 2009. [48] P. Sermanet, K. Kavukcuoglu, S. Chintala, and Y. LeCun. Pedestrian detection with unsupervised multistage feature learning. In CVPR, pages 3626–3633, 2013. [49] A. Shahroudy, J. Liu, T. Ng, and G. Wang. NTU RGB+D: A large scale dataset for 3D human activity analysis. In CVPR, pages 1010–1019, 2016. [50] A. Shahroudy, T.-T. Ng, Y. Gong, and G. Wang. Deep multimodal feature analysis for action recognition in RGB+D videos. IEEE TPAMI, 40(5):1045–1058, 2018. [51] K. Simonyan and A. Zisserman. Two-stream convolutional networks for action recognition in videos. In NIPS, pages 568–576, 2014. [52] J. T. Springenberg, A. Dosovitskiy, T. Brox, and M. A. Riedmiller. Striving for simplicity: The all convolutional net. arXiv preprint arXiv:1412.6806, 2014. 10 [53] N. Srivastava, E. Mansimov, and R. Salakhutdinov. Unsupervised learning of video representations using lstms. In ICML, pages 843–852, 2015. [54] R. Vemulapalli, F. Arrate, and R. Chellappa. Human action recognition by representing 3d skeletons as points in a lie group. In CVPR, pages 588–595, 2014. [55] P. Vincent, H. Larochelle, Y. Bengio, and P. Manzagol. Extracting and composing robust features with denoising autoencoders. In ICML, pages 1096–1103, 2008. [56] H. Wang and C. Schmid. Action recognition with improved trajectories. In ICCV, pages 3551–3558, 2013. [57] J. Wang, Z. Liu, Y. Wu, and J. Yuan. Mining actionlet ensemble for action recognition with depth cameras. In CVPR, pages 1290–1297, 2012. [58] J. Wang, Z. Liu, Y. Wu, and J. Yuan. Learning actionlet ensemble for 3d human action recognition. IEEE TPAMI, 36(5):914–927, 2014. [59] J. Wang, X. Nie, Y. Xia, Y. Wu, and S. Zhu. Cross-view action modeling, learning, and recognition. In CVPR, pages 2649–2656, 2014. [60] P. Wang, W. Li, Z. Gao, Y. Zhang, C. Tang, and P. Ogunbona. Scene flow to action map: A new representation for RGB-D based action recognition with convolutional neural networks. In CVPR, pages 416–425, 2017. [61] X. Wang, K. He, and A. Gupta. Transitive invariance for self-supervised visual representation learning. In ICCV, pages 1338–1347, 2017. [62] X. Yang and Y. Tian. Super normal vector for activity recognition using depth sequences. In CVPR, pages 804–811, 2014. [63] P. Zhang, C. Lan, J. Xing, W. Zeng, J. Xue, and N. Zheng. View adaptive recurrent neural networks for high performance human action recognition from skeleton data. In ICCV, pages 2136–2145, 2017. [64] Z. Zhang, C. Wang, B. Xiao, W. Zhou, S. Liu, and C. Shi. Cross-view action recognition via a continuous virtual path. In CVPR, pages 2690–2697, 2013. 11
2018
209
7,374
Learning Sparse Neural Networks via Sensitivity-Driven Regularization Enzo Tartaglione Politecnico di Torino Torino, Italy tartaglioneenzo@gmail.com Skjalg Lepsøy Nuance Communications Torino, Italy Attilio Fiandrotti Politecnico di Torino, Torino, Italy Télécom ParisTech, Paris, France Gianluca Francini Telecom Italia Torino, Italy Abstract The ever-increasing number of parameters in deep neural networks poses challenges for memory-limited applications. Regularize-and-prune methods aim at meeting these challenges by sparsifying the network weights. In this context we quantify the output sensitivity to the parameters (i.e. their relevance to the network output) and introduce a regularization term that gradually lowers the absolute value of parameters with low sensitivity. Thus, a very large fraction of the parameters approach zero and are eventually set to zero by simple thresholding. Our method surpasses most of the recent techniques both in terms of sparsity and error rates. In some cases, the method reaches twice the sparsity obtained by other techniques at equal error rates. 1 Introduction Deep neural networks achieve state-of-the-art performance in a number of tasks by means of complex architectures. Let us define the complexity of a neural network as the number of its learnable parameters. The complexity of architectures such as VGGNet [1] and the SENet-154 [2] lies in the order of 108 parameters, hindering their deployability on portable and embedded devices, where storage, memory and bandwidth resources are limited. The complexity of a neural network can be reduced by promoting sparse interconnection structures. Empirical evidence shows that deep architectures often require to be over-parametrized (having more parameters than training examples) in order to be successfully trained [3, 4, 5]. However, once input-output relations are properly represented by a complex network, such a network may form a starting point in order to find a simpler, sparser, but sufficient architecture [4, 5]. Recently, regularization has been proposed as a principle for promoting sparsity during training. In general, regularization replaces unstable (ill-posed) problems with nearby and stable (well-posed) ones by introducing additional information about what a solution should be like [6]. This is often done by adding a term R to the original objective function L. Letting θ denote the network parameters and λ the regularization factor, the problem minimize L(θ) with respect to θ (1) is recasted as minimize L(θ) + λR(θ) with respect to θ. (2) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Stability and generalization are strongly related or even equivalent, as shown by Mukherjee et al. [7]. Regularization therefore also helps ensure that a properly trained network generalizes well on unseen data. Several known methods aim at reaching sparsity via regularization terms that are more or less specifically designed for the goal. Examples are found in [8, 9, 10]. The original contribution of this work is a regularization and pruning method that takes advantage of output sensitivity to each parameter. This measure quantifies the change in network output that is brought about by a change in the parameter. The proposed method gradually moves the less sensitive parameters towards zero, avoiding harmful modifications to sensitive, therefore important, parameters. When a parameter value approaches zero and drops below a threshold, the parameter is set to zero, yielding the desired sparsity of interconnections. Furthermore, our method implies minimal computational overhead, since the sensitivity is a simple function of a by-product of back-propagation. Image classification experiments show that our method improves sparsity with respect to competing state-of-the-art techniques. According to our evidence, the method also improves generalization. The rest of this paper is organized as follows. In Sec. 2 we review the relevant literature concerning sparse neural architectures. Next, in Sec. 3 we describe our supervised method for training a neural network such that its interconnection matrix is sparse. Then, in Sec. 4 we experiment with our proposed training scheme over different network architectures. The experiments show that our proposed method achieves a tenfold reduction in the network complexity while leaving the network performance unaffected. Finally, Sec. 5 draws the conclusions while providing further directions for future research. 2 Related work Sparse neural architectures have been the focus of intense research recently due the advantages they entail. For example, Zhu et al. [11], have shown that a large sparse architecture improves the network generalization ability in a number of different scenarios. A number of approaches towards sparse interconnection matrices have been proposed. For example, Liu et al. [12] propose to recast multidimensional convolutional operations into bidimensional equivalents, resulting in a final reduction of the required parameters. Another approach involves the design of an object function to minimize the number of features in the convolutional layers. Wen et al. [8] propose a regularizer based on group lasso whose task is to cluster filters. However, such approaches are specific for convolutional layers, whereas the bulk of network complexity often lies in the fully connected layers. A direct strategy to introduce sparsity in neural networks is l0 regularization, which entails however solving a highly complex optimization problem (e.g., Louizos et al. [13]). Recently, a technique based on soft weight sharing has been proposed to reduce the memory footprint of whole networks (Ullrich et al. [10]). However, it limits the number of the possible parameters values, resulting in sub-optimal network performance. Another approach involves making input signals sparse in order to use smaller architectures. Inserting autoencoder layers at the begin of the neural network (Ranzato et al. [14]) or modeling of ‘receptive fields’ to preprocess input signals for image classification (Culurciello et al. [15]) are two clear examples of how a sparse, properly-correlated input signal can make the learning problem easier. In the last few years, dropout techniques have also been employed to ease sparsification. Molchanov et al. [16] propose variational dropout to promote sparsity. This approach also provides a bayesian interpretation of gaussian dropout. A similar but differently principled approach was proposed by Theis et al. [17]. However, such a technique does not achieve in fully-connected architectures state-of-the-art test error. The proposal of Han et al. [9] consists of steps that are similar to those of our method. It is a threestaged approach in which first, a network learns a coarse measurement of each connection importance, minimizing some target loss function; second, all the connections less important than a threshold are pruned; third and finally, the resulting network is retrained with standard backpropagation to learn the actual weights. An application of such a technique can be found in [18]. Their experiments 2 show reduced complexity for partially better performance achieved by avoiding network overparametrization. In this work, we propose to selectively prune each network parameter using the knowledge of sensitivity. Engelbrecht et al. [19] and Mrazova et al. [20, 21] previously proposed sensitivity-based strategies for learning sparse architectures. In their work, the sensitivity is however defined as the variation of the network output with respect to a variation of the network inputs. Conversely, in our work we define the sensitivity of a parameter as the variation of the network output with respect to the parameter, pruning parameters with low sensitivity as they contribute little to the network output. 3 Sensitivity-based regularization In this section, we first formulate the sensitivity of a network with respect to a single network parameter. Next, we insert a sensitivity-based term in the update rule. Then, we derive a perparameter general formulation of a regularization term based on sensitivity, having as particular case ReLU-activated neural networks. Finally, we propose a general training procedure aiming for sparsity. As we will experimentally see in Sec. 4, our technique not only sparsifies the network, but improves its generalization ability as well. 3.1 Some notation Here we introduce the terminology and the notation used in the rest of this work. Let a feed-forward, acyclic, multi-layer artificial neural network be composed of N layers, with xn−1 being the input of the n-th network layer and xn its output, n ∈[1, N] integer. We identify with n=0 the input layer, n = N the output layer, and other n values indicate the hidden layers. The n-th layer has learnable parameters, indicated by wn (which can be biases or weights).1 In order to identify the i-th parameter at layer n, we write wn,i. The output of the n-th layer can be described as xn = fn [gn (xn−1, wn)] , (3) where gn(·) is usually some affine function and fn(·) is the activation function at layer n. In the following, x0 indicates the network input. Let us indicate the output of the network as y = xN ∈RC, with C ∈N. Similarly, y⋆indicates the target (expected) network output associated to x0. (a) (b) Figure 1: Generic layer representation (Fig. 1a) and the case of a fully connected layer in detail (Fig. 1b, here we have wn ∈Rm×p). Biases may also be included. 1According to our notation, θ = ∪N n=1wn 3 3.2 Sensitivity definition We are interested in evaluating how influential a generic parameter wn,i is to determine the k-th output of the network (given an input of the network). Let the weight wn,i vary by a small amount ∆wn,i, such that the output varies by ∆y. For small ∆wn,i, we have, for each element, ∆yk ≈∆wn,i ∂yk ∂wn,i (4) by a Taylor series expansion. A weighted sum of the variation in all output elements is then C X k=1 αk |∆yk| = |∆wn,i| C X k=1 αk ∂yk ∂wn,i (5) where αk > 0. The sum on the right-hand side is a key quantity for the regularization, so we define it as the sensitivity: Definition 1 (Sensitivity) The sensitivity of the network output with respect to the (n, i)-th network parameter is S(y, wn,i) = C X k=1 αk ∂yk ∂wn,i , (6) where the coefficients αk are positive and constant. The choice of coefficients αk will depend on the application at hand. In Subsec. 3.5 we propose two choices of coefficients that will be used in the experiments. If the sensitivity with respect to a given parameter is small, then a small change of that parameter towards zero causes a very small change in the network output. After such a change, and if the sensitivity computed at the new value still is small, then the parameter may be moved towards zero again. Such an operation can be paired naturally with a procedure like gradient descent, as we propose below. Towards this end, we introduce the insensitivity function ¯S ¯S(y, wn,i) = 1 −S(y, wn,i) (7) The range of such a function is (−∞; 1] and the lower it is the more the parameter is relevant. We observe that having ¯S < 0 ⇔S > 1 means that a weight change brings about an output change that is bigger than the weight change itself (5). In this case we say the output is super-sensitive to the weight. In our framework we are not interested in promoting the sparsity for such a class of parameters; on the contrary, they are very relevant for generating the output. We want to focus our attention towards all those parameters whose variation is not significantly felt by the output (P k αk|∆yk| < ∆w), for which the output is sub-sensitive to them. Hence, we introduce a bounded insensitivity ¯Sb(y, wn,i) = max  0, ¯S (y, wn,i)  (8) having ¯Sb ∈[0, 1]. 3.3 The update rule As already hinted at, a parameter with small sensitivity may safely be moved some way towards zero. This can be done by subtracting a product of the parameter itself and its insensitivity measure (recall that ¯Sb is between 0 and 1), appropriately scaled by some small factor λ. Such a subtraction may be carried out simultaneously with the step towards steepest descent, effectively modifying SGD to incorporate the push of less ‘important’ parameters towards small values. 4 This brings us to the operation at the core of our method – the rule for updating each weight. At the t-th update iteration, the i-th weight in the n-th layer will be updated as wt n,i := wt−1 n,i −η ∂L ∂wt−1 n,i −λwt−1 n,i ¯Sb(y, wt−1 n,i ) (9) where L is a loss function, as in (1) and (2). Here we see why the bounded insensitivity is not allowed to become negative: this would allow to push some weights (the super-sensitive ones) away from zero. Below we show that each of the two correction terms dominates over the other in different phases of the training. The supplementary material treats this matter in more detail. The derivative of the first correction term in (9) wrt. to the weight (disregarding η) can be factorized as ∂L ∂wn,i = ∂L ∂y ∂y ∂wn,i (10) which is a scalar product of two vectors: the derivative of the loss with respect to the output elements and the derivative of the output elements with respect to the parameter in question. By the Hölder inequality, we have that ∂L ∂wn,i ≤max k ∂L ∂yk ∂y ∂wn,i 1 . (11) Furthermore, if the loss function L is the composition of the cross-entropy and the softmax function, the derivative of L with respect to any yk cannot exceed 1 in absolute value. The inequality in eq.11 then simplifies to ∂L ∂wn,i ≤ ∂y ∂wn,i 1 . (12) We note that the l1 norm on the right is proportional to the sensitivity of (6), provided that all coefficients αk are equal (as in (17) in a later section). Otherwise the l1 norm is equivalent to the sensitivity. For the following, we think of the l1 norm on the right in eq.12 as a multiple of the sensitivity. By (7), the insensitivity is complementary to the sensitivity. The bounded insensitivity is simply a restriction of the insensitivity to non-negative values (8). Now we return to the two correction terms in the update rule of (9). If the first correction term is large, then by (12) also the sensitivity must be large. A large sensitivity implies a small (or zero) bounded insensitivity. Therefore a large first correction term implies a small or zero second correction term. This typically happens in early phases of training, when the loss can be greatly reduced by changing a weight, i.e. when ∂L ∂wn,i is large. Conversely, if the loss function is near a minimum, then the first correction term is very small. In this situation, the above equations do not imply anything about the magnitude of the sensitivity. The bounded insensitivity may be near 1 for some weights, thus the second correction term will dominate. These weights will be moved towards zero in proportion to λ. Sec. 4 shows that this indeed happens for a large number of weights. The parameter cannot be moved all the way to zero in one update, as the insensitivity may change when wn,i changes; it must be recomputed at each new updated value of the parameter. The factor λ should therefore be (much) smaller than 1. 3.4 Cost function formulation The update rule of (9) does provide the “additional information” typical of regularization methods. Indeed, this method amounts to the addition of a regularization function R to an original loss function, as in (1). Since (9) specifies how a parameter is updated through the derivative of R, an integration of the update term will ‘restore’ the regularization term. The result is readily interpreted for ReLU-activated networks [3]. 5 Towards this end, we define the overall regularization term as a sum over all parameters R (θ) = X i X n Rn,i (wn,i) (13) and integrate each term over wn,i Rn,i (wn,i) = Z wn,i ¯Sb(y, wn,i)dwn,i. (14) If we solve (14) we find Rn,i (wn,i) = H  ¯S(y, wn,i)  w2 n,i 2 · " 1 − C X k=1 αksign  ∂yk ∂wn,i  ∞ X m=1 −1m+1 wm−1 (m + 1)! ∂myk ∂wm n,i # (15) where H(·) is the Heaviside (one-step) function. (15) holds for any feedforward neural network having any activation function. Now suppose that all activation functions are rectified linear units. Its derivative is the step function; the higher order derivatives are therefore zero. This results in dropping all the m > 1 terms in (15). Thus, the regularization term for ReLU-activated networks reduces to Rn,i (wn,i) = w2 n,i 2 ¯S(y, wn,i) (16) The first factor in this expression is the square of the weight, showing the relation to Tikhonov regularization. The other factor is a selection and damping mechanism. Only the sub-sensitive weights are influenced by the regularization – in proportion to their insensitivity. 3.5 Types of sensitivity In general, (6) allows for different kinds of sensitivity, depending on the value assumed by αk. This freedom permits some adaptation to the learning problem in question. If all the k outputs assume the same “relevance” (all αk = 1 C ) we say we have an unspecific formulation Sunspec(y, wn,i) = 1 C C X k=1 ∂yk ∂wn,i (17) This formulation does not require any information about the training examples. Another possibility, applicable to classification problems, does take into account some extra information. In this formulation we let only one term count, namely the one that corresponds to the desired output class for the given input x0. The factors αk are therefore taken as the elements in the one-hot encoding for the desired output y∗. In this case we speak of specific sensitivity: Sspec(y, y∗, wn,i) = C X k=1 y∗ k ∂yk ∂wn,i (18) The experiments in Sec. 4 regard classification problems, and we apply both of the above types of sensitivity. 3.6 Training procedure Our technique ideally aims to put to zero a great number of parameters. However, according to our update rule (9), less sensitive parameters approach zero but seldom reach it exactly. For this reason, we introduce a threshold T. If |wn,i| < T the method will prune it. According to this, the threshold in the very early stages must be kept to very low values (or must be introduced afterwards). Our training procedure is divided into two different steps: 6 Table 1: LeNet300 network trained over the MNIST dataset Remaining parameters Memory |θ| |θ̸=0| Top-1 FC1 FC2 FC3 Total footprint error Han et al. [9] 8% 9% 26% 21.76k 87.04kB 12.2x 1.6% Proposed (Sunspec) 2.25% 11.93% 69.3% 9.55k 34.2kB 27.87x 1.65% Proposed (Sspec) 4.78% 24.75% 73.8% 19.39k 77.56kB 13.73x 1.56% Louizos et al. [13] 9.95% 9.68% 33% 26.64k 106.57kB 12.2x 1.8% SWS[10] N/A N/A N/A 11.19k 44.76kB 23x 1.94% Sparse VD[16] 1.1% 2.7% 38% 3.71k 14.84kB 68x 1.92% DNS[24] 1.8% 1.8% 5.5% 4.72k 18.88kB 56x 1.99% Proposed (Sunspec) 0.93% 1.12% 5.9% 2.53k 10.12kB 103x 1.95% Proposed (Sspec) 1.12% 1.88% 13.4% 3.26k 13.06kB 80x 1.96% 1. Reaching the performance: in this phase we train the network in order to get to the target performance. Here, any training procedure may be adopted: this makes our method suitable also for pre-trained models and, unlike other state-of-the-art techniques, can be applied at any moment of training. 2. Sparsify: thresholding is introduced and applied to the network. The learning process still advances but in the end of every training epoch all the weights of the network are thresholded. The procedure is stopped when the network performance drops below a given target performance. 4 Results In this section we experiment with our regularization method in different supervised image classification tasks. Namely, we experiment training a number of well-known neural network architectures and over a number of different image datasets. For each trained network we measure the sparsity with layer granularity and the corresponding memory footprint assuming single precision float representation of each parameter. Our method is implemented in Julia language and experiments are performed using the Knet package [22]. 4.1 LeNet300 and LeNet5 on MNIST To start with, we experiment training the fully connected LeNet300 and the convolutional LeNet5 over the standard MNIST dataset [23] (60k training images and 10k test images). We use SGD with a learning parameter η = 0.1, a regularization factor λ = 10−5 and a thresholding value T = 10−3 unless otherwise specified. No other sparsity-promoting method (dropout, batch normalization) is used. Table 1 reports the results of the experiments over the LeNet300 network in two successive moments during the training procedure.2 The top-half of the table refers to the network trained up to the point where the error decreases to 1.6%, the best error reported in [9]. Our method achieves twice the sparsity of [9] (27.8x vs. 12.2x compression ratio) for comparable error. The bottom-half of the table refers to the network further trained up to the point where the error settles around 1.95%, the mean best error reported in [10, 16, 24]. Also in this case, our method shows almost doubled sparsity over the nearest competitor for similar error (103x vs. 68x compression ratio of [16]). Table 2 shows the corresponding results for LeNet-5 trained until the Top-1 error reaches about 0.77% (best error reported by [9]). In this case, when compared to the work of Han et al., our method achieves far better sparsity (51.07x vs. 11.87x compression ratio) for a comparable error. We observe how in all the previous experiments the largest gains stem from the first fully connected layer, where most of the network parameters lie. However, if we compare our results to other state-of-the-art sparsifiers, we see that our technique does 2 |θ| |θ̸=0| is the compression ratio, i.e. the ratio between number of parameters in the original network (cardinality of θ) and number of remaining parameters after sparsification (the higher, the better). 7 Table 2: LeNet5 network trained over the MNIST dataset Remaining parameters Memory |θ| |θ̸=0| Top-1 Conv1 Conv2 FC1 FC2 Total footprint error Han et al. [9] 66% 12% 8% 19% 36.28k 145.12kB 11.9x 0.77% Prop. (Sunspec) 67.6% 11.8% 0.9% 31.0% 8.43k 33.72kB 51.1x 0.78% Prop. (Sspec) 72.6% 12.0% 1.7% 37.4% 10.28k 41.12kB 41.9x 0.8% Louizos et al. [13] 45% 36% 0.4% 5% 6.15k 24.6kB 70x 1.0% SWS [10] N/A N/A N/A N/A 2.15k 8.6kB 200x 0.97% Sparse VD [16] 33% 2% 0.2% 5% 1.54k 6.16kB 280x 0.75% DNS [24] 14% 3% 0.7% 4% 3.88k 15.52kB 111x 0.91% 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0 200 400 600 800 1000 Loss test epoch SGD SGD+L2 SGD+Sensitivity SGD+L1 Figure 2: Loss on test set across epochs for LeNet300 trained on MNIST with different regularizers (without thresholding): our method enables improved generalization over l2-regularization. not achieve the highest compression rates. Most prominently, Sparse VD obtains higher compression at better performance compression rates. as is the case of convolutional layers. Last, we investigate how our sensitivity-based regularization term affects the network generalization ability, which is the ultimate goal of regularization. As we focus on the effects of the regularization term, no thresholding or pruning is applied and we consider the unspecific sensitivity formulation in (17). We experiment over four formulations of the regularization term R(θ): no regularizer (λ = 0), weight decay (Tikhonov, l2 regularization), l1 regularization, and our sensitivity-based regularizer. Fig. 2 shows the value of the loss function L (cross-entropy) during training. Without regularization, the loss increases after some epochs, indicating sharp overfitting. With the l1-regularization, some overfitting cannot be avoided, whereas l2-regularization prevents overfitting. However, our sensitivitybased regularizer is even more effective than l2-regularization, achieving lower error. As seen from (16), our regularization factor can be interpreted as an improved l2 term with an additional factor promoting sparsity proportionally to each parameter’s insensitivity. 4.2 VGG-16 on ImageNet Finally, we experiment on the far more complex VGG-16 [1] network over the larger ImageNet [25] dataset. VGG-16 is a 13 convolutional, 3 fully connected layers deep network having more than 100M parameters while ImageNet consists of 224x224 24-bit colour images of 1000 different types 8 of objects. In this case, we skip the initial training step as we used the open-source keras pretrained model [1]. For the sparsity step we have used SGD with η = 10−3 and λ = 10−5 for the specific sensitivity, λ = 10−6 for the unspecific sensitivity. As previous experiment revealed our method enables improved sparsification for comparable error, here we train the network up to the point where the Top-1 error is minimized. In this case our method enables an 1.08% reduction in error (9.80% vs 10.88%) for comparable sparsification, supporting the finding that our method improves a network ability to generalize as shown in Fig. 2. Table 3: VGG16 network trained on the ImageNet dataset Remaining parameters Memory |θ| |θ̸=0| Top-1 Top-5 Conv FC Total footprint error error Han et al. [9] 32.77% 4.61% 10.35M 41.4 MB 13.33x 31.34% 10.88% Prop. (Sunspec) 64.73% 2.9% 11.34M 45.36 MB 12.17x 29.29% 9.80% Prop. (Sspec) 56.49% 2.56% 9.77M 39.08 MB 14.12x 30.92% 10.06% 5 Conclusions In this work we have proposed a sensitivity-based regularize-and-prune method for the supervised learning of sparse network topologies. Namely, we have introduced a regularization term that selectively drives towards zero parameters that are less sensitive, i.e. have little importance on the network output, and thus can be pruned without affecting the network performance. The regularization derivation is completely general and applicable to any optimization problem, plus it is efficiencyfriendly, introducing a minimum computation overhead as it makes use of the Jacobian matrices computed during backpropagation. Our proposed method enables more effective sparsification than other regularization-based methods for both the specific and the unspecific formulation of the sensitivity in fully-connected architectures. It was empirically observed that for the experiments on MNIST Sunspec reaches higher sparsity than Sspec, while on ImageNet and on a deeper neural network (VGG16) Sspec is able to reach the highest sparsity. Moreover, our regularization seems to have a beneficial impact on the generalization of the network. However, in convolutional architectures the proposed technique is surpassed by one sparsifying technique. This might be explained from the fact that our sensitivity term does not take into account shared parameters. Future work involves an investigation into the observed improvement of generalization, a study of the trade-offs between specific and unspecific sensitivity, and the extension of the sensitivity term to the case of shared parameters. Acknowledgments The authors would like to thank the anonymous reviewers for their valuable comments and suggestions. This work was done at the Joint Open Lab Cognitive Computing and was supported by a fellowship from TIM. 9 References [1] Karen Simonyan and Andrew Zisserman, “Very deep convolutional networks for large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014. [2] Jie Hu, Li Shen, and Gang Sun, “Squeeze-and-excitation networks,” in Conference on Computer Vision and Pattern Recognition, CVPR, 2018. [3] Xavier Glorot, Antoine Bordes, and Yoshua Bengio, “Deep sparse rectifier neural networks,” in Proceedings of the 14th International Conference on Artiicial Intelligence and Statistics (AISTATS), 2011, pp. 315–323. [4] Alon Brutzkus, Amir Globerson, Eran Malach, and Shai Shalev-Shwartz, “SGD learns overparameterized networks that provably generalize on linearly separable data,” arXiv preprint arXiv:1710.10174, 2017. [5] Hrushikesh N Mhaskar and Tomaso Poggio, “Deep vs. shallow networks: An approximation theory perspective,” Analysis and Applications, vol. 14, no. 06, pp. 829–848, 2016. [6] Charles W. Groetsch, Inverse Problems in the Mathematical Sciences, Vieweg, 1993. [7] Sayan Mukherjee, Partha Niyogic, Tomaso Poggio, and Ryan Rifkin, “Learning theory: stability is sufficient for generalization and necessary and sufficient for consistency of empirical risk minimization,” Advances in Computational Mathematics, vol. 25, pp. 161–193, 2006. [8] Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li, “Learning structured sparsity in deep neural networks,” in Advances in Neural Information Processing Systems, 2016, pp. 2074–2082. [9] Song Han, Jeff Pool, John Tran, and William Dally, “Learning both weights and connections for efficient neural network,” in Advances in Neural Information Processing Systems, 2015, pp. 1135–1143. [10] Karen Ullrich, Edward Meeds, and Max Welling, “Soft weight-sharing for neural network compression,” arXiv preprint arXiv:1702.04008, 2017. [11] Michael Zhu and Suyog Gupta, “To prune, or not to prune: exploring the efficacy of pruning for model compression,” arXiv preprint arXiv:1710.01878, 2017. [12] Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky, “Sparse convolutional neural networks,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 806–814. [13] Christos Louizos, Max Welling, and Diederik P Kingma, “Learning sparse neural networks through l_0 regularization,” arXiv preprint arXiv:1712.01312, 2017. [14] Y-lan Boureau, Yann L Cun, et al., “Sparse feature learning for deep belief networks,” in Advances in neural information processing systems, 2008, pp. 1185–1192. [15] Eugenio Culurciello, Ralph Etienne-Cummings, and Kwabena A Boahen, “A biomorphic digital image sensor,” IEEE Journal of Solid-State Circuits, vol. 38, no. 2, pp. 281–294, 2003. [16] Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov, “Variational dropout sparsifies deep neural networks,” arXiv preprint arXiv:1701.05369, 2017. [17] Lucas Theis, Iryna Korshunova, Alykhan Tejani, and Ferenc Huszár, “Faster gaze prediction with dense networks and fisher pruning,” arXiv preprint arXiv:1801.05787, 2018. [18] Song Han, Huizi Mao, and William J Dally, “Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding,” arXiv preprint arXiv:1510.00149, 2015. [19] Andries P Engelbrecht and Ian Cloete, “A sensitivity analysis algorithm for pruning feedforward neural networks,” in Neural Networks, 1996., IEEE International Conference on. IEEE, 1996, vol. 2, pp. 1274–1278. [20] Iveta Mrázová and Zuzana Reitermanová, “A new sensitivity-based pruning technique for feed-forward neural networks that improves generalization,” in Neural Networks (IJCNN), The 2011 International Joint Conference on. IEEE, 2011, pp. 2143–2150. [21] Iveta Mrazova and Marek Kukacka, “Can deep neural networks discover meaningful pattern features?,” Procedia Computer Science, vol. 12, pp. 194–199, 2012. 10 [22] Deniz Yuret, “Knet: beginning deep learning with 100 lines of julia,” in Machine Learning Systems Workshop at NIPS 2016, 2016. [23] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278 – 2324, Nov. 1998. [24] Yiwen Guo, Anbang Yao, and Yurong Chen, “Dynamic network surgery for efficient dnns,” in Advances In Neural Information Processing Systems, 2016, pp. 1379–1387. [25] 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, vol. 115, no. 3, pp. 211–252, Dec. 2015. 11
2018
21
7,375
Extracting Relationships by Multi-Domain Matching Yitong Li1, Michael Murias2, Samantha Major3, Geraldine Dawson3 and David E. Carlson1,4,5 1Department of Electrical and Computer Engineering, Duke University 2Duke Institute for Brain Sciences, Duke University 3Departments of Psychiatry and Behavioral Sciences, Duke University 4Department of Civil and Environmental Engineering, Duke University 5Department of Biostatistics and Bioinformatics, Duke University {yitong.li,michael.murias,samantha.major, geraldine.dawson,david.carlson}@duke.edu Abstract In many biological and medical contexts, we construct a large labeled corpus by aggregating many sources to use in target prediction tasks. Unfortunately, many of the sources may be irrelevant to our target task, so ignoring the structure of the dataset is detrimental. This work proposes a novel approach, the Multiple Domain Matching Network (MDMN), to exploit this structure. MDMN embeds all data into a shared feature space while learning which domains share strong statistical relationships. These relationships are often insightful in their own right, and they allow domains to share strength without interference from irrelevant data. This methodology builds on existing distribution-matching approaches by assuming that source domains are varied and outcomes multi-factorial. Therefore, each domain should only match a relevant subset. Theoretical analysis shows that the proposed approach can have a tighter generalization bound than existing multiple-domain adaptation approaches. Empirically, we show that the proposed methodology handles higher numbers of source domains (up to 21 empirically), and provides state-of-the-art performance on image, text, and multi-channel time series classification, including clinical outcome data in an open label trial evaluating a novel treatment for Autism Spectrum Disorder. 1 Introduction Deep learning methods have shown unparalleled performance when trained on vast amounts of diverse labeled training data [21], often collected at great cost. In many contexts, especially medical and biological, it is prohibitively expensive to collect or label the number of observations necessary to train an accurate deep neural network classifier. However, a number of related sources, each with “moderate” data, may already be available, which can be combined to construct a large corpus. Naively using the combined source data is often an ineffective strategy; instead, what is needed is unsupervised multiple-domain adaptation. Given labeled data from several source domains (each representing, e.g., one patient in a medical trial, or reviews of one type of product), and unlabeled data from target domains (new patients, or new product categories), we wish to train a classifier that makes accurate predictions about the target domain data at test time. Recent approaches to multiple-domain adaptation involve learning a mapping from each domain into a common feature space, in which observations from the target and source domains have similar distributions [14, 45, 39, 30]. At test time, a target-domain observation is first mapped into this shared feature space, then classified. However, few of the existing works can model the relationship among different domains, which we note is important for several reasons. First, even though data in different domains share labels, their cause and symptoms may be different. Patients with the same 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. MNIST MNISTM SVHN USPS Source Domains (a) Baseline model MNIST MNISTM SVHN USPS Source Domains (b) Proposed model MDMN Figure 1: Figure 1(a) visualizes previous multiple-domain adaptation methods. Figure 1(b) visualizes the proposed method, with domain adaptation between all domains. condition can be caused by various reasons and diagnosed while sharing only a subset of symptoms. Extracting these relationships between patients is helpful in practice because it limits the model to only relevant information. Second, as mentioned above, a training corpus may be constructed with only a small number of sources within a larger population. For example, we might collect data from many patients with “small” data and domain adaptation is used to generalize to new patients [3]. Therefore, extracting these relationships is of practical importance. In addition to the practical argument, [32] gives a theoretical proof that adding irrelevant source domains harms performance bounds on multiple-domain adaptation. Therefore, it is necessary to automatically choose a weighting over source domains to utilize only relevant domains. There are only a few works that address such a domain weighting strategy [45]. In this manuscript, we extend the proof techniques of [4, 32] to show that a multiple-domain weighting strategy can have a tighter generalization bound than traditional multiple domain approaches. Figure 2: Figure 2 is a visualization of the graph induced on 22 patients by the proposed model, MDMN. Each node represents one subject and the target domain is shown in blue. Note that although the target is only strongly connected to one source domain, the links between source domains allow them to share strength and make more robust predictions. The lines are labeled by the mean of the directional weights learned in MDMN. Notably, many recently proposed transfer learning strategies are based on minimizing the Hdivergence between domains in feature space, which was shown to bound generalization error in domain adaptation [4]. Compared to standard L1-divergence, H-divergence limits the hypothesis to a given class, which can be better estimated using finite samples theoretically. The target error bound using H-divergence has the desirable property that it can be estimated by learning a classifier between the source and target domains with finite VC dimension, motivating the Domain Adversarial Neural Network (DANN) [14]. However, neural network usually has large VC dimensions, making the bound using H-divergence loose in practice. In this work, we propose to use a ‘Wasserstein-like’ metric to define domain similarity in the proofs. ‘Wasserstein-like’ distance in our work extends the binary output in H-divergence to real probability output. Our main contribution is our novel approach to multiple-domain adaptation. A key idea from prior work is to match every source domain’s feature-space distribution to that of the target domain [37, 29]. In contrast, we map the distribution (i) among sources and target and (ii) within source domains. It is only necessary and prudent to match one domain to a relevant subset of the others. This makes sense particularly in medical contexts, as nearly all diagnoses address a multi-factorial disease. The Wasserstein distance is chosen to 2 facilitate the mathematical and theoretical operations of pairwise matching in multiple domains. The underlying idea is also closely related to optimal transport for domain adaptation [7, 8], but address multiple domain matching. The proposed method, MDMN, is visualized in Figure 1(b), compared with standard source to target matching scheme (Figure 1(a)), showing the matching of source domains. This tweak allows for already-similar domains to merge and share statistical strength, while keeping distant clusters of domains separate from one another. At test time, only the domains most relevant to the target are used [5, 32]. In essence, this induces a potentially sparse graph on all domains, which is visualized for 22 patients from one of our experiments in Figure 2. Any neural network architecture can be modified to use MDMN, which can be considered a stand-alone domain-matching module. 2 Method Multiple Domain Matching Network (MDMN) is based upon the intuition that in the extracted feature space, inherently similar domains should have similar or identical distributions. By sharing strength within source domains, MDMN can better deal with the overfitting problem within each domain, a common problem in scientific domains. Meanwhile, the relationships between domains can also be learned, which is of interest in addition to classification performance. Figure 3: The framework of MDMN. In the following, suppose we are given N observations {(xi, yi, si)}N i=1 from S domains, where yi is the desired label for xi and si is the domain. (In the target domain, the label y is not provided and will instead be predicted.) For brevity, we assume source domains are 1, 2, · · · , S −1, and the Sth domain is the single target domain. In fact, our approach works analogously for any number of unlabeled target domains. The whole framework, shown in Figure 3, is composed of an feature extractor (or encoder), a domain adapter (Sec. 2.1) and a label classifier (Sec. 2.2). In this work, we instantiate all three as neural networks. The encoder E maps data points x to feature vectors E(x). These features are then used by the label classifier to make predictions for the supervised task. They are also used by the domain adapter, encouraging extracted features E(x) to be similar across nearby domains. 2.1 Domain Adaptation with Relationship Extraction This section details the structure of the domain adapter. In order to adapt one domain to the others, one approach is to consider a penalty proportional to the distance between each distribution and the weighted mean of the rest. Specifically, let Ps be the distribution over data points x in domain Ds, and P/s = 1 S−1 PS s0=1 wss0Ps0 the distribution of data from all other domains Dws /s . Note that the weight ws = [ws1, · · · , wsS] is domain specific and ws 2 RS, where ws lies on the simplex with ||ws||1 = 1, wss0 ≥0 for s0 = 1, . . . , S and wss = 0, which will be learned in the framework. In the following, we will use Ds to represent for its distribution Ps in order to simplify the notation. Then we can encourage all domains to be close together in the feature space by adding the following term to the loss: LD(E(x; ✓E); ✓D) = PS s=1 βsd(Ds, Dws /s ), (1) where d(·, ·) is a distance between distributions (domains). Here it is used to measure the discrepancy between one domain and a weighted average of the rest. We assume the weight βs equals 1 S−1 for s = 1, · · · , S −1 and βS = 1 to balance the penalty for the source and target domains, although this may be chosen as a tuning parameter. LD is the total domain adapter loss function. For the rest of this manuscript, we have chosen to use the Wasserstein distance as d(·, ·). This approach is facilitated by the use of Kantorovich-Rubenstein dual formulation of the Wasserstein-1 distance [2], which is given for distributions D1 and D2 as d(D1, D2) = sup||f||L1 Ex⇠P1[f(E(x))] − Ex⇠P2[f(E(x))], where ||f||L 1 denotes that the Lipschitz constant of the function f(·) is at 3 most 1, i.e. |f(x0) −f(x)| ||x0 −x||2. f() is any Lipschitz-smooth nonlinear function, which can be approximated by a neural network [2]. When S is reasonably small (< 100), it is feasible to include S small neural networks fs(·; ✓D) to approximate these distances for each domain. In our implementation, we use shared layers in the domain adapter to enhance computational efficiency and the output of the domain adapter is f(·; ✓D) = [f1, · · · , fs, · · · , fS]. The domain loss term is then given as PS s=1 sup||fs||L1 λs ⇣ Ex⇠Ds[fs(E(x))] −Ex⇠Dws /s [fs(E(x))] ⌘ . (2) To make the domain penalty in (2) feasible, it is necessary to discuss how the penalty can be included in the optimization flow of neural network training. To develop this mathematical approach, let ⇡s be the proportion of the data that comes from the sth domain, then the penalty can be rewritten as 1 S PS s=1 βs ⇣ Ex⇠Ds[fs(E(x))] −Ex⇠Dws /s [fs(E(x))] ⌘ = Es⇠Uniform(1,...,S) ⇥ Ex⇠Ds[rT s f(E(x))] ⇤ = Es⇠⇡ h Ex⇠Ds[ 1 S⇡s ⇥rT s f(E(x))] i , (3) where f(E(x)) is the concatenation of fs(E(x)), i.e. f(E(x)) = [f1(E(x)), · · · , fS(E(x))]T . r 2 RS is defined as rs = ⇢ −βswss0, s0 6= s βs, s0 = s , s0 = 1, · · · , S. (4) The form in (3) is natural to include in an optimization loop because the expectation is empirically approximated by a mini-batch of data. Let {(xi, si)}, i = 1, . . . , N denote observations and their associated domain si, and then Es⇠⇡ h Ex⇠Ds[ 1 S⇡s ⇥rT s f(E(x))] i ' 1 SN PN i=1 ⇡−1 si rT sif(E(xi; ✓E); ✓D). (5) The weight vector ws for domain Ds should choose to focus only on relevant domains, and the weights on mismatched domains should be very small. As noted previously, adding uncorrelated domains hurts generalization performance [32]. In our Theorem 3.3, we shows that a weighting scheme with these properties decreases the target error bound. Once the function fs(·; ✓D) is known, we can estimate ws by using a softmax transformation on the function expectations from fs between any two domains. Specifically, the weight ws to match Ds to other domains is calculated as ws = softmax/s(ls), with lss0 = ) Ex⇠Ds[fs(E(x))] −Ex⇠Ds0 [fs(E(x))] * , (6) where ls = [ls1, · · · , lss0, · · · , lsS]. The subscript /s means that the value wss is restricted to 0 and lss is excluded from the softmax. The scalar quantity controls how peaked ws is. Note that setting ws in (2) to the closest domain and 0 otherwise would correspond to the ! 1 case, and ! 0 corresponds to an unweighted (e.g. conventional) case. It is beneficial to force the domain regularizer to match to multiple, but not necessarily all, available domains. Practically, we can either modify in the softmax or change the Lipschitz constant used to calculate the distance (as was done). As an example, the learned graph connectivity is shown in Figure 2 is constructed by thresholding 1 2(wss0 + ws0s) to determine connectivity between nodes. 2.2 Combining the Loss Terms The proposed method uses the loss in (5) to perform the domain matching. A label classifier is also necessary, which is defined as a neural network parameterized by ✓Y . The label classifier in Figure 3 is represented as Y [E(x)], where the classifier Y is applied on the extracted feature vector E(x). The label predictor usually contains several fully connected layers with nonlinear activation functions. The cross entropy loss is used for classification, i.e. LY (x, y; ✓Y , ✓E) = PN i=1 PC c=1 yic log Yc[E(xi)], where Yc means the cth entry of the output. The MSE loss is used for regression. With the label prediction loss LY , the complete network loss is given by min✓E,✓Y max✓D LY (✓Y , ✓E) + ⇢LD(✓D, ✓E), (7) where ✓E denotes the parameters in the feature extractor/encoder, ✓D denotes the parameters in the domain adapter, and ✓Y in the label classifier. The pseudo code for training is given in Algorithm 1. 4 Algorithm 1 Multiple Source Domain Adaptation via WDA Input: Source samples from Ds, s = 1, · · · , S −1 and target samples from DS. Note that we assume index 1, · · · , S −1 are for source domains and S is for the target domain. Iteration kY and kD for training label classifier and domain discriminator. Output: Classifier parameters ✓E, ✓Y , ✓D. for iter = 1 to max_iter do Sample a mini-batch of {xs} from {Ds}S−1 s=1 and {xt} from DS. for iterY = 1 to kY do Compute lss0 = Ex2Ds [fs(E(x))] −Ex2Ds0 [fs(E(x))] for 8s, s0 2 [1, S]. Compute the weight vectors ws = softmax/s(ls) and wss = 0 for 8s 2 [1, S], where ls = (ls1, · · · , lsS). Compute domain loss LW D (xs, xt) and classifier loss LY (xs). Compute r✓Y = @LY @✓Y and r✓E = @LY @✓E + ⇢@LD @✓E Update ✓Y = ✓Y −r✓Y , ✓E = ✓E −r✓E. end for for iterD = 1 to kD do Update the weight vectors ws, 8s 2 [1, S]. Compute LD(xs, xt) and r✓D = @LD @✓D . Update ✓D = ✓D + r✓D. end for end for During training, the target domain weight βS in eq. (1) is always set to one, while sources domain weights are normalized to have sum one. This is because the ultimate goal is to work well on target domain. We use the gradient penalty introduced in [18] to implement the Lipschitz constraint. A concern is that the feature scale may change and impact the Wasserstein distance. One potential solution to this is to include batch normalization to keep the summary statistics of the extracted features constant. In practice, this is not necessary. Adam [20] is used as the optimization method while the gradient descent step in Algorithm 1 reflects the basic strategy. 2.3 Complexity Analysis Although the proposed algorithm computes pairwise domain distance, the computational cost in practice is similar compared to standard DANN model. For the domain loss functions, we share all the bottom layers for all domains. This is similar to the setup of a multi-class domain classifier with softmax output while in our model, the output is a real number. Specifically, the pairwise distance (6) is updated in each mini-batch by averaging samples in the same domain. ˆlss0 ⇡1 ns X 8xi2Ds fs(E(xi)) −1 ns0 X 8xi2Ds0 fs(E(xi)) (8) Because these pairwise calculations happen late in the network, their computational cost is dwarfed by feature generation. We believe that the methods will easily scale to hundreds of domains based on computational and memory scaling. We use exponential smoothing during the updates to improve the quality of the estimates, with lt+1 ss0 = 0.9lt ss0 + 0.1ˆlc ss0. ˆlc ss0 is the value from current iteration’s mini-batch. Then the softmax is applied on the calculated values to get the weight wss0. This procedure is used to update ws, so those parameters are not included in the backpropagation. The domain weights and network parameters are updated iteratively, as shown in Algorithm 1. 3 Theoretical Results In this section, we investigate the theorems and derivations used to bound the target error with the given method in Section 2. Specifically, the target error is bounded by the source error, the source-target distance plus additional terms which is constant under certain data and hypothesis 5 classes. The theory is developed based on prior theories of source to target adaptation. The adaptation within source domains can be developed in the same way. Additional details and derivations are available in the Supplemental Section A. Let Ds for s = 1, · · · , S and DT represent the source and the target domain, respectively. Note that there is a notation change in the target domain, where the Sth domain was denoted as the target in previous section. Here, it is easier to separate the target domain out. Suppose that there is probabilistic true labeling functions gs, gT : X ! [0, 1] and a probabilistic hypothesis f : X ! [0, 1], which in our case is a neural network. The output value of the labeling function determines the probability that the sample is 0 or 1. gs, gT are assumed Lipschitz smooth with parameters λs and λT , respectively. This differs from the previous derivation [14] that assumes that the hypothesis and labeling function were deterministic ({0, 1}). In the following, the notation of encoder E() is removed for simplicity. Thus f(x) is actually f(E(x; ✓E); ✓D). Since we first only focus on the adaptation from source to target, the output of f(·) in this section is a scalar (The last element of f(·)). Same for notation ws, which is the domain similarity of Ds and target. Definition 3.1 (Probabilistic Classifier Discrepancy). The probabilistic classifier discrepancy for domain Ds is defined as γs(f, g) = Ex⇠Ds[|f(x) −g(x)|]. (9) Note that if the label hypothesis is limited to {0, 1}, this is classification accuracy. In order to construct our main theorem, we use notation ||f||L 6 λ to denote λ-smooth function. Mathematical details are given in Definition A.6 in the appendix. Next we define the weighted Wasserstein-like quantity between sources and the target. Definition 3.2 (Weighted Wasserstein-like quantity). Given S multi-source probability distributions Ps, s = 1, · · · , S and PT for the target domain, the difference between the weighted source domains {Ds}S s=1 and target domain DT is described as, ↵λ(DT , P s wsDs) = maxf:X![0,1],||f||Lλ Ex⇠DT [f(x)] −Ex⇠P s wsDs[f(x)]. (10) Note that if the bound on the function from 0 to 1 is removed, then this quantity is the KantorovichRubinstein dual form of the Wasserstein-1 distance. As λ ! 1, this is the same as the commonly used L1-divergence or variation divergence [4]. Thus, we can derive this theorem with H-divergence exactly, but prefer to use the smoothness constraint to match the used Wasserstein distance. We also define f ⇤as an optimal hypothesis that achieves the minimum discrepancy γ⇤, which is given in the appendix A.3. Now we come to the main theorem of this work. Theorem 3.3 (Bound on weighted multi-source discrepancy). For a hypothesis f : X ! [0, 1], γT (f, gT ) PS s=1 wsγs(f, gs) + ↵λT +λ⇤(PS s=1 wsDs, DT ) + γ⇤ (11) The quantity γ⇤given in (27) is defined in the appendix and addresses the fundamental mismatch in true labeling functions, which is uncontrollable by domain adaptation. Note that a weighted sum of Lipschitz continuous functions is also Lipschitz continuous. λ⇤is the Lipschitz continuity for the weighted domain combination λ⇤= PS s=1 wsλs, where fs() of domain Ds has Lipschitz constant λs. We note that in Theorem 3.3 we are dependent on the weighted sum of the source domains, implying that increasing the weight on irrelevant source domain may hurt generalization performance. This matches existing literature. Second, a complex model with high learning capacity will reduce the source error γs(f, gs), but the uncertainty introduced by the model will increase the domain discrepancy measurement ↵λ+λ⇤({Ds}S s=1, DT ). Compared to the multi-source domain adversarial network’s (MDAN’s) [45] bound, γT (f, gT )  maxs γs(f, gs) + maxs dH∆H(Ds, DT ) + γ⇤, where the definition of dH∆H is given in appendix section A.2. Theorem 3.3 reveals that weighting has a tighter bound because an irrelevant domain with little weight will not seriously hurt the generalization bound whereas prior approaches have taken the max over the least relevant domain. Also, the inner domain matching helps prevent spurious relationships between irrelevant domains and the target. Therefore, MDAN can pick out more relevant source domains compared to the alternative methods evaluated. 4 Related Work There is a large history in domain adaptation to transfer source distribution information to the target distribution or vice versa, and has been approached in a variety of manners. Kernel Mean 6 Matching (KMM) is widely used in the assumption that target data can be represented by a weighted combination of samples in the source domain [37, 19, 12, 29, 40]. Clustering [25] and late fusion [1] approaches have also been evaluated. Distribution matching has been explored with the Minimum Mean Discrepancy [29] and optimal transport [8, 7], which is similar to the motivation used in our domain penalization. With the increasing use of neural networks, weight sharing and transfer has emerged as an effective strategy for domain adaptation [15]. With the development of Generative Adversarial Networks (GANs) [17], adversarial domain adaptation has become popular. The Domain Adversarial Neural Network (DANN) is a newly proposed model for feature adaptation rather than simple network weight sharing [14]. Since its publication, the DANN approach has been generalized [39, 43] and extended to multiple domains [45]. In the multiple domain case, a weighted combination of source domains is used for adaptation. [22] is based on the DANN framework, but uses distributional summary statistics in the adversary. Several other methods use source or target sample generation with GANs on single source domain adaptation [35, 27, 26, 33], but extensions to multi-source domains are not straightforward. [3] provides a multi-stage multi-source domain adaptation. There has also been theoretical analysis of error bounds for multi-source domain adaptation. [9] analyzes the theory on distributed weighted combining of multiple source domains. [32] gives a bound on target loss when only using k-nearest source domains. It shows that adding more uncorrelated source domains training data hurts the generalization bound. The bound that [4] gives is also on the target risk loss. It introduces the H-divergence as a measurement of the distance between source and target domains. [5] further analyzes whether source sample quantity can compensate for quality under different methods and different target error measurements. Domain adaptation can be used in a wide variety of applications. [16, 10] uses it for natural language processing tasks. [12] perform video concept detection using multi-source domain adaptation with auxiliary classifiers. [15, 14, 1, 3, 39] focus on image domain transfer learning. The multi-source domain adaptation in previous works is usually limited to fewer than five source domains. Some scientific applications have more challenging situation by adapting from a significantly higher number of source domains [44]. In some neural signals, different methods have been employed to transfer among subjects based on hand crafted EEG features [38, 24]; however, these models need to be trained in several steps, making them less robust. 5 Experiment We tested MDMN by applying it to three classification problems: image recognition, natural-language sentiment detection, and multi-channel time series analysis. The sentiment classification task is given in the Appendix due to limited space. 5.1 Results on Image Datasets We first test the performance of the proposed MDMN model on MNIST, MNISTM, SVHN and USPS datasets. Visualizations of these datasets are given in the Appendix Section C.1. In each test, one dataset is left out as target domain while the remaining three are treated as source domains. The feature extractor E consists of two convolutional layers plus two fully connected layers. Both the label predictor and domain adapter are two layers MLP. ReLU nonlinearity is used between layers. The baseline method is the concatenation of feature extractor and label predictor as a standard CNN but it has no access to any target domain data during training process. While TCA [34] and SA [13] methods can process raw images, the results are significantly stronger following a feature extraction step. The results from these methods are given by following two independent steps. First, a convolutional neural network with the same structure as in our proposed approach is used as a baseline. This model is trained on the source domains, and then features are extracted for all domains to use as inputs into TCA and SA. Another issue is computational complexity for TCA, because this algorithm computes the matrix inverse during the inference, which is of complexity O(N 3). Hence, data was limited for this algorithm. For the adversarial based algorithms [39, 14, 45] and MDMN model, the domain classifier is the uniform, which is a two layer MLP with ReLU nonlinearities and a soft-max top layer. 7 (a) Baseline (b) DANN (c) MDANs (d) MDMN Figure 4: Visualization of feature spaces of different models by t-SNE. Each color represents one dataset of MNIST, MNISTM, SVHN and USPS. The testing target domain is MNISTM. The digit label is shown in the plot. The goal is to adapt generalized feature from source domains to the target domains; the digits should cluster together rather than the color clustering. (a) Classification accuracy on SEED dataset. (b) Relative classification accuracy on ASD dataset. Figure 5: Relative classification accuracy by subject on two EEG datasets. The accuracy without subtracting the baseline performance is given in appendix C.2. The classification accuracy is compared in Table 1. The top row shows the baseline result on the target domain with the classifier trained on the three other datasets. The proposed model MDMN outperforms the other baselines on all datasets. Note that some domain-adaptation algorithms actually lower the accuracy, revealing that domain-specific features are being transfered. Another problem encountered is the mismatch between the source domain and target domain. For instance, when the target domain is the MNIST-M dataset, it is expected to give large weight to MNIST dataset samples during training. However, algorithms like TCA, SA and DANN equally weight all source domain datasets, making the result worse than MDMN. Acc. % MNIST MNISTM USPS SVHN Baseline 94.6 60.8 89.4 43.7 TCA [34] 78.4 45.2 75.4 39.7 SA [13] 90.8 59.9 86.3 40.2 DAN [28] 97.1 67.0 90.4 51.9 ADDA [39] 89.0 80.3 85.2 43.5 DANN [14] 97.9 68.8 89.3 50.1 MDANs [45] 97.2 68.5 90.1 50.5 MDMN 98.0 83.8 94.5 53.1 Table 1: Accuracy on image classification. For the TCA method, 20% of the data was randomly selected. If we project the feature vector for each data to two dimensions using the TSNE embedding [31], the features are shown in Figure 4. The goal is to mix different colors while distinguishing different digits. The baseline model in Figure 4(a) shows no adaptation for the target domain, i.e. the digit ‘0’ from USPS and MNIST datasets form two islands if domain adaptation is not imposed. The DANN model and the MDANs model shows some “mixing” effect, which indicates that domain adaptation is happening because the extracted features are more similar between domains. MDMN has the most clear digit mixing effect. The model finds the digit label features instead of domain specific features. A larger figure of the same result is given in Appendix C.1 for enhanced clarity. 5.2 Result on EEG Time Series Two datasets are used to evaluate performance on Electroencephalography (EEG) data: SEED dataset and an Autism Spectrum Disorder (ASD) dataset. 8 The SEED dataset [46] focuses on analyzing emotion using EEG signal. This dataset has 15 subjects. The EEG signal is recorded when each subject watches 15 movie clips for 3 times at three different days. Each video clip is attached with a negative/neutral/positive emotion label. The sampling rate is at 1000Hz and a 62-electrode layout is used. In our experiment, we downsample the EEG signal to 200Hz. The test scheme is the leave-one-out cross-validation. In each time, one subject is picked out as test and the remaining 14 subjects are used as training and validation. The Autism Spectrum Disorder (ASD) dataset [11] aims at discovering whether there are significant changes in neural activity in a open label clinical trial evaluating the efficacy of a single infusion of autologous cord blood for treatment of ASD [11]. The study involves 22 children from ages 3 to 7 years undergoing treatment for ASD with EEG measurements at baseline (T1), 6 months post treatment (T2), and 12 months post treatment (T3). The signal was recorded when a child was watching a total of three one-minute long videos designed to measure responses to dynamic social and nonsocial stimuli. The data has 121 signal electrodes. The classification task is to predict the treatment stage T1, T2 and T3 to test the effectiveness of the treatment and analyze what features are dynamic in response to the treatment. By examining the features, we can track how neural changes correlate to this treatment stages. We also adopt the leave-one-out cross-validation scheme for this dataset, where one subject is left out as testing, the remaining 21 subjects are separated as training and validation. Leaving complete subjects out better estimates generalization to a population in these types of neural tasks [42]. The classification accuracy using different methods is compared in Table 2. In this setting, we choose our baseline model as the SyncNet [23]. SyncNet is a neural network with structured filter targeting at extracting neuroscience related features. The simplest framework of SyncNet is adopted which only contains one layer of convolutional filters. As in [23], we set the filter number to 10 for both datasets. For TCA, SA and ITL methods, the baseline model was trained as before without a domain adapter on the source domain data. Extracted features from this model were then used to extract features from target domains. Dataset SEED ASD SyncNet [23] 49.29 62.06 TCA [34] 39.70 55.65 SA [13] 53.90 62.53 ITL [36] 45.27 54.62 DAN [28] 50.28 61.88 DANN [14] 55.87 63.81 MDANs [45] 56.65 63.38 MDMN 60.59 67.78 Table 2: Classification mean accuracy in percentage on EEG datasets. MDMN outperforms other competitors on both EEG datasets. A subject by subject plot is shown in Figure 5. Because performance on subjects is highly variable, we only visualize performance relative to baseline, and absolute performance is visualized in Figure 8 in the appendix. Because the source domains are large but each source domain is highly variable, the requirement to find relevant domains is of increased importance on both of the EEG datasets. For the ASD dataset, DANN and MDANs do not match the performance of MDMN mainly because they cannot correctly pick out most related subject from source domains. This is also true for TCA, SA and ITL. Our proposed algorithm MDMN overcomes this problem by computing domain similarity in feature space while performing feature mapping, and a domain relationship graph by subject is given in Figure 2. Each subject is related to all the others with different weight. The missing edges, like the edges to node ‘s10’, are those with weight less than 0.09. Our algorithm automatically finds the relationship and the domain adaptation happens with the calculated weight, instead of treating all domains equally. 6 Conclusion In this work, we propose the Multiple Domain Matching Network (MDMN) that uses feature matching across different source domains. MDMN is able to use pairwise domain feature similarity to give a weight to each training domain, which is of key importance when the number of source domains increases, especially in many neuroscience and biological applications. While performing domain adaptation, MDMN can also extract the relationship between domains. The relationship graph itself is of interest in many applications. Our proposed adversarial training framework further applies this idea on different domain adaptation tasks and shows state-of-the-art performance. 9 Acknowledgements Funding was provided by the Stylli Translational Neuroscience Award, Marcus Foundation, NICHD P50-HD093074, and NIMH 3R01MH099192-05S2. References [1] S. Ao, X. Li, and C. X. Ling. Fast generalized distillation for semi-supervised domain adaptation. In AAAI, 2017. [2] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. [3] J. T. Ash, R. E. Schapire, and B. E. Engelhardt. Unsupervised domain adaptation using approximate label matching. arXiv preprint arXiv:1602.04889, 2016. [4] S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan. A theory of learning from different domains. Machine Learning, 2010. [5] S. Ben-David and R. Urner. Domain adaptation–can quantity compensate for quality? Annals of Mathematics and Artificial Intelligence, 2014. [6] M. Chen, Z. Xu, K. Q. Weinberger, and F. Sha. Marginalized stacked denoising autoencoders. In Proceedings of the Learning Workshop, Utah, UT, USA, volume 36, 2012. [7] N. Courty, R. Flamary, A. Habrard, and A. Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In NIPS, 2017. [8] N. Courty, R. Flamary, D. Tuia, and A. Rakotomamonjy. Optimal transport for domain adaptation. IEEE PAMI, 2017. [9] K. Crammer, M. Kearns, and J. Wortman. Learning from multiple sources. JMLR, 2008. [10] H. Daumé III. Frustratingly easy domain adaptation. arXiv preprint arXiv:0907.1815, 2009. [11] G. Dawson, J. M. Sun, K. S. Davlantis, M. Murias, L. Franz, J. Troy, R. Simmons, M. SabatosDeVito, R. Durham, and J. Kurtzberg. Autologous cord blood infusions are safe and feasible in young children with autism spectrum disorder: Results of a single-center phase i open-label trial. Stem Cells Translational Medicine, 2017. [12] L. Duan, I. W. Tsang, D. Xu, and T.-S. Chua. Domain adaptation from multiple sources via auxiliary classifiers. In ICML. ACM, 2009. [13] B. Fernando, A. Habrard, M. Sebban, and T. Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In ICCV, 2013. [14] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. JMLR, 2016. [15] T. Gebru, J. Hoffman, and L. Fei-Fei. Fine-grained recognition in the wild: A multi-task domain adaptation approach. In ICCV, 2017. [16] X. Glorot, A. Bordes, and Y. Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In ICML, 2011. [17] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014. [18] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017. [19] C.-A. Hou, Y.-H. H. Tsai, Y.-R. Yeh, and Y.-C. F. Wang. Unsupervised domain adaptation with label and structural consistency. IEEE Transactions on Image Processing, 2016. 10 [20] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. ICLR, 2014. [21] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [22] C. Li, D. Alvarez-Melis, K. Xu, S. Jegelka, and S. Sra. Distributional adversarial networks. arXiv preprint arXiv:1706.09549, 2017. [23] Y. Li, M. Murias, S. Major, G. Dawson, K. Dzirasa, L. Carin, and D. E. Carlson. Targeting eeg/lfp synchrony with neural nets. In NIPS, 2017. [24] Y.-P. Lin and T.-P. Jung. Improving eeg-based emotion classification using conditional transfer learning. Frontiers in human neuroscience, 2017. [25] H. Liu, M. Shao, and Y. Fu. Structure-preserved multi-source domain adaptation. In ICDM. IEEE, 2016. [26] M.-Y. Liu, T. Breuel, and J. Kautz. Unsupervised image-to-image translation networks. In NIPS, 2017. [27] M.-Y. Liu and O. Tuzel. Coupled generative adversarial networks. In NIPS, 2016. [28] M. Long, Y. Cao, J. Wang, and M. I. Jordan. Learning transferable features with deep adaptation networks. In ICML, 2016. [29] M. Long, H. Zhu, J. Wang, and M. I. Jordan. Unsupervised domain adaptation with residual transfer networks. In NIPS, 2016. [30] M. Long, H. Zhu, J. Wang, and M. I. Jordan. Deep transfer learning with joint adaptation networks. In ICML, 2017. [31] L. v. d. Maaten and G. Hinton. Visualizing data using t-sne. JMLR, 2008. [32] Y. Mansour, M. Mohri, and A. Rostamizadeh. Domain adaptation with multiple sources. In NIPS, 2009. [33] S. Motiian, Q. Jones, S. Iranmanesh, and G. Doretto. Few-shot adversarial domain adaptation. In NIPS, 2017. [34] S. J. Pan, I. W. Tsang, J. T. Kwok, and Q. Yang. Domain adaptation via transfer component analysis. IEEE Transactions on Neural Networks, 2011. [35] P. Russo, F. M. Carlucci, T. Tommasi, and B. Caputo. From source to target and back: symmetric bi-directional adaptive gan. arXiv preprint arXiv:1705.08824, 2017. [36] Y. Shi and F. Sha. Information-theoretical learning of discriminative clusters for unsupervised domain adaptation. In ICML, 2012. [37] Q. Sun, R. Chattopadhyay, S. Panchanathan, and J. Ye. A two-stage weighting framework for multi-source domain adaptation. In NIPS, 2011. [38] W. Tu and S. Sun. A subject transfer framework for eeg classification. Neurocomputing, 2012. [39] E. Tzeng, J. Hoffman, K. Saenko, and T. Darrell. Adversarial discriminative domain adaptation, 2017. [40] H. Venkateswara, J. Eusebio, S. Chakraborty, and S. Panchanathan. Deep hashing network for unsupervised domain adaptation. In CVPR, 2017. [41] C. Villani. Optimal transport: old and new. Springer Science & Business Media, 2008. [42] M.-A. T. Vu, T. Adali, D. Ba, G. Buzsaki, D. Carlson, K. Heller, C. Liston, C. Rudin, V. Sohal, A. S. Widge, et al. A shared vision for machine learning in neuroscience. Journal of Neuroscience, 2018. 11 [43] Q. Xie, Z. Dai, Y. Du, E. Hovy, and G. Neubig. Adversarial invariant feature learning. In NIPS, 2017. [44] H. Xu, A. Lorbert, P. J. Ramadge, J. S. Guntupalli, and J. V. Haxby. Regularized hyperalignment of multi-set fmri data. In Statistical Signal Processing Workshop (SSP). IEEE, 2012. [45] H. Zhao, S. Zhang, G. Wu, J. P. Costeira, J. M. Moura, and G. J. Gordon. Multiple source domain adaptation with adversarial training of neural networks. arXiv preprint arXiv:1705.09684, 2017. [46] W.-L. Zheng and B.-L. Lu. Investigating critical frequency bands and channels for eeg-based emotion recognition with deep neural networks. IEEE Transactions on Autonomous Mental Development, 2015. 12
2018
210
7,376
Distributed k-Clustering for Data with Heavy Noise Xiangyu Guo University at Buffalo Buffalo, NY 14260 xiangyug@buffalo.edu Shi Li University at Buffalo Buffalo, NY 14260 shil@buffalo.edu Abstract In this paper, we consider the k-center/median/means clustering with outliers problems (or the (k, z)-center/median/means problems) in the distributed setting. Most previous distributed algorithms have their communication costs linearly depending on z, the number of outliers. Recently Guha et al. [10] overcame this dependence issue by considering bi-criteria approximation algorithms that output solutions with 2z outliers. For the case where z is large, the extra z outliers discarded by the algorithms might be too large, considering that the data gathering process might be costly. In this paper, we improve the number of outliers to the best possible (1 + ϵ)z, while maintaining the O(1)-approximation ratio and independence of communication cost on z. The problems we consider include the (k, z)-center problem, and (k, z)-median/means problems in Euclidean metrics. Implementation of the our algorithm for (k, z)-center shows that it outperforms many previous algorithms, both in terms of the communication cost and quality of the output solution. 1 Introduction Clustering is a fundamental problem in unsupervised learning and data analytics. In many real-life datasets, noises and errors unavoidably exist. It is known that even a few noisy data points can significantly influence the quality of the clustering results. To address this issue, previous work has considered the clustering with outliers problem, where we are given a number z on the number of outliers, and need to find the optimum clustering where we are allowed to discard z points, under some popular clustering objective such as k-center, k-median and k-means. Due to the increase in volumes of real-life datasets, and the emergence of modern parallel computation frameworks such as MapReduce and Hadoop, computing a clustering (with or without outliers) in the distributed setting has attracted a lot of attention in recent years. The set of points are partitioned into m parts that are stored on m different machines, who collectively need to compute a good clustering by sending messages to each other. Often, the time to compute a good solution is dominated by the communications among machines. Many recent papers on distributed clustering have focused on designing O(1)-approximation algorithms with small communication cost [2, 13, 10]. Most previous algorithms for clustering with outliers have the communication costs linearly depending on z, the number of outliers. Such an algorithm performs poorly when data is very noisy. Consider the scenario where distributed sensory data are collected by a crowd of people equipped with portable sensory devices. Due to different skill levels of individuals and the quality of devices, it is reasonable to assume that a small constant fraction of the data points are unreliable. Recently, Guha et al. [10] overcame the linear dependence issue, by giving distributed O(1)approximation algorithms for k-center/median/means with outliers problems with communication cost independent of z. However, the solutions produced by their algorithms have 2z outliers. Such a solution discards z more points compared to the (unknown) optimum one, which may greatly 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. decrease the efficiency of data usage. Consider an example where a research needs to be conducted using the inliers of a dataset containing 10% noisy points; a filtering process is needed to remove the outliers. A solution with 2z outliers will only preserve 80% of data points, as opposed to the promised 90%. As a result, the quality of the research result may be reduced. Unfortunately, a simple example (described in the supplementary material) shows that if we need to produce any multiplicatively approximate solution with only z outliers, then the linear dependence on z can not be avoided. We show that, even deciding whether the optimum clustering with z outliers has cost 0 or not, for a dataset distributed on 2 machines, requires a communication cost of Ω(z) bits. Given such a negative result and the positive results of Guha et al. [10], the following question is interesting from both the practical and theoretical points of view: Can we obtain distributed O(1)-approximation algorithms for k-center/median/means with outliers that have communication cost independent of z and output solutions with (1 + ϵ)z outliers, for any ϵ > 0? On the practical side, an algorithm discarding ϵz additional outliers is acceptable, as the number can be made arbitrarily small, compared to both the promised number z of outliers and the number n −z of inliers. On the theoretical side, the (1 + ϵ)-factor for the number of outliers is the best we can hope for if we are aiming at an O(1)-approximation algorithm with communication complexity independent of z; thus answering the question in the affirmative can give the tight tradeoff between the number of outliers and the communication cost in terms of z. In this paper, we make progress in answering the above question for many cases. For the k-center objective, we solve the problem completely by giving a (24(1 + ϵ), 1 + ϵ)-bicriteria approximation algorithm with communication cost O  km ϵ · log ∆ ϵ  , where ∆is the aspect ratio of the metric. (24(1 + ϵ) is the approximation ratio, 1 + ϵ is the multiplicative factor for the number of outliers our algorithm produces; the formal definition appears later.) For k-median/means objective, we give a distributed (1 + ϵ, 1 + ϵ)-bicrteria approximation algorithm for the case of Euclidean metrics. The communication complexity of the algorithm is poly 1 ϵ , k, D, m, log ∆  , where D is the dimension of the underlying Euclidean metric. (The exact communication complexity is given in Theorem 1.2.) Using dimension reduction techniques, we can assume D = O( log n ϵ2 ), by incurring a (1+ϵ)-distortion in pairwise distances. So, the setting indeed covers a broad range of applications, given that the term “k-means clustering” is defined and studied exclusively in the context of Euclidean metrics. The (1 + ϵ, 1 + ϵ)-bicriteria approximation ratio comes with a caveat: our algorithm has running time exponential in many parameters such as 1 ϵ , k, D and m (though it has no exponential dependence on n or z). 1.1 Formulation of Problems We call the k-center (resp. k-median and k-means) problem with z outliers as the (k, z)-center (resp. (k, z)-median and (k, z)-means) problem. Formally, we are given a set P of n points that reside in a metric space d, two integers k ≥1 and z ∈[0, n]. The goal of the problem is to find a set C of k centers and a set P ′ ⊆P of n −z points so as to minimize maxp∈P ′ d(p, C) (resp. P p∈P ′ d(p, C) and P p∈P ′ d2(p, C)), where d(p, C) = minc∈C d(p, c) is the minimum distance from p to a center in C. For all the 3 objectives, given a set C ⊆P of k centers, the best set P ′ can be derived from P by removing the z points p ∈P with the largest d(p, C). Thus, we shall only use a set C of k centers to denote a solution to a (k, z)-center/median/means instance. The cost of a solution C is defined as maxp∈P ′ d(p, C), P p∈P ′ d(p, C) and P p∈P ′ d2(p, C) respectively for a (k, z)-center, median and means instance, where P ′ is obtained by applying the optimum strategy. The n −z points in P ′ and the z points in P \ P ′ are called inliers and outliers respectively in the solution. As is typical in the machine learning literature, we consider general metrics for (k, z)-center, and Euclidean metrics for (k, z)-median/means. In the (k, z)-center problem, we assume that each point p in the metric space d can be described using O(1) words, and given the descriptions of two points p and q, one can compute d(p, q) in O(1) time. In this case, the set C of centers must be from P since these are all the points we have. For (k, z)-median/means problem, points in P and centers C are from Euclidean space RD, and it is not required that C ⊆P. One should treat D as a small number, since dimension reduction techniques can be applied to project points to a lower-dimension space. 2 Bi-Criteria Approximation We say an algorithm for the (k, z)-center/median/means problem achieves a bi-criteria approximation ratio (or simply approximation ratio) of (α, β), for some α, β ≥1, if it outputs a solution with at most βz outliers, whose cost is at most α times the cost of the optimum solution with z outliers. Distributed Clustering In the distributed setting, the dataset P is split among m machines, where Pi is the set of data points stored on machine i. We use ni to denote |Pi|. Following the communication model of [8] and [10], we assume there is a central coordinator, and communications can only happen between the coordinator and the m machines. The communication cost is measured in the total number of words sent. Communications happen in rounds, where in each round, messages are sent between the coordinator and the m machines. A message sent by a party (either the coordinator or some machine) in a round can only depends on the input data given to the party, and the messages received by the party in previous rounds. As is common in most of the previous results, we require the number of rounds used to be small, preferably a small constant. Our distributed algorithm needs to output a set C of k centers, as well as an upper bound L on the maximum radius of the generated clusters. For simplicity, only the coordinator needs to know C and L. We do not require the coordinator to output the set of outliers since otherwise the communication cost is forced to be at least z. In a typical clustering task, each machine i can figure out the set of outliers in its own dataset Pi based on C and L (1 extra round may be needed for the coordinator to send C and L to all machines). 1.2 Prior Work In the centralized setting, we know the best possible approximation ratios of 2 and 3 [4] for the kcenter and (k, z)-center problems respectively, and thus our understanding in this setting is complete. There has been a long stream of research on approximation algorithms k-median and k-means, leading to the current best approximation ratio of 2.675 [3] for k-median, 9 [1] for k-means, and 6.357 for Euclidean k-means [1]. The first O(1)-approximation algorithm for (k, z)-median is given by Chen, [7]. Recently, Krishnaswamy et al. [12] developed a general framework that gives O(1)-approximations for both (k, z)-median and (k, z)-means. Much of the recent work has focused on solving k-center/median/means and (k, z)center/median/means problems in the distributed setting [9, 2, 11, 13, 11, 13, 8, 6, 10, 5]. Many distributed O(1) approximation algorithms with small communication complexity are known for these problems. However, for (k, z)-center/median/means problems, most known algorithms have communication complexity linearly depending on z, the number of outliers. Guha et al. [10] overcame the dependence issue, by giving (O(1), 2 + ϵ)-bicriteria approximation algorithms for all the three objectives. The communication costs of their algorithms are ˜O(m/ϵ + mk), where ˜O hides a logarithmic factor. 1.3 Our Contributions Our main contributions are in designing (O(1), 1 + ϵ)-bicriteria approximation algorithms for the (k, z)-center/median/means problems. The algorithm for (k, z)-center works for general metrics: Theorem 1.1. There is a 4-round, distributed algorithm for the (k, z)-center problem, that achieves a (24(1 + ϵ), 1 + ϵ)-bicriteria approximation and O  km ϵ · log ∆ ϵ  communication cost, where ∆is the aspect ratio of the metric. We give a high-level picture of the algorithm. By guessing, we assume that we know the optimum cost L∗(since we do not know, we need to lose the log ∆ ϵ -factor in the communication complexity). In the first round of the algorithm, each machine i will call a procedure called aggregating, on its set Pi. This procedure performs two operations. First, it discards some points from Pi; second, it moves each of the survived points by a distance of at most O(1)L∗. After the two operations, the points will be aggregated at a few locations. Thus, machine i can send a compact representation of these points to the coordinator: a list of (p, w′ p) pairs, where p is a location and w′ p is the number of points aggregated at p. The coordinator will collect all the data points from all the machines, and run the algorithm of [4] for (k, z′)-center instance on the collected points, for some suitable z′. 3 To analyze the algorithm, we show that the set P ′ of points collected by the coordinator wellapproximates the original set P. The main lemma is that the total number of non-outliers removed by the aggregation procedure on all machines is at most ϵz. This incurs the additive factor of ϵz in the number of outliers. We prove this by showing that inside any ball of radius L∗, and for every machine i ∈[m], we removed at most ϵz km points in Pi. Since the non-outliers are contained in the union of k balls of radius L∗, and there are m machines, the total number of removed non-outliers is at most ϵz. For each remaining point, we shift it by a distance of O(1)L∗, leading to an O(1)-loss in the approximation ratio of our algorithm. We perform experiments comparing our main algorithm stated in Theorem 1.1 with many previous ones on real-world datasets. The results show that it matches the state-of-art method in both solution quality (objective value) and communication cost. We remark that the qualities of solutions are measured w.r.t removing only z outliers. Theoretically, we need (1 + ϵ)z outliers in order to achieve an O(1)-approximation ratio and our constant 24 is big. In spite of this, empirical evaluations suggest that the algorithm on real-word datasets performs much better than what can be proved theoretically in the worst case. For (k, z)-median/means problems, our algorithm works for the Euclidean metric case and has communication cost depending on the dimension D of the Euclidean space. One can w.l.o.g. assume D = O(log n/ϵ2) by using the dimension reduction technique. Our algorithm is given in the following theorem: Theorem 1.2. There is a 2-round, distributed algorithm for the (k, z)-median/means problems in D-dimensional Euclidean space, that achieves a (1 + ϵ, 1 + ϵ)-bicriteria approximation ratio with probability 1 −δ. The algorithm has communication cost O  ΦD · log(n∆/ϵ) ϵ  , where ∆ is the aspect ratio of the input points, Φ = O 1 ϵ2 (kD + log 1 δ ) + mk  for (k, z)-median, and Φ = O 1 ϵ4 (kD + log 1 δ ) + mk log mk δ  for (k, z)-means. We now give an overview of our algorithm for (k, z)-median/means. First, it is not hard to reformulate the objective of the (k, z)-median problem as minimizing supL≥0 P p∈P dL(p, C) −zL  , where dL is obtained from d by truncating all distances at L. By discretization, we can construct a set L of O  log(∆n/ϵ) ϵ  interesting values that the L under the superior operator can take. Thus, our goal becomes to find a set C, that is simultaneously good for every k-median instance defined by dL, L ∈L. Since now we are handling k-median instances (without outliers), we can use the communication-efficient algorithm of [2] to construct an ϵ-coreset QL with weights wL for every L ∈L. Roughly speaking, the coreset QL is similar to the set P for the task of solving the k-median problem under metric dL. The size of each ϵ-coreset QL is at most Φ, implying the communication cost stated in the theorem. After collecting all the coresets, the coordinator can approximately solve the optimization problem on them. This will lead to an (1 + O(ϵ), 1 + O(ϵ))-bicriteria approximate solution. The running time of the algorithm, however, is exponential in the total size of the coresets. The argument can be easily adapted to the (k, z)-means setting. Organization In Section 2, we prove Theorem 1.1, by giving the (24(1 + ϵ), 1 + ϵ)-approximation algorithm. The empirical evaluations of our algorithm for (k, z)-center and the proof of Theorem 1.2 are provided in the supplementary material. Notations Throughout the paper, point sets are multi-sets, where each element has its own identity. By a copy of some point p, we mean a point with the same description as p but a different identity. For a set Q of points, a point p, and a radius r ≥0, we define ballQ(p, r) = {q ∈Q : d(p, q) ≤r} to be the set of points in Q that have distances at most r to p. For a weight vector w ∈ZQ ≥0 on some set Q of points, and a set S ⊆Q, we use w(S) = P p∈S wp to denote the total weight of points in S. Throughout the paper, P is always the set of input points. We shall use dmin = minp,q∈P :d(p,q)>0 d(p, q) and dmax = maxp,q∈P d(p, q) to denote the minimum and maximum non-zero pairwise distance between points in P. Let ∆= dmax dmin denote the aspect ratio of the metric. 4 2 Distributed (k, z)-Center Algorithm with (1 + ϵ)z Outliers In this section, we prove Theorem 1.1, by giving the (24(1 + ϵ), 1 + ϵ)-approximation algorithm for (k, z)-center, with communication cost O  km ϵ · log ∆ ϵ  . Let L∗be the cost of the optimum (k, z)center solution (which is not given to us). We assume we are given a parameter L ≥0 and our goal is to design a main algorithm with communication cost O km ϵ  , that either returns a (k, (1+ϵ)z)-center solution of cost at most 24L, or certifies that L∗> L. Notice that L∗∈{0}∪[dmin/2, dmax]. We can obtain our (24(1 + ϵ), 1 + ϵ)-approximation by running the main algorithm for O  log ∆ ϵ  different values of L in parallel, and among all generated solutions, returning the one correspondent to the smallest L. A naive implementation requires all the parties to know dmin and dmax in advance; we show in the supplementary material that the requirement can be removed. In intermediate steps, we may deal with (k, z)-center instances where points have integer weights. In this case, the instance is defined as (Q, w), where Q is a set of points, w ∈ZQ >0, and z is an integer between 0 and w(Q) = P q∈Q wq. The instance is equivalent to the instance ˆQ, the multi-set where we have wq copies of each q ∈Q. [4] gave a 3-approximation algorithm for the (k, z)-center problem. However, our setting is slightly more general so we can not apply the result directly. We are given a weighted set Q of points that defines the (k, z)-center instance. The optimum set C∗of centers, however, can be from the superset P ⊇Q which is hidden to us. Thus, our algorithm needs output a set C of k centers from Q and compare it against the optimum set C∗of centers from P. Notice that by losing a factor of 2, we can assume centers are in Q; this will lead to a 6-approximation. Indeed, by applying the framework of [4] more carefully, we can obtain a 4-approximation for this general setting. We state the result in the following theorem: Theorem 2.1 ([4]). Let d be a metric over the set P of points, Q ⊆P and w ∈ZQ >0. There is an algorithm kzc (Algorithm 1) that takes inputs k, z′ ≥1, (Q, w′) with |Q| = n′, the metric d restricted to Q, and a real number L′ ≥0. In time O(n′2), the algorithm either outputs a (k, z′)-center solution C′ ⊆Q to the instance (Q, w′) of cost at most 4L′, or certifies that there is no (k, z′)-center solution C∗⊆P of cost at most L′ and outputs “No”. The main algorithm is dist-kzc (Algorithm 3), which calls an important procedure called aggregating (Algorithm 2). We describe aggregating and dist-kzc in Section 2.1 and 2.2 respectively. 2.1 Aggregating Points The procedure aggregating, as described in Algorithm 2, takes as input the set Q ⊆P of points to be aggregated (which will be some Pi when we actually call the procedure), the guessed optimum cost L, and y ≥0, which controls how many points can be removed from Q. It returns a set Q′ of points obtained from aggregation, along with their weights w′. Algorithm 1 kzc(k, z′, (Q, w′), L′) 1: U ←Q, C′ ←∅; 2: for i ←1 to k do 3: pi ←p ∈Q with largest w′(ballU(p, 2L′)) 4: C′ ←C′ ∪{pi} 5: U ←U \ ballU(pi, 4L′) 6: if w′(U) > z′ then return “No” else return C′ Algorithm 2 aggregating(Q, L, y) 1: U ←Q, Q′ ←∅; 2: while ∃p ∈Q with |ballU(p, 2L)| > y do 3: Q′ ←Q′ ∪{p}, w′ p ←|ballU(p, 4L)| 4: U ←U \ ballU(p, 4L) 5: return (Q′, w′) In aggregating, we start from U = Q and Q′ = ∅and keep removing points from U. In each iteration, we check if there is a p ∈Q with |ballU(p, 2L)| ≥y. If yes, we add p to Q′, remove ballU(p, 4L) from U and let wp be the number of points removed. We repeat thie procedure until such a p can not be found. We remark that the procedure is very similar to the algorithm kzc (Algorithm 1) in [4]. We start from some simple observations about the algorithm. Claim 2.2. We define V = S p∈Q′ ballQ(p, 4L) to be the set of points in Q with distance at most 4L to some point in Q′ at the end of Algorithm 2. Then, the following statements hold at the end of the algorithm: 5 p 2L 3L points in C∗ points in U L p (a) (b) 4L Figure 1: Two cases in proof of Lemma 2.3. In Figure (a), the balls {ballU(c, L) : c ∈C∗, d(p, c) ≤3L} (red circles) are all empty. So, ballU(p, 2L) ⊆O. In Figure (b), there is a non-empty ballU(c, L) for some c ∈C∗with d(p, c) ≤3L (the red circle). The ball is contained in ballU(p, 4L). ≤ϵz km balls for C∗ points in Vi points in Ui points in P ′ i Figure 2: Illustration for proof of Lemma 2.7. fi : Vi →P ′ i is indicated by the dashed lines, each of whom is of length at most 4L. The number of crosses in a circle is at most ϵz km. 1. U = Q \ V . 2. ballU(p, 2L) ≤y for every p ∈Q. 3. There is a function f : V →Q′ such that d(p, f(p)) ≤4L, ∀p ∈V , and w′(q) = |f −1(q)|, ∀q ∈ Q′. Proof. U is exactly the set of points in Q with distance more than 4L to any point in Q′ and thus U = Q \ V . Property 2 follows from the termination condition of the algorithm. Property 3 holds by the way we add points to Q′ and remove points from U. If in some iteration we added q to Q′, we can define f(p) = q for every point p ∈ballU(p, 4L), i.e, every point removed from U in the iteration. We think of U as the set of points we discard from Q and V as the set of survived points. We then move each p ∈V to f(p) ∈Q′ and thus V will be aggregated at the set Q′ of locations. The following crucial lemma upper bounds |Q′|: Lemma 2.3. Let ˆz ≥0 and assume there is a (k, ˆz)-center solution C∗⊆P to the instance Q with cost at most L. Then, at the end of Algorithm 2 we have |Q′| ≤k + ˆz y. Proof. Let O = Q\S c∈C∗ballQ(c, L) be the set of outliers according to solution C∗. Thus |O| ≤ˆz. Focus on the moment before we run Step 3 in some iteration of aggregating. See Figure 1 for the two cases we are going to consider. In case (a), every center c ∈ballC∗(p, 3L) has ballU(c, L) = ∅. In this case, every point q ∈ballU(p, 2L) has d(q, C∗) > L: if d(p, c) > 3L for some c ∈C∗, then d(q, c) ≥d(p, c)−d(p, q) > 3L−2L = L by triangle inequality; for some c ∈C∗with d(p, c) ≤3L, we have ballU(c, L) = ∅, implying that d(q, c) > L as q ∈U. Thus, ballU(p, 2L) ⊆O. So, Step 3 in this iteration will decrease |O ∩U| by at least |ballU(p, 4L)| ≥|ballU(p, 2L)| > y. Consider the case (b) where some c ∈ballC∗(p, 3L) has ballU(c, L) ̸= ∅. Then ballU(p, 4L) ⊇ ballU(c, L) will be removed from U by Step 3 in this iteration. Thus, 1. if case (a) happens, then |U ∩O| is decreased by more than y in this iteration; 2. otherwise case (b) happens; then for some c ∈C∗, ballU(c, L) changes from non-empty to ∅. The first event can happen for at most |O|/y ≤ˆz/y iterations and the second event can happen for at most |C∗| ≤k iterations. So, |Q′| ≤k + ˆz/y. 6 2.2 The Main Algorithm We are now ready to describe the main algorithm for the (k, z)-center problem, given in Algorithm 3. In the first round, each machine will call aggregating(Pi, L, ϵz km) to obtain (P ′ i, w′ i). All the machines will first send their corresponding |P ′ i| to the coordinator. In Round 2 the algorithm will check if P i∈[m] |P ′ i| is small or not. If yes, send a “Yes” message to all machines; otherwise return “No” and terminate the algorithm. In Round 3, if a machine i received a “Yes” message from the coordinator, then it sends the dataset P ′ i with the weight vector w′ i to the coordinator. Finally in Round 4, the coordinator collects all the weighted points P ′ = S i∈[m] P ′ i and run kzc on these points. Algorithm 3 dist-kzc input on all parties: n, k, z, m, L, ϵ input on machine i: dataset Pi with |Pi| = ni output: a set C′ ⊆P or “No” (which certifies L∗> L) Round 1 on machine i ∈[m] 1: (P ′ i, w′ i) ←aggregating(Pi, L, ϵz km) 2: send |P ′ i| to the coordinator Round 2 on the coordinator 1: if P i∈[m] |P ′ i| > km(1 + 1/ϵ) then return “No” else send “Yes” to each machine i ∈[m] Round 3 on machine i ∈[m] 1: Upon receiving of a “Yes” message from the coordinator, respond by sending (P ′ i, w′ i) Round 4 on the coordinator 1: let P ′ ←Sm i=1 P ′ i 2: let w′ be the function from P ′ to Z>0 obtained by merging w′ 1, w′ 2, · · · , w′ m 3: let z′ ←(1 + ϵ)z + w′(P ′) −n 4: if z′ < 0 then return “No” else return kzc(k, z′, (P ′, w′), L′ = 5L) An immediate observation about the algorithm is that its communication cost is small: Claim 2.4. The communication cost of dist-kzc is O( km ϵ ). Proof. The total communication cost of Round 1 and Round 2 is O(m). We run Round 3 only when the coordinator sent the “Yes” message, in which case the communication cost is at most Pm i=1 |P ′ i| ≤km(1 + 1/ϵ) = O( km ϵ ). It is convenient to define some notations before we make further analysis. For every machine i ∈[m], let P ′ i be the P ′ i constructed in Round 1 on machine i. Let Vi = S p∈P ′ i ballPi(p, 4L) be the set of points in Pi that are within distance at most 4L to some point in P ′ i. Notice that this is the definition of V in Claim 2.2 for the execution of aggregating on machine i. Let Ui = Pi \ Vi; this is the set U at the end of this execution. Let fi be the mapping from Vi to P ′ i satisfying Property 3 of Claim 2.2. Let V = S i∈[m] Vi, P ′ = S i∈[m] P ′ i and f be the function from V to P ′, obtained by merging f1, f2, · · · , fm. Thus (p, f(p)) ≤4L, ∀p ∈V and w′(q) = |f −1(q)|, ∀q ∈P ′. Claim 2.5. If dist-kzc returns a set C′, then C′ is a (k, (1 + ϵ)z)-center solution to the instance P with cost at most 24L. Proof. C′ must be returned in Step 4 in Round 4. By Theorem 2.1 for kzc, C′ is a (k, z′)-center solution to (P ′, w′) of cost at most 4 · 5L = 20L. That is, w′ P ′ \ S c∈C′ ballP ′(c, 20L)  ≤z′. This implies w′ S c∈C′ ballP ′(c, 20L)  ≥w′(P ′) −z′ = n −(1 + ϵ)z. Notice that for each q ∈P ′, the set f −1(q) ⊆V ⊆P of points are within distance 4L from q and w′(q) = |f −1(q)|. So, S c∈C′ ballP (c, 24L) ≥n −(1 + ϵ)z, which is exactly P \ S c∈C′ ballP (c, 24L) ≤(1 + ϵ)z. We can now assume L ≥L∗and we need to prove that we must reach Step 4 in Round 4 and return a set C′. We define C∗⊆P to be a set of size k such that |P \ S c∈C∗ball(c, L)| ≤z. Let I = S c∈C∗ballP (c, L) be the set of “inliers” according to C∗and O = P \ I be the set of outliers. Thus, |I| ≥n −z and |O| ≤z. Lemma 2.6. After Round 1, we have P i∈[m] |P ′ i| ≤km(1 + 1/ϵ). 7 Proof. Let zi = |Pi ∩O| = Pi \ S c∈C∗ballPi(c, L) be the set of outliers in Pi. Then, C∗is a (k, zi)-center solution to the instance Pi with cost at most L. By Lemma 2.3, we have that |P ′ i| ≤k + zi ϵz/(km). So, we have P i∈[m] |P ′ i| ≤km + km ϵz P i∈[m] zi ≤km 1 + 1 ϵ  . Therefore, the coordinator will not return “No” in Round 2. It remains to prove the following Lemma. Lemma 2.7. Algorithm 3 will reach Step 4 in Round 4 and return a set C′. Proof. See Figure 2 for the illustration of the proof. By Property 2 of Claim 2.2, we have |ballUi(p, 2L)| ≤ ϵz km for every p ∈Ui since Ui ⊆Pi. This implies that for every c ∈C∗, we have |ballUi(c, L)| ≤ ϵz km. (Otherwise, taking an arbitrary p in the ball leads to a contradiction.) |Ui ∩I| = [ c∈C∗ ballUi(c, L) ≤ X c∈C∗ |ballUi(c, L)| ≤ X c∈C∗ ϵz km ≤ϵz m, ∀i ∈[m]. X i∈[m] |I ∩Vi| = X i∈[m] |I ∩Pi| −|I ∩Ui|  ≥ X i∈[m]  |I ∩Pi| −ϵz m  = |I| −ϵz ≥n −(1 + ϵ)z. For every p ∈V ∩I, f(p) will have distance at most L + 4L = 5L to some center in C∗. Also, notice that w′(q) = |f −1(q)| for every q ∈P ′, we have that w′ S c∈C∗ballP ′(c, 5L)  ≥|V ∩I| ≥n −(1 + ϵ)z. So, w′(P ′ \ S c∈C∗ballP ′(c, 5L)) ≤w(P ′) −n + (1 + ϵ)z = z′. This implies that z′ ≥0, and there is a (k, z′)-center solution C∗⊆P to the instance (P ′, w′) of cost at most 5L. Thus dist-kzc will reach Step 4 in Round 4 and returns a set C′. This finishes the proof of the Lemma. We now briefly analyze the running times of algorithms on all parties. The running time of computing P ′ i on each machine i in round 1 is O(n2 i ) and this is the bottleneck for machine i. Considering all possible values of L, the running time on machine i is O  n2 i · log ∆ ϵ  . The running time of the round-4 algorithm of the central coordinator for one L will be O  km ϵ 2 . We sort all the interesting L values in increasing order. The central coordinator can use binary search to find some L′ such that the main algorithm outputs a set C′ for L = L′ but outputs “No” for L being the value before L′ in the ordering. So, the running time of the central coordinator can be made O  km ϵ 2 · log log ∆ ϵ  . The quadratic dependence of running time of machine i on ni might be an issue when ni is big; we discuss how to alleviate the issue in the supplementary material. 3 Conclusion In this paper, we give a distributed (24(1 + ϵ), 1 + ϵ)-bicriteria approximation for the (k, z)-center problem, with communication cost O  km ϵ · log ∆ ϵ  . The running times of the algorithms for all parties are polynomial. We evaluate the algorithm on realworld data sets and it outperforms most previous algorithms, matching the performance of the state-of-art method[10]. For the (k, z)-median/means problem, we give a distributed (1 + ϵ, 1 + ϵ)-bicriteria approximation algorithm with communication cost O  ΦD · log ∆ ϵ  , where Φ is the upper bound on the size of the coreset constructed using the algorithm of [2]. The central coordinator needs to solve the optimization problem of finding a solution that is simultaneously good for O  log(∆n/ϵ) ϵ  k-median/means instances. Since the approximation ratio for this problem will go to both factors in the bicriteria ratio, we really need a (1 + ϵ)-approximation for the optimization problem. Unfortunately, solving k-median/means alone is already APX-hard, and we don’t know a heuristic algorithm that works well in practice (e.g, a counterpart to Lloyd’s algorithm for k-means). It is interesting to study if a different approach can lead to a polynomial time distributed algorithm with O(1)-approximation guarantee. 8 Acknowledgments This research was supported by NSF grants CCF-1566356 and CCF-1717134. References [1] Sara Ahmadian, Ashkan Norouzi-Fard, Ola Svensson, and Justin Ward. Better guarantees for k-means and euclidean k-median by primal-dual algorithms. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 61–72, 2017. [2] Maria-Florina Balcan, Steven Ehrlich, and Yingyu Liang. Distributed k-means and k-median clustering on general communication topologies. In Advances in Neural Information Processing Systems 26, NIPS 2013, December 5-8, 2013, Lake Tahoe, Nevada, United States., pages 1995–2003, 2013. [3] Jaroslaw Byrka, Thomas Pensyl, Bartosz Rybicki, Aravind Srinivasan, and Khoa Trinh. An improved approximation for k-median and positive correlation in budgeted optimization. ACM Trans. Algorithms, 13(2):23:1–23:31, 2017. [4] Moses Charikar, Samir Khuller, David M. Mount, and Giri Narasimhan. Algorithms for facility location problems with outliers. In Proceedings of the 12th Annual Symposium on Discrete Algorithms, January 7-9, 2001, Washington, DC, USA., pages 642–651, 2001. [5] Jiecao Chen, Erfan Sadeqi Azer, and Qin Zhang. A practical algorithm for distributed clustering and outlier detection. CoRR, abs/1805.09495, 2018. [6] Jiecao Chen, He Sun, David P. Woodruff, and Qin Zhang. Communication-optimal distributed clustering. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 3720–3728, 2016. [7] Ke Chen. A constant factor approximation algorithm for k-median clustering with outliers. In Proceedings of the 19th Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2008, San Francisco, California, USA, January 20-22, 2008, pages 826–835, 2008. [8] Hu Ding, Yu Liu, Lingxiao Huang, and Jian Li. k-means clustering with distributed dimensions. In Proceedings of the 33rd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 1339–1348, 2016. [9] Alina Ene, Sungjin Im, and Benjamin Moseley. Fast clustering using mapreduce. In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Diego, CA, USA, August 21-24, 2011, pages 681–689, 2011. [10] Sudipto Guha, Yi Li, and Qin Zhang. Distributed partial clustering. In Proceedings of the 29th ACM Symposium on Parallelism in Algorithms and Architectures, SPAA 2017, Washington DC, USA, July 24-26, 2017, pages 143–152, 2017. [11] Sungjin Im and Benjamin Moseley. Brief announcement: Fast and better distributed mapreduce algorithms for k-center clustering. In Proceedings of the 27th ACM on Symposium on Parallelism in Algorithms and Architectures, SPAA 2015, Portland, OR, USA, June 13-15, 2015, pages 65–67, 2015. [12] Ravishankar Krishnaswamy, Shi Li, and Sai Sandeep. Constant approximation for k-median and k-means with outliers via iterative rounding. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29, 2018, pages 646–659, 2018. [13] Gustavo Malkomes, Matt J. Kusner, Wenlin Chen, Kilian Q. Weinberger, and Benjamin Moseley. Fast distributed k-center clustering with outliers on massive data. In Advances in Neural Information Processing Systems 28, NIPS 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 1063–1071, 2015. 9
2018
211
7,377
Interpreting Neural Network Judgments via Minimal, Stable, and Symbolic Corrections Xin Zhang CSAIL, MIT xzhang@csail.mit.edu Armando Solar-Lezama CSAIL, MIT asolar@csail.mit.edu Rishabh Singh Google Brain rising@google.com Abstract We present a new algorithm to generate minimal, stable, and symbolic corrections to an input that will cause a neural network with ReLU activations to change its output. We argue that such a correction is a useful way to provide feedback to a user when the network’s output is different from a desired output. Our algorithm generates such a correction by solving a series of linear constraint satisfaction problems. The technique is evaluated on three neural network models: one predicting whether an applicant will pay a mortgage, one predicting whether a first-order theorem can be proved efficiently by a solver using certain heuristics, and the final one judging whether a drawing is an accurate rendition of a canonical drawing of a cat. 1 Introduction When machine learning is used to make decisions about people in the real world, it is extremely important to be able to explain the rationale behind those decisions. Unfortunately, for systems based on deep learning, it is often not even clear what an explanation means; showing someone the sequence of operations that computed a decision provides little actionable insight. There have been some recent advances towards making deep neural networks more interpretable (e.g. [21]) using two main approaches: i) generating input prototypes that are representative of abstract concepts corresponding to different classes [23] and ii) explaining network decisions by computing relevance scores to different input features [1]. However, these explanations do not provide direct actionable insights regarding how to cause the prediction to move from an undesirable class to a desirable class. In this paper, we argue that for the specific class of judgment problems, minimal, stable, and symbolic corrections are an ideal way of explaining a neural network decision. We use the term judgment to refer to a particular kind of binary decision problem where a user presents some information to an algorithm that is supposed to pass judgment on its input. The distinguishing feature of judgments relative to other kinds of decision problems is that they are asymmetric; if I apply for a loan and I get the loan, I am satisfied, and do not particularly care for an explanation; even the bank may not care as long as on aggregate the algorithm makes the bank money. On the other hand, I very much care if the algorithm denies my mortgage application. The same is true for a variety of problems, from college admissions, to parole, to hiring decisions. In each of these cases, the user expects a positive judgment, and would like an actionable explanation to accompany a negative judgment. We argue that a correction is a useful form of feedback; what could I have done differently to elicit a positive judgment? For example, if I applied for a mortgage, knowing that I would have gotten a positive judgment if my debt to income ratio (DTI) was 10% lower is extremely useful; it is actionable information that I can use to adjust my finances. We argue, however, that the most useful corrections are those that are minimal, stable and symbolic. First, in order for a correction to be actionable, the corrected input should be as similar as possible from the original offending input. For example, knowing that a lower DTI would have given me the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. 0.08 0.10 Interest Rate 0.24 0.26 0.28 0.30 0.32 Debt-to-Income (a) Mortgage Underwriting 0.5 1.0 % Clauses That Are Unit 0 2 4 6 8 Avg. Clause Length (b) Solver Performance Prediction (c) Drawing Tutoring Figure 1: Symbolic explanations generated by our approach for neural networks in different domains. loan is useful, but knowing that a 65 year old billionaire from Nebraska would have gotten the loan is not useful. Minimality must be defined in terms of an error model which specifies which inputs are subject to change and how. For a bank loan, for example, debt, income and loan amount are subject to change within certain bounds, but I will not move to another state just to satisfy the bank. Second, the suggested correction should be stable, meaning that there should be a neighborhood of points surrounding the suggested correction for which the outcome is also positive. For example, if the algorithm tells me that a 10% lower DTI would have gotten me the mortgage, and then six months later I come back with a DTI that is 11% lower, I expect to get the mortgage, and will be extremely disappointed if the bank says, “oh, sorry, we said 10% lower, not 11% lower”. So even though for the neural network it may be perfectly reasonable to give positive judgments to isolated points surrounded by points that get negative judgments, corrections that lead to such isolated points will not be useful. Finally, even if the correction is minimal and robust, it is even better if rather than a single point, the algorithm can produce a symbolic correction that provides some insight about the relationship between different variables. For example, knowing that for someone like me the bank expects a DTI of between 20% and 30% is more useful than just knowing a single value. And knowing something about how that range would change as a function of my credit score would be even more useful still. In this paper, we present the first algorithm capable of computing minimal stable symbolic corrections. Given a neural network with ReLU activations and an input with a negative judgment, our algorithm produces a symbolic description of a space of corrections such that any correction in that space is guaranteed to change the judgment. In the limit, the algorithm will find the closest region with a volume above a given threshold. Internally, our algorithm reduces the problem into a series of linear constraint satisfaction problems, which are solved using the Gurobi linear programming (LP) solver [9]. We show that in practice, the algorithm is able to find good symbolic corrections in 12 minutes on average for small but realistic networks. While the running time is dominated by solver invocations, only under 2% of it is spent is spent on actual solving and the majority of the time is spent on creating these LP instances. We evaluate our approach on three neural networks: one predicting whether an applicant will pay a mortgage, one predicting whether a first-order theorem can be proved efficiently by a solver using certain heuristics, and the other judging whether a drawing is an accurate rendition of a canonical drawing of a cat. Explanation showcases. Figure 1 shows example explanations generated by our approach on the aforementioned networks. Figure 1(a) suggests a mortgage applicant to change DTI and interest rate in order to get their application accepted. While the red cross represents the original application, the blue triangle represents the symbolic correction (i.e. the region of points that all lead to a positive outcome). Since the user may only be able to change DTI and interest rates often vary between applications, it is essential to provide a symbolic correction rather than a concrete correction to make the feedback actionable. Figure 1(b) suggests a user to reformulate a first-order theorem when the network predicts it as challenging to solve. Intuitively, either reducing the problem size (by decreasing average clauses lengths) or providing a partial solution (by adding unit clauses) would reduce the problem complexity. Finally, Figure 1(c) shows how to add lines to a drawing so that it gets recognized by the network as a canonical cat drawing. The red lines represent the original input, while the blue boxes represent the symbolic correction and the cyan lines represent one concrete correction in it. Briefly, any concrete correction whose vertices fall into the blue boxes would make the drawing pass the network’s judgment. Comparing to the previous two corrections which only involves 2 features, this correction involves 8 features (coordinates of each vertex) and can go upto 20 features. This highlights our approach’s ability to generate relatively complex corrections. 2 2 Background and Problem Definition We first introduce some notations we will use in explaining our approach. Suppose F is a neural network with ReLU activation. In the model we consider, the input to F is a (column) vector v0 1 of size s0. The network computes the output of each ReLU (hidden or output) layer as vi+1 = fi(vi) = ReLU(W ivi + bi) Where W i is an si+1 × si matrix, bi is a vector of size si+1, and ReLU applies the rectifier function elementwise to the output of the linear operations. We focus on classification problems, where the classification of input v is obtained by lF (v) ∈argmaxiF(v)[i]. We are specifically focused on binary classification problems (that is, lF (v) ∈{0, 1}). The judgment problem is a special binary classification problem where one label is preferable than the other. We assume 1 is preferable throughout the paper. The judgment interpretation problem concerns providing feedback in the form of corrections when lF (v) = 0. A correction δ is a real vector of input vector length such that lF (v + δ) = 1. As mentioned previously, a desirable feedback should be a minimal, stable, and symbolic correction. We first introduce what it means for a concrete correction δ to be minimal and stable. Minimality is defined in terms of a norm ∥δ∥on δ that measures the distance between the corrected input and the original input. For simplicity, we use L1 norm to measure the sizes of all vectors throughout Section 2 and Section 3. We say δ is e-stable if for any δ′ such that if ∥δ −δ′∥≤e, we have lF (v + δ′) = 1. A symbolic correction ∆is a connected set of concrete corrections. More concretely, we will use a set of linear constraints to represent a symbolic correction. We say a symbolic correction is e-stable if there exists a correction δ ∈∆such that for any δ′ where ∥δ′ −δ∥≤e, we have δ′ ∈∆. We call such a correction a stable region center inside ∆. To define minimality, we define the distance of ∆from the original input using the distance of a stable region center that has the smallest distance among all stable region centers. More formally: dise(∆) := minδ∈S∥δ∥, where S := {δ ∈∆| ∀δ′.∥δ′ −δ∥≤e =⇒δ′ ∈∆}. When ∆is not e-stable, S will be empty, so we define dise(∆) := ∞. We can now define the judgment interpretation problem. Definition 1. (Judgment Interpretation) Given a neural network F, an input vector v such that lF (v) = 0, and a real value e, a judgment interpretation is an e-stable symbolic correction ∆with the minimum distance among all e-stable symbolic corrections. 3 Our Approach Algorithm 1 outlines our approach to find a judgment interpretation for a given neural network F and an input vector v. Besides these two inputs, it is parameterized by a real e and an integer n. The former specifies the radius parameter in our stability definition, while the latter specifies how many features are allowed to vary to produce the judgment interpretation. We parameterize the number of features to change as high-dimension interpretations can be hard for end users to understand. For instance, it is very easy for a user to understand if the explanation says their mortgage would be approved as long as they change the DTI and the credit score while keeping the other features as they were. On the other hand, it is much harder to understand an an interpretation that involves all features (in our experiment, there are 21 features for the mortgage underwriting domain). The output is a judgment interpretation that is expressed in a system of linear constraints, which are in the form of Ax + b ≥0, where x is a vector of variables, A is a matrix, and b is a vector. Algorithm 1 finds such an interpretation by iteratively invoking findProjectedInterpretation (Algorithm 2) to find an interpretation that varies a list of n features s. It returns the one with the least 1Unless specified, all vectors in the paper are by columns. 3 Algorithm 1 Finding a judgment interpretation. INPUT A neural network F and an input vector v such that lF (v) = 0. OUTPUT A judgment interpretation ∆. 1: PARAM A real value e and an integer number n. 2: Sn := {s | s is a subarray of [1, ..., |v|] with length n} 3: ∆:= None, d := +∞ 4: for s ∈Sn do 5: ∆s := findProjectedInterpretation(F, v, s, e) 6: if dise(∆s) < d then 7: ∆:= ∆s, d := dise(∆s) 8: return ∆ Algorithm 2 findProjectedInterpretation INPUT A neural network F, an input vector v, an integer vector s, and a real number e. OUTPUT A symbolic correction ∆s that only changes features indexed by s. 1: PARAM An integer m, the maximum number of verified linear regions to consider. 2: regions := ∅, workList := [] 3: δ0 := findMinimumConcreteCorrection(F, v, s) 4: a0 := getActivations(F, δ0 + v) 5: L0 := getRegionFromActivations(F, a0, v, s) 6: regions := regions ∪{L0} 7: workList := append(workList, a0) 8: while len(workList)! = 0 do 9: a := popHead(workList) 10: for p ∈[1, len(a)] do 11: if checkRegionBoundary(F, a, p, v, s) then 12: a′ := copy(a) 13: a′[p] := ¬a′[p] 14: L′ := getRegionFromActivations(F, a′, v, s) 15: if L′ /∈regions then 16: regions := regions ∪{L′} 17: if len(regions) = m then 18: workList := [] 19: break 20: workList := append(workList, a′) 21: return inferConvexCorrection(regions) distance. Recall that the distance is defined as dise(∆) = minδ∈S∥δ∥, which can be evaluated by solving a sequence of linear programming problems when L1 norm is used. We next discuss findProjectedInterpretation which is the heart of our approach. 3.1 Finding a Judgment Interpretation along given features In order to find a judgment interpretation, we need to find a set of linear constraints that are minimal, stable, and verified (that is, all corrections satisfying it will make the input classified as 1). None of these properties are trivial to satisfy given the complexity of any real-world neural network. We first discuss how we address these challenges at a high level, then dive into the details of the algorithm. To address minimality, we first find a single concrete correction that is minimum by leveraging an existing adversarial example generation technique [7] and then generate a symbolic correction by expanding upon it. To generate a stable and verified correction, we exploit the fact that ReLU-based neural networks are piece-wise linear functions. Briefly, all the inputs that activate the same set of neurons can be characterized by a set of linear constraints. We can further characterize the subset of inputs that are classified as 1 by adding an additional linear constraint. Therefore, we can use a set of linear constraints to represent a set of verified concrete corrections under certain activations. We call this set of corrections a verified linear region (or region for short). We first identify the region that the initial concrete correction belongs to, then grow the set of regions by identifying regions that are connected to existing regions. Finally, we infer a set of linear constraints whose concrete corrections are a subset of ones enclosed by the set of discovered regions. Algorithm 2 details our approach, which we describe below. Generating the initial region. We first find a minimum concrete correction δ0 by leveraging a modified version of the fast signed gradient method [7] that minimizes the L1 distance (on line 3). More concretely, starting with a vector of 0s, we calculate δ0 by iteratively adding a modified gradient that takes the sign of the most significant dimension among the selected features until lF (v + δ0) = 1. For example, if the original gradient is [0.5, 1.0, 6.0, −6.0], the modified gradient would be [0, 0, 1.0, 0] or [0, 0, 0, −1.0]. Then we obtain the ReLU activations a0 for v + δ0 (by invoking getActivations on line 4), which is a Boolean vector where each Boolean value represents 4 whether a given neuron is activated. Finally, we obtain the initial region that δ0 falls into by invoking getRegionFromActivations (on line 5), which is defined below: getRegionFromActivations(F, a, v, s) := activationConstraints(F, a, v) ∧classConstraints(F, a, v) ∧featureConstraints(s), where activationConstraints(F, a, v) := V j∈[1,k] V m∈[1,|fj|]{Ga r (x + v) ≥0 if a[r] = true} ∧V j∈[1,k] V m∈[1,|fj|]{Ga r (x + v) < 0 if a[r] = false}, where Ga r (x + v) := wr · f a m−1(...f a 1 (f a 0 (x + v))) + br, r := P i∈[1,j−1] |fi| + m classConstraints(F, a, v) := F a(x + v)[1] > F a(x + v)[0], featureConstraints(s) := V j /∈s x[j] = 0. In the definition above, we use the notation f a i to refer to layer i with its activations “fixed” to a. More formally, f a i (vi) = W a i vi + ba i where W a i and ba i have zeros in all the rows where the activation indicated that rectifier in the original layer had produced a zero. We use k to represent the number of ReLU layers and |fj| to represent the number of neurons in the jth layer. Integer r indexes the mth neuron in jth layer. Vector wr and real number br are the weights and the bias of neuron r respectively. Intuitively, activationConstraints uses a set of linear constraints to encode the activation of each neuron. Expanding to connecting regions. After generating the initial region, Algorithm 1 tries to grow the set of concrete corrections by identifying regions that are connected to existing regions (line 6-20). How do we know whether a region is connected to another efficiently? There are 2n regions for a network with n neurons and checking whether two sets of linear constraints intersect can be expensive on high dimensions. Intuitively, two regions are likely connected if their activations only differ by one ReLU. However, this is not entirely correct given a region is not only constrained by the activations by also the desired classification. Our key insight is that, since a ReLU-based neural network is a continuous function, two regions are connected if their activations differ by one neuron, and there are concrete corrections on the face of one of the corresponding convex hulls, and this face corresponds to the differing neuron. Intuitively, on the piece-wise function represented by a neural network, the sets of concrete corrections in two adjacent linear pieces are connected if there are concrete corrections on the boundary between them. Following the intuition, we define checkRegionBoundary: checkRegionBoundary(F, a, p, v, s) := isFeasible(boundaryConstraints(F, a, v, p) ∧classConstraints(F, a, v) ∧featureConstraints(s)) where boundaryConstraints(F, a, p, v) := V j∈[1,k] V m∈[1,|fj|]{Ga r (x + v) = 0 if r = p} ∧V j∈[1,k] V m∈[1,|fj|]{Ga r (x + v) ≥0 if a[r] = true and r! = p} ∧V j∈[1,k] V m∈[1,|fj|]{Ga r (x + v) < 0 if a[r] = false and r! = p} where Ga r (x + v) := wr · f a m−1(...f a 1 (f a 0 (x + v))) + br and r := P i∈[1,j−1] |fi| + m. By leveraging checkRegionBoundary, Algorithm 2 uses a worklist algorithm to identify regions that are connected or transitively connected to the initial region until no more such regions can be found or the number of discovered regions reaches a predefined upper bound m (line 8-20). Infer the final explanation. Finally, Algorithm 2 infers a set of linear constraints whose corresponding concrete corrections are contained in the discovered regions. Moreover, to satisfy the stability constraint, we want this set to be as large as possible. Intuitively, we want to find a convex hull (represented by the returning constraints) that is contained in a polytope (represented by the regions), such that the volume of the convex hull is maximized. Further, we infer constraints that represent relatively simple shapes, such as simplexes or boxes, for two reasons. First, explanations in simpler shapes are easier for the end user to understand; secondly, it is relatively efficient to calculate the volume of a simplex or a box. The procedure inferConvexCorrection implements the above process using a greedy algorithm. In the case of simplexes, we first randomly choose a discovered region and randomly sample a simplex inside it. Then for each vertex, we move it by a very small distance in a random direction such that (1) the simplex is still contained in the set of discovered regions, and (2) the volume increases. The 5 process stops until the volume cannot be increased further. For boxes, the procedure is similar except that we move the surfaces rather than the vertices. Note that our approach is sound but not optimal or complete. In other words, whenever Algorithm 1 finds a symbolic correction, the correction is verified and stable, but it is not guaranteed to be minimal. Also, when our approach fails to find a stable symbolic correction, it does not mean that such corrections do not exist. However, in practice, we find that our approach is able to find stable corrections for most of the time and the distances of the discovered corrections are small enough to be useful (as we shall see in Section 4.2). 3.2 Extensions We finish this section by discussing several extensions to our approach. Handling categorical features. Categorical features are typically represented using one-hot encoding and directly applying Algorithm 2 on the embedding can result in a symbolic correction comprising invalid concrete corrections. To address this issue, we enumerate the embeddings representing different values of categorical features and apply Algorithm 2 to search symbolic corrections under each of them. Extending for multiple classes. Our approach can be easily extended for multiple classes as long as there is only one desirable class. Concretely, we need to: 1) guide the initial concrete correction generation (to the desirable class), which has been studied in the literature of adversarial example generation; 2) extend classConstraints so that the desired class gets a higher weight than any other class. Compared to the binary case, the classConstraints only grows linearly by the number of classes, while the majority of the constraints are the ones encoding the activations. Thus, the time should not grow significantly, as we shall see in subsection 4.2. That said, the focus of our paper is judgment problems which do binary classifications. Extending to non-ReLU activations. Our approach applies without any change as long as the activation functions are continuous and can be approximated using piece-wise linear functions. For networks whose activations are continuous but cannot be approximated using piece-wise linear functions, we can still apply our algorithm but need constraints that are more expressive than linear constraints to represent verified regions. When activations are not continuous, our approach no longer applies as our method of testing whether two regions are connected relies on them being continuous. Incorporating prior knowledge on features. When the user has constraints or preferences over the features, our approach can be extended to incorporate such prior knowledge in the following ways: 1) if some features cannot be changed, we can avoid searching feature combinations involving them, which also saves computationally; 2) if a feature can only be changed to a value in an interval, we simply add this interval as a constraint to LP formulation; 3) if some features are preferable to change, we can adjust the coefficients of features in the distance function accordingly. 4 Empirical Evaluation We evaluate our approach on three neural network models from different domains. 4.1 Experiment Setup Implementation. We implemented our approach in a tool called POLARIS, which is written in three thousand lines of Python code. To implement findMinimumConcreteCorrection, we used a customized version of the CleverHans library [24]. To implement isFeasible which checks feasibility of generated linear constraints, we applied the commercial linear programming solver Gurobi 7.5.2 [9]. Neural networks. Table 1 summarizes the statistics of the neural networks. The mortgage underwriting network predicts whether an applicant would default on the loan. Its architecture is akin to state-of-the-art neural networks for predicting mortgage risks [28], and has a recall of 90% and a precision of 6%. It is trained to have a high recall to be conservative in accepting applications. The solver performance prediction network predicts whether a first-order theorem can be solved efficiently by a solver based on static and dynamic characteristics of the instance. We chose its architecture using a grid search. The drawing tutoring network judges whether a drawing is an accurate rendition 6 Table 1: Summary of the neural networks used in our evaluation. Application Network Structure # ReLUs Dataset (train/val./test: 50/50/25) # features F1 Accuracy Mortgage Underwriting 5 dense layers of 200 ReLUs each 1,000 Applications and performance of 34 million Single-Family loans [6] 21 0.118 0.8 Solver Performance Prediction 8 dense layers of 100 ReLUs each 800 Statistics of 6,118 first-order theorems and their solving times [13] 51 0.74 0.792 Drawing Tutoring 3 1-D conv. layers (filter shape: [5,4,8]) and 1 dense layer of 1,024 ReLUs 4,096 0.12 million variants of a canonical cat drawing and 0.12 million of cat drawings from Google QuickDraw[8] 512 0.995 0.995 of a canonical drawing of a cat. A drawing is represented by a set of line segments on a 256 × 256 canvas, each of which is represented by the coordinates of its vertices. A drawing comprises up to 128 lines, which leads to 512 features. Evaluation inputs. For the first two applications, we randomly chose 100 inputs in the test sets that were rejected by the networks. For drawing tutoring, we used 100 variants of the canonical drawing and randomly removed subsets of line segments so that they get rejected by the network. Algorithm configurations. Our approach is parameterized by the number of features n allowed to change simultaneously, the maximum number of regions to consider m, the stability metric, the distance metric, and the shape of the generated symbolic correction. We set n = 2 for mortgage underwriting and solver performance prediction as corrections of higher dimensions on them are hard for end users to understand. Moreover, we limit the mutable features to 5 features each that are plausible for the end user to change. Details of these features are described in Appendix B.1. As for drawing tutoring, we set n ∈[1, 20], which allows us to add up to 5 line segments. To reduce the computational cost, we use a generative network to recommend the features to change rather than enumerating all combinations of features. The network is a variational autoencoder that completes drawing sketches [10]. We set m = 100 and discuss the effect of using different m later. For the stability metric and the distance metric, we use a weighted L∞norm and a weighted L1 respectively for mortgage underwriting and solver performance prediction, which are described in Appendix B.1. For drawing tutoring, we measure the distance of a correction by the number of features changed (L0), which reflects how many lines are added. We say a correction is stable if it contains at least 3 pixels in each dimension. Finally, we use triangles to represent the corrections for mortgage underwriting and solver performance prediction, while we use axis-aligned boxes for drawing tutoring. The blue rectangles in Figure 1(c) are projections of a box correction on coordinates of added line vertices. Experiment environment. All the experiments were run on a Dell XPS 8900 Desktop with 16GB RAM and an Intel I7 4GHZ quad-core processor running Ubuntu 16.04. 4.2 Experiment Results We first discuss how often POLARIS generates stable corrections and how far away these corrections are from the original input. We then study the efficiency. Next, we discuss the effect of varying m, the maximum number of regions to consider. We then compare against grid search. Finally, we discuss the performance of POLARIS when there are multiple classes. Stability and minimality. For the selected 100 inputs that are rejected by each network, POLARIS successfully generated symbolic corrections for 85 inputs of mortgage underwriting, 81 inputs of solver performance prediction, and 75 inputs of drawing tutoring. For the remaining inputs, it is either the case that the corrections found by POLARIS were discarded for being unstable, or the case that POLARIS failed to find an initial concrete correction due to the incompleteness of the applied adversarial example generation algorithm. These results show that POLARIS is effective in finding symbolic corrections that are stable and verified. We next discuss how similar these corrections are to the original input. Figure 2 lists the sorted distances of the aforementioned 85 symbolic corrections. For mortgage application and solver performance prediction, the distance is defined using a weighted L1 norm, where the weight for each feature is 1/(max-min) (see Appendix B.1). The average distances of corrections generated on these two applications are 0.31 and 0.25 respectively. Briefly, the former would mean, for example, to decrease the DTI by 19.5% or to increase the interest rate by 3%, while the latter would mean, for example, to add 25% more unit clauses or horn clauses. Moreover, the smallest distances for these 7 0 20 40 60 80 100 Loan Application 0.5 1.0 1.5 Correction Distance average = 0.31 0 20 40 60 80 100 Theorem 0.5 1.0 1.5 Correction Distance average = 0.25 0 20 40 60 80 100 Drawing 5 10 15 20 Correction Distance average = 7.68 (a) Mortgage Underwriting (b) Solver Performance Prediction (c) Drawing Tutoring Figure 2: Distances of judgment interpretations generated by POLARIS. 0 20 40 60 80 100 Loan Application 0 1000 2000 3000 Running Time (Seconds) average = 1292 0 20 40 60 80 100 Theorem 0 1000 2000 3000 Running Time (Seconds) average = 147 0 20 40 60 80 100 Drawing 0 1000 2000 3000 Running Time (Seconds) average = 781 (a) Mortgage Underwriting (b) Solver Performance Prediction (c) Drawing Tutoring Figure 3: Running time of POLARIS on each input. two applications are only 0.016 and 0.03. As for drawing tutoring, the distance is measured by the number of features to change (that is, number of added lines × 4). As figure 2(c) shows, the sizes of the corrections range from 1 line to 5 lines, with 2 lines being the average. In conclusion, the corrections found by POLARIS are often small enough to be actionable for end users. To better understand these corrections qualitatively, we inspect several corrections more closely in Appendix B.2. We also include more example corrections in Appendix B.3. Efficiency. Figure 3 shows the sorted running time of POLARIS across all inputs for our three applications. On average, POLARIS takes around 20 minutes, 2 minutes, and 13 minutes to generate corrections for each input of the three applications respectively. We first observe POLARIS consumes the least time on solver performance prediction. It is not only because solver performance prediction has the smallest network but also because the search often terminates much earlier before reaching the maximum number of regions to consider (m=100). On the other hand, POLARIS often reaches this limit on the other two applications. Although drawing tutoring has a larger network than mortgage underwriting, POLARIS consumes less time on it. This is because POLARIS uses a generative network to decide which features to change for drawing tutoring, which leads to one invocation to Algorithm 2 per input. On the other hand, for mortgage underwriting, POLARIS needs to invoke Algorithm 2 for multiple times per input which searches under a combination of different features. However, a single invocation to Algorithm 2 is still faster for mortgage underwriting. After closer inspection, we find the running time is dominated by invocations to the LP solver. We have two observations about the invocation time. First, most of the time is spent in instance creation rather than actual solving due to the poor performance of python binding of Gurobi. For instance, in mortgage underwriting, while each instance creation takes around 60ms, the actual solving typically only takes around 1ms. As a result, POLARIS can be made even more efficient if we re-implement it using C++ or if Gurobi improves the python binding. Second, the LP solver scales well as the size of the network and the number of dimensions grow. For example, compared to the solving time (1ms) in mortgage underwriting, where the network comprises 1,000 neurons and the corrections are 2-dimension, the solving time only grows up to around 7ms in drawing tutoring, where the network comprises 4,096 neurons and the corrections are up to 20-dimension. This indicates that POLARIS has the potential to scale to even larger networks with higher input dimensions. Varying maximum number of regions. Table 2 shows the results of varying maximum number of regions to consider (m) for four randomly selected inputs of mortgage underwriting. To simplify the discussion, we only study corrections generated under DTI and interest rate. As the table shows, both the volume and running time increase roughly linearly as the number of explored regions grows. Comparing to sampling by a grid. An alternative approach to generate judgment interpretations is to sample by a grid. Since there may be unviable inputs between two adjacent viable inputs, a grid with fine granularity is needed to produce a symbolic correction with high confidence. However, this is not feasible if there are continuous features or the input dimension is high. For instance, the corrections generated on drawing tutoring may involve up to 20 features. Even if we only sample 3 pixels along each feature, it would require over 3 billion samples. Our approach on the other hand, verifies a larger number of concrete corrections at once by verifying a linear region. 8 Table 2: Effect of varying the maximum number of regions to consider. m # explored regions volume time (in seconds) 100 88, 100, 100, 100 2.4, 10.3, 9.2, 1.29 102, 191, 141, 118 500 88, 205, 214, 500 2.4, 26.3, 21.9, 6.9 100, 374, 288, 517 1000 88, 205, 214, 1000 2.4, 26.3, 21.9, 10.2 100, 375, 290, 1115 2000 88, 205, 214, 1325 2.4, 26.3, 21.9, 11.2 101, 375, 291, 1655 0 20 40 60 80 100 Theorem 0 1000 2000 3000 Running Time (Seconds) average = 140 Figure 4: Running time of POLARIS for multiple classes. Scaling to multiclass classification. As discussed in Section 3.2, when extending for multiple classes, the runtime of our approach should not grow significantly compared to similar binary class settings. As an empirical justification, we extended the network in our solver performance prediction application to a six-class one. It predicts which solver heuristic out of five can efficiently solve a problem or concludes that none can. To enable a fair comparison, the new network has a similar structure (8 hidden dense layers each of which has 100 ReLUs). We chose one heuristic as the desirable class. Figure 4 shows the sorted running time of POLARIS across the inputs. While it took 147 seconds on average to produce an explanation for the original network, it took 140 seconds for the new network on average. 5 Related Work Our work is related to previous works on interpreting neural networks in terms of the problem [21], and works on generating adversarial examples [7] in terms of the underlying techniques. Much work on interpretability has gone into analyzing the results produced by a convolutional network that does image classification. The Activation Maximization approach and its follow-ups visualize learnt high-level features by finding inputs that maximize activations of given neurons [5, 12, 17, 31, 23]. Zeiler and Fergus [33] uses deconvolution to visualize what a network has learnt. Not just limited to image domains, more recent works try to build interpretability as part of the network itself [25, 18, 30, 32, 19]. There are also works that try to explain a neural network by learning a more interpretable model [26, 16, 3]. Lundberg et al. [20] and Kindersmans et al. [14] assign importance values to features for a particular prediction. Koh and Liang [15] trace a prediction back to the training data. Anchors [27] identifies features that are sufficient to preserve current classification. Similar to our work, Dhurandhar et al. [4] infers minimum perturbations that would change the current classification. While we infer a stable symbolic corrections representing a set of perturbations, they infer a single concrete correction. As stated in our introduction, it provides many benefits for a correction to be symbolic and stable. In summary, the problem definition of judgement interpretation is new, and none of the existing approaches can directly solve it. Moreover, these approaches typically generate a single input prototype or relevant features, but do not result in corrections or a space of inputs that would lead the prediction to move from an undesirable class to a desirable class. Adversarial examples were first introduced by Szegedy and et al. [29], where box-constrained LBFGS is applied to generate them. Various approaches have been proposed later. The fast gradient sign method [7] calculates an adversarial perturbation by taking the sign of the gradient. The Jacobianbased Saliency Map Attack (JSMA) [11] applies a greedy algorithm based a saliency map which models the impact each pixel has on the resulting classification. Deepfool [22] is an untargeted attack optimized for the L2 norm. Bastani at al. [2] applies linear programming to find an adversarial example under the same activations. While these techniques are similar to ours in the sense that they also try to find minimum corrections, the produced corrections are concrete and correspond to individual inputs. On the other hand, our corrections are symbolic and correspond to sets of inputs. 6 Conclusion We proposed a new approach to interpret a neural network by generating minimal, stable, and symbolic corrections that would change its output. Such an interpretation is a useful way to provide feedback to a user when the neural network fails to produce a desirable output. We designed and implemented the first algorithm for generating such corrections, and demonstrated its effectiveness on three neural network models from different real-world domains. 9 Acknowledgments We thank the reviewers for their insightful comments and useful suggestions. This work was funded in part by ONR PERISCOPE MURI, award N00014-17-1-2699. References [1] S. Bach, A. Binder, G. Montavon, F. Klauschen, K.-R. Müller, and W. Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015. [2] O. Bastani, Y. Ioannou, L. Lampropoulos, D. Vytiniotis, A. V. Nori, and A. Criminisi. Measuring neural net robustness with constraints. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 2613–2621, 2016. [3] O. Bastani, C. Kim, and H. Bastani. Interpretability via model extraction. CoRR, abs/1706.09773, 2017. [4] A. Dhurandhar, P. Chen, R. Luss, C. Tu, P. Ting, K. Shanmugam, and P. Das. Explanations based on the missing: Towards contrastive explanations with pertinent negatives. CoRR, abs/1802.07623, 2018. [5] D. Erhan, Y. Bengio, A. Courville, and P. Vincent. Visualizing higher-layer features of a deep network. University of Montreal, 1341(3):1, 2009. [6] Fannie Mae. Fannie Mae single-family loan performance data. http://www.fanniemae.com/ portal/funding-the-market/data/loan-performance-data.html, 2017. Accessed: 2018-02-07. [7] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. CoRR, abs/1412.6572, 2014. [8] I. Google. The Quick, Draw! Dataset. https://github.com/googlecreativelab/ quickdraw-dataset, 2017. Accessed: 2018-05-13. [9] Gurobi Optimization, Inc. Gurobi optimizer reference manual. http://www.gurobi.com, 2018. [10] D. Ha and D. Eck. A neural representation of sketch drawings. arXiv preprint arXiv:1704.03477, 2017. [11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 770–778, 2016. [12] G. E. Hinton. A practical guide to training restricted boltzmann machines. In Neural Networks: Tricks of the Trade - Second Edition, pages 599–619. Springer, 2012. [13] S. B. H. James P Bridge and L. C. Paulson. First-order theorem proving Data Set. https:// archive.ics.uci.edu/ml/datasets/First-order+theorem+proving, 2013. Accessed: 2018-05-13. [14] P.-J. Kindermans, K. T. Schütt, M. Alber, K.-R. Müller, D. Erhan, B. Kim, and S. Dähne. Learning how to explain neural networks: Patternnet and patternattribution. In International Conference on Learning Representations, 2018. [15] P. W. Koh and P. Liang. Understanding black-box predictions via influence functions. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pages 1885–1894, 2017. [16] V. Krakovna and F. Doshi-Velez. Increasing the interpretability of recurrent neural networks using hidden markov models. CoRR, abs/1606.05320, 2016. 10 [17] H. Lee, R. B. Grosse, R. Ranganath, and A. Y. Ng. Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML 2009, Montreal, Quebec, Canada, June 14-18, 2009, pages 609–616, 2009. [18] T. Lei, R. Barzilay, and T. S. Jaakkola. Rationalizing neural predictions. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pages 107–117, 2016. [19] O. Li, H. Liu, C. Chen, and C. Rudin. Deep learning for case-based reasoning through prototypes: A neural network that explains its predictions. CoRR, abs/1710.04806, 2017. [20] S. M. Lundberg and S. Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 4768–4777, 2017. [21] G. Montavon, W. Samek, and K. Müller. Methods for interpreting and understanding deep neural networks. CoRR, abs/1706.07979, 2017. [22] S. Moosavi-Dezfooli, A. Fawzi, and P. Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pages 2574–2582, 2016. [23] A. Nguyen, A. Dosovitskiy, J. Yosinski, T. Brox, and J. Clune. Synthesizing the preferred inputs for neurons in neural networks via deep generator networks. In Advances in Neural Information Processing Systems, pages 3387–3395, 2016. [24] N. Papernot, N. Carlini, I. Goodfellow, R. Feinman, F. Faghri, A. Matyasko, K. Hambardzumyan, Y.-L. Juang, A. Kurakin, R. Sheatsley, A. Garg, and Y.-C. Lin. cleverhans v2.0.0: an adversarial machine learning library. arXiv preprint arXiv:1610.00768, 2017. [25] P. H. O. Pinheiro and R. Collobert. From image-level to pixel-level labeling with convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2015, Boston, MA, USA, June 7-12, 2015, pages 1713–1721, 2015. [26] M. T. Ribeiro, S. Singh, and C. Guestrin. "Why should I trust you?": Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, August 13-17, 2016, pages 1135–1144, 2016. [27] M. T. Ribeiro, S. Singh, and C. Guestrin. Anchors: High-precision model-agnostic explanations. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, New Orleans, Louisiana, USA, February 2-7, 2018, 2018. [28] J. Sirignano, A. Sadhwani, and K. Giesecke. Deep learning for mortgage risk. arXiv preprint arXiv:1607.02470, 2016. [29] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. J. Goodfellow, and R. Fergus. Intriguing properties of neural networks. CoRR, abs/1312.6199, 2013. [30] S. Tan, K. C. Sim, and M. J. F. Gales. Improving the interpretability of deep neural networks with stimulated learning. In 2015 IEEE Workshop on Automatic Speech Recognition and Understanding, ASRU 2015, Scottsdale, AZ, USA, December 13-17, 2015, pages 617–623, 2015. [31] A. van den Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 1747–1756, 2016. [32] C. Wu, P. Karanasou, M. J. F. Gales, and K. C. Sim. Stimulated deep neural network for speech recognition. In Interspeech 2016, 17th Annual Conference of the International Speech Communication Association, San Francisco, CA, USA, September 8-12, 2016, pages 400–404, 2016. 11 [33] M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In Computer Vision - ECCV 2014 - 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part I, pages 818–833, 2014. 12
2018
212
7,378
Diverse Ensemble Evolution: Curriculum Data-Model Marriage Tianyi Zhou, Shengjie Wang, Jeff A. Bilmes Depts. of Computer Science and Engineering, and Electrical and Computer Engineering University of Washington, Seattle {tianyizh, wangsj, bilmes}@uw.edu Abstract We study a new method “Diverse Ensemble Evolution (DivE2)” to train an ensemble of machine learning models that assigns data to models at each training epoch based on each model’s current expertise and an intra- and inter-model diversity reward. DivE2 schedules, over the course of training epochs, the relative importance of these characteristics; it starts by selecting easy samples for each model, and then gradually adjusts towards the models having specialized and complementary expertise on subsets of the training data, thereby encouraging high accuracy of the ensemble. We utilize an intra-model diversity term on data assigned to each model, and an inter-model diversity term on data assigned to pairs of models, to penalize both within-model and cross-model redundancy. We formulate the data-model marriage problem as a generalized bipartite matching, represented as submodular maximization subject to two matroid constraints. DivE2 solves a sequence of continuous-combinatorial optimizations with slowly varying objectives and constraints. The combinatorial part handles the data-model marriage while the continuous part updates model parameters based on the assignments. In experiments, DivE2 outperforms other ensemble training methods under a variety of model aggregation techniques, while also maintaining competitive efficiency. 1 Introduction Ensemble methods [7, 57, 31, 8] are simple and powerful machine learning approaches to obtain improved performance by aggregating predictions (e.g., majority voting or weighted averaging) over multiple models. Over the past few decades, they have been widely applied, consistently yielding good results. For neural networks (NN) in particular, ensemble methods have shown their utility from the early 1980s [72, 28, 39, 10] to recent times [50, 27, 66, 20]. State-of-the-art results on many contemporary competitions/benchmarks are achieved via ensembles of deep neural networks (DNNs), e.g., ImageNet [17], SQuAD [55], and the Kaggle competitions (https://www.kaggle.com/). In addition to boosting state-of-the-art performance of collections of large models, ensembles of small and weak models can achieve performance comparable to much larger individual models, and this can be useful when machine resources are limited. Inference over an ensemble of models, moreover, can be easily parallelized even on a distributed machine. A key reason for the success of ensemble methods is that the diversity among different models can reduce the variance of the combined predictions and improve generalization. Intuitively, diverse models tend to make mistakes on different samples in different ways (e.g., assigning largest probability to different wrong classes), so during majority voting or averaging, those different mistakes cancel each other out and the correct predictions can prevail. As neural networks grow larger in size and intricacy, their variance correspondingly increases, offering opportunity for reduction by a diverse ensemble of such networks. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Randomization is a widely-used technique to produce diverse ensembles. Classical ensemble methods such as random initialization [17, 63], random forests [31, 8] and Bagging [7, 19], encourage diversity by randomly initializing starting points/subspaces or resampling the training set for different models. Ensemble-like methods for DNNs, e.g., dropout [61] and swapout [59], implicitly train multiple diverse models by randomly dropping hidden units out during the training of a single model. Diversity can also be promoted by sequentially training multiple models to encourage a difference between the current and previously trained models, such as Boosting [57, 23, 50] and snapshot ensembles [32]. Such sequential methods, however, are hard to parallelize and can lead to long training times when applied to neural networks. Despite the consensus that diversity is essential to ensemble training, there is little work explicitly encouraging and controlling diversity during ensemble model training. Most previous methods encourage diversity only implicitly, and are incapable of adjusting the amount of diversity precisely based on criterion determined during different learning stages, nor do they have an explicit diversity representation. Some methods implicitly encourage diversity during training, but they rely on learning rate scheduling (e.g., snapshot ensembles [32]) or end-to-end training of an additive combination of models (e.g., mixture of experts [33, 34, 58]) to promote diversity, which is hard to control and interpret. Moreover, many existing ensemble training methods train all models in the ensemble on all samples in the training set by repeatedly iterating through it, so the training cost increases linearly with the number of models and number of samples. In such case, each model might waste much of its time on a large number of redundant or irrelevant samples that have already been learnt, and that might contribute nearly zero-valued gradients. The performance of an ensemble on each sample only depends on whether a subset of models (e.g., half for majority voting) makes a correct prediction, so it should be unnecessary to train each model on every sample. In this paper, we aim to achieve an ensemble of models using explicitly encouraged diversity and focused expertise, i.e., each model is an expert in a sufficiently large local-region of the data space, and all the models together cover the entire space. We propose an efficient meta-algorithm “diverse ensemble evolution (DivE2)”, that “evolves” the ensemble adaptively by changing over stages both the diversity encouragement and each model’s expertise, and this is based on information available during ensemble training. It does this encouraging both intra- and inter-model diversity. Each training stage is formulated as a hybrid continuous-combinatorial optimization. The combinatorial part solves a data-model-marriage assignment via submodular generalized bipartite matchings; the algorithm explicitly controls the diversity of the ensemble and the expertise of each model by assigning different subsets of the training data to different models. The continuous part trains each model’s parameters using the assigned subset of data. At each stage, all the models may be updated in parallel after receiving their assigned data. A similar approach to encourage inter-model diversity was used in[15] but there diversity of different models is achieved by encouraging diverse subsets of features and the goal was to cluster the features into potentially overlapping groups; here we are encouraging diverse subsets of samples to be assigned to models during the training process and we are matching data samples to models. We apply DivE2 to four benchmark datasets, and show that it improves over randomization-based ensemble training methods on a variety of approaches to aggregate ensemble models into a single prediction. Moreover, with model selection based ensemble aggregation (defined below), DivE2 can quickly reach reasonably good ensemble performance after only a few learning stages even though each individual model has poor performance on the entire training set. Furthermore, DivE2 exhibits competitive efficiency and good of model expertise interpretability, both of which can be important in DNN training. 2 Diverse Ensemble Evolution (DivE2): Formulation 2.1 Data-Model Marriage An ensemble of models can make an accurate prediction on a sample without requiring each model making accurate predictions on that sample [41, 26, 42]. Rather, it requires a subset of models to produce accurate predictions, and the remainder may err in different ways. Hence, rather than training each model on the entire training set, we may in theory assign a data subset to each model. Then, each sample is learned by a subset of models, and different models are trained on different subsets thereby avoiding common mistakes across models. Consider a weighted bipartite graph (see Fig. 1), with the set of n = |V | training samples V on the left side, the set of m = |U| models U on the right side, and edges E , {(vj, ui)|vj 2 V, ui 2 U} 2 connecting all sample-model pairs with edge weights defined by the loss `(vj; wi) of sample vj = (xj, yj) (where xj is the features and yj is the label(s)) on model ui (where model ui is parameterized by wi). We wish to marry samples with models by selecting a subset of edges having overall small loss. We can express this as follows: max {wi}m i=1 max A✓E X (vj,ui)2A (β −`(vj; wi)), (1) where β −`(vj; wi) translates loss to reward (or accuracy), and β is a constant larger than any per-sample loss on any model, i.e., β ≥`(vj; wi), 8i, j 1. Samples Models V U E ≤" (k =2) ≤' ('=3) Figure 1: Data-Model Marriage as Bipartite Matching. With no constraints, all edges are selected thus requiring all models to learn all samples. As mentioned above, for ensembles, every sample need only be learned by a few models, and thus, for any sample v, we may wish to limit the number of incident edges selected to be no greater than k. This can be achieved using partition matroid MV = (E, IV ), where IV = (I1, I2, . . . , In) and Ii ✓E. IV contains all subsets of E where no sample is incident to more than k edges in any subset, i.e. IV = {A ✓E : |A \ δ(v)| k, 8v 2 V }, where δ(v) ✓E is the set of edges incident to v (likewise for δ(u), u 2 U). Therefore, as long as a selected subset A ✓E satisfies the constraint (A 2 IV ), every sample is selected by at most k models. With only the constraint A 2 Iv, different models can be assigned dramatically differently sized data subsets. In the extremely unbalanced case, k models might get all the training data, while the other models get no data at all. This is obviously undesirable because k models will learn from the same data (no diversity and no specialized and complementary expertise), while the others models learn nothing. Running time also is not improved since training time is linear in the size of the largest assigned data set, which is all of the data in this case. We therefore introduce a second partition matroid constraint MU = (E, IU), which limits to p the number of samples selected by each model. Specifically, Iu = {A ✓E : |A \ δ(u)| p, 8u 2 U}. Eq. (1) then becomes: max {wi}m i=1 max A✓E,A2Iv\Iu X (vj,ui)2A (β −`(vj; wi)). (2) The interplay between the two constraints (i.e., Iv: k models per sample, and Iu: p samples per model) is important to our later design of a curriculum that leads to a diverse and complementary ensemble. When mp < nk, Iu tends to saturate (i.e., |A \ δ(u)| = p, 8u 2 U) earlier than Iv. Hence, each model generally has the opportunity to select the top-p easiest samples (i.e., those having the smallest loss) for itself. We call this the “model selecting sample” (or early learning) phase, where each model quickly learns to perform well on a subset of data. On the other hand, when mp > nk, Iv tends to saturate earlier (i.e., |A \ δ(v)| = k, 8v 2 V ), and each sample generally has the opportunity to select the best-k models for itself. We call this the “sample selecting model” (or later learning) phase, where models may develop complementary expertise so that together they can perform accurately over the entire data space. We give conditions on which phase dominates in Lemma 1. 2.2 Inter-model & Intra-model Diversity To encourage different multiple models to gain different proficiencies, the subsets of training data assigned to different models should be diverse. The two constraints introduced above are helpful to encourage diversity to a certain extent when p and k are small. For example, when k = 1 and p n/m, no pairs of models share any training sample. Different training samples, however, can still be similar and thus redundant, and in this case the above approach might not encourage diversity when p or k is large. Therefore, we incorporate during training an explicit inter-model diversity term Finter(A) , P i,j2[m],i<j F # (δ(ui) [ δ(uj)) \ A $ and add it to the objective function in Eq. (2). This discourages model pairs from becoming too similar by discouraging their being assigned similar data. The set function F : 2E ! R+ is chosen from the large expressive family of submodular functions, which naturally measure the diversity of a set of items [24]. A submodular function satisfies the diminishing return property: given a finite ground set V , any A ✓B ✓V and an element 1Although in theory the loss can be arbitrarily large, in practice, it is usually forced to be upper bounded by a constant for a stable gradient, e.g., a small σ used in −log(pi + σ) −log(σ) when computing cross entropy loss. Gradient clipping widely used in training neural nets also avoids arbitrarily large loss. 3 v /2 B, v 2 V , we have F({v} [ A) −F(A) ≥F({v} [ B) −F(B). Submodular functions have been applied to a variety of diversity-driven tasks to achieve good results [45, 44, 3, 54, 25, 22]. Another issue of Eq. (2) is that each model might select easy but redundant samples when constraint Iu dominates (the model-selecting-sample phase). This is problematic as each model might quickly focus on a small group of easy samples, and may overfit to such small region in the data space. We therefore introduce another set function Fintra(A) = P i2[m] F 0(δ(ui) \ A) to promote the diversity of samples assigned to each model. Similar to F, we also choose F 0 to be a submodular function. The optimization procedure now becomes: max W max A✓E,A2Iv\Iu G(A, W) , X (vj,ui)2A (β −`(vj; wi)) + γFinter(A) + λFintra(A), (3) where γ and λ are two non-negative weights to control the trade-offs between the reward term and the diversity terms, and we denote W , {wi}m i=1 for simplicity. By optimizing the objective G(A, W), we explicitly encourage model diversity in the ensemble, while ensuring every sample gets learned by k models so that the ensemble can generate correct predictions. A form of this objective has been called “submodular generalized matchings” [1] where it was used to associate peptides and spectra. 3 Diverse Ensemble Evolution (DivE2): Algorithm 3.1 Solving a Continuous-Combinatorial Optimization Algorithm 1 SELECTLEARN(k, p, λ, γ, {w0 i }m i=1) 1: Input: {vj}n j=1, {l(·; wi)}m i=1, ⇡(·; ⌘) 2: Output: {wi}m i=1 3: Initialize: wi w0 i 8i 2 [m], t = 0 4: while not “converged” do 5: W {wt i}m i=1, define G(·, W) by W; 6: ˆA SUBMODULARMAX(G(·, W), k, p); 7: if G( ˆA, W) > G(A, W) then 8: A ˆA; 9: end if 10: for i 2 {1, · · · , m} do 11: −r ˆH(wt i) @ @wt i P vj2V (A\δ(ui)) `(vj; wt i); 12: wt+1 i wt i + ⇡ ⇣ {w⌧ i , −r ˆH(w⌧ i )}⌧2[1,t]; ⌘t⌘ ; 13: end for 14: t t + 1; 15: end while Eq. (3) is a hybrid optimization involving both a continuous variable W and a discrete variable A. It degrades to maximization of a piecewise continuous function H(W) , maxA✓E,A2Iv\Iu G(A, W), with each piece defined by a fixed A achieving the maximum of G(A, W) in a local region of W. Suppose that A is fixed, then maximizing G(A, W) (or H(W)) consists of to m independent continuous minimization problems, i.e., minwi P vj2V (A\δ(ui)) `(vj; wi), 8i 2 [m]. Here V (A) ✓V denotes the samples incident to the set of edges A ✓E, so V (A \ δ(ui)) is the subset of samples assigned to model ui. When loss `(·; wi) is convex w.r.t. wi for every i, a global optimal solution to the above continuous minimization can be obtained by various off-the-shelf algorithms. When `(·; wi) is non-convex, e.g., each model is a deep neural networks, there also exist many practical and provable algorithms that can achieve a local optimal solution, say, by backpropagation. Suppose we fix W, then maximizing G(A, W) reduces to the data assignment problem (a generalized bipartite matching problem [43], see Appendix [71] Sec. 5.3 for more details), and the optimal A defines one piece of H(W) in the vicinity of W. Finding the optimal assignment is NP-hard since G(·, W) is a submodular function (a weighted sum of a modular and two submodular functions) and we wish to maximize over a feasibility constraint consisting of the intersection of two partition matroids (Iv \ Iu). Thanks to submodularity, fast approximate algorithms [51, 48, 49] exist that find a good quality approximate optimal solution. Let ˆH(W) denote the piecewise continuous function achieved when the discrete problem is solved approximately using submodular optimization, then we have ˆH(W) ≥↵· H(W) for every W, where ↵2 [0, 1] is the approximation factor. Therefore, solving the max-max problem in Eq. (3) requires interaction between a combinatorial (submodular in specific) optimizer and a continuous (convex or non-convex) optimizer ⇡(·; ⌘) 2. We alternate between the two optimizations while keeping the objective G(A, W) non-decreasing. 2The optimizer ⇡(·; ⌘) can be any gradient descent methods, e.g., SGD, momentum methods, Nesterov’s accelerated gradient [52], Adagrad [18], Adam [36], etc. Here the first parameter · can include any historical solutions and gradients, and ⌘is a learning rate schedule (i.e., learning rate is ⌘t for iteration t). 4 Intuitively, we utilize the discrete optimization to select a better piece of ˆH(W), and then apply the continuous optimization to find a better solution on that piece. Details are given in Algorithm 1. For each iteration, we compute an approximate solution ˆA ✓E using submodular maximization SUBMODULARMAX (line 6); in lines 7-9 we compare ˆA with the old A on G(·, W) and choose the better one; lines 10-13 run an optimizer ⇡(·; ⌘) to update each model wi according to its assigned data. Algorithm 1 always generates a non-decreasing (assuming ⇡(·; ⌘) does the same using, say, a line search) sequence of objective values. With a damped learning rate, only small adjustments get applied to W and G(·, W). Thus, after a certain point the combinatorial part repeatedly selects the same A (and line 7 eventually is always false), so the algorithm then converges as the continuous optimizer converges. 3 3.2 Theoretical Perspectives An interesting viewpoint of the max-max problem in Eq. (3) is its analogy to K-means problems [46]. Eq. (3) strictly generalizes the kmeans objective, by setting γ = λ = 0, k = 1, p to be the number of desired clusters, and the loss to be the distance metric used in K-means (e.g., L2 distance), and the model to be a real valued vector of having the same dimension as x. Since K-means problem is NP-hard, our objective is also NP-hard. We next analyze conditions for either of the constraints (Iv, Iu) introduced in Section 2.1 to saturate. In the two extreme cases, we know that the “sample selecting model” constraint Iv saturates when nk ⌧mp (e.g., k = 1 and p = n), and the “model selecting sample” constraint Iu saturates when nk ≫mp (e.g., k = m and p = 1). However, it is not clear what exactly happens between them. The following Lemma shows the precise saturation conditions of the two constraints, with proof details in Section 5.1 of Appendix [71]. Lemma 1. If SUBMODULARMAX is greedy algorithm or its variant, the data assignment ˆA produced by lines 6-9 in Algorithm 1 fulfills: 1) Iv saturates, i.e., | ˆA\δ(v)| = k, 8v 2 V , and | ˆA| = nk, if k < mp+p/n+(p−1); 2) Iu saturates, i.e., | ˆA \ δ(u)| = p, 8u 2 U, and | ˆA| = mp, if k > mp−p/n−(p−1); 3) when mp+p/n+(p−1) k mp−p/n−(p−1), we have | ˆA| ≥min{(k −1) + (m −k + 1)p, (p − 1) + (n −p + 1)k}. As stated above, we can think the objective H(W) as a piecewise function, where each piece is associated with a solution to the discrete optimization problem. Since it is NP-hard to optimize the discrete problem, Algorithm 1 optimizes W on ˆH(W), which is defined by the SUBMODULARMAX solutions, rather than on H(W). Algorithm 1 has the following properties. Proposition 1. Algorithm 1: (1) generates a monotonically non-decreasing sequence of objective values G(A; W) (assuming ⇡(·; ⌘) does the same) (2) converges to a stationary point on ˆH(W); and (3) for any loss `(u, w) that is β-strongly convex w.r.t. w, if SUBMODULARMAX has approximation factor ↵, it converges to a local optimum ˆW 2 argmaxW 2K ˆH(W) (i.e., ˆW is optimal in an local area K) such that for any local optimum W ⇤ loc 2 K on the true objective H(W), we have ˆH( ˆW) ≥↵H(W ⇤ loc)+ β 2 ·min{(k−1)+(m−k+1)p, (p−1)+(n−p+1)k}·k ˆW −W ⇤ lock2 2. (4) The proof is in Section 5.2 of Appendix [71]. The result in Eq. (4) implies that in any local area K, if ˆW is not close to W ⇤ loc (i.e., k ˆW −W ⇤ lock2 is large), the algorithm can still achieve an objective ˆH( ˆW) close to H(W ⇤ loc), which is a good approximate solution from the perspective of maximizing G(A, W). Section 5.3 of Appendix [71] shows that the approximation factor is ↵= 1/2+G for the greedy algorithm, where G is the curvature of G(·, W). When the weights λ and γ are small, G decreases and G(·, W) becomes more modular. Therefore, the approximation ratio ↵increases and the lower bound in Eq. (4) improves. For general non-convex losses and models (e.g., DNNs), Eq. (4) degenerates to a weaker bound: ˆH( ˆW) ≥↵H(W ⇤ loc). 3.3 Ensemble Evolution: Curricula for Diverse Ensembles with Complementary Expertise For a model ensemble to produce correct predictions, we require only that every sample be learnt by a few (small k) models. Optimizing Eq. (3) with small k from the beginning, however, might be harmful as the models are randomly initialized, and using the loss of such early stage models for the edge weights and small k could lead to arbitrary samples being associated and subsequently 3Convergence is defined as the gradient r ˆH(W) w.r.t. W being zero. In practice, we use kr ˆH(W)k ✏ for a small ✏. 5 locked to models. We would, instead, rather have a larger k and more use of the diversity terms at the beginning. To address this, we design an ensemble curriculum to guide the training process and to gradually approach our ultimate goal. Algorithm 2 Diverse Ensemble Evolution (DIVE2) 1: Input: {(xj, yj)}n j=1, {w0 i }m i=1, ⇡(·; ⌘), µ, ∆k, ∆p, T 2: Output: {wt i}m i=1 3: Initialize: k m, p ≥1 s.t. mp nk, λ 2 [0, 1], γ 2 [0, 1] 4: for t 2 {1, · · · , T} do 5: {wt i}m i=1 SELECTLEARN(k, p, λ, γ, {wt−1 i }m i=1); 6: λ (1 −µ) · λ, γ (1 −µ) · γ; 7: k max{dk −∆ke, 1}, p min{bp + ∆pc, n}; 8: end for In Section 2.1, we discussed two (mp < nk and mp > nk) extreme training regimes. In the first regime, there are plenty of samples to go around but models may only choose a limited set of samples, so this encourages different models to improve on samples they are already good at. In the first regime, however, inter-model diversity is important to encourage models to become sufficiently different from each other. Intra-diversity is also important in the first regime, since it discourages models from being trained on entirely redundant data. In the second regime, there are plenty of models to go around but samples may choose only a limited number of models. Each model is then given a set of samples that it is particularly good at, and further training further specialization. Since all samples are assigned models, this leads to complementary proficiencies covering the data space. These observations suggest we start at the first regime mp nk with small p and large k, and gradually switch to the second regime with mp ≥nk by slowly increasing p and decreasing k. In earlier stages, we also should set the diversity weights λ and γ to be large, and then slowly reduce them as we move towards the second regime. It is worth noting that besides intra-model diversity regularization, increasing p is also helpful to expand the expertise of each model since it encourages each model to select more diverse samples. Decreasing k also helps to encourage inter-model diversity since it allows each sample to be shared by fewer models. In later stages, the solution of Algorithm 1 becomes more exact. With λ and γ decreasing, according to Lemma 2, the curvature G of G(·, W) approaches 0, the approximation factor ↵= 1/2+G of greedy algorithm increases, and the approximate objective ˆH(W) ≥↵H(W) becomes closer to the true objective H(W). Moreover, during later stages when the “sample selecting model” constraint (Iv) dominates and λ and γ are almost 0, the inner modular maximization is be exactly solved (↵= 1) and greedy algorithm degenerates to simple sorting. The detailed diverse ensemble evolution (DivE2) procedure is shown in Algorithm 2. The curriculum is composed of T stages. Each stage uses SELECTLEARN (Algorithm 1) to (approximately) solve a continuous-combinatorial optimization in the form of Eq. (3) with pre-specified values of (k, p, λ, γ) and initialization {wt−1 i }m i=1 from the previous episode as a warm start (line 5). The procedure reduces λ and γ by a multiplicative factor (1 −µ) in line 6, linearly decreases k by ∆k and additively increases p by ∆p, in Line 7. Both k and p are restricted to be integers and within the legal ranges, i.e., k 2 [1, m] and p 2 [1, n]. The warm start initialization is similar in spirit to continuation schemes used in previous curriculum learning (CL) [6, 5, 4, 35, 2, 60, 70] and SPL [40, 64, 62, 65], to avoid getting trapped in local minima and to stabilize optimization. As consecutive problems have the same form with similar parameters (k, p, λ, γ), the solution to the previous problem might still evaluate well on the next one. Hence, instead of running lines 5-14 in Algorithm 1 until full convergence (as instructed by line 4), we run them for 10 iterations for reduced running time. 4 Experiments We apply three different ensemble training methods to train ensembles of neural networks with different structures on four datasets, namely: (1) MobileNetV2 [56] on CIFAR10 [38]; (2) ResNet18 [29] on CIFAR100 [38]; (3) CNNs with two convolutional layers4 on Fashion-MNIST (“Fashion” in all tables) [69]; (4) and lastly CNNs with six convolutional layers on STL10 [12]5. The three training methods include DivE2 and two widely used approaches as baselines, which are • Bagging(BAG)[7]: sample a new training set of the same size as the original one (with replacement) for each model, and train it for several epochs on the sampled training set. 4A variant of LeNet5 with 64 kernels for each convolutional layer. 5The network structure is from https://github.com/aaron-xichen/pytorch-playground. 6 • RandINIT(RND): randomly initialize model weights of each model, and train it for several epochs on the whole training set. Details can be found in Table 3 of Appendix [71]. We everywhere fix the number of models at m = 10, and use `2 parameter regularization on w with weight 1 ⇥10−4. In DivE2’s training phase, we start from k = 6, p = n/2m and linearly change to k = 1, p = 3n/m in T = 200 episodes. We employ the “facility location” submodular function [14, 45] for both the intra and inter-model diversity, i.e., F(A) = P v02V maxv2V (A) !v,v0 where !v,v0 represents the similarity between sample v and v0. We utilize a Gaussian kernel for similarity using neural net features z(v) for each v, i.e., !v,v0 = exp # −kz(v)−z(v0)k2/2σ2$ , where σ is the mean value of all the n(n−1)/2 pairwise distances. For every dataset, we train a neural networks on a small random subset of training data (e.g., hundreds of samples) for one epoch, and use the inputs to the last fully connected layer as features z. These features are also used in the Top-k DCS-KNN approach (below) to compute the pairwise `2 distances to find the K nearest neighbors. 4.1 Aggregation Methods using an Ensemble of Models CIFAR10 CIFAR100 Fashion-MNIST STL10 Figure 2: Compare DivE2 with Bagging(upper row) and RandINIT(lower row) in terms of test accuracy (%) vs. number of training batches on CIFAR10, CIFAR100, Fashion-MNIST and STL10, with m = 10 and k = 3. For ensemble model aggregation, when applying a trained ensemble of models to new samples, we must determine (1) which models to use, and (2) how to aggregate their outputs. Here we mainly discuss the first point about different model selection methods, because the aggregation we employ is either an evenly or a weighted average of the selected model outputs. Static model selection methods [72, 10, 53] choose a subset of models from the ensemble and apply it to all samples. By contrast, dynamic classifier selection (DCS) [11, 47, 73, 16] selects different subsets of models to be aggregated for each sample. KNN based DCS [68, 37] is a widely used method that usually achieves better performance than other DCS and static methods. When training, DivE2 assigns different subsets of samples to different models, so for aggregation, we may benefit more from using sample-specific model selection methods. Therefore, we focus on DCS-type methods, in particular, the following: • Top-k Oracle: average the outputs (e.g., logits before applying softmax) of the top-k models with the smallest loss on the given sample. It requires knowing the true label, and thus is a cheating method that cannot be applied in practice. However, it shows a useful upper bound on the other methods that select k models for aggregation. • All Average: evenly average the outputs of all m models. • Random-k Average: randomly select k models and average their outputs. • Top-k Confidence: select the top-k models with the highest confidence (i.e., highest probability of the predicted class) on the given sample, and average their outputs. • Top-k DCS-KNN: apply an KNN based DCS method, i.e., find the K nearest neighbors of the given sample from the training data, select the top-k models assigned to the K nearest neighbors by Top-k Oracle, and average their outputs. • Top-k NN-LossPredict: train an L2-regression neural nets with m outputs to predict the per-sample losses on the m models by using a training set composed of all training samples and their losses on 7 the trained models. For aggregation, select the top-k models with the smallest predicted losses on the given sample, and average their outputs. We compare the three training methods used with the aforementioned aggregation methods with different k6. We summarize the highest test-set accuracy when k = 3 in Table 2, and show how the Table 1: Total time (secs.) of DivE2 and time only on SUBMODULARMAX. Dataset CIFAR10 CIFAR100 Fashion STL10 Total time 26790.75s 34658.27s 2922.89s 4065.81s SUBMODULARMAX 1857.36s 2697.36s 81.64s 378.84s test accuracy improves as training proceeds (i.e., as the total training batches on all models increases) in Fig. 2. In Fig. 2, solid curves denote DivE2, while dashed curves denote the three baseline training methods. Different colors refer to different aggregation methods, and gray curves represent single model performance (gray solid curves denote models trained by DivE2, while gray dashed curves denote models trained by other baselines). Similar results for k = 5 and k = 7 can be found in Appendix [71]. In addition, we also tested DivE2 without the “model selecting sample” constraint and any diversity, which equals to [41, 26, 42] in multi-class case. It achieves a test accuracy of 90.11% (vs. 94.36% of DivE2) on CIFAR10 and 71.01% (vs. 78.89% of DivE2) on CIFAR100 when using Top-3 NN-LP for aggregation. Table 2: The highest test accuracy (%) achieved by different combinations of ensemble training and aggregation methods on four datasets, with k = 3. DivE2 usually requires less training time than others to achieve the highest accuracy. The best non-cheating test accuracy (i.e., not Top-k Oracle) is highlighted below. Train:Aggregation CIFAR10 CIFAR100 Fashion STL10 BAG:Top-k Oracle (Cheat) 97.85 88.02 95.60 89.13 BAG:All Average 93.69 73.12 91.24 74.96 BAG:Random-k Avg. 93.05 72.86 91.00 74.03 BAG:Top-k Confidence 93.51 74.59 90.81 75.76 BAG:Top-k DCS-KNN 92.86 73.06 91.39 74.07 BAG:Top-k NN-L.P. 93.45 73.62 92.38 75.16 RND:Top-k Oracle (Cheat) 97.80 87.01 95.71 89.54 RND:All Average 93.28 75.71 91.13 77.13 RND:Random-k Avg. 93.11 75.56 90.77 76.75 RND:Top-k Confidence 93.51 76.54 91.07 77.93 RND:Top-k DCS-KNN 93.18 75.72 92.01 77.23 RND:Top-k NN-L.P. 93.69 76.69 92.48 77.28 DivE2:Top-k Oracle (Cheat) 98.01 90.12 96.40 90.18 DivE2:All Average 94.20 79.12 86.16 78.95 DivE2:Random-k Avg. 93.26 77.69 82.75 78.59 DivE2:Top-k Confidence 94.05 78.76 92.10 79.38 DivE2:Top-k DCS-KNN 93.81 77.61 92.10 79.23 DivE2:Top-k NN-L.P. 94.36 78.89 92.76 80.49 Top-k Oracle (cheating) is always the best, and provides an upper bound. In addition, DivE2 usually has higher upper bound than others, and thus has more potential for future improvement. Solid curves (DivE2) are usually higher than dashed curves (other baselines) in later stages, no matter which aggregation method is used. Although diversity introduces more difficult samples and lead to slower convergence in early stages, it helps accelerate convergence in later stages. Although the test accuracy on single models achieved by DivE2 is usually lower than those obtained by other baselines, the test accuracy on the ensemble is better. This indicates that different models indeed develop different local expertise. Hence, each model performs well good only in a local region but poorly elsewhere. However, their expertise is complementary, so the overall performance of the ensemble outperforms other baselines. We visualize the expertise of each model across different classes in Fig. 3 of Appendix [71] for Fashion-MNIST as an example. Among all aggregation methods, Top-k NN-LossPredict and Top-k DCS-KNN show comparable or better performance than other aggregation methods, but require much less aggregation costs when k is small. As shown in Appendix [71], when changing k from minority (k = 3) to majority (k = 7), the test accuracy of these two aggregation methods usually improves by a large margin. According to Table 1, DivE2 only requires a few extra computational time for data assignment. The model training dominates the computations but is highly parallelizable since the updates on different models are independent. Acknowledgments This material is based upon work supported by the National Science Foundation under Grant No. IIS-1162606, the National Institutes of Health under award R01GM103544, and by a Google, a Microsoft, and an Intel research award. This research is also supported by the CONIX Research Center, one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA. 6The k used in aggregation fixed, and is different from the k in training (which decreases from 6 to 1). 8 References [1] Wenruo Bai, Jeffrey Bilmes, and William S. Noble. Bipartite matching generalizations for peptide identification in tandem mass spectrometry. In 7th ACM Conference on Bioinformatics, Computational Biology, and Health Informatics (ACM BCB), ACM SIGBio, Seattle, WA, October 2016. ACM, ACM SIGBio. [2] Sumit Basu and Janara Christensen. Teaching classification boundaries to humans. In AAAI, pages 109–115, 2013. [3] Dhruv Batra, Payman Yadollahpour, Abner Guzman-Rivera, and Gregory Shakhnarovich. Diverse m-best solutions in markov random fields. In ECCV, pages 1–16, 2012. [4] Yoshua Bengio. Evolving Culture Versus Local Minima, pages 109–138. Springer Berlin Heidelberg, 2014. [5] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798– 1828, 2013. [6] Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, pages 41–48, 2009. [7] Leo Breiman. Bagging predictors. Machine Learning, 24(2):123–140, 1996. [8] Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001. [9] Cristian Buciluˇa, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’06, pages 535–541, 2006. [10] Rich Caruana, Alexandru Niculescu-Mizil, Geoff Crew, and Alex Ksikes. Ensemble selection from libraries of models. In Proceedings of the Twenty-first International Conference on Machine Learning, ICML ’04, 2004. [11] Paulo R. Cavalin, Robert Sabourin, and Ching Y. Suen. Dynamic selection approaches for multiple classifier systems. Neural Computing and Applications, 22(3):673–688, 2013. [12] Adam Coates, Honglak Lee, and Andrew Y. Ng. An analysis of single-layer networks in unsupervised feature learning. In AISTATS, pages 215–223, 2011. [13] M. Conforti and G. Cornuejols. Submodular set functions, matroids and the greedy algorithm: tight worst-case bounds and some generalizations of the Rado-Edmonds theorem. Discrete Applied Mathematics, 7(3):251–274, 1984. [14] G. Cornuéjols, M. Fisher, and G.L. Nemhauser. On the uncapacitated location problem. Annals of Discrete Mathematics, 1:163–177, 1977. [15] Andrew Cotter, Mahdi Milani Fard, Seungil You, Maya Gupta, and Jeff Bilmes. Constrained interacting submodular groupings. In International Conference on Machine Learning (ICML), Stockholm, Sweden, July 2018. [16] Rafael M.O. Cruz, Robert Sabourin, and George D.C. Cavalcanti. Dynamic classifier selection: Recent advances and perspectives. Information Fusion, 41:195–216, 2018. [17] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. [18] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011. [19] B. Efron. Bootstrap methods: Another look at the jackknife. The Annals of Statistics, 7(1):1–26, 1979. 9 [20] Gamaleldin F. Elsayed, Shreya Shankar, Brian Cheung, Nicolas Papernot, Alex Kurakin, Ian J. Goodfellow, and Jascha Sohl-Dickstein. Adversarial examples that fool both human and computer vision. arXiv, 2018. [21] M. L. Fisher, G. L. Nemhauser, and L. A. Wolsey. An analysis of approximations for maximizing submodular set functions-II. Mathematical Programming Studies, 8, 1978. [22] Madalina Fiterau and Artur Dubrawski. Projection retrieval for classification. In Advances in Neural Information Processing Systems 25, pages 3023–3031. 2012. [23] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 55(1):119–139, 1997. [24] Satoru Fujishige. Submodular functions and optimization. Annals of discrete mathematics. Elsevier, 2005. [25] Jennifer Gillenwater, Alex Kulesza, and Ben Taskar. Near-optimal map inference for determinantal point processes. In NIPS, pages 2735–2743, 2012. [26] Abner Guzmán-rivera, Dhruv Batra, and Pushmeet Kohli. Multiple choice learning: Learning to produce multiple structured outputs. In Advances in Neural Information Processing Systems 25, pages 1799–1807. 2012. [27] Shizhong Han, Zibo Meng, AHMED-SHEHAB KHAN, and Yan Tong. Incremental boosting convolutional neural network for facial action unit recognition. In Advances in Neural Information Processing Systems (NIPS), pages 109–117. 2016. [28] L. K. Hansen and P. Salamon. Neural network ensembles. IEEE Transactions on Pattern Analysis and Machine Intelligence, 12(10):993–1001, 1990. [29] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. [30] Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. [31] Tin Kam Ho. Random decision forests. In Proceedings of 3rd International Conference on Document Analysis and Recognition, volume 1, pages 278–282, 1995. [32] Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E. Hopcroft, and Kilian Q. Weinberger. Snapshot ensembles: Train 1, get M for free. In International Conference on Learning Representations (ICLR), 2017. [33] Robert A. Jacobs, Michael I. Jordan, Steven J. Nowlan, and Geoffrey E. Hinton. Adaptive mixtures of local experts. Neural Computing, 3(1):79–87, 1991. [34] Michael I. Jordan and Robert A. Jacobs. Hierarchical mixtures of experts and the em algorithm. Neural Computing, 6(2):181–214, 1994. [35] Faisal Khan, Xiaojin (Jerry) Zhu, and Bilge Mutlu. How do humans teach: On curriculum learning and teaching dimension. In NIPS, pages 1449–1457, 2011. [36] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. [37] Albert H. R. Ko, Robert Sabourin, and Alceu Souza Britto, Jr. From dynamic classifier selection to dynamic ensemble selection. Pattern Recognition, 41(5):1718–1731, 2008. [38] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. [39] Anders Krogh and Jesper Vedelsby. Neural network ensembles, cross validation, and active learning. In Advances in Neural Information Processing Systems (NIPS), pages 231–238. 1995. 10 [40] M. Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In NIPS, pages 1189–1197, 2010. [41] Stefan Lee, Senthil Purushwalkam, Michael Cogswell, David J. Crandall, and Dhruv Batra. Why m heads are better than one: Training a diverse ensemble of deep networks. arXiv, abs/1511.06314, 2015. [42] Stefan Lee, Senthil Purushwalkam Shiva Prakash, Michael Cogswell, Viresh Ranjan, David Crandall, and Dhruv Batra. Stochastic multiple choice learning for training diverse deep ensembles. In Advances in Neural Information Processing Systems 29, pages 2119–2127. 2016. [43] Hui Lin and Jeff Bilmes. Word alignment via submodular maximization over matroids. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies: short papers-Volume 2, pages 170–175. Association for Computational Linguistics, 2011. [44] Hui Lin and Jeff A. Bilmes. A class of submodular functions for document summarization. In ACL, pages 510–520, 2011. [45] Hui Lin, Jeff A. Bilmes, and Shasha Xie. Graph-based submodular selection for extractive summarization. In Proc. IEEE Automatic Speech Recognition and Understanding (ASRU), Merano, Italy, December 2009. [46] S. Lloyd. Least squares quantization in pcm. IEEE Transactions on Information Theory (TIT), 28(2):129–137, 1982. [47] Christopher J. Merz. Dynamical Selection of Learning Algorithms, pages 281–290. Springer New York, 1996. [48] Michel Minoux. Accelerated greedy algorithms for maximizing submodular set functions. In Optimization Techniques, volume 7 of Lecture Notes in Control and Information Sciences, chapter 27, pages 234–243. Springer Berlin Heidelberg, 1978. [49] Baharan Mirzasoleiman, Ashwinkumar Badanidiyuru, Amin Karbasi, Jan Vondrák, and Andreas Krause. Lazier than lazy greedy. In AAAI, pages 1812–1818, 2015. [50] Mohammad Moghimi, Mohammad Saberian, Jian Yang, Li-Jia Li, Nuno Vasconcelos, and Serge Belongie. Boosted convolutional neural networks. In British Machine Vision Conference (BMVC), 2016. [51] G. L. Nemhauser, L. A. Wolsey, and M. L. Fisher. An analysis of approximations for maximizing submodular set functions-I. Mathematical Programming, 14(1):265–294, 1978. [52] Yurii Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1):127–152, 2005. [53] Ioannis Partalas, Grigorios Tsoumakas, and Ioannis Vlahavas. Focused ensemble selection: A diversity-based method for greedy ensemble selection. In European Conference on Artificial Intelligence (ECML), pages 117–121, 2008. [54] Adarsh Prasad, Stefanie Jegelka, and Dhruv Batra. Submodular meets structured: Finding diverse subsets in exponentially-large structured item sets. In NIPS, pages 2645–2653, 2014. [55] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, 000+ questions for machine comprehension of text. In EMNLP, 2016. [56] Mark Sandler, Andrew G. Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Inverted residuals and linear bottlenecks: Mobile networks for classification, detection and segmentation. arXiv, 2018. [57] Robert E. Schapire. The strength of weak learnability. Machine Learning, 5(2):197–227, 1990. [58] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In International Conference on Learning Representations (ICLR), 2017. 11 [59] Saurabh Singh, Derek Hoiem, and David Forsyth. Swapout: Learning an ensemble of deep architectures. In Advances in Neural Information Processing Systems (NIPS), pages 28–36. 2016. [60] Valentin I. Spitkovsky, Hiyan Alshawi, and Daniel Jurafsky. Baby Steps: How “Less is More” in unsupervised dependency parsing. In NIPS 2009 Workshop on Grammar Induction, Representation of Language and Language Learning, 2009. [61] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research (JMLR), 15:1929–1958, 2014. [62] James Steven Supancic III and Deva Ramanan. Self-paced learning for long-term tracking. In CVPR, pages 2379–2386, 2013. [63] C. Szegedy, Wei Liu, Yangqing Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Conference on Computer Vision and Pattern Recognition (CVPR), volume 00, pages 1–9, 2015. [64] Kevin Tang, Vignesh Ramanathan, Li Fei-fei, and Daphne Koller. Shifting weights: Adapting object detectors from image to video. In NIPS, pages 638–646, 2012. [65] Ye Tang, Yu-Bin Yang, and Yang Gao. Self-paced dictionary learning for image classification. In MM, pages 833–836, 2012. [66] F. Tramèr, A. Kurakin, N. Papernot, I. Goodfellow, D. Boneh, and P. McDaniel. Ensemble adversarial training: Attacks and defenses. In International Conference on Learning Representations (ICLR), 2018. [67] Andreas Veit, Michael J Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In Advances in Neural Information Processing Systems (NIPS), pages 550–558. 2016. [68] K. Woods, W. P. Kegelmeyer, and K. Bowyer. Combination of multiple classifiers using local accuracy estimates. IEEE Transactions on Pattern Analysis and Machine Intelligence, 19(4):405–410, 1997. [69] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, 2017. [70] Tianyi Zhou and Jeff Bilmes. Minimax curriculum learning: Machine teaching with desirable difficulties and scheduled diversity. In International Conference on Learning Representations (ICLR), 2018. [71] Tianyi Zhou, Shengjie Wang, and Jeff Bilmes. Supplementary material for diverse ensemble evolution. In NIPS, 2018. [72] Zhi-Hua Zhou, Jianxin Wu, and Wei Tang. Ensembling neural networks: Many could be better than all. Artificial Intelligence, 137(1):239–263, 2002. [73] Xingquan Zhu, Xindong Wu, and Ying Yang. Dynamic classifier selection for effective mining from noisy data streams. In Data Mining, 2004. ICDM ’04. Fourth IEEE International Conference on, pages 305–312, 2004. 12
2018
213
7,379
Q-learning with Nearest Neighbors Devavrat Shah ⇤ Massachusetts Institute of Technology devavrat@mit.edu Qiaomin Xie ⇤ Massachusetts Institute of Technology qxie@mit.edu Abstract We consider model-free reinforcement learning for infinite-horizon discounted Markov Decision Processes (MDPs) with a continuous state space and unknown transition kernel, when only a single sample path under an arbitrary policy of the system is available. We consider the Nearest Neighbor Q-Learning (NNQL) algorithm to learn the optimal Q function using nearest neighbor regression method. As the main contribution, we provide tight finite sample analysis of the convergence rate. In particular, for MDPs with a d-dimensional state space and the discounted factor γ 2 (0, 1), given an arbitrary sample path with “covering time” L, we establish that the algorithm is guaranteed to output an "-accurate estimate of the optimal Q-function using eO " L/("3(1 −γ)7) # samples. For instance, for a wellbehaved MDP, the covering time of the sample path under the purely random policy scales as eO " 1/"d# , so the sample complexity scales as eO " 1/"d+3# . Indeed, we establish a lower bound that argues that the dependence of e⌦ " 1/"d+2# is necessary. 1 Introduction Markov Decision Processes (MDPs) are natural models for a wide variety of sequential decisionmaking problems. It is well-known that the optimal control problem in MDPs can be solved, in principle, by standard algorithms such as value and policy iterations. These algorithms, however, are often not directly applicable to many practical MDP problems for several reasons. First, they do not scale computationally as their complexity grows quickly with the size of the state space and especially for continuous state space. Second, in problems with complicated dynamics, the transition kernel of the underlying MDP is often unknown, or an accurate model thereof is lacking. To circumvent these difficulties, many model-free Reinforcement Learning (RL) algorithms have been proposed, in which one estimates the relevant quantities of the MDPs (e.g., the value functions or the optimal policies) from observed data generated by simulating the MDP. A popular model-free Reinforcement Learning (RL) algorithm is the so called Q-learning [47], which directly learns the optimal action-value function (or Q function) from the observations of the system trajectories. A major advantage of Q-learning is that it can be implemented in an online, incremental fashion, in the sense that Q-learning can be run as data is being sequentially collected from the system operated/simulated under some policy, and continuously refines its estimates as new observations become available. The behaviors of standard Q-learning in finite state-action problems have by now been reasonably understood; in particular, both asymptotic and finite-sample convergence guarantees have been established [43, 22, 41, 18]. In this paper, we consider the general setting with continuous state spaces. For such problems, existing algorithms typically make use of a parametric function approximation method, such as a linear approximation [27], to learn a compact representation of the action-value function. In many of ⇤Both authors are affiliated with Laboratory for Information and Decision Systems (LIDS). DS is with the Department of EECS as well as Statistics and Data Science Center at MIT. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. the recently popularized applications of Q-learning, much more expressive function approximation method such as deep neural networks have been utilized. Such approaches have enjoyed recent empirical success in game playing and robotics problems [38, 29, 14]. Parametric approaches typically require careful selection of approximation method and parametrization (e.g., the architecture of neural networks). Further, rigorous convergence guarantees of Q-learning with deep neural networks are relatively less understood. In comparison, non-parametric approaches are, by design, more flexible and versatile. However, in the context of model-free RL with continuous state spaces, the convergence behaviors and finite-sample analysis of non-parametric approaches are less understood. Summary of results. In this work, we consider a natural combination of the Q-learning with Kernel-based nearest neighbor regression for continuous state-space MDP problems, denoted as Nearest-Neighbor based Q-Learning (NNQL). As the main result, we provide finite sample analysis of NNQL for a single, arbitrary sequence of data for any infinite-horizon discounted-reward MDPs with continuous state space. In particular, we show that the algorithm outputs an "-accurate (with respect to supremum norm) estimate of the optimal Q-function with high probability using a number of observations that depends polynomially on ", the model parameters and the “cover time” of the sequence of the data or trajectory of the data utilized. For example, if the data was sampled per a completely random policy, then our generic bound suggests that the number of samples would scale as eO(1/"d+3) where d is the dimension of the state space. We establish effectively matching lower bound stating that for any policy to learn optimal Q function within " approximation, the number of samples required must scale as e⌦(1/"d+2). In that sense, our policy is nearly optimal. Our analysis consists of viewing our algorithm as a special case of a general biased stochastic approximation procedure, for which we establish non-asymptotic convergence guarantees. Key to our analysis is a careful characterization of the bias effect induced by nearest-neighbor approximation of the population Bellman operator, as well as the statistical estimation error due to the variance of finite, dependent samples. Specifically, the resulting Bellman nearest neighbor operator allows us to connect the update rule of NNQL to a class of stochastic approximation algorithms, which have biased noisy updates. Note that traditional results from stochastic approximation rely on unbiased updates and asymptotic analysis [35, 43]. A key step in our analysis involves decomposing the update into two sub-updates, which bears some similarity to the technique used by [22]. Our results make improvement in characterizing the finite-sample convergence rates of the two sub-updates. In summary, the salient features of our work are • Unknown system dynamics: We assume that the transition kernel and reward function of the MDP is unknown. Consequently, we cannot exactly evaluate the expectation required in standard dynamic programming algorithms (e.g., value/policy iteration). Instead, we consider a samplebased approach which learns the optimal value functions/policies by directly observing data generated by the MDP. • Single sample path: We are given a single, sequential samples obtained from the MDP operated under an arbitrary policy. This in particular means that the observations used for learning are dependent. Existing work often studies the easier settings where samples can be generated at will; that is, one can sample any number of (independent) transitions from any given state, or reset the system to any initial state. For example, Parallel Sampling in [23]. We do not assume such capabilities, but instead deal with the realistic, challenging setting with a single path. • Online computation: We assume that data arrives sequentially rather than all at once. Estimates are updated in an online fashion upon observing each new sample. Moreover, as in standard Q-learning, our approach does not store old data. In particular, our approach differs from other batch methods, which need to wait for all data to be received before starting computation, and require multiple passes over the data. Therefore, our approach is space efficient, and hence can handle the data-rich scenario with a large, increasing number of samples. • Non-asymptotic, near optimal guarantees: We characterize the finite-sample convergence rate of our algorithm; that is, how many samples are needed to achieve a given accuracy for estimating the optimal value function. Our analysis is nearly tight in that we establish a lower bound that nearly matches our generic upper bound specialized to setting when data is generated per random policy or more generally any policy with random exploration component to it. While there is a large and growing literature on Reinforcement Learning for MDPs, to the best of our knowledge, ours is the first result on Q-learning that simultaneously has all of the above four features. 2 Table 1: Summary of relevant work. See Appendix A for details. Specific work Method Continuous Unknown Single Online Non-asymptotic state space transition Kernel sample path update guarantees [10], [36], [37] Finite-state approximation Yes No No Yes Yes [43], [22], [41] Q-learning No Yes Yes Yes No [20], [3], [18] Q-learning No Yes Yes Yes Yes [23] Q-learning No Yes No Yes Yes [42],[28] Q-learning Yes Yes Yes Yes No [33], [32] Kernel-based approximation Yes Yes No No No [19] Value/Policy iteration No Yes No No Yes [44] Parameterized TD-learning No Yes Yes Yes No [12] Parameterized TD-learning No Yes No Yes Yes [8] Parameterized TD-learning No Yes Yes Yes Yes [9] Non-parametric LP No Yes No No Yes [30] Fitted value iteration Yes Yes No No Yes [1] Fitted policy iteration Yes Yes Yes No Yes Our work Q-learning Yes Yes Yes Yes Yes We summarize comparison with relevant prior works in Table 1. Detailed discussion can be found in Appendix A. 2 Setup In this section, we introduce necessary notations, definitions for the framework of Markov Decision Processes that will be used throughout the paper. We also precisely define the question of interest. Notation. For a metric space E endowed with metric ⇢, we denote by C(E) the set of all bounded and measurable functions on E. For each f 2 C(E), let kfk1 := supx2E|f(x)| be the supremum norm, which turns C(E) into a Banach space B. Let Lip(E, M) denote the set of Lipschitz continuous functions on E with Lipschitz bound M, i.e., Lip(E, M) = {f 2 C(E) | |f(x) −f(y)| M⇢(x, y), 8x, y 2 E} . The indicator function is denoted by 1{·}. For each integer k ≥0, let [k] , {1, 2, . . . , k}. Markov Decision Process. We consider a general setting where an agent interacts with a stochastic environment. This interaction is modeled as a discrete-time discounted Markov decision process (MDP). An MDP is described by a five-tuple (X, A, p, r, γ), where X and A are the state space and action space, respectively. We shall utilize t 2 N to denote time. Let xt 2 X be state at time t. At time t, the action chosen is denoted as at 2 A. Then the state evolution is Markovian as per some transition probability kernel with density p (with respect to the Lebesgue measure λ on X). That is, Pr(xt+1 2 B|xt = x, at = a) = Z B p(y|x, a)λ(dy) (1) for any measurable set B 2 X. The one-stage reward earned at time t is a random variable Rt with expectation E[Rt|xt = x, at = a] = r(x, a), where r : X ⇥A ! R is the expected reward function. Finally, γ 2 (0, 1) is the discount factor and the overall reward of interest is P1 t=0 γtRt The goal is to maximize the expected value of this reward. Here we consider a distance function ⇢: X ⇥X ! R+ so that (X, ⇢) forms a metric space. For the ease of exposition, we use Z for the joint state-action space X ⇥A. We start with the following standard assumptions on the MDP: Assumption 1 (MDP Regularity). We assume that: (A1.) The continuous state space X is a compact subset of Rd; (A2.) A is a finite set of cardinality |A|; (A3.) The one-stage reward Rt is nonnegative and uniformly bounded by Rmax, i.e., 0 Rt Rmax almost surely. For each a 2 A, r(·, a) 2 Lip(X, Mr) for some Mr > 0. (A4.) The transition probability kernel p satisfies |p(y|x, a) −p(y|x0, a)| Wp(y)⇢(x, x0) , 8a 2 A, 8x, x0, y 2 X, where the function Wp(·) satisfies R X Wp(y)λ(dy) Mp. 3 The first two assumptions state that the state space is compact and the action space is finite. The third and forth stipulate that the reward and transition kernel are Lipschitz continuous (as a function of the current state). Our Lipschitz assumptions are identical to (or less restricted than) those used in the work of [36], [11], and [17]. In general, this type of Lipschitz continuity assumptions are standard in the literature on MDPs with continuous state spaces; see, e.g., the work of [15, 16], and [6]. A Markov policy ⇡(·|x) gives the probability of performing action a 2 A given the current state x. A deterministic policy assigns each state a unique action. The value function for each state x under policy ⇡, denoted by V ⇡(x), is defined as the expected discounted sum of rewards received following the policy ⇡from initial state x, i.e., V ⇡(x) = E⇡[P1 t=0 γtRt|x0 = x]. The action-value function Q⇡under policy ⇡is defined by Q⇡(x, a) = r(x, a) + γ R y p(y|x, a)V ⇡(y)λ(dy). The number Q⇡(x, a) is called the Q-value of the pair (x, a), which is the return of initially performing action a at state s and then following policy ⇡. Define β , 1/(1 −γ) and Vmax , βRmax. Since all the rewards are bounded by Rmax, it is easy to see that the value function of every policy is bounded by Vmax [18, 40]. The goal is to find an optimal policy ⇡⇤that maximizes the value from any start state. The optimal value function V ⇤is defined as V ⇤(x) = V ⇡⇤(x) = sup⇡V ⇡(x), 8x 2 X. The optimal action-value function is defined as Q⇤(x, a) = Q⇡⇤(x, a) = sup⇡Q⇡(x, a). The Bellman optimality operator F is defined as (FQ)(x, a) = r(x, a) + γE  max b2A Q(x0, b) | x, a ( = r(x, a) + γ Z X p(y|x, a) max b2A Q(y, b)λ(dy). It is well known that F is a contraction with factor γ on the Banach space C(Z) [7, Chap. 1]. The optimal action-value function Q⇤is the unique solution of the Bellman’s equation Q = FQ in C(X ⇥A). In fact, under our setting, it can be show that Q⇤is bounded and Lipschitz. This is stated below and established in Appendix B. Lemma 1. Under Assumption 1, the function Q⇤satisfies that kQ⇤k1 Vmax and that Q⇤(·, a) 2 Lip(X, Mr + γVmaxMp) for each a 2 A. 3 Reinforcement Learning Using Nearest Neighbors In this section, we present the nearest-neighbor-based reinforcement learning algorithm. The algorithm is based on constructing a finite-state discretization of the original MDP, and combining Q-learning with nearest neighbor regression to estimate the Q-values over the discretized state space, which is then interpolated and extended to the original continuous state space. In what follows, we shall first describe several building blocks for the algorithm in Sections 3.1–3.4, and then summarize the algorithm in Section 3.5. 3.1 State Space Discretization Let h > 0 be a pre-specified scalar parameter. Since the state space X is compact, one can find a finite set Xh , {ci}Nh i=1 of points in X such that min i2[Nh] ⇢(x, ci) < h, 8x 2 X. The finite grid Xh is called an h-net of X, and its cardinality n ⌘Nh can be chosen to be the h-covering number of the metric space (X, ⇢). Define Zh = Xh ⇥A. Throughout this paper, we denote by Bi the ball centered at ci with radius h; that is, Bi , {x 2 X : ⇢(x, ci) h} . 3.2 Nearest Neighbor Regression Suppose that we are given estimated Q-values for the finite subset of states Xh = {ci}n i=1, denoted by q = {q(ci, a), ci 2 Xh, a 2 A}. For each state-action pair (x, a) 2 X ⇥A, we can predict its Q-value via a regression method. We focus on nonparametric regression operators that can be written as nearest neighbors averaging in terms of the data q of the form (ΓNNq)(x, a) = Pn i=1K(x, ci)q(ci, a), 8x 2 X, a 2 A, (2) where K(x, ci) ≥0 is a weighting kernel function satisfying Pn i=1 K(x, ci) = 1, 8x 2 X. Equation (2) defines the so-called Nearest Neighbor (NN) operator ΓNN, which maps the space C(Xh ⇥A) 4 into the set of all bounded function over X ⇥A. Intuitively, in (2) one assesses the Q-value of (x, a) by looking at the training data where the action a has been applied, and by averaging their values. It can be easily checked that the operator ΓNN is non-expansive in the following sense: kΓNNq −ΓNNq0k1 kq −q0k1 , 8q, q0 2 C(Xh ⇥A). (3) This property will be crucially used for establishing our results. K is assumed to satisfy K(x, y) = 0 if ⇢(x, y) ≥h, 8x 2 X, y 2 Xh, (4) where h is the discretization parameter defined in Section 3.1.2 This means that the values of states located in the neighborhood of x are more influential in the averaging procedure (2). There are many possible choices for K. In Section C we describe three representative choices that correspond to k-Nearest Neighbor Regression, Fixed-Radius Near Neighbor Regression and Kernel Regression. 3.3 A Joint Bellman-NN Operator Now, we define the joint Bellman-NN (Nearest Neighbor) operator. As will become clear subsequently, it is this operator that the algorithm aims to approximate, and hence it plays a crucial role in the subsequent analysis. For a function q : Zh ! R, we denote by ˜Q , (ΓNNq) the nearest-neighbor average extension of q to Z; that is, ˜Q(x, a) = (ΓNNq)(x, a), 8(x, a) 2 Z. The joint Bellman-NN operator G on R|Zh| is defined by composing the original Bellman operator F with the NN operator ΓNN and then restricting to Zh; that is, for each (ci, a) 2 Zh, (Gq)(ci, a) , (FΓNNq)(ci, a) = (F ˜Q)(ci, a) = r(ci, a) + γE  max b2A (ΓNNq)(x0, b) | ci, a ( . (5) It can be shown that G is a contraction operator with modulus γ mapping R|Zh| to itself, thus admitting a unique fixed point, denoted by q⇤ h; see Appendix E.2. 3.4 Covering Time of Discretized MDP As detailed in Section 3.5 to follow, our algorithm uses data generated by an abritrary policy ⇡for the purpose of learning. The goal of our approach is to estimate the Q-values of every state. For there to be any hope to learn something about the value of a given state, this state (or its neighbors) must be visited at least once. Therefore, to study the convergence rate of the algorithm, we need a way to quantify how often ⇡samples from different regions of the state-action space Z = X ⇥A. Following the approach taken by [18] and [3], we introduce the notion of the covering time of MDP under a policy ⇡. This notion is particularly suitable for our setting as our algorithm is based on asynchronous Q-learning (that is, we are given a single, sequential trajectory of the MDP, where at each time step one state-action pair is observed and updated), and the policy ⇡may be non-stationary. In our continuous state space setting, the covering time is defined with respect to the discretized space Zh, as follows: Definition 1 (Covering time of discretized MDP). For each 1 i n = Nh and a 2 A, a ballaction pair (Bi, a) is said to be visited at time t if xt 2 Bi and at = a. The discretized state-action space Zh is covered by the policy ⇡if all the ball-action pairs are visited at least once under the policy ⇡. Define ⌧⇡,h(x, t), the covering time of the MDP under the policy ⇡, as the minimum number of steps required to visit all ball-action pairs starting from state x 2 X at time-step t ≥0. Formally, ⌧⇡,h(x, t) is defined as min n s ≥0 : xt =x, 8iNh, a2A, 9ti,a 2[t, t+s], such that xti,a 2Bi and ati,a =a, under ⇡ o , with notation that minimum over empty set is 1. We shall assume that there exists a policy ⇡with bounded expected cover time, which guarantees that, asymptotically, all the ball-action pairs are visited infinitely many times under the policy ⇡. 2This assumption is not absolutely necessary, but is imposed to simplify subsequent analysis. In general, our results hold as long as K(x, y) decays sufficiently fast with the distance ⇢(x, y). 5 Assumption 2. There exists an integer Lh < 1 such that E[⌧⇡,h(x, t)] Lh, 8x 2 X, t > 0. Here the expectation is defined with respect to randomness introduced by Markov kernel of MDP as well as the policy ⇡. In general, the covering time can be large in the worst case. In fact, even with a finite state space, it is easy to find examples where the covering time is exponential in the number of states for every policy. For instance, consider an MDP with states 1, 2, . . . , N, where at any state i, the chain is reset to state 1 with probability 1/2 regardless of the action taken. Then, every policy takes exponential time to reach state N starting from state 1, leading to an exponential covering time. To avoid the such bad cases, some additional assumptions are needed to ensure that the MDP is well-behaved. For such MDPs, there are a variety of polices that have a small covering time. Below we focus on a class of MDPs satisfying a form of the uniform ergodic assumptions, and show that the standard "-greedy policy (which includes the purely random policy as special case by setting " = 1) has a small covering time. This is done in the following two Propositions. Proofs can be found in Appendix D. Proposition 1. Suppose that the MDP satisfies the following: there exists a probability measure ⌫ on X, a number ' > 0 and an integer m ≥1 such that for all x 2 X, all t ≥0 and all policies µ, Prµ (xm+t 2 ·| xt = x) ≥'⌫(·). (6) Let ⌫min , mini2[n] ⌫(Bi), where we recall that n ⌘Nh = |Xh| is the cardinality of the discretized state space. Then the expected covering time of "-greedy is upper bounded by Lh = O ⇣ m|A| "'⌫min log(n|A|) ⌘ . Proposition 2. Suppose that the MDP satisfies the following: there exists a probability measure ⌫on X, a number ' > 0 and an integer m ≥1 such that for all x 2 X, all t ≥0, there exists a sequence of actions ˆa(x) = (ˆa1, . . . , ˆam) 2 Am, Pr (xm+t 2 ·| xt = x, at = ˆa1, . . . , at+m−1 = ˆam) ≥'⌫(·). (7) Let ⌫min , mini2[n] ⌫(Bi), where we recall that n ⌘Nh = |Xh| is the cardinality of the discretized state space. Then the expected covering time of "-greedy is upper bounded by Lh = O ⇣ m|A|m+1 "m+1'⌫min log(n|A|) ⌘ . 3.5 Q-learning using Nearest Neighbor We describe the nearest-neighbor Q-learning (NNQL) policy. Like Q-learning, it is a model-free policy for solving MDP. Unlike standard Q-learning, it is (relatively) efficient to implement as it does not require learning the Q function over entire space X ⇥A. Instead, we utilize the nearest neighbor regressed Q function using the learned Q values restricted to Zh. The policy assumes access to an existing policy ⇡(which is sometimes called the “exploration policy”, and need not have any optimality properties) that is used to sample data points for learning. The pseudo-code of NNQL is described in Policy 1. At each time step t, action at is performed from state Yt as per the given (potentially non-optimal) policy ⇡, and the next state Yt+1 is generated according to p(·|Yt, at). Note that the sequence of observed states (Yt) take continuous values in the state space X. The policy runs over iteration with each iteration lasting for a number of time steps. Let k denote iteration count, Tk denote time when iteration k starts for k 2 N. Initially, k = 0, T0 = 0, and for t 2 [Tk, Tk+1), the policy is in iteration k. The iteration is updated from k to k + 1 when starting with t = Tk, all ball-action (Bi, a) pairs have been visited at least once. That is, Tk+1 = Tk + ⌧⇡,h(YTk, Tk). In the policy description, the counter Nk(ci, a) records how many times the ball-action pair (Bi, a) has been visited from the beginning of iteration k till the current time t; that is, Nk(ci, a) = Pt s=Tk 1{Ys 2 Bi, as = a}. By definition, the iteration k ends at the first time step for which min(ci,a) Nk(ci, a) > 0. During each iteration, the policy keeps track of the Q-function over the finite set Zh. Specifically, let qk denote the approximate Q-values on Zh within iteration k. The policy also maintains Gkqk(ci, at), which is a biased empirical estimate of the joint Bellman-NN operator G applied to the estimates qk. 6 Policy 1 Nearest-Neighbor Q-learning Input: Exploration policy ⇡, discount factor γ, number of steps T, bandwidth parameter h, and initial state Y0. Construct discretized state space Xh; initialize t = k = 0, ↵0 = 1, q0 ⌘0; Foreach (ci, a) 2 Zh, set N0(ci, a) = 0; end repeat Draw action at ⇠⇡(·|Yt) and observe reward Rt; generate the next state Yt+1 ⇠p(·|Yt, at); Foreach i such that Yt 2 Bi do ⌘N = 1 Nk(ci,at)+1; if Nk(ci, at) > 0 then (Gkqk)(ci, at) = (1 −⌘N)(Gkqk)(ci, at) + ⌘N " Rt + γ maxb2A(ΓNNqk)(Yt+1, b) # ; else (Gkqk)(ci, at) = Rt + γ maxb2A(ΓNNqk)(Yt+1, b); end Nk(ci, at) = Nk(ci, at) + 1 end if min(ci,a)2Zh Nk(ci, a) > 0 then Foreach (ci, a) 2 Zh do qk+1(ci, a) = (1 −↵k)qk(ci, a) + ↵k(Gkqk)(ci, a); end k = k + 1; ↵k = β β+k; Foreach (ci, a) 2 Zh do Nk(ci, a) = 0; end end t = t + 1; until t ≥T; return ˆq = qk At each time step t 2 [Tk, Tk+1) within iteration k, if the current state Yt falls in the ball Bi, then the corresponding value (Gkqk)(ci, at) is updated as (Gkqk)(ci, at) = (1 −⌘N)(Gkqk)(ci, at) + ⌘N ⇣ Rt + γ max b2A (ΓNNqk)(Yt+1, b) ⌘ , (8) where ⌘N = 1 Nk(ci,at)+1. We notice that the above update rule computes, in an incremental fashion, an estimate of the joint Bellman-NN operator G applied to the current qk for each discretized stateaction pair (ci, a), using observations Yt that fall into the neighborhood Bi of ci. This nearest-neighbor approximation causes the estimate to be biased. At the end of iteration k, i.e., at time step t = Tk+1 −1, a new qk+1 is generated as follows: for each (ci, a) 2 Zh, qk+1(ci, a) = (1 −↵k)qk(ci, a) + ↵k(Gkqk)(ci, a). (9) At a high level, this update is similar to standard Q-learning updates — the Q-values are updated by taking a weighted average of qk, the previous estimate, and Gkqk, an one-step application of the Bellman operator estimated using newly observed data. There are two main differences from standard Q-learning: 1) the Q-value of each (ci, a) is estimated using all observations that lie in its neighborhood — a key ingredient of our approach; 2) we wait until all ball-action pairs are visited to update their Q-values, all at once. Given the output ˆq of Policy 1, we obtain an approximate Q-value for each (continuous) state-action pair (x, a) 2 Z via the nearest-neighbor average operation, i.e., QT h (x, a) = (ΓNNˆq) (x, a); here the superscript T emphasizes that the algorithm is run for T time steps with a sample size of T. 4 Main Results As a main result of this paper, we obtain finite-sample analysis of NNQL policy. Specifically, we find that the NNQL policy converges to an "-accurate estimate of the optimal Q⇤with time T that has polynomial dependence on the model parameters. The proof can be found in Appendix E. 7 Theorem 1. Suppose that Assumptions 1 and 2 hold. With notation β = 1/(1 −γ) and C = Mr + γVmaxMp, for a given " 2 (0, 4Vmaxβ), define h⇤⌘h⇤(") = " 4βC . Let Nh⇤be the h⇤covering number of the metric space (X, ⇢). For a universal constant C0 > 0, after at most T = C0 Lh⇤V 3 maxβ4 "3 log ✓2 δ ◆ log ✓Nh⇤|A| V 2 maxβ4 δ"2 ◆ steps, with probability at least 1 −δ, we have //QT h⇤−Q⇤// 1 ". The theorem provides sufficient conditions for NNQL to achieve " accuracy (in sup norm) for estimating the optimal action-value function Q⇤. The conditions involve the bandwidth parameter h⇤and the number of time steps T, both of which depend polynomially on the relevant problem parameters. Here an important parameter is the covering number Nh⇤: it provides a measure of the “complexity” of the state space X, replacing the role of the cardinality |X| in the context of discrete state spaces. For instance, for a unit volume ball in Rd, the corresponding covering number Nh⇤scales as O " (1/h⇤)d# (cf. Proposition 4.2.12 in [46]). We take note of several remarks on the implications of the theorem. Sample complexity: The number of time steps T, which also equals the number of samples needed, scales linearly with the covering time Lh⇤of the underlying policy ⇡to sample data for the given MDP. Note that Lh⇤depends implicitly on the complexities of the state and action space as measured by Nh⇤and |A|. In the best scenario, Lh⇤, and hence T as well, is linear in Nh⇤⇥|A| (up to logarithmic factors), in which case we achieve (near) optimal linear sample complexity. The sample complexity T also depends polynomially on the desired accuracy "−1 and the effective horizon β = 1/(1 −γ) of the discounted MDP — optimizing the exponents of the polynomial dependence remains interesting future work. Space complexity: The space complexity of NNQL is O(Nh⇤⇥|A|), which is necessary for storing the values of qk. Note that NNQL is a truly online algorithm, as each data point (Yt, at) is accessed only once upon observation and then discarded; no storage of them is needed. Computational complexity: In terms of computational complexity, the algorithm needs to compute the NN operator ΓNN and maximization over A in each time step, as well as to update the values of qk for all ci 2 Xh⇤and a 2 A in each iteration. Therefore, the worst-case computational complexity per time step is O(Nh⇤⇥|A|), with an overall complexity of O(T ⇥Nh⇤⇥|A|). The computation can be potentially sped up by using more efficient data structures and algorithms for finding (approximate) nearest neighbors, such as k-d trees [5], random projection trees [13], Locality Sensitive Hashing [21] and boundary trees [26]. Choice of h⇤: NNQL requires as input a user-specified parameter h, which determines the discretization granularity of the state space as well as the bandwidth of the (kernel) nearest neighbor regression. Theorem 1 provides a desired value h⇤= "/4βC, where we recall that C is the Lipschitz parameter of the optimal action-value function Q⇤(see Lemma 1). Therefore, we need to use a small h⇤if we demand a small error ", or if Q⇤fluctuates a lot with a large C. 4.1 Special Cases and Lower Bounds Theorem 1, combined with Proposition 1, immediately yield the following bound that quantify the number of samples required to obtain an "-optimal action-value function with high probability, if the sample path is generated per the uniformly random policy. The proof is given in Appendix F. Corollary 1. Suppose that Assumptions 1 and 2 hold, with X = [0, 1]d. Assume that the MDP satisfies the following: there exists a uniform probability measure ⌫over X, a number ' > 0 and an integer m ≥1 such that for all x 2 X, all t ≥0 and all policies µ, Prµ (xm+t 2 ·| xt = x) ≥'⌫(·). After at most T =  1 "d+3 log3 ✓1 δ" ◆ steps, where ⌘(|A|, d, β, m) is a number independent of " and δ, we have //QT h⇤−Q⇤// 1 " with probability at least 1 −δ. Corollary 1 states that the sample complexity of NNQL scales as eO " 1 "d+3 # . We will show that this is effectively necessary by establishing a lower bound on any algorithm under any sampling policy! The proof of Theorem 2 can be found in Appendix G. 8 Theorem 2. For any reinforcement learning algorithm ˆQT and any number δ 2 (0, 1), there exists an MDP problem and some number Tδ > 0 such that Pr // ˆQT −Q⇤// 1 ≥C ✓log T T ◆ 1 2+d ( ≥δ, for all T ≥Tδ, where C > 0 is a constant. Consequently, for any reinforcement learning algorithm ˆQT and any sufficiently small " > 0, there exists an MDP problem such that in order to achieve Pr h// ˆQT −Q⇤// 1 < " i ≥1 −δ, one must have T ≥C0d ✓1 " ◆2+d log ✓1 " ◆ , where C0 > 0 is a constant. 5 Conclusions In this paper, we considered the reinforcement learning problem for infinite-horizon discounted MDPs with a continuous state space. We focused on a reinforcement learning algorithm NNQL that is based on kernelized nearest neighbor regression. We established nearly tight finite-sample convergence guarantees showing that NNQL can accurately estimate optimal Q function using nearly optimal number of samples. In particular, our results state that the sample, space and computational complexities of NNQL scale polynomially (sometimes linearly) with the covering number of the state space, which is continuous and has uncountably infinite cardinality. In this work, the sample complexity analysis with respect to the accuracy parameter is nearly optimal. But its dependence on the other problem parameters is not optimized. This will be an important direction for future work. It is also interesting to generalize approach to the setting of MDP beyond infinite horizon discounted problems, such as finite horizon or average-cost problems. Another possible direction for future work is to combine NNQL with a smart exploration policy, which may further improve the performance of NNQL. It would also be of much interest to investigate whether our approach, specifically the idea of using nearest neighbor regression, can be extended to handle infinite or even continuous action spaces. Acknowledgment This work was supported in parts by NSF projects NeTs-1523546, TRIPODS-1740751, and CMMI1462158. References [1] A. Antos, C. Szepesvári, and R. Munos. Learning near-optimal policies with Bellman-residual minimization based fitted policy iteration and a single sample path. Machine Learning, 71(1):89– 129, 2008. [2] M. G. Azar, R. Munos, M. Ghavamzadeh, and H. J. Kappen. Reinforcement learning with a near optimal rate of convergence. Technical Report, 2011. [3] M. G. Azar, R. Munos, M. Ghavamzadeh, and H. J. Kappen. Speedy Q-learning. In NIPS, 2011. [4] A. Barreto, D. Precup, and J. Pineau. Practical kernel-based reinforcement learning. The Journal of Machine Learning Research, 17(1):2372–2441, 2016. [5] J. L. Bentley. Multidimensional binary search trees in database applications. IEEE Transactions on Software Engineering, (4):333–340, 1979. [6] D. Bertsekas. Convergence of discretization procedures in dynamic programming. IEEE Transactions on Automatic Control, 20(3):415–419, 1975. 9 [7] D. P. Bertsekas. Dynamic programming and optimal control, volume II. Athena Scientific, Belmont, MA, 3rd edition, 2007. [8] Jalaj Bhandari, Daniel Russo, and Raghav Singal. A finite time analysis of temporal difference learning with linear function approximation. In Sébastien Bubeck, Vianney Perchet, and Philippe Rigollet, editors, Proceedings of the 31st Conference On Learning Theory, volume 75 of Proceedings of Machine Learning Research, pages 1691–1692. PMLR, 06–09 Jul 2018. [9] N. Bhat, V. F. Farias, and C. C. Moallemi. Non-parametric approximate dynamic programming via the kernel method. In NIPS, 2012. [10] C.-S. Chow and J. N. Tsitsiklis. The complexity of dynamic programming. Journal of Complexity, 5(4):466–488, 1989. [11] C.-S. Chow and J. N. Tsitsiklis. An optimal one-way multigrid algorithm for discrete-time stochastic control. IEEE Transactions on Automatic Control, 36(8):898–914, 1991. [12] Gal Dalal, Balázs Szörényi, Gugan Thoppe, and Shie Mannor. Finite sample analysis for TD(0) with linear function approximation. arXiv preprint arXiv:1704.01161, 2017. [13] S. Dasgupta and Y. Freund. Random projection trees and low dimensional manifolds. In Proceedings of the Fortieth Annual ACM Symposium on Theory of Computing, pages 537–546. ACM, 2008. [14] Y. Duan, X. Chen, R. Houthooft, J. Schulman, and P. Abbeel. Benchmarking deep reinforcement learning for continuous control. In International Conference on Machine Learning, pages 1329– 1338, 2016. [15] F. Dufour and T. Prieto-Rumeau. Approximation of Markov decision processes with general state space. Journal of Mathematical Analysis and applications, 388(2):1254–1267, 2012. [16] F. Dufour and T. Prieto-Rumeau. Finite linear programming approximations of constrained discounted Markov decision processes. SIAM Journal on Control and Optimization, 51(2):1298– 1324, 2013. [17] F. Dufour and T. Prieto-Rumeau. Approximation of average cost Markov decision processes using empirical distributions and concentration inequalities. Stochastics: An International Journal of Probability and Stochastic Processes, 87(2):273–307, 2015. [18] E. Even-Dar and Y. Mansour. Learning rates for Q-learning. JMLR, 5, December 2004. [19] W. B. Haskell, R. Jain, and D. Kalathil. Empirical dynamic programming. Mathematics of Operations Research, 41(2), 2016. [20] H. V. Hasselt. Double Q-learning. In NIPS. 2010. [21] P. Indyk and R. Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing, pages 604–613. ACM, 1998. [22] T. Jaakkola, M. I. Jordan, and S. P. Singh. On the convergence of stochastic iterative dynamic programming algorithms. Neural Comput., 6(6), 1994. [23] M. Kearns and S. Singh. Finite-sample convergence rates for Q-learning and indirect algorithms. In NIPS, 1999. [24] S. H. Lim and G. DeJong. Towards finite-sample convergence of direct reinforcement learning. In Proceedings of the 16th European Conference on Machine Learning, pages 230–241. Springer-Verlag, 2005. [25] Bo Liu, Ji Liu, Mohammad Ghavamzadeh, Sridhar Mahadevan, and Marek Petrik. Finite-sample analysis of proximal gradient TD algorithms. In Proceedings of the Thirty-First Conference on Uncertainty in Artificial Intelligence, pages 504–513. AUAI Press, 2015. 10 [26] C. Mathy, N. Derbinsky, J. Bento, J. Rosenthal, and J. S. Yedidia. The boundary forest algorithm for online supervised and unsupervised learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, pages 2864–2870, 2015. [27] F. S. Melo, S. P. Meyn, and M. I. Ribeiro. An analysis of reinforcement learning with function approximation. In Proceedings of the 25th international conference on Machine learning, pages 664–671. ACM, 2008. [28] Francisco S Melo and M Isabel Ribeiro. Q-learning with linear function approximation. In International Conference on Computational Learning Theory, pages 308–322. Springer, 2007. [29] V. Mnih, K. Kavukcuoglu, D. Silver, A. A. Rusu, J. Veness, M. G. Bellemare, A. Graves, M. Riedmiller, A. K Fidjeland, and G. Ostrovski. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [30] R. Munos and C. Szepesvári. Finite-time bounds for fitted value iteration. Journal of Machine Learning Research, 9(May):815–857, 2008. [31] E. A. Nadaraya. On estimating regression. Theory of Probability & Its Applications, 9(1):141– 142, 1964. [32] D. Ormoneit and P. Glynn. Kernel-based reinforcement learning in average-cost problems. IEEE Trans. Automatic Control, 47(10), 2002. [33] D. Ormoneit and ´S. Sen. Kernel-based reinforcement learning. Mach. Learning, 49(2-3), 2002. [34] Jason Pazis and Ronald Parr. PAC optimal exploration in continuous space Markov decision processes. In Proceedings of the Twenty-Seventh AAAI Conference on Artificial Intelligence, pages 774–781. AAAI Press, 2013. [35] H. Robbins and S. Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pages 400–407, 1951. [36] J. Rust. Using randomization to break the curse of dimensionality. Econometrica, 65(3), 1997. [37] N. Saldi, S. Yuksel, and T. Linder. On the asymptotic optimality of finite approximations to markov decision processes with borel spaces. Math. of Operations Research, 42(4), 2017. [38] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, and M. Lanctot. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [39] Charles J. Stone. Optimal global rates of convergence for nonparametric regression. The Annals of Statistics, pages 1040–1053, 1982. [40] A. L Strehl, L. Li, E. Wiewiora, J. Langford, and M. L. Littman. PAC model-free reinforcement learning. In ICML, 2006. [41] C. Szepesvári. The asymptotic convergence-rate of Q-learning. In NIPS, 1997. [42] C. Szepesvári and W. D. Smart. Interpolation-based Q-learning. In Proceedings of the TwentyFirst International Conference on Machine learning, page 100. ACM, 2004. [43] J. N. Tsitsiklis. Asynchronous stochastic approximation and Q-learning. Mach. Learning, 16(3), 1994. [44] J. N. Tsitsiklis and B. Van Roy. An analysis of temporal-difference learning with function approximation. IEEE Trans. Automatic Control, 42(5), 1997. [45] Alexandre B. Tsybakov. Introduction to Nonparametric Estimation. Springer Series in Statistics. Springer, 2009. [46] Roman Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge University Press, 2017. [47] C. J. C. H. Watkins and P. Dayan. Q-learning. Mach. learning, 8(3-4), 1992. [48] G. S. Watson. Smooth regression analysis. Sankhy¯a: The Indian Journal of Statistics, Series A, pages 359–372, 1964. 11
2018
214
7,380
Modular Networks: Learning to Decompose Neural Computation Louis Kirsch∗ Department of Computer Science University College London mail@louiskirsch.com Julius Kunze Department of Computer Science University College London juliuskunze@gmail.com David Barber Department of Computer Science University College London david.barber@ucl.ac.uk Abstract Scaling model capacity has been vital in the success of deep learning. For a typical network, necessary compute resources and training time grow dramatically with model size. Conditional computation is a promising way to increase the number of parameters with a relatively small increase in resources. We propose a training algorithm that flexibly chooses neural modules based on the data to be processed. Both the decomposition and modules are learned end-to-end. In contrast to existing approaches, training does not rely on regularization to enforce diversity in module use. We apply modular networks both to image recognition and language modeling tasks, where we achieve superior performance compared to several baselines. Introspection reveals that modules specialize in interpretable contexts. 1 Introduction When enough data and training time is available, increasing the number of network parameters typically improves prediction accuracy [16, 6, 14, 1]. While the largest artificial neural networks currently only have a few billion parameters [9], the usefulness of much larger scales is suggested by the fact that human brain has evolved to have an estimated 150 trillion synapses [19] under tight energy constraints. In deep learning, typically all parts of a network need to be executed for every data input. Unfortunately, scaling such architectures results in a roughly quadratic explosion in training time as both more iterations are needed and the cost per sample grows. In contrast, usually only few regions of the brain are highly active simultaneously [20]. Furthermore, the modular structure of biological neural connections [28] is hypothesized to optimize energy cost [8, 15], improve adaption to changing environments and mitigate catastrophic forgetting [26]. Inspired by these observations, we propose a novel way of training neural networks by automatically decomposing the functionality needed for solving a given task (or set of tasks) into reusable modules. We treat the choice of module as a latent variable in a probabilistic model and learn both the decomposition and module parameters end-to-end by maximizing a variational lower bound of the likelihood. Existing approaches for conditional computation [25, 2, 21] rely on regularization to avoid a module collapse (the network only uses a few modules repeatedly) that would result in poor ∗now affiliated with IDSIA, The Swiss AI Lab (USI & SUPSI) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. M1 M2 M3 Controller Input Output Add / Concatenate M4 M5 M6 (a) Based on the input, the controller selects K modules from a set of M available modules. In this example, K = 3 and M = 6. Controller Input Output Add / Concatenate M1 M2 M3 M4 M5 M6 M4 M2 M5 (b) The selected modules then each process the input, with the results being summed up or concatenated to form the final output of the modular layer. Figure 1: Architecture of the modular layer. Continuous arrows represent data flow, while dotted arrows represent flow of modules. performance. In contrast, our algorithm learns to use a variety of modules without such a modification and we show that training is less noisy compared to baselines. A small fixed number out of a larger set of modules is selected to process a given input, and only the gradients for these modules need to be calculated during backpropagation. Different from approaches based on mixture-of-experts, our method results in fully deterministic module choices enabling low computational costs. Because the pool of available modules is shared between processing stages (or time steps), modules can be used at multiple locations in the network. Therefore, the algorithm can learn to share parameters dynamically depending on the context. 2 Modular Networks The network is composed of functions (modules) that can be combined to solve a given task. Each module fi for i ∈{1, . . . , M} is a function fi(x; θi) that takes a vector input x and returns a vector output, where θi denotes the parameters of module i. A modular layer, as illustrated in Figure 1, determines which modules (based on the input to the layer) are executed. The output of the layer concatenates (or sums) the values of the selected modules. The output of this layer can then be fed into a subsequent modular layer. The layer can be placed anywhere in a neural network. More fully, each modular layer l ∈{1, . . . , L} is defined by the set of M available modules and a controller which determines which K from the M modules will be used. The random variable a(l) denotes the chosen module indices a(l) ∈{1, . . . , M}K. The controller distribution of layer l, p(a(l)|x(l), φ(l)) is parameterized by φ(l) and depends on the input to the layer x(l) (which might be the output of a preceding layer). While a variety of approaches could be used to calculate the output y(l), we used concatenation and summation in our experiments. In the latter case, we obtain y(l) = K X i=1 fa(l) i x(l); θa(l) i  (1) Depending on the architecture, this can then form the input to a subsequent modular layer l + 1. The module selections at all layers can be combined to a single joint distribution given by p(a|x, φ) = L Y l=1 p(a(l)|x(l), φ(l)) (2) The entire neural network, conditioned on the composition of modules a, can be used for the parameterization of a distribution over the final network output y ∼p(y|x, a, θ). For example, the 2 Algorithm 1 Training modular networks with generalized EM Given dataset D = {(xn, yn) |n = 1, . . . , N} Initialize a∗ n for all n = 1, . . . , N by sampling uniformly from all possible module compositions repeat Sample mini-batch of datapoint indices I ⊆{1, . . . , N} ▷Partial E-step for each n ∈I do Sample module compositions ˜A = {˜as ∼p(an|xn, φ)|s = 1, . . . , S} Update a∗ n to best value out of ˜A ∪{a∗ n} according to Equation 11 end for repeat k times ▷Partial M-step Sample mini-batch from dataset B ⊆D Update θ and φ with gradient step according to Equation 8 on mini-batch B until convergence final module might define a Gaussian distribution N y µ, σ2 as the output of the network whose mean and variance are determined by the final layer module. This defines a joint distribution over output y and module selection a p(y, a|x, θ, φ) = p(y|x, a, θ)p(a|x, φ) (3) Since the selection of modules is stochastic we treat a as a latent variable, giving the marginal output p(y|x, θ, φ) = X a p(y|x, a, θ)p(a|x, φ) (4) Selecting K modules at each of the L layers means that the number of states of a is M KL. For all but a small number of modules and layers, this summation is intractable and approximations are required. 2.1 Learning Modular Networks From a probabilistic modeling perspective the natural training objective is maximum likelihood. Given a collection of input-output training data (xn, yn), n = 1, . . . , N, we seek to adjust the module parameters θ and controller parameters φ to maximize the log likelihood: L(θ, φ) = N X n=1 log p(yn|xn, θ, φ) (5) To address the difficulties in forming the exact summation over the states of a we use generalized Expectation-Maximisation (EM) [17], here written for a single datapoint log p(y|x, θ, φ) ≥− X a q(a) log q(a) + X a q(a) log (p(y|x, a, θ)p(a|x, φ)) ≡L(q, θ, φ) (6) where q(a) is a variational distribution used to tighten the lower bound L on the likelihood. We can more compactly write L(q, θ, φ) = Eq(a)[log p(y, a|x, θ, φ)] + H[q] (7) where H[q] is the entropy of the distribution q. We then seek to adjust q, θ, φ to maximize L. The partial M-step on (θ, φ) is defined by taking multiple gradient ascent steps, where the gradient is ∇θ,φL(q, θ, φ) = ∇θ,φ Eq(a)[log p(y, a|x, θ, φ)] (8) In practice we randomly select a mini-batch of datapoints at each iteration. Evaluating this gradient exactly requires a summation over all possible values of a. We experimented with different strategies to avoid this and found that the Viterbi EM [17] approach is particularly effective in which q(a) is constrained to the form q(a) = δ(a, a∗) (9) where δ(x, y) is the Kronecker delta function which is 1 if x = y and 0 otherwise. A full E-step would now update a∗to a∗ new = argmax a p(y|x, a, θ)p(a|x, φ) (10) 3 for all datapoints. For tractability we instead make the E-step partial in two ways: Firstly, we choose the best from only S samples ˜as ∼p(a|x, φ) for s ∈{1, ..., S} or keep the previous a∗if none of these are better (thereby making sure that L does not decrease): a∗ new = argmax a∈{˜as|s∈{1,...,S}}∪{a∗} p(y|x, a, θ)p(a|x, φ) (11) Secondly, we apply this update only for a mini-batch, while keeping the a∗associated with all other datapoints constant. The overall stochastic generalized EM approach is summarized in Algorithm 1. Intuitively, the algorithm clusters similar inputs, assigning them to the same module. We begin with an arbitrary assignment of modules to each datapoint. In each partial E-step we use the controller p(a|x, φ) as a guide to reassign modules to each datapoint. Because this controller is a smooth function approximator, similar inputs are assigned to similar modules. In each partial M-step the module parameters θ are adjusted to learn the functionality required by the respective datapoints assigned to them. Furthermore, by optimizing the parameters φ we train the controller to predict the current optimal module selection a∗ n for each datapoint. Figure 2 visualizes the above clustering process for a simple feed-forward neural network composed of 6 modular layers with K = 1 modules being selected at each layer out of a possible M = 3 modules. The task is image classification, see Section 3.3. Each node in the graph represents a module and each datapoint uses a path of modules starting from layer 1 and ending in layer 6. The width of the edge between two nodes n1 and n2 represents the number of datapoints that use the first module n1 followed by n2; the size of a node represents how many times that module was used. Figure 2 shows how a subset of datapoints starting with a fairly uniform distribution over all paths ends up being clustered to a single common path. The upper and lower graphs correspond to two different subsets of the datapoints. We visualized only two clusters but in general many such clusters (paths) form, each for a different subset of datapoints. 2.2 Alternative Training Related work [25, 3, 21] uses two different training approaches that can also be applied to our modular architecture. REINFORCE [30] maximizes the lower bound B(θ, φ) ≡ X a p(a|x, φ) log p(y|x, a, θ) ≤L(θ, φ) (12) on the log likelihood L. Using the log-trick we obtain the gradients ∇φB(θ, φ) = Ep(a|x,φ)[log p(y|x, a, θ)∇φ log p(a|x, φ)] (13) ∇θB(θ, φ) = Ep(a|x,φ)[∇θ log p(y|x, a, θ)] (14) These expectations are then approximated by sampling from p(a|x, φ). An alternative training algorithm is the noisy top-k mixture of experts [25]. A mixture of experts is the weighted sum of several parameterized functions and therefore also separates functionality into multiple components. A gating network is used to predict the weight for each expert. Noise is added to the output of this gating network before setting all but the maximum k units to −∞, effectively disabling these experts. Only these k modules are then evaluated and gradients backpropagated. We discuss issues with these training techniques in the next section. 2.3 Avoiding Module Collapse Related work [25, 3, 21] suffered from the problem of missing module diversity ("module collapse"), with only a few modules actually realized. This premature selection of only a few modules has often been attributed to a self-reinforcing effect where favored modules are trained more rapidly, further increasing the gap [25]. To counter this effect, previous studies introduced regularizers to encourage different modules being used for different datapoints within a mini-batch. In contrast to these approaches, no regularization is needed in our method. However, to avoid module collapse, we must take sufficient gradient steps within the partial M-step to optimize both the module parameters θ, as well as the controller parameters φ. That is, between each E-step, there are many gradient updates for both θ and φ. Note that this form of training is critical, not just to prevent module collapse but to 4 Layer Module Beginning of training Mid-training End of training Figure 2: Two different subsets of datapoints (top and bottom) that use the same modules at the end of training (right) start with entirely different modules (left) and slowly cluster together over the course of training (left to right). Nodes in the graph represent modules with their size proportional to the number of datapoints that use this module. Edges between nodes n1 and n2 and their stroke width represent how many datapoints first use module n1 followed by n2. obtain a high likelihood. When module collapse occurs, the resulting log-likelihood is lower than the log-likelihood of the non-module-collapsed trained model. In other words, our approach is not a regularizer that biases the model towards a desired form of a sub-optimal minimum – it is a critical component of the algorithm to ensure finding a high-valued optimum. 3 Experiments To investigate how modules specialize during training, we first consider a simple toy regression problem. We then apply our modular networks to language modeling and image classification. Alternative training methods for our modular networks are noisy top-k gating [25], as well as REINFORCE [3, 21] to which we will compare our approach. Except if noted otherwise, we use a controller consisting of a linear transformation followed by a softmax function for each of the K modules to select. Our modules are either linear transformations or convolutions, followed by a ReLU activation. Additional experimental details are given in the supplementary material. In order to analyze what kind of modules are being used we define two entropy measures. The module selection entropy is defined as Ha = 1 BL L X l=1 B X n=1 H h p(a(l) n |xn, φ) i (15) where B is the size of the batch. Ha has larger values for more uncertainty for each sample n. We would like to minimize Ha (so we have high certainty in the module being selected for a datapoint xn). Secondly, we define the entropy over the entire batch Hb = 1 L L X l=1 H " 1 B B X n=1 p(a(l) n |xn, φ) # (16) Module collapse would correspond to a low Hb. Ideally, we would like to have a large Hb so that different modules will be used, depending on the input xn. 3.1 Toy Regression Problem We demonstrate the ability of our algorithm to learn conditional execution using the following regression problem: For each data point (xn, yn), the input vectors xn are generated from a mixture of Gaussians with two components with uniform latent mixture probabilities p(sn = 1) = p(sn = 2) = 1 2 according to xn|sn ∼N (xn µsn, Σsn). Depending on the component sn, the target yn is 5 0 2000 4000 6000 8000 10000 step 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 entropy Batch module selection entropy Module selection entropy (a) Module composition learned on the toy dataset. 0 2000 4000 6000 8000 10000 step 0 250 500 750 1000 1250 1500 1750 loss Training loss Test loss (b) Minimization of loss on the toy dataset. Figure 3: Performance of one modular layer on toy regression. generated by linearly transforming the input xn according to yn = Rxn if sn = 1 Sxn otherwise (17) where R is a randomly generated rotation matrix and S is a diagonal matrix with random scaling factors. In the case of our toy example, we use a single modular layer, L = 1, with a pool of two modules, M = 2, where one module is selected per data point, K = 1. Loss and module selection entropy quickly converge to zero, while batch module selection entropy stabilizes near log 2 as shown in Figure 3. This implies that the problem is perfectly solved by the architecture in the following way: Each of the two modules specializes on regression of data points from one particular component by learning the corresponding linear transformations R and S respectively and the controller learns to pick the corresponding module for each data point deterministically, thereby effectively predicting the identity of the corresponding generating component. Thus, our modular networks successfully decompose the problem into modules yielding perfect training and generalization performance. 3.2 Language Modeling Modular layers can readily be used to update the state within an RNN. This allows us to model sequence-to-sequence tasks with a single RNN which learns to select modules based on the context. For our experiments, we use a modified Gated Recurrent Unit [5] in which the state update operation is a modular layer. Therefore, K modules are selected and applied at each time step. Full details can be found in the supplement. We use the Penn Treebank2 dataset, consisting of 0.9 million words with a vocabulary size of 10,000. The input of the recurrent network for each timestep is a jointly-trained embedding vector of size 32 that is associated with each word. We compare the EM-based modular networks approach to unregularized REINFORCE (with an exponential moving average control variate) and noisy top-k, as well as a baseline without modularity, that uses the same K modules for all datapoints. This baseline uses the same number of module parameters per datapoint as the modular version. For this experiment, we test four configurations of the network being able to choose K out of M modules at each timestep: 1 out of 5 modules, 3 out of 5, 1 out of 15, and 3 out of 15. We report the test perplexity after 50,000 iterations for the Penn Treebank dataset in Table 1. When only selecting a single module out of 5 or 15, our modular networks outperform both baselines with 1 or 3 fixed modules. Selecting 3 out of 5 or 15 seems to be harder to learn, currently not outperforming a single chosen module (K = 1). Remarkably, apart from the controller network, the baseline with three static modules performs three times the computation and achieves worse test perplexity compared to a single intelligently selected module using our method. Compared to the REINFORCE and noisy-top-k training methods, our approach has lower test perplexities for each module configuration. 2http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz 6 Table 1: Test perplexity after 50,000 steps on Penn Treebank Type #modules (M) #parallel modules (K) test perplexity EM Modular Networks 15 1 229.651 EM Modular Networks 5 1 236.809 EM Modular Networks 15 3 246.493 EM Modular Networks 5 3 236.314 REINFORCE 15 1 240.760 REINFORCE 5 1 240.450 REINFORCE 15 3 274.060 REINFORCE 5 3 267.585 Noisy Top-k (k = 4) 15 1 422.636 Noisy Top-k (k = 4) 5 1 338.275 Baseline 1 1 247.408 Baseline 3 3 241.294 0 50000 100000 150000 200000 step 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 entropy REINFORCE EM Modular Networks Noisy Top-k (a) Module selection entropy Ha 0 50000 100000 150000 200000 step 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 entropy REINFORCE EM Modular Networks Noisy Top-k (b) Batch module selection entropy Hb Figure 4: Modular networks are less noisy during optimization compared to REINFORCE and more deterministic than noisy top-k. Our method uses all modules at the end of training, shown by a large batch module selection entropy. The task is language modeling on the Penn Treebank dataset. We further inspect training behavior in Figure 4. Using our method, all modules are effectively being used at the end of training, as shown by a large batch module selection entropy in Figure 4b. Additionally, the optimization is generally less noisy compared to the alternative approaches and the method quickly reaches a deterministic module selection. Figure 5 shows how the module selection changes over the course of training for a single batch. At the beginning of training, the controller essentially has no preference over modules for any instance in the batch. Later in training, the selection is deterministic for some datapoints and finally becomes fully deterministic. For language modeling tasks, modules specialize in certain grammatical and semantic contexts. This is illustrated in Table 2, where we observe specialization on numerals, the beginning of a new 0 20 40 60 80 100 120 batch instance module Figure 5: A visualization of the controller distribution for a particular mini-batch, choosing K = 1 out of M = 5 modules. Training progresses from the top image to the bottom image. A black pixel represents zero probability and a white pixel represents probability 1. 7 Table 2: For a few out of M = 15 modules (with K = 1), we show examples of the corresponding input word which they are invoked on (highlighted) together with surrounding words in the sentence. Module 1 Module 3 Module 14 ... than <number> <number> ... ... Australia <new sentence> A ... ... said the acquired ... ... be substantially less ... ... opposition <new sentence> I ... ... on the first ... ... up <number> <number> ... ... said <new sentence> But ... ... that the carrier ... ... <number> million was ... ... teachers for the ... ... to the recent ... ... $ <number> billion ... ... result <new sentence> That ... ... and the sheets ... ... <number> million of ... ... <new sentence> but the ... ... and the naczelnik ... ... $ <number> billion ... ... based on the ... ... if the actual ... ... by <number> to ... ... business <new sentence> He ... ... say the earnings ... ... yield <number> <number> ... ... rates <new sentence> This ... ... in the third ... ... debt from the ... ... offer <new sentence> Federal ... ... brain the skin ... ... ... ... 0 100000 200000 300000 400000 500000 600000 700000 step 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 test accuracy EM Modular Networks EM Modular Networks conv controller Baseline 0 100000 200000 300000 400000 500000 600000 700000 step 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 training accuracy EM Modular Networks EM Modular Networks conv controller Baseline Figure 6: Modular networks test (left) and training accuracy (right) for a linear controller and a convolutional controller compared to the non-modularized baseline. sentence and the occurrence of the definite article the, indicating that the word to be predicted is a noun or adjective. 3.3 Image Classification We applied our method to image classification on CIFAR10 [13] by using a modularized feed-forward network. Compared to [21], we not only modularized the two fully connected layers but also the remaining three convolutional layers. Details can be found in the supplement. Figure 6 shows how using modules achieves higher training accuracy compared to the nonmodularized baseline. However, in comparison to the language modeling tasks, this does not lead to improved generalization. We found that the controller overfits to specific features. In Figure 6 we therefore compared to a more constrained convolutional controller that reduces overfitting considerably. Shazeer et al. [25] make a similar claim in their study and therefore only train on very large language modeling datasets. More investigation is needed to understand how to take advantage of modularization in tasks with limited data. 4 Related Work Learning modules and their composition is closely related to mixtures of experts, dating back to [11, 12]. A mixture of experts is the weighted sum of several parameterized functions and therefore also separates functionality into multiple components. Our work is different in two major aspects. Firstly, our training algorithm is designed such that the selection of modules becomes fully deterministic instead of a mixture. This enables efficient prediction such that only the single most likely module has to be evaluated for each of the K distributions. Secondly, instead of having a single selection of modules, we compose modules hierarchically in an arbitrary manner, both sequentially and in parallel. The latter idea has been, in part, pursued by [10], relying on stacked mixtures of experts instead of a single selection mechanism. Due to their training by backpropagation of entire mixtures, 8 summing over all paths, no clear computational benefits have yet been achieved through such a form of modularization. Different approaches for limiting the number of evaluations of experts are stochastic estimation of gradients through REINFORCE [30] or noisy top-k gating [4]. Nevertheless, both the mixture of experts in [3] based on REINFORCE as well as the approach by [25] based on noisy top-k gating require regularization to ensure diversity of experts for different inputs. If regularization is not applied, only very few experts are actually used. In contrast, our modular networks use a different training algorithm, generalized Viterbi EM, enabling the training of modules without any artificial regularization. This has the advantage of not forcing the optimization to reach a potentially sub-optimal log-likelihood based on regularizing the training objective. Our architecture differs from [25] in that we don’t assign a probability to every of the M modules and pick the K most likely but instead we assign a probability to each composition of modules. In terms of recurrent networks, in [25] a mixture-of-experts layer is sandwiched between multiple recurrent neural networks. However, to the best of our knowledge, we are the first to introduce a method where each modular layer is updating the state itself. The concept of learning modules has been further extended to multi-task learning with the introduction of routing networks [21]. Multiple tasks are learned jointly by conditioning the module selection on the current task and/or datapoint. While conditioning on the task through the use of the multi-agent Weighted Policy Learner shows promising results, they reported that a single agent conditioned on the task and the datapoint fails to use more than one or two modules. This is consistent with previous observations [3, 25] that a RL-based training without regularization tends to use only few modules. We built on this work by introducing a training method that no longer requires this regularization. As future work we will apply our approach in the context of multi-task learning. There is also a wide range of literature in robotics that uses modularity to learn robot skills more efficiently by reusing functionality shared between tasks [22, 7]. However, the decomposition into modules and their reuse has to be specified manually, whereas our approach offers the ability to learn both the decomposition and modules automatically. In future work we intend to apply our approach to parameterizing policies in terms of the composition of simpler policy modules. Conditional computation can also be achieved through activation sparsity or winner-take-all mechanisms [27, 23, 24] but is hard to parallelize on modern accelerators such as GPUs. A solution that works with these accelerators is learning structured sparsity [18, 29] but often requires non-sparse computation during training or is not conditional. 5 Conclusion We introduced a novel method to decompose neural computation into modules, learning both the decomposition as well as the modules jointly. Compared to previous work, our method produces fully deterministic module choices instead of mixtures, does not require any regularization to make use of all modules, and results in less noisy training. Modular layers can be readily incorporated into any neural architecture. We introduced the modular gated recurrent unit, a modified GRU that enables minimalistic sequence-to-sequence models based on modular computation. We applied our method in language modeling and image classification, showing how to learn modules for these different tasks. Training modular networks has long been a sought-after goal in neural computation since this opens up the possibility to significantly increase the power of neural networks without an increase in parameter explosion. We have introduced a simple and effective way to learn such networks, opening up a range of possibilities for their future application in areas such as transfer learning, reinforcement learning and lifelong learning. Future work may also explore how modular networks scale to larger problems, architectures, and different domains. A library to use modular layers in TensorFlow can be found at http://louiskirsch.com/libmodular. Acknowledgments We thank Ilya Feige, Hippolyt Ritter, Tianlin Xu, Raza Habib, Alex Mansbridge, Roberto Fierimonte, and our anonymous reviewers for their feedback. This work was supported by the Alan Turing Institute under the EPSRC grant EP/N510129/1. Furthermore, we thank IDSIA (The Swiss AI Lab) 9 for the opportunity to finalize the camera ready version on their premises, partially funded by the ERC Advanced Grant (no: 742870). References [1] D. Amodei et al. “Deep Speech 2: End-to-End Speech Recognition in English and Mandarin”. In: ICML (2015). [2] E. Bengio. “On Reinforcement Learning for Deep Neural Architectures: Conditional Computation with Stochastic Computation Policies”. PhD thesis. McGill University Libraries, 2017. [3] E. Bengio et al. “Conditional Computation in Neural Networks for Faster Models”. In: ICLR Workshop (2016). [4] Y. Bengio, N. Léonard, and A. Courville. “Estimating or propagating gradients through stochastic neurons for conditional computation”. In: arXiv preprint arXiv:1308.3432 (2013). [5] K. Cho et al. “Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation”. In: Conference on Empirical Methods in Natural Language Processing (2014). [6] D. C. Ciresan, U. Meier, and J. Schmidhuber. “Multi-Column Deep Neural Networks for Image Classification”. IEEE Conference on Computer Vision and Pattern Recognition CVPR 2012. 2012. [7] I. Clavera, D. Held, and P. Abbeel. “Policy transfer via modularity and reward guiding”. IEEE International Conference on Intelligent Robots and Systems. Vol. 2017-Septe. 2017, pp. 1537–1544. [8] J. Clune, Mouret J-B., and H. Lipson. “The evolutionary origins of modularity”. In: Proceedings of the Royal Society of London B: Biological Sciences 280.1755 (2013). [9] A. Coates et al. “Deep learning with COTS HPC systems”. In: ICML (2013), pp. 1337–1345. [10] D. Eigen, M. Ranzato, and I. Sutskever. “Learning Factored Representations in a Deep Mixture of Experts”. In: ICLR Workshop (2013). [11] R. A. Jacobs et al. “Adaptive Mixtures of Local Experts”. In: Neural Computation 3.1 (1991), pp. 79–87. [12] M. I. Jordan and R. A. Jacobs. “Hierarchical Mixtures of Experts and the EM Algorithm”. In: Neural Computation 6.2 (1994), pp. 181–214. [13] A. Krizhevsky and G. Hinton. “Learning Multiple Layers of Features from Tiny Images”. MSc thesis. University of Toronto, 2009. [14] A. Krizhevsky, I. Sutskever, and G. E. Hinton. “ImageNet classification with deep convolutional neural networks”. In: NIPS (2012), pp. 1097–1105. [15] R. A. Legenstein and W. Maass. “Neural circuits for pattern recognition with small total wire length”. In: Theoretical Computer Science (2002), pp. 239–249. [16] L. Li, Z. Ding, and D. Huang. “Recognizing location names from Chinese texts based on Max-Margin Markov network”. In: International Conference on Natural Language Processing and Knowledge Engineering (2008). [17] R. M. Neal and G. E. Hinton. “Learning in Graphical Models”. In: ed. by M. I. Jordan. Cambridge, MA, USA: MIT Press, 1999. Chap. A View of, pp. 355–368. [18] K. Neklyudov et al. “Structured Bayesian Pruning via Log-Normal Multiplicative Noise”. NIPS. 2017, pp. 6775–6784. [19] B. Pakkenberg et al. “Aging and the human neocortex”. In: Experimental gerontology 38.1-2 (2003), pp. 95–99. [20] M. Ramezani et al. “Joint sparse representation of brain activity patterns in multi-task fMRI data”. In: IEEE Transactions on Medical Imaging 34.1 (2015), pp. 2–12. [21] C. Rosenbaum, T. Klinger, and M. Riemer. “Routing Networks: Adaptive Selection of Nonlinear Functions for Multi-Task Learning”. ICLR. 2018. [22] H. Sahni et al. “Learning to Compose Skills”. In: NIPS Workshop (2017). [23] J. Schmidhuber. “Self-delimiting neural networks”. In: arXiv preprint arXiv:1210.0118 (2012). [24] J. Schmidhuber. “The neural bucket brigade”. Connectionism in perspective. 1989, pp. 439– 446. 10 [25] N. Shazeer et al. “Outrageously Large Neural Networks: The Sparsely-Gated Mixture-ofExperts Layer”. In: ICLR (2017). [26] O. Sporns and R. F. Betzel. “Modular Brain Networks”. In: Annual Review of Psychology 67.1 (2016), pp. 613–640. [27] R. K. Srivastava et al. “Compete to compute”. NIPS. 2013, pp. 2310–2318. [28] P. Sternberg. “Modular processes in mind and brain”. In: Cognitive Neurophysiologogy 28.4 & 4 (2011), pp. 156–208. [29] W. Wen et al. “Learning structured sparsity in deep neural networks”. NIPS. 2016, pp. 2074– 2082. [30] R. J. Williams. “Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning”. In: Machine Learning 8 (1992), pp. 229–256. 11
2018
215
7,381
The Convergence of Sparsified Gradient Methods Dan Alistarh⇤ IST Austria dan.alistarh@ist.ac.at Torsten Hoefler ETH Zurich htor@inf.ethz.ch Mikael Johansson KTH mikaelj@kth.se Sarit Khirirat KTH sarit@kth.se Nikola Konstantinov IST Austria nikola.konstantinov@ist.ac.at Cédric Renggli ETH Zurich cedric.renggli@inf.ethz.ch Abstract Stochastic Gradient Descent (SGD) has become the standard tool for distributed training of massive machine learning models, in particular deep neural networks. Several families of communication-reduction methods, such as quantization, largebatch methods, and gradient sparsification, have been proposed to reduce the overheads of distribution. To date, gradient sparsification methods–where each node sorts gradients by magnitude, and only communicates a subset of the components, accumulating the rest locally–are known to yield some of the largest practical gains. Such methods can reduce the amount of communication per step by up to three orders of magnitude, while preserving model accuracy. Yet, this family of methods currently has no theoretical justification. This is the question we address in this paper. We prove that, under analytic assumptions, sparsifying gradients by magnitude with local error correction provides convergence guarantees, for both convex and non-convex smooth objectives, for data-parallel SGD. The main insight is that sparsification methods implicitly maintain bounds on the maximum impact of stale updates, thanks to selection by magnitude. Our analysis also reveals that these methods do require analytical conditions to converge well, justifying and complementing existing heuristics. 1 Introduction The proliferation of massive datasets has led to renewed focus on distributed machine learning computation. In this context, tremendous effort has been dedicated to scaling the classic stochastic gradient descent (SGD) algorithm, the tool of choice for training a wide variety of machine learning models. In a nutshell, SGD works as follows. Given a function f : Rn ! R to minimize and given access to stochastic gradients ˜G of this function, we apply the iteration xt+1 = xt −↵˜G(xt), (1) where xt is our current set of parameters, and ↵is the step size. The standard way to scale SGD to multiple nodes is via data-parallelism: given a set of P nodes, we split the dataset into P partitions. Nodes process samples in parallel, but each node maintains a globally consistent copy of the parameter vector xt. In each iteration, each node computes a new stochastic gradient with respect to this parameter vector, based on its local data. Nodes then aggregate all of these gradients locally, and update their iterate to xt+1. Ideally, this procedure would enable us to process P times more samples per unit of time, equating to linear scalability. ⇤Authors ordered alphabetically. The full version can be found at https://arxiv.org/abs/1809.10505. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. However, in practice scaling is limited by the fact that nodes have to exchange full gradients upon every iteration. To illustrate, when training a deep neural network such as AlexNet, each iteration takes a few milliseconds, upon which nodes need to communicate gradients in the order of 200 MB each, in an all-to-all fashion. This communication step can easily become the system bottleneck [4]. A tremendous amount of work has been dedicated to addressing this scalability problem, largely focusing on the data-parallel training of neural networks. One can classify proposed solutions into a) lossless, either based on factorization [31, 7] or on executing SGD with extremely large batches, e.g., [11], b) quantization-based, which reduce the precision of the gradients before communication, e.g., [22, 8, 4, 29], and c) sparsification-based, which reduce communication by only selecting an “important” sparse subset of the gradient components to broadcast at each step, and accumulating the rest locally, e.g., [24, 9, 2, 26, 17, 25]. While methods from the first two categories are efficient and provide theoretical guarantees, e.g., [31, 4], some of the largest benefits in practical settings are provided by sparsification methods. Recent work [2, 17] shows empirically that the amount of communication per node can be reduced by up to 600⇥through sparsification without loss of accuracy in the context of large-scale neural networks. (We note however that these methods do require significant additional hyperparameter optimization.) Contribution. We prove that, under analytic assumptions, gradient sparsification methods in fact provide convergence guarantees for SGD. We formally show this claim for both convex and nonconvex smooth objectives, and derive non-trivial upper bounds on the convergence rate of these techniques in both settings. From the technical perspective, our analysis highlights connections between gradient sparsification methods and asynchronous gradient descent, and suggests that some of the heuristics developed to ensure good practical performance for these methods, such as learning rate tuning and gradient clipping, might in fact be necessary for convergence. Sparsification methods generally work as follows. Given standard data-parallel SGD, in each iteration t, each node computes a local gradient ˜G, based on its current view of the model. The node then truncates this gradient to its top K components, sorted in decreasing order of magnitude, and accumulates the error resulting from this truncation locally in a vector ✏. This error is added to the current gradient before truncation. The top K components selected by each node in this iteration are then exchanged among all nodes, and applied to generate the next version of the model. Sparsification methods are reminiscent of asynchronous SGD algorithms, e.g., [20, 10, 8], as updates are not discarded, but delayed. A critical difference is that sparsification does not ensure that every update is eventually applied: a “small” update may in theory be delayed forever, since it is never selected due to its magnitude. Critically, this precludes the direct application of existing techniques for the analysis of asynchronous SGD, as they require bounds on the maximum delay, which may now be infinite. At the same time, sparsification could intuitively make better progress than an arbitrarily-delayed asynchronous method, since it applies K “large” updates in every iteration, as opposed to an arbitrary subset in the case of asynchronous methods. We resolve these conflicting intuitions, and show that in fact sparsification methods converge relatively fast. Our analysis yields new insight into this popular communication-reduction method, giving it a solid theoretical foundation, and suggests that prioritizing updates by magnitude might be a useful tactic in other forms of delayed SGD as well. Our key finding is that this algorithm, which we call TopK SGD, behaves similarly to a variant of asynchronous SGD with “implicit” bounds on staleness, maintained seamlessly by the magnitude selection process: a gradient update is either salient, in which case it will be applied quickly, or is eventually rendered insignificant by the error accumulation process, in which case it need not have been applied in the first place. This intuition holds for both convex and non-convex objectives, although the technical details are different. Related Work. There has been a recent surge of interest in distributed machine learning, e.g., [1, 33, 6]; due to space limits, we focus on communication-reduction techniques that are closely related. Lossless Methods. One way of doing lossless communication-reduction is through factorization [7, 31], which is effective in deep neural networks with large fully-connected layers, whose gradients can be decomposed as outer vector products. This method is not generally applicable, and in particular may not be efficient in networks with large convolutional layers, e.g., [13, 27]. A second lossless method is executing extremely large batches, hiding communication cost behind increased computation [11, 32]. Although promising, these methods currently require careful per-instance 2 parameter tuning, and do not eliminate communication costs. Asynchronous methods, e.g., [20] can also be seen as a way of performing communication-reduction, by overlapping communication and computation, but are also known to require careful parameter tuning [34]. Quantization. Seide et al. [23] and Strom [25] were among the first to propose quantization to reduce the bandwidth costs of training deep networks. Their techniques employ a variant of erroraccumulation. Alistarh et al. [4, 12] introduced a theoretically-justified stochastic quantization technique called Quantized SGD (QSGD), which trades off compression and convergence rate. This technique was significantly refined for the case of two-bit precision by [30]. Recent work [28] studies the problem of selecting a sparse, low-variance unbiased gradient estimator as a linear planning problem. This approach differs from the algorithms we analyze, as it ensures unbiasedness of the estimators in every iteration. By contrast, error accumulation inherently biases the applied updates. Sparsification. Strom [25], Dryden et al. [9] and Aji and Heafield [2] considered sparsifying the gradient updates by only applying the top K components, taken at at every node, in every iteration, for K corresponding to < 1% of the dimension, and accumulating the error. Shokri [24] and Sun et al. [26] independently considered similar algorithms, but for privacy and regularization purposes, respectively. Lin et al. [17] performed an in-depth empirical exploration of this space in the context of training neural networks, showing that extremely high gradient sparsity can be supported by convolutional and recurrent networks, without loss of accuracy, under careful hyperparameter tuning. Analytic Techniques. The first reference to approach the analysis of quantization techniques is Buckwild! [8], in the context of asynchronous training of generalized linear models. Our analysis in the case of convex SGD uses similar notions of convergence, and a similar general approach. The distinctions are: 1) the algorithm we analyze is different; 2) we do not assume the existence of a bound ⌧on the delay with which a component may be applied; 3) we do not make sparsity assumptions on the original stochastic gradients. In the non-convex case, we use a different approach. 2 Preliminaries Background and Assumptions. Please recall our modeling of the basic SGD process in Equation (1). Fix n to be the dimension of the problems we consider; unless otherwise stated k·k will denote the 2-norm. We begin by considering a general setting where SGD is used to minimize a function f : Rn ! R, which can be either convex or non-convex, using unbiased stochastic gradient samples ˜G(·), i.e., E[ ˜G(xt)] = rf(xt). We assume throughout the paper that the second moment of the average of P stochastic gradients with respect to any choice of parameter values is bounded, i.e.: E[k 1 P P X p=1 ˜Gp(x)k2] M 2, 8x 2 Rn (2) where ˜G1(x), . . . , ˜GP (x) are P independent stochastic gradients (at each node). We also give the following definitions: Definition 1. For any differentiable function f: Rd ! R, • f is c-strongly convex if 8x, y 2 Rd, it satisfies f(y) ≥f(x) + hrf(x), y −xi + c 2kx −yk2. • f is L-Lipschitz smooth (or L-smooth for short) if 8x, y 2 Rd, krf(x) −rf(y)kLkx −yk. We consider both c-strongly convex and L-Lipschitz smooth (non-convex) objectives. Let x⇤be the optimum parameter set minimizing Equation (1). For ✏> 0, the “success region” to which we want to converge is the set of parameters S = {x | kx −x⇤k2✏}. Rate Supermartingales. In the convex case, we phrase convergence of SGD in terms of rate supermartingales; we will follow the presentation of De et al. [8] for background. A supermartingale is a stochastic process Wt with the property that that E[Wt+1|Wt] Wt. A martingale-based proof of convergence will construct a supermartingale Wt(xt, xt−1, . . . , x0) that is a function of time and the current and previous iterates; it intuitively represents how far the algorithm is from convergence. Definition 2. Given a stochastic algorithm such as the iteration in Equation (1), a non-negative process Wt : Rn⇥t ! R is a rate supermartingale with horizon B if the following conditions are true. First, it must be a supermartingale: for any sequence xt, . . . , x0 and any t B, E[Wt+1(xt −↵˜Gt(xt), xt, . . . , x0)] Wt(xt, xt−1, . . . , x0). (3) 3 Algorithm 1 Parallel TopK SGD at a node p. Input: Stochastic Gradient Oracle ˜Gp(·) at node p Input: value K, learning rate ↵ Initialize v0 = ✏p 0 = ~0 for each step t ≥1 do accp t ✏p t−1 + ↵˜Gp t (vt−1) {accumulate error into a locally generated gradient} ✏p t accp t −TopK(accp t ) {update the error} Broadcast(TopK(accp t ), SUM) { broadcast to all nodes and receive from all nodes } gt 1 P PP q=1 TopK(accq t) { average the received (sparse) gradients } vt vt−1 −gt { apply the update } end for Second, for all times T B and for any sequence xT , . . . , x0, if the algorithm has not succeeded in entering the success region S by time T, it must hold that WT (xT , xT −1, . . . , x0) ≥T. (4) Convergence. Assuming the existence of a rate supermartingale, one can bound the convergence rate of the corresponding stochastic process. Statement 1. Assume that we run a stochastic algorithm, for which W is a rate supermartingale. For T B, the probability that the algorithm does not complete by time T is Pr(FT ) E[W0(x0)] T . The proof of this general fact is given by De Sa et al. [8], among others. A rate supermartingale for sequential SGD is: Statement 2 ([8]). There exists a Wt where, if the algorithm has not succeeded by timestep t, Wt(xt, . . . , x0) = ✏ 2↵c✏−↵2 ˜ M 2 log ⇣ e kxt −x⇤k2 ✏−1⌘ + t, where ˜ M is a bound on the second moment of the stochastic gradients for the sequential SGD process. Further, Wt is a rate submartingale for sequential SGD with horizon B = 1. It is also H-Lipschitz in the first coordinate, with H = 2p✏ % 2↵c✏−↵2M 2&−1, that is for any t, u, v and any sequence xt−1, . . . , x0 : kWt (u, xt−1, . . . , x0) −Wt (v, xt−1, . . . , x0) kHku −vk. 3 The TopK SGD Algorithm Algorithm Description. In the following, we will consider a variant of distributed SGD where, in each iteration t, each node computes a local gradient based on its current view of the model, which we denote by vt, which is consistent across nodes (see Algorithm 1 for pseudocode). The node adds its local error vector from the previous iteration (defined below) into the gradient, and then truncates this sum to its top K components, sorted in decreasing order of (absolute) magnitude. Each node accumulates the components which were not selected locally into the error vector ✏t, which is added to the current gradient before the truncation procedure. The selected top K components are then broadcast to all other nodes. (We assume that broadcast happens point-to-point, but in practice it could be intermediated by a parameter server, or via a more complex reduction procedure.) Each node collects all messages from its peers, and applies their average to the local model. This update is the same across all nodes, and therefore vt is consistent across nodes at every iteration. Variants of this pattern are implemented in [2, 9, 17, 25, 26]. When training networks, this pattern is used in conjunction with heuristics such as momentum tuning and gradient clipping [17]. Analysis Preliminaries. Define ˜Gt(vt) = 1 P PP p=1 ˜Gp t (vt). In the following, it will be useful to track the following auxiliary random variable at each global step t: xt+1 = xt −1 P P X p=1 ↵˜Gp t (vt) = xt −↵˜Gt(vt), (5) 4 where x0 = 0n. Intuitively, xt tracks all the gradients generated so far, without truncation. One of our first objectives will be to bound the difference between xt and vt at each time step t. Define: ✏t = 1 P P X p=1 ✏p t . (6) The variable xt is set up such that, by induction on t, one can prove that, for any time t ≥0, vt −xt = ✏t. (7) Convergence. A reasonable question is whether we wish to show convergence with respect to the auxiliary variable xt, which aggregates gradients, or with respect to the variable vt, which measures convergence in the view which only accumulates truncated gradients. Our analysis will in fact show that the TopK algorithm converges in both these measures, albeit at slightly different rates. So, in particular, nodes will be able to observe convergence by directly observing the “shared” parameter vt. 3.1 An Analytic Assumption The update to the parameter vt+1 at each step is 1 P P X p=1 TopK ⇣ ↵˜Gp t (vt) + ✏p t ⌘ . The intention is to apply the top K components of the sum of updates across all nodes, that is, 1 P TopK P X p=1 ⇣ ↵˜Gp t (vt) + ✏p t ⌘! . However, it may well happen that these two terms are different: one could have a fixed component j of ↵˜Gp t +✏p t with the large absolute values, but opposite signs, at two distinct nodes, and value 0 at all other nodes. This component would be selected at these two nodes (since it has high absolute value locally), whereas it would not be part of the top K taken over the total sum, since its contribution to the sum would be close to 0. Obviously, if this were to happen on all components, the algorithm would make very little progress in such a step. In the following, we will assume that such overlaps can only cause the algorithm to lose a small amount of information at each step, with respect to the norm of “true” gradient ˜Gt. Specifically: Assumption 1. There exists a (small) constant ⇠such that, for every iteration t ≥0, we have: )))))TopK 1 P P X p=1 ⇣ ↵˜Gp t (vt) + ✏p t ⌘! − P X p=1 1 P TopK ⇣ ↵˜Gp t (vt) + ✏p t ⌘))))) ⇠k↵˜Gt(vt)k. (8) Discussion. We validate Assumption 1 experimentally on a number of different learning tasks in Section 6 (see also Figure 1). In addition, we emphasize the following points: • As per our later analysis, in both the convex and non-convex cases, the influence of ⇠on convergence is dampened linearly by the number of nodes P. Unless ⇠grows linearly with P, which appears unlikely, its value will become irrelevant as parallelism is increased. • Assumption 1 is necessary for a general, worst-case analysis. Its role is to bound the gap between the top-K of the gradient sum (which would be applied at each step in a “sequential” version of the process), and the sum of top-Ks (which is applied in the distributed version). If the number of nodes P is 1, the assumption trivially holds. To illustrate necessity, consider a dummy instance with two nodes, dimension 2, and K = 1. Assume that at a step node 1 has gradient vector (−1001, 500), and node 2 has gradient vector (1001, 500). Selecting the top-1 (max abs) of the sum of the two gradients would result in the gradient (0, 1000). Applying the sum of top-1’s taken locally results in the gradient (0, 0), since we select (1001, 0) and (−1001, 0), respectively. This is clearly not desirable, but in theory possible. The assumption states that this worst-case scenario is unlikely, by bounding the norm difference between the two terms. 5 • The intuitive cause for the example above is the high variability of the local gradients at the nodes. One can therefore view Assumption 1 as a bound on the variance of the local gradients (at the nodes) with respect to the global variance (aggregated over all nodes). We further expand on this observation in Section 6. 4 Analysis in the Convex Case We now focus on the convergence of Algorithm 1 with respect to the parameter vt. We assume that the function f is c-strongly convex and that the bound (2) holds. Due to space constraints, the complete proofs are deferred to the full version of our paper [3]. Technical Preliminaries. We begin by noting that for any vector x 2 Rn, it holds that kx −TopK (x) k1n −K n kxk1, and kx −TopK (x) k2n −K n kxk2. Thus, if γ = q n−K n , we have that kx −TopK (x) kγkxk. In practice, the last inequality may be satisfied by a much smaller value of γ, since the gradient values are very unlikely to be uniform. We now bound the difference between vt and xt using Assumption 1. We have the following: Lemma 1. With the processes xt and vt defined as above: kvt −xtk = ))))) 1 P P X p=1 ⇣ ↵˜Gp t−1(vt−1) + ✏p t−1 ⌘ −1 P P X p=1 TopK ⇣ ↵˜Gp t−1(vt−1) + ✏p t−1 ⌘)))))  ✓ γ + ⇠ P ◆ t X k=1 γk−1kxt−k+1 −xt−kk. (9) We now use the previous result to bound a quantity that represents the difference between the updates based on the TopK procedure and those based on full gradients. Lemma 2. Under the assumptions above, taking expectation with respect to gradients at time t: E "))))) 1 P P X p=1 ⇣ ↵˜Gp t (vt) ⌘ −1 P P X p=1 TopK ⇣ ↵˜Gp t (vt) + ✏p t ⌘))))) # (γ + 1) ✓ γ + ⇠ P ◆ t X k=1 γk−1kxt−k+1 −xt−kk+ ✓ γ + ⇠ P ◆ ↵M. (10) Before we move on, we must introduce some notation. Set constants C = (γ + 1) ✓ γ + ⇠ P ◆1 X k=1 γk−1 = 1 + γ 1 −γ ✓ γ + ⇠ P ◆ , and C0 = C + ✓ γ + ⇠ P ◆ = ✓ γ + ⇠ P ◆ 2 1 −γ . The Convergence Bound. Our main result in this section is the following: Theorem 1. Assume that W is a rate supermartingale with horizon B for the sequential SGD algorithm and that W is H-Lipschitz in the first coordinate. Assume further that ↵HMC0 < 1. Then for any T B, the probability that vs 62 S for all s T is: Pr [FT ]  E [W0 (v0)] (1 −↵HMC0) T . (11) The proof proceeds by defining a carefully-designed random process with respect to the iterate vt, and proving that it is a rate supermartingale assuming the existence of W. We now apply this result with the martingale Wt for the sequential SGD process that uses the average of P stochastic gradients as an update (so that ˜ M = M in Statement 2). We obtain: 6 Corollary 1. Assume that we run Algorithm 1 for minimizing a convex function f satisfying the listed assumptions. Suppose that the learning rate is set to ↵, with: ↵< min ⇢2c✏ M 2 , 2 (c✏−p✏MC0) M 2 0 . Then for any T > 0 the probability that vi 62 S for all i T is: Pr (FT )  ✏ (2↵c✏−↵2M 2 −↵2p✏MC0) T log ✓ekv0 −x⇤k2 ✏ ◆ . (12) Note that the learning rate is chosen so that the denominator on the right-hand side is positive. This is discussed in further detail in Section 6. Compared to the sequential case (Statement 2), the convergence rate for the TopK algorithm features a slowdown of ↵2p✏MC0. Assuming that P is constant with respect to n/K, C0 = r n −K n + ⇠ P ! 2 1 − q n−K n = 2 n K r n −K n + ⇠ P ! 1 + r n −K n ! = O ⇣n K ⌘ . Hence, the slowdown is linear in n/K and ⇠/P. In particular, the effect of ⇠is dampened by the number of nodes. 5 Analysis for the Non-Convex Case We now consider the more general case when SGD is minimizing a (not necessarily convex) function f, using SGD with (decreasing) step sizes ↵t. Again, we assume that the bound (2) holds. We also assume that f is L-Lipschitz smooth. As is standard in non-convex settings [18], we settle for a weaker notion of convergence, namely: min t2{1,...,T } E ⇥ krf (vt) k2⇤T !1 −! 0, that is, the algorithm converges ergodically to a point where gradients are 0. Our strategy will be to leverage the bound on the difference between the “real” model xt and the view vt observed at iteration t to bound the expected value of f(vt), which in turn will allow us to bound 1 PT t=1 ↵t T X t=1 ↵tE ⇥ krf (vt) k2⇤ , where the parameters ↵t are appropriately chosen decreasing learning rate parameters. We start from: Lemma 3. For any time t ≥1: kvt −xtk2 ⇣ 1 + ⇠ P γ ⌘2 Pt k=1 % 2γ2&k kxt−k+1 −xt−kk2. We will leverage this bound on the gap to prove the following general bound: Theorem 2. Consider the TopK algorithm for minimising a function f that satisfies the assumptions in this section. Suppose that the learning rate sequence and K are chosen so that for any time t > 0: t X k=1 % 2γ2&k ↵2 t−k ↵t D (13) for some constant D > 0. Then, after running Algorithm 1 for T steps: 1 PT t=1 ↵t T X t=1 ↵tE ⇥ krf (vt) k2⇤ 4 (f (x0) −f (x⇤)) PT t=1 ↵t + ✓ 2LM 2 + 4L2M 2 ⇣ 1 + ⇠ P γ ⌘2 D ◆PT t=1 ↵2 t PT t=1 ↵t . (14) Notice again that the effect of ⇠in the bound is dampened by P. One can show that inequality (13) holds whenever K = cn for some constant c > 1 2 and the step sizes are chosen so that ↵t = t−✓for a constant ✓> 0. When K = cn with c > 1 2, a constant learning rate depending on the number of iterations T can also be used to ensure ergodic convergence. We refer the reader to the full version of our paper for a complete derivation [3]. 7 0 10 20 30 40 Epoch 0.2 0.4 0.6 0.8 1.0 1.2 Emprirical ξ TopK [K=1.0%] TopK [K=10.0%] (a) Empirical ⇠logistic/RCV1. 0 10 20 30 40 Epoch 2 4 6 8 10 12 Emprirical ξ TopK [K=1.0%] TopK [K=10.0%] (b) Empirical ⇠synthetic. 0 20 40 60 80 100 Epoch 1.2 1.4 1.6 1.8 2.0 2.2 2.4 Emprirical ξ TopK [K=1.0%] TopK [K=10.0%] (c) Empirical ⇠ResNet110. Figure 1: Validating Assumption 1 on various models and datasets. 6 Discussion and Experimental Validation The Analytic Assumption. We start by empirically validating Assumption 1 in Figure 1 on two regression tasks (a synthetic linear regression task of dimension 1,024, and logistic regression for text categorization on RCV1 [15]), as well as ResNet110 [13] on CIFAR-10 [14]. Exact descriptions of the experimental setup are given in the full version of the paper [5]. Specifically, we sample gradients at different epochs during the training process, and bound the constant ⇠by comparing the left and right-hand sides of Equation (8). The assumption appears to hold with relatively low, stable values of the constant ⇠. We note that RCV1 is relatively sparse (average density ' 10%), while gradients in the other two settings are fully dense. Additionally, we present an intuitive justification why Assumption 1 can be seen as a bound on the variance of the local gradients with respect to the global variance. Through a series of elementary operations, one can obtain: k✏tk1 P P X p=1 k✏p t k1 P t X k=1 γk P X p=1 k↵˜Gp t−k+1k, (15) which in turn implies that: kTopK 1 P P X p=1 ⇣ ↵˜Gp t (vt) + ✏p t ⌘! − P X p=1 1 P TopK ⇣ ↵˜Gp t (vt) + ✏p t ⌘ k γ↵k ˜Gtk+ γ P k✏tk+ γ P P X p=1 k✏p t k+γ↵ P P X p=1 k↵˜Gp t (vt) k (16) The left-hand side of (16) is the quantity we wanted to control via Assumption 1. The first term on the right-hand side is the global (averaged) gradient at time t, while the remaining terms are all bounded by a dampened sum of local gradients, as per equation (15). Therefore, assuming a bound on the variance of the local gradients with respect to the global variance is equivalent to saying that the left-hand side of (16) is bounded by the the norm of the global gradient, at least in expectation. This is exactly the intention behind Assumption 1. Note also that equation (15) provides a bound on the norm of the error term at time t, which is similar to the one in Lemma 1, but expressed in terms of the norms of the local gradients. One can build on this argument and our techniques in Section 4 to show convergence of the TopK algorithm directly. However, such analysis will rely on a bound on the variance of the local gradients (as apposed to the bound in equation (2)), which is a strong assumption that ignores the effect of averaging over the P nodes. In contrast, Assumption 1 allows for a more elegant analysis that provides better convergence rates, which are due to the averaging of the local gradients at every step of the TopK algorithm. We refer to the full version of our paper for further details. Learning Rate and Variance. In the convex case, the choice of learning rate must ensure both 2↵c✏−↵2M 2 > 0 and ↵HMC0 < 1, implying ↵< min ⇢2c✏ M 2 , 2 (c✏−p✏MC0) M 2 0 . (17) Note that this requires the second term to be positive, that is ✏> ⇣ MC0 c ⌘2 . Hence, if we aim for convergence within a small region around the optimum, we may need to ensure that gradient variance is bounded, either by minibatching or, empirically, by gradient clipping [17]. 8 The Impact of the Parameter K and Gradient “Shape.” In the convex case, the dependence on the convergence with respect to K and n is encapsulated by the parameter C0 = O(n/K) assuming P is constant. Throughout the analysis, we only used worst-case bounds on the norm gap between the gradient and its top K components. These bounds are tight in the (unlikely) case where the gradient values are uniformly distributed; however, there is empirical evidence showing that this is not the case in practice [19], suggesting that this gap should be smaller. The algorithm may implicitly exploit this narrower gap for improved convergence. Please see Figure 2 for empirical validation of this claim, confirming that the gradient norm is concentrated towards the top elements. 0 20 40 60 80 100 K in percentage 0.0 0.2 0.4 0.6 0.8 1.0 Norm Difference Full - TopK (a) TopK norm RCV1. 0 20 40 60 80 100 K in percentage 0.0 0.2 0.4 0.6 0.8 1.0 Norm Difference Full - TopK (b) TopK norm synthetic. 0 20 40 60 80 100 K in percentage 0.0 0.2 0.4 0.6 0.8 1.0 Norm Difference Full - TopK (c) TopK norm ResNet110. Figure 2: Examining the value of k ˜G −TopK( ˜G)k/k ˜Gk versus K on various datasets/tasks. Every line represents a randomly chosen gradient per epoch during training with standard hyper parameters. In the non-convex case, the condition K = cn with c > 1/2 is quite restrictive. Again, the condition is required since we are assuming the worst-case configuration (uniform values) for the gradients, in which case the bound in Lemma 4 is tight. However, we argue that in practice gradients are unlikely to be uniformly distributed; in fact, empirical studies [19] have noticed that usually gradient components are normally distributed, which should enable us to improve this lower bound on c. Comparison with SGD Variants. In the convex case, we note that, when K is a constant fraction of n, the convergence of the TopK algorithm is essentially dictated by the Lipschitz constant of the supermartingale W, and by the second-moment bound M, and will be similar to sequential SGD. Please see Figure 3 for an empirical validation of this fact. 0 10 20 30 40 50 Epoch 0.550 0.575 0.600 0.625 0.650 0.675 0.700 Error TopK [K=0.1%] TopK [K=1.0%] TopK [K=10.0%] Baseline (a) RCV1 convergence. 0 10 20 30 40 50 Epoch 50 100 150 200 Error TopK [K=0.1%] TopK [K=1.0%] TopK [K=10.0%] Baseline (b) Linear regression. 0 25 50 75 100 125 150 Epoch 0.0 0.5 1.0 1.5 2.0 Error TopK [K=0.025%] TopK [K=0.1%] TopK [K=0.2%] Baseline (c) ResNet110 on CIFAR10. Figure 3: Examining convergence versus value of K on various datasets and tasks. Compared to asynchronous SGD, the convergence rate of the TopK algorithm is basically that of an asynchronous algorithm with maximum delay ⌧= O(pn/K). That is because an asynchronous algorithm with dense updates and max delay ⌧has a convergence slowdown of ⇥(⌧pn) [8, 16, 3]. We note that, for large sparsity (0.1%—1%), there is a noticeable convergence slowdown, as predicted. The worst-case convergence of TopK is similar to SGD with stochastic quantization, e.g., [4, 28]: for instance, for K = pn, the worst-case convergence slowdown is O(pn), the same as QSGD [4]. The TopK procedure is arguably simpler to implement than the parametrized quantization and encoding techniques required to make stochastic quantization behave well [4]. Here, TopK had superior convergence rate compared to stochastic quantization/sparsification [4, 28] given the same communication budget per node. 7 Conclusions We provided the first theoretical analysis of the “TopK” sparsification communication-reduction technique. Our approach should extend to methods combining sparsification with quantization by reduced precision [2, 25] and methods using approximate quantiles [2, 17]. We provide a theoretical foundation for empirical results shown with large-scale experiments on recurrent neural networks on production-scale speech, neural machine translation, as well as image classification tasks [9, 17, 25, 2]. 9 Acknowledgement This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie Grant Agreement No. 665385. References [1] Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. Tensorflow: A system for large-scale machine learning. In OSDI, volume 16, pages 265–283, 2016. [2] Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. arXiv preprint arXiv:1704.05021, 2017. [3] Dan Alistarh, Christopher De Sa, and Nikola Konstantinov. The convergence of stochastic gradient descent in asynchronous shared memory. arXiv preprint arXiv:1803.08841, 2018. [4] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Randomized quantization for communication-efficient stochastic gradient descent. In Proceedings of NIPS 2017, 2017. [5] Dan Alistarh, Torsten Hoefler, Mikael Johansson, Sarit Khirirat, Nikola Konstantinov, and Cédric Renggli. The convergence of sparsified gradient methods. arXiv preprint arXiv:1809.10505, 2018. [6] Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274, 2015. [7] Trishul M Chilimbi, Yutaka Suzue, Johnson Apacible, and Karthik Kalyanaraman. Project adam: Building an efficient and scalable deep learning training system. In OSDI, volume 14, pages 571–582, 2014. [8] Christopher De Sa, Ce Zhang, Kunle Olukotun, and Christopher Ré. Taming the wild: A unified analysis of Hogwild. Style Algorithms. In NIPS, 2015. [9] Nikoli Dryden, Sam Ade Jacobs, Tim Moon, and Brian Van Essen. Communication quantization for data-parallel training of deep neural networks. In Proceedings of the Workshop on Machine Learning in High Performance Computing Environments, pages 1–8. IEEE Press, 2016. [10] John C Duchi, Sorathan Chaturapruek, and Christopher Ré. Asynchronous stochastic convex optimization. arXiv preprint arXiv:1508.00882, 2015. [11] Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017. [12] Demjan Grubic, Leo Tam, Dan Alistarh, and Ce Zhang. Synchronous multi-gpu training for deep learning with low-precision communications: An empirical study. In EDBT, pages 145–156, 2018. [13] 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. [14] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [15] David D Lewis, Yiming Yang, Tony G Rose, and Fan Li. Rcv1: A new benchmark collection for text categorization research. Journal of machine learning research, 5(Apr):361–397, 2004. [16] Xiangru Lian, Yijun Huang, Yuncheng Li, and Ji Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Advances in Neural Information Processing Systems, pages 2737–2745, 2015. [17] Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887, 2017. 10 [18] Ji Liu and Stephen J Wright. Asynchronous stochastic coordinate descent: Parallelism and convergence properties. SIAM Journal on Optimization, 25(1):351–376, 2015. [19] M. Rastegari, V. Ordonez, J. Redmon, and A. Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, 2016. [20] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in neural information processing systems, pages 693–701, 2011. [21] Cèdric Renggli, Dan Alistarh, and Torsten Hoefler. Sparcml: High-performance sparse communication for machine learning. arXiv preprint arXiv:1802.08021, 2018. [22] F. Seide, H. Fu, L. G. Jasha, and D. Yu. 1-bit stochastic gradient descent and application to data-parallel distributed training of speech dnns. Interspeech, 2014. [23] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit Stochastic Gradient Descent and its Application to Data-parallel Distributed Training of Speech DNNs. In Fifteenth Annual Conference of the International Speech Communication Association, 2014. [24] Reza Shokri and Vitaly Shmatikov. Privacy-preserving deep learning. In Proceedings of the 22nd ACM SIGSAC conference on computer and communications security, pages 1310–1321. ACM, 2015. [25] Nikko Strom. Scalable distributed dnn training using commodity gpu cloud computing. In Sixteenth Annual Conference of the International Speech Communication Association, 2015. [26] Xu Sun, Xuancheng Ren, Shuming Ma, and Houfeng Wang. meprop: Sparsified back propagation for accelerated deep learning with reduced overfitting. arXiv preprint arXiv:1706.06197, 2017. [27] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, pages 4278–4284, 2017. [28] Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communication-efficient distributed optimization. arXiv preprint arXiv:1710.09854, 2017. [29] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pages 1508–1518, 2017. [30] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pages 1508–1518, 2017. [31] Eric P Xing, Qirong Ho, Wei Dai, Jin Kyu Kim, Jinliang Wei, Seunghak Lee, Xun Zheng, Pengtao Xie, Abhimanu Kumar, and Yaoliang Yu. Petuum: A new platform for distributed machine learning on big data. IEEE Transactions on Big Data, 1(2):49–67, 2015. [32] Yang You, Igor Gitman, and Boris Ginsburg. Scaling sgd batch size to 32k for imagenet training. arXiv preprint arXiv:1708.03888, 2017. [33] Dong Yu, Adam Eversole, Mike Seltzer, Kaisheng Yao, Zhiheng Huang, Brian Guenter, Oleksii Kuchaiev, Yu Zhang, Frank Seide, Huaming Wang, et al. An introduction to computational networks and the computational network toolkit. Microsoft Technical Report MSR-TR-2014–112, 2014. [34] Jian Zhang, Ioannis Mitliagkas, and Christopher Ré. Yellowfin and the art of momentum tuning. arXiv preprint arXiv:1706.03471, 2017. 11
2018
216
7,382
Deepcode: Feedback Codes via Deep Learning Hyeji Kim⇤, Yihan Jiang†, Sreeram Kannan†, Sewoong Oh‡, Pramod Viswanath‡ Samsung AI Centre Cambridge*, University of Washington†, University of Illinois at Urbana Champaign‡ Abstract The design of codes for communicating reliably over a statistically well defined channel is an important endeavor involving deep mathematical research and wideranging practical applications. In this work, we present the first family of codes obtained via deep learning, which significantly beats state-of-the-art codes designed over several decades of research. The communication channel under consideration is the Gaussian noise channel with feedback, whose study was initiated by Shannon; feedback is known theoretically to improve reliability of communication, but no practical codes that do so have ever been successfully constructed. We break this logjam by integrating information theoretic insights harmoniously with recurrent-neural-network based encoders and decoders to create novel codes that outperform known codes by 3 orders of magnitude in reliability. We also demonstrate several desirable properties in the codes: (a) generalization to larger block lengths; (b) composability with known codes; (c) adaptation to practical constraints. This result also presents broader ramifications to coding theory: even when the channel has a clear mathematical model, deep learning methodologies, when combined with channel-specific information-theoretic insights, can potentially beat state-of-the-art codes, constructed over decades of mathematical research. 1 Introduction The ubiquitous digital communication enabled via wireless (e.g. WiFi, mobile, satellite) and wired (e.g. ethernet, storage media, computer buses) media has been the plumbing underlying the current information age. The advances of reliable and efficient digital communication have been primarily driven by the design of codes which allow the receiver to recover messages reliably and efficiently under noisy environments. The discipline of coding theory has made significant progresses in the past seven decades since Shannon’s celebrated work in 1948 [1]. As a result, we now have near optimal codes in a canonical setting, namely, Additive White Gaussian Noise (AWGN) channel. However, several channel models of great practical interest lack efficient and practical coding schemes. Channels with feedback (from the receiver to the transmitter) is an example of a long-standing open problem and with significant practical importance. Modern wireless communication includes feedback, in one form or the other; for example, the feedback can be the received value itself or quantization of the received value or an automatic repeat request (ARQ) [2]. Accordingly, there are different models for channels with feedback, and among them, the AWGN channel with output feedback is a model that captures the essence of channels with feedback; this model is also classical, introduced by Shannon in 1956 [3]. In this channel model, the received value is fed back (with ⇤H. Kim is with Samsung AI Centre Cambridge, UK. Email: hkim1505@gmail.com †Y. Jiang and S. Kannan are with the Department of Electrical Engineering at University of Washington. Email: yihanrogerjiang@gmail.com and ksreeram@uw.edu. ‡S. Oh and P. Viswanath are with the Coordinated Science Lab at University of Illinois at Urbana Champaign (UIUC). S. Oh is with the Department of Industrial and Enterprise Systems Engineering at UIUC. P. Viswanath is with the Department of Electrical Engineering at UIUC. Email: {swoh,pramodv}@illinois.edu 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. unit time delay) to the transmitter without any processing (we refer to Figure 1 for an illustration of channel). Designing codes for this channel via deep learning approaches is the central focus of this paper. While the output feedback does not improve the Shannon capacity of the AWGN channel [3], it is known to provide better reliability at finite block lengths [4]. On the other hand, practical coding schemes have not been successful in harnessing the feedback gain thereby significantly limiting the use of feedback in practice. This state of the art is at odds with the theoretical predictions of the gains in reliability via using feedback: the seminal work of Schalkwijk-Kailath [4] proposed S-K scheme, a (theoretically) achievable scheme with superior reliability guarantees, but which suffers from extreme sensitivity to both the precision of the numerical computation and noise in the feedback [5, 6]. Another competing scheme of [7] is designed for channels with noisy feedback, but not only is the reliability poor, it is almost independent of the feedback quality, suggesting that the feedback data is not being fully exploited. More generally, it has been proven that no linear code incorporating the noisy output feedback can perform well [8]. This is especially troubling since all practical codes are linear and linear codes are known to achieve capacity (without feedback) [9]. In this paper, we demonstrate new neural network-driven encoders (with matching decoders) that operate significantly better (100–1000 times) than state of the art, on the AWGN channel with (noisy) output feedback. We show that architectural insights from simple communication channels with feedback when coupled with recurrent neural network architectures can discover novel codes. We consider Recurrent Neural Network (RNN) parameterized encoders (and decoders), which are inherently nonlinear and map information bits directly to real-valued transmissions in a sequential manner. Designing codes driven by deep learning has been of significant interest recently [10–25], starting from [10] which proposes an autoencoder framework for communications. In [10], it is demonstrated that for classical AWGN channels, feedforward neural codes can mimic the performance of a wellknown code for a short block length (4 information bits). Extending this idea to orthogonal frequency division multiplex (OFDM), [11, 12] show that neural codes can mimic the performance of stateof-the-art codes for short block lengths (8 information bits). Several results extend the autoencoder idea to other settings of AWGN channels [13] and modulation [26]). Beyond AWGN channels, [14] considers the problem of communicating a complicated source (text) over erasure channels and shows that RNN-based neural codes that map raw texts directly to a codeword can beat the state-of-the art codes, when the reliability is evaluated by human (as opposed to bit error rate). Deep learning has been applied also in the problem of designing decoders for existing encoders [15–19], demonstrating the efficiency, robustness, and adaptivity of neural decoders over the existing decoders. In a different context, for distributed computation, where encoder adds redundant computations so that the decoder can reliably approximate the desired computations under unavailabilities, [20] showed that neural network based codes can beat the state of the art codes. While several works in the past years apply deep learning for channel coding, very few of them consider the design of novel codes using deep learning (rather than decoders). Furthermore, none of them are able to beat state-of-the-art codes on a standard (well studied) channel. We demonstrate first family of codes obtained via deep learning which beats state-of-the-art codes, signaling a potential shift in code design, which historically has been driven by individual human ingenuity with sporadic progress over the decades. Henceforth, we call this new family of codes Deepcode. We also demonstrate the superior performance of variants of Deepcode under a variety of practical constraints. Furthermore, Deepcode has complexity comparable to traditional codes, even without any effort at optimizing the storage and run-time complexity of the neural network architectures. Our main contributions are as follows: 1. We demonstrate Deepcode – a new family of RNN-driven neural codes that have three orders of magnitude better reliability than state of the art with both noiseless and noisy feedback. Our results are significantly driven by the intuition obtained from information and coding theory, in designing a series of progressive improvements in the neural network architectures (Section 3 and 4). 2. We show that variants of Deepcode significantly outperform state-of-the art codes under a variety of practical constraints (example: delayed feedback, very noisy feedback link) (Section 4). 2 3. We show composability: Deepcode naturally concatenates with a traditional inner code and demonstrates continued improvements in reliability as the block length increases (Section 4). 4. Our interpretation and analysis of Deepcode provide guidance on the fundamantal understanding of how the feedback can be used and some information theoretic insights into designing codes for channels with feedback (Section 5). 2 Problem formulation The most canonical channel studied in the literature (example: textbook material [27]) and also used in modeling practical scenarios (example: 5G LTE standards) is the Additive White Gaussian Noise (AWGN) channel without feedback. Concretely, the encoder takes in K information bits jointly, b = (b1, · · · , bK) 2 {0, 1}K, and outputs n real valued signals to be transmitted over a noisy channel (sequentially). At the i-th transmission for each i 2 {1, . . . , n}, a transmitted symbol xi 2 R is corrupted by an independent Gaussian noise ni ⇠N(0, σ2), and the decoder receives yi = xi + ni 2 R. After receiving the n received symbols, the decoder makes a decision on which information bit b was sent, out of 2K possible choices. The goal is to maximize the probability of correctly decoding the received symbols and recover b. Both the encoder and the decoder are functions, mapping b 2 {0, 1}K to x 2 Rn and y 2 Rn to ˆb 2 {0, 1}K, respectively. The design of a good code (an encoder and a corresponding decoder) addresses both (i) the statistical challenge of achieving a small error rate; and (ii) the computational challenge of achieving the desired error rate with efficient encoder and decoder. Almost a century of progress in this domain of coding theory has produced several innovative codes that efficiently achieve small error rate, including convolutional codes, Turbo codes, LDPC codes, and polar codes. These codes are known to perform close to the fundamental limits on reliable communication [28]. BLER SNR = −10 log10 σ2 Figure 1: AWGN channel with noisy feedback (left). Deepcode significantly outperforms the baseline of S-K and the state-of-the art codes, on block-length 50 and noiseless feedback (right). In a canonical AWGN channel with noisy feedback, the received symbol yi is transmitted back to the encoder after one unit time of delay and via another additive white Gaussian noise feedback channel (Figure 1). The encoder can use this feedback symbol to sequentially and adaptively decide what symbol to transmit next. At time i the encoder receives a noisy view of what was received at the receiver (in the past by one unit time), ˜yi−1 = yi−1 + wi−1 2 R, where the noise is independent and distributed as wi−1 ⇠N(0, σ2 F ). Formally, an encoder is now a function that sequentially maps the information bit vector b and the feedback symbols ˜yi−1 1 = (˜y1, · · · , ˜yi−1) received thus far to a transmit symbol xi: fi : (b, ˜yi−1 1 ) 7! xi, i 2 {1, · · · , n} and a decoder is a function that maps the received sequence yn 1 = (y1, · · · , yn) into estimated information bits: g : yn 1 7! ˆb 2 {0, 1}K. The standard measures of performance are the average bit error rate (BER) defined as BER ⌘ (1/K) PK i=1 P(bi 6= ˆbi) and the block error rate (BLER) defined as BLER ⌘P(b 6= ˆb), where the randomness comes from the forward and feedback channels and any other sources of randomness that might be used in the encoding and decoding processes. It is standard (both theoretically and practically) to have an average power constraint, i.e., (1/n)E[kxk2] 1, where x = (x1, · · · , xn) and the expectation is over the randomness in choosing the information bits b uniformly at random, the randomness in the noisy feedback symbols ˜yi’s, and any other randomness used in the encoder. 3 While the capacity of the channel remains the same in the presence of feedback [3], the reliability can increase significantly as demonstrated by the celebrated result of Schalkwijk and Kailath (S-K), [4], which is described in detail in Appendix D. Although the optimal theoretical performance is met by the S-K code, critical drawbacks make it fragile. Theoretically, the scheme critically relies on exactly noiseless feedback (i.e. σ2 F = 0), and does not extend to channels with even arbitrarily small amount of noise in the feedback (i.e. σ2 F > 0). Practically, the scheme is extremely sensitive to numerical precisions; we see this in Figure 1, the numerical errors dominate the performance of the S-K scheme, with a practical choice of MATLAB implementation with a precision of 16 bits to represent floating-point numbers. Even with a noiseless feedback channel with σ2 F = 0, which the S-K scheme is designed for, it is outperformed significantly by our proposed Deepcode (described in detail in Section 3). At moderate SNR of 2 dB, Deepcode can outperform S-K scheme by three orders of magnitude in BLER. The resulting BLER is shown as a function of the Signal-to-Noise Ratio (SNR) defined as −10 log10 σ2. Also shown as baselines are the state-of-the art polar, LDPC, and tail-bitting convolutional codes (TBCC) in a 3GPP document for the 5G meeting [29] (we refer to Appendix A for the details of these codes used in the simulation). Deepcode significantly improves over all state-of-the-art codes of similar block-length and the same rate. Also plotted as a baseline are the theoretically estimated performance of the best code with no efficient decoding schemes. This impractical baseline lies between approximate achievable BLER (labelled Normapx in the figure) and a converse to the BLER (labelled Converse in the figure) from [28, 30]. More recently proposed schemes address S-K scheme’s sensitivity to noise in the feedback, but either still suffer from similar sensitivity to numerical precisions at the decoder [31], or is incapable of exploiting the feedback information [7] as we illustrate in Figure 4. 3 Neural encoder and decoder A natural strategy to create a feedback code is to utilize a recurrent neural network (RNN) as an encoder since (i) communication with feedback is naturally a sequential process and (ii) to exploit the sequential structure for efficient decoding. We propose representing the encoder and the decoder as RNNs, training them jointly under AWGN channels with noisy feedback, and minimizing the error in decoding the information bits. However, in our experiments, we find that this strategy by itself is insufficient to achieve any performance improvement with feedback. We exploit information theoretic insights to enable improved performance, by considering the erasure channel with feedback: here transmitted bits are either received perfectly or erased and whether the previous bit was erased or received perfectly is fed back to the transmitter. In such a channel, the following two-phase scheme can be used: transmit a block of symbols, and then transmit whichever symbols were erased in the first block (and ad infinitum). This motivates a two-phase scheme, where uncoded bits are sent in the first phase, and then based on the feedback in the first phase, coded bits are sent in the second phase; thus the code only needs to be designed for the second phase. Even inside this two-phase paradigm, several architectural choices need to be made. We show in this section that these intuitions can be critically employed to innovate neural network architectures. Our experiments focus on the setting of rate 1/3 and information block length of 50 for concreteness1. That is, the encoder maps K = 50 message bits to a codeword of length n = 150. We discuss generalizations to longer block lengths in Section 4. A. RNN feedback encoder/decoder (RNN (linear) and RNN (tanh)). We propose an encoding scheme that progresses in two phases. In the first phase, the K information bits are sent raw (uncoded) over the AWGN channel. In the second phase, 2K coded bits are generated based on the information bits b and (delayed) output feedback and sequentially transmitted. We propose a decoding scheme using two layers of bidirectional Gated Recurrent Units (GRU). When jointly trained, a linear RNN encoder achieves performance close to Turbo code that does not use the feedback information at all as shown in Figure 2. With a non-linear activation function of tanh(·), the performance improves, achieving BER close to the existing S-K scheme. Such a gain of non-linear codes over linear ones is in-line with theory [31]. 1Source codes are available under https://github.com/hyejikim1/feedback_code (Keras) and https://github.com/yihanjiang/feedback_code (PyTorch). 4 Encoder A: RNN feedback encoder BER SNR =−10 log10 σ2 Figure 2: Building upon a simple linear RNN encoder (left), we progressively improve the architecture. Eventually with RNN(tanh)+ZP+W+A architecture formally described in Section 3, we significantly outperform the baseline of S-K scheme and Turbo code, by several orders of magnitude in the bit error rate, on block-length 50 and noiseless feedback (σ2 F = 0). Encoding. The architecture of the encoder is shown in Figure 2. The encoding process has two phases. In the first phase, the encoder simply transmits the K raw message bits. That is, the encoder maps bk to ck = 2bk −1 for k 2 {1, · · · , K}, and stores the feedback ˜y1, · · · , ˜yK for later use. In the second phase, the encoder generates a coded sequence of length 2K (length (1/r −1)K for general rate r code) through a single directional RNN. In particular, each k-th RNN cell generates two coded bits ck,1, ck,2 for k 2 {1, . . . , K}, which uses both the information bits and (delayed) output feedback from the earlier raw information bit transmissions. The input to the k-th RNN cell is of size four: bk, ˜yk −ck (the estimated noise added to the k-th message bit in phase 1) and the most recent two noisy feedbacks from phase 2: ˜yk−1,1 −ck−1,1 and ˜yk−1,2 −ck−1,2. Note that we use ˜yk,j = ck,j + nk,j + wk,j to denote the feedback received from the transmission of ck,j for k 2 {1, · · · , K} and j 2 {1, 2}, and nk,j and wk,j are corresponding forward and feedback channel noises, respectively. To generate codewords that satisfy power constraint, we put a normalization layer to the RNN outputs so that each coded bit has a mean 0 and a variance 1. During training, the normalization layer subtracts the batch mean from the output of RNN and divide by the standard deviation of the batch. After training, we compute the mean and the variance of the RNN outputs over 106 examples. In testing, we use the precomputed means and variances. Further implementation details are in Appendix B. Decoding. Based on the received sequence y = (y1, · · · , yk, y1,1, y1,2, y2,1, y2,2, · · · , yK,1, yK,2) of length 3K, the decoder estimates K information bits. For the decoder, we use a two-layered bidirectional Gated Recurrent Unit (GRU), where the input to the k-th GRU cell is a tuple of three received symbols, (yk, yk,1, yk,2). We refer to Appendix B for more implementation details. Training. Both the encoder and decoder are trained jointly using binary cross-entropy as the loss function over 4 ⇥106 examples, with batch size 200, via an Adam optimizer (β1=0.9, β2=0.999, ✏=1e-8). The input to the neural network is K information bits and the output is K estimated bits (as in the autoencoder setting). During the training, we let K = 100. AWGN channels are simulated for the channels from the encoder to the decoder and from decoder to the encoder. In training, we let the forward SNR equal to be test SNR and feedback SNR to be the test feedback SNR. We randomly initialize weights of the encoder and the decoder. We observed that training with random initialization of encoder-decoder gives a better encoder-decoder compared to initializing with a pre-trained encoder/decoder by sequential channel codes for non-feedback AWGN channels (e.g. convolutional codes). We also use a decaying learning rate and gradient clipping; we reduce the learning rate by 10 times after training with 106 examples, starting from 0.02. Gradients are clipped to 1 if L2 norm of the gradient exceeds 1 so that we prevent the gradients from getting too large. Typical error analysis. Due to the recurrent structure in generating coded bits (ck,1, ck,2), the coded bit stream carries more information on the first few bits than last few bits (e.g. b1 than bK). This results in more errors in the last information bits, as shown in Figure 3, where we plot the average BER of bk for k = {1, · · · , K}. 5 BER of bk Position (k) σ2 Position (k) Figure 3: (Left) A naive RNN(tanh) code gives a high BER in the last few information bits. With the idea of zero padding and power allocation, the RNN(tanh)+ZP+W+A architecture gives a BER that varies less across the bit position, and overall BER is significantly improved over the naive RNN(tanh) code. (Middle) Noise variances across bit position which results in a block error: High noise variance on the second parity bit stream (c1,2, · · · , cK,2) causes a block error. (Right) Noise covariance: Noise sequence which results in a block error does not have a significant correlation across position. B. RNN feedback code with zero padding (RNN (tanh) + ZP). In order to reduce high errors in the last information bits, as shown in Figure 3, we apply the zero padding (ZP) technique; we pad a zero in the end of information bits, and transmit a codeword for the padded information bits (The encoder and decoder with zero padding are illustrated in Appendix B). By bringing zero padding, the BER of the last information bits, as well as other bits, drops significantly, as shown in Figure 3. Zero padding requires a few extra channel usages (e.g. with 3 symbol zero padding, we map 50 information bits to a codeword of length 153). However, due to the significant improvement in BER, it is widely used in sequential codes (e.g. convolutional codes and turbo codes). Typical error analysis. To see if there is a pattern in the noise sequence which makes the decoder fail, we study the first and second order noise statistics which result in the error in decoding. In Figure 3 (Middle), we plot the average variance of noise added to bk in first phase and ck,1 and ck,2 in the second phase, as a function of k. From the figure, we make two observations; (i) large noise in the last bits cause an error, and (ii) large noise in ck,2 is likely to cause an error, which implies that the raw bit stream and the coded bit streams are not equally robust to the noise – an observation that will be exploited next. In Figure 3 (Right), we plot noise covariances that result in a decoding error. From Figure 3 (Right), we see that there is no particular correlation within the noise sequence that makes the decoder fail. This suggests that there is no particular error pattern to be exploited, and the BER performance further improved. C. RNN feedback code with power allocation (RNN(tanh) + ZP + W). Based on the observation that the raw bit ck and coded bit ck,1, ck,2 are not equally robust, as shown in Figure 3 (Middle), we introduce trainable weights which allow allocating different amount of power to the raw bit and coded bits. Appendix B provides all implementation details. By introducing and training these weights, we achieve the improvement in BER as shown in Figures 2 and 3. Typical error analysis. While the average BER is improved by about an order of magnitude for most bit positions as shown in Figure 3 (Left), the BER of the last bit remains about the same. On the other hand, the BER of first few bits are now smaller, suggesting the following bit-specific power allocation method. D. Deepcode: RNN feedback code with bit power allocation (RNN(tanh) + ZP + W + A). We introduce a weight vector allowing the power of bits in different position to be different, as illustrated in Figure 10. Ideally, we would like to reduce the power for the first information bits and increase the power for the last information bits. The resulting BER curve is shown in Figure 2(-o-). We can see that the BER is noticeably decreased. In Figure 3(-o-), we can see that the BER in the last bits are reduced, and we can also see that the BER in the first bits are increased. Our use of unequal power allocation across information bits is in-line with other approaches from information theory [32], [33]. We call this neural code Deepcode. Typical error analysis. As shown in Figure 3, the BER at each position remains about the same except for the last few bits. This suggests a symmetry in our code and nearest-neighbor-like decoder. For an AWGN channel without feedback, it is known that the optimal decoder (nearest neighbor 6 decoder) under a symmetric code (in particular, each coded bit follows a Gaussian distribution) is robust to the distribution of noise [34]; the BER does not increase if we keep the power of noise and only change the distribution. As an experiment demonstrating the robustness of Deepcode, in Appendix E, we show that BER of Deepcode does not increase if we keep the power of noise and change the distribution from i.i.d. Gaussian to bursty Gaussian noise. Complexity. Complexity and latency, as well as reliability, are important metrics in practice, as the encoder and decoder need to run in real time on mobile devices. Deepcode has computational complexity and latency comparable to currently used codes (without feedback) that are already in communication standards. Turbo decoder, for example, is a belief-propagation decoder with many (e.g., 10 – 20) iterations, and each iteration is followed by a permutation. Turbo encoder also includes a permutation of information bits (of length K). On the other hand, the proposed neural encoder in Deepcode is a single layered RNN encoder with 50 hidden units, and the neural decoder in Deepcode is a 2-layered GRU decoder, also with 50 hidden units, all of which are matrix multiplications that can be parallelized. Ideas such as knowledge distillation [35] and network binarization [36] can be used to potentially further reduce the complexity of the network. 4 Practical considerations: noise, delay, coding in feedback, and blocklength We considered so far the AWGN channel with noiseless output feedback with a unit time-step delay. In this section, we demonstrate the robustness of Deepcode (and its variants) under two variations on the feedback channel, noise and delay, and present generalization to longer block lengths. We show that (a) Deepcode and its variant that allows a K-step delayed feedback are more reliable than the state-of-the-art schemes in channels with noisy feedback; (b) by allowing the receiver to feed back an RNN encoded output instead of its raw output, and learning this RNN encoder, we achieve a further improvement in reliability, demonstrating the power of encoding in the feedback link; (c) Deepcode concatenated with turbo code achieves superior error rate decay as block length increases with noisy feedback. Noisy feedback. We show that Deepcode trained under AWGN channels with noisy output feedback, achieves a significantly smaller BER than both S-K and C-L schemes under AWGN channels with noisy output feedback. In Figure 4 (Left), we plot the BER as a function of the feedback SNR for S-K scheme, C-L scheme, and Deepcode for a rate 1/3, 50 information bits, where we fix the forward channel SNR to be 0dB. As feedback SNR increases, we expect the BER to decrease. However, as shown in Figure 4 (Left), the C-L scheme, which is designed for noisy feedback, and S-K scheme are very sensitive to noise in the feedback, and reliability is almost independent of feedback quality. Deepcode outperforms these two baseline (linear) codes by a large margin, with decaying error as feedback SNR increases, showing that Deepcode harnesses noisy feedback information to make communication more reliable. This is highly promising as the performance under noisy feedback is directly related to the practical communication channels. Noise feedback with delay. We model the practical constraint of delay in the feedback, by introducing a variant of Deepcode that works with a K time-step delayed feedback (discussed in detail in Appendix B.5); recall K is the number of information bits and this code tolerates a large delay in the feedback. Perhaps unexpectedly, we see from Figure 4 (Left) that this neural code for delayed feedback achieves a similar BER to no delay in the feedback; this is true especially at small feedback SNRs, till around 12dB. Noisy feedback with delay and coding. It is natural to allow the receiver send back a general function of its past received values, i.e., receiver encodes its output and sends the coded (real valued) bit. Designing the code for this setting is challenging as it involves designing two encoders and one decoder jointly in a sequential manner. We propose using RNN as an encoder that maps noisy output to the transmitted feedback, with implementation details in Appendix B.5. Figure 4 demonstrates the powerful encoding of the received output, as learnt by the neural architecture; the BER is improved two-three times. Generalization to longer block lengths. In wireless communications, a wide range of blocklengths are of interest (e.g., 40 to 6144 information bits in LTE standards). In previous sections, we considered block length of 50 information bits. Here we show how to generalize Deepcode to longer block lengths and achieve an improved reliability as we increase the block length. 7 BER SNR of feedback channel BER SNR BER Blocklength Figure 4: (Left) Deepcode (introduced in section 3) and a variant of neural code which allows K timestep delay significantly outperform the two baseline schemes under noisy feedback. Another variant of Deepcode which allows the receiver to feed back an RNN encoded output (with K-step delay) performs even better than the neural code with raw output feedback (with unit-delay), demonstrating the power of coding in the feedback. (Middle) By unrolling the RNN cells of Deepcode, the BER of Deepcode remains the same for block lengths 50 to 500. (Right) Concatenated Deepcode and turbo code (with and without noise in the feedback) achieves BER that decays exponentially as block length increases, faster than turbo codes (without feedback) at same rate. A natural generalization of the RNN-based neural code is to unroll the RNN cells. In Figure 4 (Middle), we plot the BER as a function of the SNR, for 50 information bits and length 500 information bits (under noiseless feedback) when we unroll the RNN cells. We can see that the BER remains the same as we increase block lengths. This is not an entirely satisfying generalization because, typically, it is possible to design a code for which error rate decays faster as block length increases. For example, turbo codes have error rate decaying exponentially (log BER decades linearly) in the block length as shown in Figure 4 (Right). This critically relies on the interleaver, which creates long range dependencies between information bits that are far apart in the block. Given that the neural encoder is a sequential code, there is no strong long range dependence. Each transmitted bit depends on only a few past information bits and their feedback (we refer to Section 5 for a detailed discussion). To resolve this problem, we propose a new concatenated code which concatenates Deepcode (as inner code) and turbo code as an outer code. The outer code is not restricted to a turbo code, and we refer to Appendix C for a detailed discussion. In Figure 4 (Right), we plot the BERs of the concatenated code, under both noiseless and noisy feedback (of feedback SNR 10dB), and turbo code, both at rate 1/9 at (forward) SNR −6.5dB. From the figure, we see that even with noisy feedback, BER drops almost exponentially (log BER drops linearly) as block length increases, and the slope is sharper than the one for turbo codes. We also note that in this setting, C-L scheme suggests not using the feedback. 5 Interpretation Thus far we have used information theoretic insights in driving our deep learning designs. Here, we ask if the deep learning architectures we have learnt can provide an insight to the information theory of communication with feedback. We aim to understand the behavior of Deepcode (i.e., the coded bits generated via RNN in Phase II). We show that in the second phase, (a) the encoder focuses on refining information bits that were corrupted by large noise in the first phase; and (b) the coded bit depends on past as well as current information bits, i.e., coupling in the coding process. Correcting highly corrupted noise in Phase I. The major motivation of the two-phase encoding scheme is that after Phase I, the encoder knows which out of K information bits were corrupted by a large noise, and in Phase II, encoder can focus on refining those bits. In Figure 5, we plot samples of (nk, ck,1) (left) and (nk, ck,2) (right) for bk = 1 and bk = 0 where nk denotes the noise added to the the transmission of bk in the first phase. Consider bk = 1. This figure shows that if the noise added to bit bk in phase 1 is large, encoder generates coded bits close to zero (i.e., does not further refine bk). Otherwise, encoder generates coded bits of large magnitude (i.e., use more power to refine bk). Coupling. A natural question is whether our feedback code is exploiting the memory of RNN and coding information bits jointly. To answer this question, we look at the correlation between 8 ck,1 ck,2 nk nk Figure 5: Noise in first phase vs. first parity bit (left) and second parity bit (right). Blue(x) points are when bk = 1 and Red (o) points are for bk = 0. information bits and the coded bits. If the memory of RNN were not used, we would expect the coded bits (ck,1, ck,2) to depend only on bk. We find that E[ck,1bk] = −0.42, E[ck,1bk−1] = −0.24, E[ck,1bk−2] = −0.1, E[ck,1bk−3] = −0.05, and E[ck,2bk] = 0.57, E[ck,2bk−1] = −0.11, E[ck,2bk−2] = −0.05, E[ck,2bk−3] = −0.02 (for the encoder for forward SNR 0dB and noiseless feedback). This result implies that the RNN encoder does make use of the memory, of length two to three. Overall, our analysis suggests that Deepcode exploits memory and selectively enhances bits that were subject to larger noise - properties reminiscent of any good code. We also observe that the relationship between the transmitted bit and previous feedback demonstrates a non-linear relationship as expected. Thus our code has features requisite of a strong feedback code. Furthermore, improvements can be obtained if instead of transmitting two coded symbols per bit during Phase II, an attention-type mechanism can be used to zoom in on bits that were prone to high noise in Phase I. These insights suggest the following generic feedback code: it is a sequential code with long cumulative memory but the importance of a given bit in the memory is dynamically weighted based on the feedback. 6 Conclusion In this paper we have shown that appropriately designed and trained RNN codes (encoder and decoder), which we call Deepcode, outperform the state-of-the-art codes by a significant margin on the challenging problem of communicating over AWGN channels with noisy output feedback, both on the theoretical model and with practical considerations taken into account. By concatenating Deepcode with a traditional outer code, the BER curve drops significantly with increasing block lengths, allowing generalizations of the learned neural network architectures. The encoding and decoding capabilities of the RNN architectures suggest that new codes could be found in other open problems in information theory (e.g., network settings), where practical codes are sorely missing. 7 Acknowledgment We thank Shrinivas Kudekar and Saurabh Tavildar for helpful discussions and providing references to the state-of-the-art feedforward codes. We thank Dina Katabi for a detailed discussion that prompted work on system implementation. This work is in part supported by National Science Foundation awards CCF-1553452 and RI-1815535, Army Research Office under grant number W911NF-18-10384, and Amazon Catalyst award. Y. Jiang and S. Kannan would also like to acknowledge NSF awards 1651236 and 1703403. References [1] C. E. Shannon, “A mathematical theory of communication, part i, part ii,” Bell Syst. Tech. J., vol. 27, pp. 623–656, 1948. [2] C. J. Il, J. Mayank, S. Kannan, L. Philip, and K. Sachin, “Achieving single channel, full duplex wireless communication,” in Proceedings of the 16th Annual International Conference on Mobile Computing and Networking, MOBICOM 2010, Chicago, Illinois, USA, September 20-24, 2010. [3] C. Shannon, “The zero error capacity of a noisy channel,” IRE Transactions on Information Theory, vol. 2, no. 3, pp. 8–19, 1956. 9 [4] J. Schalkwijk and T. Kailath, “A coding scheme for additive noise channels with feedback–i: No bandwidth constraint,” IEEE Transactions on Information Theory, vol. 12, no. 2, pp. 172–182, 1966. [5] J. Schalkwijk, “A coding scheme for additive noise channels with feedback–ii: Band-limited signals,” IEEE Transactions on Information Theory, vol. 12, no. 2, pp. 183–189, April 1966. [6] R. G. Gallager and B. Nakiboglu, “Variations on a theme by schalkwijk and kailath,” IEEE Transactions on Information Theory, vol. 56, no. 1, pp. 6–17, Jan 2010. [7] Z. Chance and D. J. Love, “Concatenated coding for the AWGN channel with noisy feedback,” IEEE Transactions on Information Theory, vol. 57, no. 10, pp. 6633–6649, Oct 2011. [8] Y.-H. Kim, A. Lapidoth, and T. Weissman, “The Gaussian channel with noisy feedback,” in IEEE International Symposium on Information Theory. IEEE, 2007, pp. 1416–1420. [9] P. Elias, “Coding for noisy channels,” in IRE Convention record, vol. 4, 1955, pp. 37–46. [10] T. J. O’Shea and J. Hoydis, “An introduction to deep learning for the physical layer,” arXiv preprint arXiv:1702.00832, 2017. [11] A. Felix, S. Cammerer, S. Dörner, J. Hoydis, and S. t. Brink, “OFDM-autoencoder for end-to-end learning of communications systems,” arXiv preprint arXiv:1803.05815, 2018. [12] S. Cammerer, S. Dörner, J. Hoydis, and S. ten Brink, “End-to-end learning for physical layer communications,” in The International Zurich Seminar on Information and Communication (IZS 2018) Proceedings. ETH Zurich, 2018, pp. 51–52. [13] T. J. O’Shea, T. Erpek, and T. C. Clancy, “Deep learning based MIMO communications,” CoRR, vol. abs/1707.07980, 2017. [14] N. Farsad, M. Rao, and A. Goldsmith, “Deep learning for joint source-channel coding of text,” IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018. [15] H. Kim, Y. Jiang, R. Rana, S. Kannan, S. Oh, and P. Viswanath, “Communication algorithms via deep learning,” in The International Conference on Representation Learning (ICLR 2018) Proceedings. Vancouver, April, 2018. [16] E. Nachmani, Y. Be’ery, and D. Burshtein, “Learning to decode linear codes using deep learning,” in IEEE 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton) 2016, pp. 341–346. [17] E. Nachmani, E. Marciano, L. Lugosch, W. J. Gross, D. Burshtein, and Y. Be’ery, “Deep learning methods for improved decoding of linear codes,” IEEE Journal of Selected Topics in Signal Processing, 2018. [18] X. Tan, W. Xu, Y. Be’ery, Z. Zhang, X. You, and C. Zhang, “Improving massive MIMO belief propagation detector with deep neural network,” arXiv preprint arXiv:1804.01002, 2018. [19] J. Seo, J. Lee, and K. Kim, “Decoding of polar code by using deep feed-forward neural networks,” International Conference on Computing, Networking and Communications (ICNC), pp. 238–242, March 2018. [20] J. Kosaian, K. Rashmi, and S. Venkataraman, “Learning a code: Machine learning for approximate non-linear coded computation,” arXiv preprint arXiv:1806.01259, 2018. [21] J. Zhao and Z. Gao, “Research on the blind equalization technology based on the complex BP neural network with tunable activation functions,” IEEE 2nd Advanced Information Technology, Electronic and Automation Control Conference (IAEAC), pp. 813–817, March 2017. [22] N. Farsad and A. Goldsmith, “Neural network detection of data sequences in communication systems,” IEEE Transactions on Signal Processing, vol. 66, no. 21, pp. 5663–5678, Nov 2018. [23] H. He, C. Wen, S. Jin, and G. Y. Li, “Deep learning-based channel estimation for beamspace mmWave massive MIMO systems,” CoRR, vol. abs/1802.01290, 2018. [24] H. Sun, X. Chen, M. Hong, Q. Shi, X. Fu, and N. D. Sidiropoulos, “Learning to optimize: Training deep neural networks for interference management,” IEEE Transactions on Signal Processing, August 2018. [25] C.-K. Wen, W.-T. Shih, and S. Jin, “Deep learning for massive MIMO CSI feedback,” IEEE Wireless Communications Letters, December 2017. 10 [26] T. J. O’Shea, K. Karra, and T. C. Clancy, “Learning to communicate: Channel auto-encoders, domain specific regularizers, and attention,” in IEEE International Symposium on Signal Processing and Information Technology (ISSPIT), 2016, pp. 223–228. [27] T. M. Cover and J. A. Thomas, Elements of information theory. John Wiley & Sons, 2012. [28] Y. Polyanskiy, H. V. Poor, and S. Verdú, “Channel coding rate in the finite blocklength regime,” IEEE Transactions on Information Theory, vol. 56, no. 5, pp. 2307–2359, 2010. [29] H. Huawei, “Performance evaluation of channel codes for control channel,” 3GPP TSGRAN WG1 #87 Reno, U.S.A., November 14-18, 2016, vol. R1-1611257. [Online]. Available: www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_87/Docs/R1-1611257.zip [30] T. Erseghe, “On the evaluation of the Polyanskiy-Poor-Verdu converse bound for finite block-length coding in AWGN,” IEEE Transactions on Information Theory, vol. 61, January 2014. [31] Y. H. Kim, A. Lapidoth, and T. Weissman, “The Gaussian channel with noisy feedback,” in IEEE International Symposium on Information Theory, June 2007, pp. 1416–1420. [32] T. Duman and M. Salehi, “On optimal power allocation for turbo codes,” in IEEE International Symposium on Information Theory - Proceedings. IEEE, 1997, p. 104. [33] H. Qi, D. Malone, and V. Subramanian, “Does every bit need the same power? an investigation on unequal power allocation for irregular LDPC codes,” in 2009 International Conference on Wireless Communications Signal Processing, Nov 2009, pp. 1–5. [34] A. Lapidoth, “Nearest neighbor decoding for additive non-Gaussian noise channels,” IEEE Transactions on Information Theory, vol. 42, no. 5, pp. 1520–1529, Sep 1996. [35] G. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” arXiv preprint arXiv:1503.02531, 2015. [36] M. Rastegari, V. Ordonez, J. Redmon, and A. Farhadi, “Xnor-net: Imagenet classification using binary convolutional neural networks,” in European Conference on Computer Vision. Springer, 2016, pp. 525–542. [37] A. Ben-Yishai and O. Shayevitz, “Interactive schemes for the AWGN channel with noisy feedback,” IEEE Transactions on Information Theory, vol. 63, no. 4, pp. 2409–2427, April 2017. [38] G. D. Forney, Jr, MIT Press, Cambridge, MA., 1966. [39] K. Miwa, N. Miki, T. Kawamura, and M. Sawahashi, “Performance of decision-directed channel estimation using low-rate turbo codes for dft-precoded OFDMA,” in IEEE 75th Vehicular Technology Conference (VTC Spring), May 2012, pp. 1–5. 11
2018
217
7,383
Chain of Reasoning for Visual Question Answering Chenfei Wu∗, Jinlai Liu∗, Xiaojie Wang, Xuan Dong Center for Intelligence Science and Technology Beijing University of Posts and Telecommunications {wuchenfei,liujinlai, xjwang, dongxuan8811}@bupt.edu.cn Abstract Reasoning plays an essential role in Visual Question Answering (VQA). Multi-step and dynamic reasoning is often necessary for answering complex questions. For example, a question “What is placed next to the bus on the right of the picture?” talks about a compound object “bus on the right,” which is generated by the relation <bus, on the right of, picture>. Furthermore, a new relation including this compound object <sign, next to, bus on the right> is then required to infer the answer. However, previous methods support either one-step or static reasoning, without updating relations or generating compound objects. This paper proposes a novel reasoning model for addressing these problems. A chain of reasoning (CoR) is constructed for supporting multi-step and dynamic reasoning on changed relations and objects. In detail, iteratively, the relational reasoning operations form new relations between objects, and the object refining operations generate new compound objects from relations. We achieve new state-of-the-art results on four publicly available datasets. The visualization of the chain of reasoning illustrates the progress that the CoR generates new compound objects that lead to the answer of the question step by step. 1 Introduction “The technical issues of acquiring knowledge, representing it, and using it appropriately to construct and explain lines-of-reasoning, are important problems in the design of knowledge-based systems, which illuminates the art of Artificial Intelligence” [1]. Advances in image and language processing have developed powerful tools on knowledge representation, such as long short-term memory (LSTM) [2] and convolutional neural network (CNN) [3]. However, it is still a challenge to construct “lines-of-reasoning” with these representations for different tasks. This paper meets the challenge in visual question answering, a typical field of Artificial Intelligence. Visual question answering (VQA) aims to select an answer given an image and a related question. The left part of Fig. 1 gives an example of the image and the question. Lots of work has been done on this task in recent years. Among them, reasoning, named in different ways, plays a critical role. Most of existing VQA models that enable reasoning can be divided into three categories. Firstly, relation-based method [4] views reasoning procedure as relational reasoning. It calculates the relations between image regions to infer the answer in one-step. However, one-step relational reasoning can only construct pairwise relations between initial objects, which is not always sufficient for complex questions. It is not a trivial problem to extend one-step reasoning to multi-step because of the exponential increase of computational complexity. Secondly, attention-based methods [5, 6] view reasoning procedure as to update the attention distribution on objects, such as image regions or bounding boxes, so as to gradually infer the answer. However, no matter how many times the attention distributions are updated, the objects are still from the original input, and the entire reasoning ∗The first two authors contributed equally. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Question: What is placed next to the bus on the right of the picture? GRU RCNN <bus2, on the right of, picture> <bus1, in front of, tree> ... <sign, next to, bus on the right> ... bus2 bus1 sign tree Initial objects Compound objects Relations New relations Answer: sign sign next to the bus on the right bus on the right bus in front of the tree Compound objects Figure 1: Chain of Reasoning for VQA. The alternate updating of objects and relations forms a chain of reasoning. The relational reasoning operation forms new relations between objects. The object refining operation generates new compound objects from relations. procedure does not produce compound objects, such as “sign next to the bus on the right”, which many questions talk about. Thirdly, module-based methods [7, 8, 9] view reasoning procedure as a layout generated from manually pre-defined modules. It uses the layout to instantiate modular networks. However, the modules are pre-defined which means the reasoning procedure does not produce new modules or relations anymore. As a result, it is difficult to meet the requirements of diversity of relations in dynamic and multi-step reasoning. This paper tries to construct a chain of reasoning (CoR) for addressing these problems. Both of the iteratively updated relations and compound objects are used as nodes in the chain. Updated relations push reasoning to involve more compound objects; compound objects maintain the intermediate conclusions of reasoning and make the next-step relational reasoning possible by lowering the computational complexity efficiently. An example of the CoR is shown in Fig. 1. Initial objects in the image are first recognized, such as two buses and a sign in the original image. All pairwise relations between these objects are then calculated, and a combination of the relations are used to generate compound objects, such as “bus on the right.” More complex relations are further calculated between the compound objects and initial objects to generate more complex compound objects, such as “sign next to the bus on the right,” which brings us the answer. In summary, our contributions are as follows: • We introduce a new VQA model that performs a chain of reasoning, which generates new relations and compound objects dynamically to infer the answer. • We achieve new state-of-the-art results on four publicly available datasets. We conduct a detailed ablation study to show that our proposed chain structure is superior to stack structure and parallel structure. • We visualize the chain of reasoning, which shows the progress that the CoR generates new compound objects dynamically that lead to the answer of the question step by step. 2 Related Work Reasoning plays a crucial role in VQA. Recent studies modeled the reasoning procedure from different perspectives. In this section, we briefly review three types of existing work that enable reasoning. We also highlight differences between previous models and ours. Relation-based methods The relation-based method performs one-step relational reasoning to infer the answer. [4] proposed a plug-and-play module called “Relation Networks” (RN). RN uses full arrangement to model all the interactions between objects in the image and performs multi-layer perceptrons (MLPs) to calculate all the relations. Then, the relations are summed and passed through other MLPs to infer the final answer. Modeling pairwise relationships already brings the O(m2) computational complexity and makes it impossible to carry out multi-step reasoning. By object refining, our model lowers the computational complexity and makes the multi-step reasoning possible. 2 Question: What is placed next to the bus on the right of the picture? GRU RCNN Linear Linear softmax Linear Expand Linear sigmoid Linear sigmoid Expand Expand Linear Linear softmax Linear Linear sigmoid Linear sigmoid Expand Answer: sign Classifier Decision Making Concatenate Data Embedding Chain of Reasoning Figure 2: The overall structure of the proposed model for solving the VQA task. It consists of Data Embedding, Chain of Reasoning, and Decision Making, marked with dash lines respectively. Attention-based methods Usually, attention-based methods enable reasoning by locating relevant objects in original input features, such as bounding boxes or image regions. Initially, [10] proposed one-step attention to locate relevant objects of images. Furthermore, [5, 6] proposed multi-step attention to update relevant objects of images and infer the answer progressively. Additionally, [11, 12] proposed multi-modal attention, which finds not only the relevant objects of images but also questions or answers. Recently, [13, 14, 15, 16] used bilinear fusion in attention mechanism to find more accurate objects of input features. Attention distributions in the above work are always on original input features. In contrast, our model pay attentions on not only objects in original input features but also new compound objects generated dynamically during reasoning. Module-based methods Module-based methods try to define relations as modules in advance, and the reasoning procedure is determined by a layout generated from these modules. [7] proposed neural module network, which uses fixed layouts generated from dependency parses. Later, [8] proposed dynamic neural module network, which learns to optimize the layout structure by predicting a list of layout candidates. However, the layout candidates are still generated by dependency parses. To solve this problem, [9] proposed an end-to-end module network, which learns to optimize over full space of network and requires no parser at evaluation time. Our model forms new relations dynamically in the reasoning procedure, instead of choosing from a set of manually pre-defined modules. 3 Chain of Reasoning based model for VQA The overall structure of our model for VQA is illustrated in Fig. 2. It consists of three parts: Data Embedding, Chain of Reasoning, and Decision Making. Data Embedding pre-processes the image and question. Chain of Reasoning is the core part of the model. Starting from outputs of Data Embedding, relational reasoning on initial objects forms new relations, and object refining generates new compound objects based on the new relations. Iteratively, these two operations on updated relations and objects build the chain of reasoning, which outputs a series of results. Decision Making makes use of all the results to select the final answer of the question. We give the details of the three parts in Section 3.1∼3.3 respectively. 3.1 Data Embedding Faster-RCNN [17] is used to encode images with the static features provided by bottom-upattention [18], GRU [19] is used to encode text with the parameters initialized with skip-thoughts [20], as denoted in Eq. (1). V = RCNN(image), Q = GRU(question), (1) 3 where V ∈Rm×dv denotes the visual features of the top-ranked m detection boxes and Q ∈ Rdq denotes the question embedding. Here, V is viewed as a set of m initial objects, i.e. V = {v1, v2, . . . , vm}. From the perspective of reasoning, V can also be viewed as m initial premises. 3.2 Chain of Reasoning Starting from initial objects O(1) = V defined in Eq. (1), a chain of reasoning consists of a series of sub-chains and an output at each time, which is explained in Fig. 3. sub-chain output sub-chain output Figure 3: Sub-chains and their outputs in Chain of Reasoning. In Fig. 3, O(t) ∈Rm×dv is the set of initial objects at time t = 1 or compound objects at time t > 1. g O(t) ∈Rdv is the output of the chain at time t. R(t) ∈Rm×m×dv is the set of updated relations at time t. O(t+1) ∈Rm×dv is the set of new compound objects at time t + 1. From the perspective of reasoning, O(t) can also be viewed as intermediate conclusions when t > 1. We first give the details on the output at time t, and then describe how the sub-chain is formed. The output at time t is designed to capture information provided by O(t) under the guidance of question . An attention-based method is used as in Eq. (2)∼(5). P (t) = relu(O(t)W (t) o ), S(t) = relu(QW (t) q ), (2) F (t) = K X k=1 (P (t)W (t) p,k) ⊙(S(t)W (t) s,k) (3) α(t) = softmax(F (t)W (t) f ), (4) g O(t) =  α(t)T O(t), (5) where Eq. (2) maps the objects at time t to P (t) ∈Rm×dp and maps the question feature to S(t) ∈Rds at time t. Eq. (3) uses the Mutan fusion mechanism proposed by [16]. K is the hyperparameter. F (t) ∈Rm×df is the fusion embedding at time t. α(t) ∈Rm in Eq. (4) is the attention distribution over the m compound objects at time t. g O(t) ∈Rdv in Eq. (5) is the result of attention at time t, which is also the output of chain of reasoning at time t. The output at each time t will be used for final decision making. To write simple, we omit the bias b. The sub-chain O(t) →R(t) →O(t+1) is performed in two operations. The first operation from O(t) to R(t) is called relational reasoning which forms new relations between objects, and the second operation from R(t) to O(t+1) is called object refining which generates new compound objects to start a new sub-chain. We introduce them respectively as follows. Relational reasoning from O(t) to R(t) The m objects in O(t) interact with the m initial objects in O(1) under the guidance of the question Q, as denoted in Eq. (6)∼(7). Gl = σ (relu(QWl1)Wl2) , Gr = σ (relu(QWr1)Wr2) , (6) R(t) ij = (O(t) i ⊙Gl) ⊕(O(1) j ⊙Gr), (7) where Eq (6) maps question feature to the same dimension as the object feature by a two-layer MLP with different weights respectively. σ is the sigmoid function. Gl, Gr ∈Rdv are the guidances. Eq. 7 is the sum of the guided ith compound object at time t and the guided jth initial object. ⊙denotes the element-wise multiplication and ⊕denotes the element-wise summation. 4 Notice that Gl and Gr are different guidances with different weights, but the weights in Gl and Gr are shared among all sub-chains respectively. As a result, two sets of weights are trained: the set of weights in Gl make the question focus on the compound objects and another set of weights in Gr make the question focus on the initial objects. This is in line with the reasoning procedure — the question decides what the model should do for the intermediate conclusions it already got and the initial premises. Besides, initial objects O(1) j used at each time allow the model to capture initial premises through the whole reasoning procedure. Object refining from R(t) to O(t+1) The previous relational reasoning operation produces m×m relations between m compound objects and m initial objects. Since modeling the pairwise relations increases the compexity of reasoning from O(m) to O(m2), n-step reasoning will face the complexity of O(mn). In order to avoid the exponential complexity of multi-step reasoning, we refine these relations to m new compound objects, each denoted in Eq. (8): O(t+1) j = m X i=1 α(t) i R(t) ij , (8) where O(t+1) j is the jth compound object at time t + 1, In Eq. (8), the attention weights of the compound objects α(t) are used to refine the relations R(t) formed by the compound objects and the initial objects. This has two advantages: Firstly, Eq. (8) is more in line with the reasoning procedure. The jth compound object at time t + 1 is determined by all the compound objects at time t and the jth initial object. This means that any conclusion generated by the next reasoning step will use all the intermediate conclusions in the previous step. At the same time, if an intermediate conclusion in the previous step is important, then its information is more likely to be used in the next step. Secondly, Eq. (8) makes it mathematically simple and computationally feasible to begin a next turn reasoning. Mathematically, we can use a single set of equations to describle the whole chain. Computationally, we can keep the complexity of O(nm2) when we perform n sub-chains of reasoning. 3.3 Decision Making The decision maker at time T gives an answer to the question by making use of all the outputs g O(t) (t = 1, 2, ..., T). An concatenation is employed for integrating T outputs in Eq. (9). O∗= [relu( g O(1)W (1)); relu( g O(2)W (2)); ...; relu(] O(T )W (T ))], (9) where O∗∈Rd∗is the joint feature of outputs. We further fuse joint feature and question by Eq.(10). H = K X k=1 (O∗Wo∗,k) ⊙(QWq′,k), (10) where K ∈R+ is the hyperparameter, H ∈Rdh is the joint embedding. Finally, a linear layer with a softmax activation function is used to predict the candidate answer distribution as shown in Eq. (11). ˆa = softmax(HWh), (11) 3.4 Training We first calculate the ground-truth answer distribution in Eq. (12): ai = PN j=1 1{uj = i} N −PN j=1 1{uj /∈D} , (12) where a ∈R|D| is the ground-truth answer distribution, ui is the answer given by the ith annotator. N is the number of annotators. In detail, N is 10 in the VQA 1.0 and VQA 2.0 dataset; N is 1 in the COCO-QA dataset and the TDIUC dataset. Finally, we use the KL-divergence as the loss function between a and ˆa in Eq. (13): L (ˆa, a) = |D| X i=1 ai log ai ˆai  . (13) 5 Table 1: Comparision with the state-of-the-arts on the VQA 1.0 dataset. VQA 1.0 Test-dev VQA 1.0 Test-std Open-Ended MC Open-Ended MC Method All Y/N Num. Other All All Y/N Num. Other All Single image feature HighOrderAtt[12] 69.4 69.3 MLB(7)[14] 66.77 84.54 39.21 57.81 66.89 84.61 39.07 57.79 Mutan(5)[16] 67.42 85.14 39.81 58.52 67.36 84.91 39.79 58.35 Multi image feature DualMFA[21] 66.01 83.59 40.18 56.84 70.04 66.09 83.37 40.39 56.89 69.97 ReasonNet[22] 67.9 84.0 38.7 60.4 Single image feauture CoR-2(36boxes) (ours) 68.16 85.57 43.76 58.80 72.60 68.19 85.61 43.10 58.75 72.61 CoR-3(36boxes) (ours) 68.37 85.69 44.06 59.08 72.84 68.54 85.83 43.93 59.11 72.93 Table 2: Comparision with the state-of-the-arts on the VQA 2.0 dataset. VQA 2.0 Test-dev VQA 2.0 Test-std Method All Y/N Num. Other All Y/N Num. Other MF-SIG-VG[23] 64.73 81.29 42.99 55.55 Up-Down(36 boxes)[24] 65.32 81.82 44.21 56.05 65.67 82.20 43.90 56.26 LC_Baseline(100 boxes)[25] 67.50 82.98 46.88 58.99 67.78 83.21 46.60 59.20 LC_Counting(100 boxes)[25] 68.09 83.14 51.62 58.97 68.41 83.56 51.39 59.11 CoR-2(36 boxes) (ours) 67.96 84.7 47.1 58.42 68.15 84.82 46.8 58.52 CoR-3(36 boxes) (ours) 68.19 84.98 47.19 58.64 68.59 85.16 47.19 59.07 CoR-3(100 boxes) (ours) 68.62 85.22 47.95 59.15 69.14 85.76 48.4 59.43 Table 3: Comparision with the state-of-the-arts on the COCO-QA dataset. Method All Obj. Num. Color Loc. WUPS0.9 WUPS0.0 QRU [26] 62.50 65.06 46.90 60.50 56.99 72.58 91.62 HieCoAtt [11] 65.4 68.0 51.0 62.9 58.8 75.1 92.0 Dual-MFA [21] 66.49 68.86 51.32 65.89 58.92 76.15 92.29 CoR-2(36 boxes) (ours) 68.67 69.76 55.14 73.36 59.52 77.47 92.68 CoR-3(36 boxes) (ours) 69.38 70.42 55.83 74.13 60.57 78.10 92.86 Table 4: Comparision with the state-of-the-arts on the TDIUC dataset. Question Type MCB-A[13] RAU[27] CATL-QTAW [28] CoR-2 (ours) CoR-3 (ours) Sceen Recognition 93.06 93.96 93.80 94.48 94.68 Sport Recognition 92.77 93.47 95.55 95.94 95.90 Color Attributes 68.54 66.86 60.16 73.59 74.47 Other Attributes 56.72 56.49 54.36 59.59 60.02 Activity Recognition 52.35 51.60 60.10 60.29 62.19 Positional Reasoning 35.40 35.26 34.71 39.34 40.92 Sub. Object Recognition 85.54 86.11 86.98 88.38 88.83 Absurd 84.82 96.08 100.00 95.17 94.70 Utility and Affordances 35.09 31.58 31.48 40.35 37.43 Object Presence 93.64 94.38 94.55 95.40 95.75 Counting 51.01 48.43 53.25 57.72 58.83 Sentiment Understanding 66.25 60.09 64.38 66.72 67.19 Overall (Arithmetric MPT) 67.90 67.81 69.11 72.25 72.58 Overall (Harmonic MPT) 60.47 59.00 60.08 65.65 65.77 Overall Accuracy 81.86 84.26 85.03 86.58 86.91 6 4 Experiments 4.1 Datasets and evaluation metrics We evaluate our model on four public datasets: the VQA 1.0 dataset [29], the VQA 2.0 dataset [30], the COCO-QA dataset[31] and the TDIUC dataset [27]. VQA 1.0 contains 614,163 samples, including 204,721 images from COCO [32]. VQA 2.0 is a more balanced version and contains 1,105,904 samples. COCO-QA is a smaller dataset that contains 78,736 samples. TDIUC is a larger dataset that contains 1,654,167 samples and 12 question types. For VQA 1.0 and VQA 2.0, we use the evaluation tool proposed in [29] to evaluate the model. For COCO-QA and TDIUC, we calculate the simple accuracy for each question type. Besides, additional WUPS [33] is calculated for COCO-QA and additional Arithmetic/Harmonic mean-per-type (MPT) [27] is calculated for TDIUC. 4.2 Implementation details During the data-embedding phase, the image features are mapped to the size of 36×2048 and the text features are mapped to the size of 2400. In the chain of reasoning phase, the number of hidden layer in Mutan is 510; hyperparameter K is 5. The attention hidden unit number is 620. In the decision making phase, the joint feature embedding is set to 510. All the nonlinear layers of the model all use the relu activation function and dropout [34] to prevent overfitting. All settings are commonly used in previous work. We implement the model using Pytorch. We use Adam[35] to train the model with a learning rate of 10−4 and a batch_size of 64. More details, including source codes, will be published in the near future. 4.3 Comparison with the state-of-the-art In this section, we compare our single CoR-T model with the state-of-the-art models on four datasets. CoR-T means that the model consists of T sub-chains. Firstly, Tab. 1 shows the results on the VQA 1.0 dataset. Using a single image feature, CoR-3 not only outperforms all the models that use single image feature but also outperforms the state-of-the-art ReasonNet [22] model, which uses six input image features including face analysis, object classification, scene classification and so on. Secondly, Tab. 2 shows the results on the VQA 2.0 dataset. Compared with Up-Down (36 boxes) [24], which is the winning model in the VQA challenge 2017, CoR-3 (36 boxes) achieves 2.92% higher accuracy in test-std set. Compared with the most recent state-of-the-art model LC_counting (100 boxes) [25], our single CoR-3 (100 boxes) model achieves a new state-of-the-art result of 69.14% in the test-std set. Thirdly, Tab. 3 shows the results on the COCO-QA dataset. CoR-3 improves the overall accuracy of the state-of-the-art Dual-MFA from 66.49% to 69.38%. In particular, there is an improvement of 4.51% in “Num.” and 8.24% in “Color”. Fourthly, Tab. 4 shows the results on the TDIUC dataset. CoR-3 improves the overall accuracy of the state-of-the-art CATL-QTAW [28] from 85.03% to 86.91%. There is also an improvement of 5.58% in “Counting” and 5.93% in “Color Attributes”. In summary, CoR achieves consistently best performance on all four datasets. 4.4 Ablation study In this section, we conduct some ablation experiments. For a fair comparion, all the data provided in this section are trained under the VQA 2.0 training set and tested on the VQA 2.0 validation set. All the models use the exact same bottom-up-attention feature (36 boxes) extracted from faster-rcnn. Tab. 5 shows the effectiveness of the chain structure. We implement MLB[14], Mutan [16] and their stack and parallel structure. The stack structure is proposed by SAN [5], which stacks 2 or 3 attention layers. The parallel structure is similar to Multi-Head Attention [36], which consists of 2 or 3 attention layers running in parallel. As shown in Tab. 5, the chain structure not only significantly improves the performance of attention models but also superior to their stack or parallel structures. For example, compared with Mutan, Mutan-Stack-3 is only 0.29% higher while CoR-3 is 1.53% higher. Furthermore, the chain structure is insensitive to the attention model. CoR-2 and CoR-3 can achieve high performance whether using Mutan or MLB. Tab. 6 shows the effectiveness of the relational reasoning operation. Firstly, we implement CoR-2 with [O(t) i ; O(1) j ; G]W1, which is proposed RN [4]. We find it lowers the performance (64.96%→62.46%). This is because the purpose of relational reasoning here is to prepare for generating compound 7 Table 5: Effectiveness of the chain structure on the VQA 2.0 validation. Method MLB[14] MLBStack-2 MLBStack-3 MLBParallel-2 MLBParallel-3 CoR-2 with MLB CoR-3 with MLB Val 62.91 63.28 63.55 63.20 63.28 64.90 64.96 Method Mutan[16] MutanStack-2 MutanStack-3 MutanParallel-2 MutanParallel-3 CoR-2 CoR-3 Val 63.61 63.78 63.90 63.66 63.80 64.96 65.14 Table 6: Effectiveness of relational reasoning operation on the VQA 2.0 validation. Method Val CoR-2 with [O(t) i ; O(1) j ; G]W1 62.46 CoR-2 with (O(t) i + O(1) j ) ⊙G 64.73 CoR-2 with (O(t) i ⊙Gl) ⊕(O(t) j ⊙Gr) 64.24 CoR-2 64.96 Table 7: Effectiveness of object refining operation on the VQA 2.0 validation. Method Val CoR-2 with Pm i=1 α(t) i R(t) ji 64.42 CoR-2 64.96 Table 8: Effectiveness of the model on different question types on the CLEVR dataset. Method Overall Count Exist Compare Numbers Query Attribute Compare Attribute MLB 85.0 90.0 76.7 78.8 91.1 82.7 Mutan 86.3 92.5 80.2 81.7 91.2 84.5 RN 96.4 CoR-2 98.7 98.8 97.7 92.3 99.9 99.7 objects, and the element-wise sum in Eq. (7) is more fine-grained. Secondly, we implement CoR2 with (O(t) i ⊕O(1) j ) ⊙G, which uses a single question guidance and also lowers performance (64.96%→64.73%). This shows that different guidances for compound objects and initial objects are beneficial to improve the performance. Thirdly, we implement CoR-2 with (O(t) i ⊙Gl)⊕(O(t) j ⊙Gr), which calculates the relations by the compound objects themselves without the initial object O(1) j . We find it still lowers the performance (64.96%→64.24%). This shows using initial premises O(1) j at each step is crucial and may avoid “over-reasoning” by modeling very complex relations between compound objects. Tab. 7 shows the effectiveness of the object refining operation. We implement a similar operation Pm i=1 α(t) i R(t) ji . Although the formula is similar to Pm i=1 α(t) i R(t) ij in Eq. 8, the meaning is totally different. Pm i=1 α(t) i R(t) ij generates the jth compound object by weighted sum of the relations between each compound object and the jth initial object while Pm i=1 α(t) i R(t) ji generates that by weighted sum of the relations between each initial object and jth compound object. The former focuses on using the previous reasoning conclusions while the latter focuses on the initial premises. CoR-2 has better results and is more in line with the reasoning procedure — focusing more on previous intermediate conclusions to push the next step reasoning. Tab. 8 shows effectiveness of the model on different question types. We conduct experiments on the state description matrix version of the CLEVR dataset [37]. CoR-2 reaches an overall accuracy of 98.7%, which outperforms MLB and Mutan on the same setup. Furthermore, CoR-2 achieves the performance of 99.9% in question type of “Query Attribute” and 99.7% in question type of “Compare Attribute”. It is worth mentioning that there is still room for improvement in “Compare Numbers” questions. 8 4.5 Qualitative evaluation Example 1. What object is on the upper right side of the picture? Example 2. How many people can be seen in the picture? 0.22, 1.00 0.19, 1.00 0.25, 0.92 0.23, 0.90 0.81, 0.91 0.10, 0.88 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0.17, 1.00 0.15, 1.00 0.98, 0.64 0.00, 0.66 1.00, 0.71 0.00, 0.64 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 GT: fire hydrant Pred: fire hydrant ! GT: 3 Pred: 3 ! Example 3. What color is illuminated on the traffic light? Example 4. What object is to the right of the dog in this image? 0.35, 1.00 0.34, 1.00 0.43, 0.66 0.39, 0.69 0.83, 0.65 0.14, 0.65 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0.18, 1.00 0.10, 1.00 0.29, 0.91 0.23, 0.89 0.70, 0.94 0.13, 0.92 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 0.0 0.2 0.4 0.6 0.8 1.0 GT: green Pred: green ! GT: legs Pred: dog # Figure 4: Visualization of the reasoning procedure of CoR-3. In Figure 4, we visualize the compound objects generated by CoR-3 and their attention weights. Four examples are given including three success cases and one failure case. Each example contains three steps. The red box and the blue box in each step represent objects with the top two attention weights respectively. The initial objects in the first step are part of the original image and easy to visualize by the bounding box, but the compound objects in the second and third step are difficult to visualize directly. Therefore, we search from 1105904 × 36 boxes (1105904 is the number of samples and each sample has 36 boxes) and find the box with the most similar feature by cosine similarity to represent the compound object. The upper left corner of each box contains a tuple of the form (w, s). w is the attention weight, s is the similarity between the searched box and the real compound object. In Example 1, the left image shows a pillar (red box) and ground (blue box). Their values of w are 0.22 and 0.19 respectively. Since they are initial top two rcnn objects in O(1), the values of s are 1. The model focuses on some disperse “objects”, which can be further seen by attention distribution histogram below. The middle image shows top two compound objects in the second step. The red box focuses on “objects on the upper”. The attention weight of the red box increased slightly to 0.25. The similarity between the red box and the real compound object is 0.92. The right image shows top two more complex compound objects in the third step. The “objects on the upper right” has been focused in the red box. Interestingly, the w of the red box increases to 0.81, which means in the third step, CoR-3 is very confident that the box containing “hydrant” is exactly the final answer. Statistics show that 96.76% of the success cases satisfy the phenomenon of dispersion to concentration. In Example 2∼3, two more success cases are shown. In Example 4, the model already gets the intermediate result “dog in the image” in the third step but fails to further find “leg on the right of the dog in the image”, which seems that three-step reasoning is insufficient here. 5 Conclusion In this paper, we propose a novel chain of reasoning model for VQA task. The reasoning procedure is viewed as the alternate updating of objects and relations. Experimental results on four publicly available datasets show that CoR outperforms state-of-the-art approaches. Ablation study shows that proposed chain structure is superior to stack structure and parallel strucuture. The visualization of the chain of reasoning illustrates the progress that the CoR generates new compound objects that lead to the answer of the question step-by-step. In the future, we plan to apply CoR to other tasks that require reasoning like reading comprehension question answering or video question answering. 9 Acknowledgments We would like to thank the anonymous reviewers for their valuable comments. This paper is supported by NSFC (No. 61273365), NSSFC (2016ZDA055), 111 Project (No. B08004), Beijing Advanced Innovation Center for Imaging Technology, Engineering Research Center of Information Networks of MOE, China. References [1] Edward A. Feigenbaum. The art of artificial intelligence. 1. Themes and case studies of knowledge engineering. Technical report, Stanford Univ CA Dept of Computer Science, 1977. [2] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [3] Yann LeCun, Bernhard Boser, John S. Denker, Donnie Henderson, Richard E. Howard, Wayne Hubbard, and Lawrence D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989. [4] Adam Santoro, David Raposo, David GT Barrett, Mateusz Malinowski, Razvan Pascanu, Peter Battaglia, and Timothy Lillicrap. A simple neural network module for relational reasoning. In NIPS, 2017. [5] Zichao Yang, Xiaodong He, Jianfeng Gao, Li Deng, and Alex Smola. Stacked attention networks for image question answering. In CVPR, 2016. [6] Huijuan Xu and Kate Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. In ECCV, pages 451–466, 2016. [7] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Neural module networks. In CVPR, pages 39–48, 2016. [8] Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Dan Klein. Learning to compose neural networks for question answering. In NAACL, pages 1545–1554, 2016. [9] Ronghang Hu, Jacob Andreas, Marcus Rohrbach, Trevor Darrell, and Kate Saenko. Learning to reason: End-to-end module networks for visual question answering. In ICCV, 2017. [10] Kan Chen, Jiang Wang, Liang-Chieh Chen, Haoyuan Gao, Wei Xu, and Ram Nevatia. ABC-CNN: An attention based convolutional neural network for visual question answering. arXiv:1511.05960, 2015. [11] Jiasen Lu, Jianwei Yang, Dhruv Batra, and Devi Parikh. Hierarchical Question-Image CoAttention for Visual Question Answering. In NIPS, 2016. [12] Idan Schwartz, Alexander G. Schwing, and Tamir Hazan. High-Order Attention Models for Visual Question Answering. In NIPS, 2017. [13] Akira Fukui, Dong Huk Park, Daylen Yang, Anna Rohrbach, Trevor Darrell, and Marcus Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. In EMNLP, pages 457–468, 2016. [14] Jin-Hwa Kim, Kyoung-Woon On, Jeonghee Kim, Jung-Woo Ha, and Byoung-Tak Zhang. Hadamard product for low-rank bilinear pooling. In ICLR, 2017. [15] Zhou Yu, Jun Yu, Jianping Fan, and Dacheng Tao. Multi-modal Factorized Bilinear Pooling with Co-Attention Learning for Visual Question Answering. In ICCV, 2017. [16] Hedi Ben-younes, Rémi Cadene, Matthieu Cord, and Nicolas Thome. MUTAN: Multimodal Tucker Fusion for Visual Question Answering. In ICCV, pages 2631–2639, 2017. [17] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, pages 91–99, 2015. 10 [18] Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In CVPR, volume 3, page 6, 2018. [19] Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the Properties of Neural Machine Translation: Encoder-Decoder Approaches. arXiv preprint arXiv:1409.1259, 2014. [20] Ryan Kiros, Yukun Zhu, Ruslan R. Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In NIPS, pages 3294–3302, 2015. [21] Pan Lu, Hongsheng Li, Wei Zhang, Jianyong Wang, and Xiaogang Wang. Co-attending Freeform Regions and Detections with Multi-modal Multiplicative Feature Embedding for Visual Question Answering. In AAAI, 2018. [22] Ilija Ilievski and Jiashi Feng. Multimodal Learning and Reasoning for Visual Question Answering. In NIPS, pages 551–562, 2017. [23] Chen Zhu, Yanpeng Zhao, Shuaiyi Huang, Kewei Tu, and Yi Ma. Structured Attentions for Visual Question Answering. In ICCV, 2017. [24] Damien Teney, Peter Anderson, Xiaodong He, and Anton van den Hengel. Tips and Tricks for Visual Question Answering: Learnings from the 2017 Challenge. In CVPR, 2018. [25] Yan Zhang, Jonathon Hare, and Adam Prügel-Bennett. Learning to Count Objects in Natural Images for Visual Question Answering. In ICLR, 2018. [26] Ruiyu Li and Jiaya Jia. Visual question answering with question representation update (qru). In NIPS, pages 4655–4663, 2016. [27] Kushal Kafle and Christopher Kanan. An Analysis of Visual Question Answering Algorithms. In ICCV, 2017. [28] Yang Shi, Tommaso Furlanello, Sheng Zha, and Animashree Anandkumar. Question Type Guided Attention in Visual Question Answering. In ECCV, 2018. [29] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C. Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In ICCV, pages 2425–2433, 2015. [30] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In CVPR, volume 1, page 9, 2017. [31] Mengye Ren, Ryan Kiros, and Richard Zemel. Exploring models and data for image question answering. In NIPS, pages 2953–2961, 2015. [32] Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740–755, 2014. [33] Mateusz Malinowski and Mario Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In NIPS, pages 1682–1690, 2014. [34] 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. [35] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [36] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, \Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, pages 5998–6008, 2017. [37] J. Johnson, B. Hariharan, L. v d Maaten, L. Fei-Fei, C. L. Zitnick, and R. Girshick. CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning. In CVPR, pages 1988–1997, July 2017. 11
2018
218
7,384
Hamiltonian Variational Auto-Encoder Anthony L. Caterini1, Arnaud Doucet1,2, Dino Sejdinovic1,2 1Department of Statistics, University of Oxford 2Alan Turing Institute for Data Science {anthony.caterini, doucet, dino.sejdinovic}@stats.ox.ac.uk Abstract Variational Auto-Encoders (VAEs) have become very popular techniques to perform inference and learning in latent variable models: they allow us to leverage the rich representational power of neural networks to obtain flexible approximations of the posterior of latent variables as well as tight evidence lower bounds (ELBOs). Combined with stochastic variational inference, this provides a methodology scaling to large datasets. However, for this methodology to be practically efficient, it is necessary to obtain low-variance unbiased estimators of the ELBO and its gradients with respect to the parameters of interest. While the use of Markov chain Monte Carlo (MCMC) techniques such as Hamiltonian Monte Carlo (HMC) has been previously suggested to achieve this [25, 28], the proposed methods require specifying reverse kernels which have a large impact on performance. Additionally, the resulting unbiased estimator of the ELBO for most MCMC kernels is typically not amenable to the reparameterization trick. We show here how to optimally select reverse kernels in this setting and, by building upon Hamiltonian Importance Sampling (HIS) [19], we obtain a scheme that provides low-variance unbiased estimators of the ELBO and its gradients using the reparameterization trick. This allows us to develop a Hamiltonian Variational Auto-Encoder (HVAE). This method can be re-interpreted as a target-informed normalizing flow [22] which, within our context, only requires a few evaluations of the gradient of the sampled likelihood and trivial Jacobian calculations at each iteration. 1 Introduction Variational Auto-Encoders (VAEs), introduced by Kingma and Welling [15] and Rezende et al. [23], are popular techniques to carry out inference and learning in complex latent variable models. However, the standard mean-field parametrization of the approximate posterior distribution can limit its flexibility. Recent work has sought to augment the VAE approach by sampling from the VAE posterior approximation and transforming these samples through mappings with additional trainable parameters to achieve richer posterior approximations. The most popular application of this idea is the Normalizing Flows (NFs) approach [22] in which the samples are deterministically evolved through a series of parameterized invertible transformations called a flow. NFs have demonstrated success in various domains [2, 16], but the flows do not explicitly use information about the target posterior. Therefore, it is unclear whether the improved performance is caused by an accurate posterior approximation or simply a result of overparametrization. The related Hamiltonian Variational Inference (HVI) [25] instead stochastically evolves the base samples according to Hamiltonian Monte Carlo (HMC) [20] and thus uses target information, but relies on defining reverse dynamics in the flow, which, as we will see, turns out to be unnecessary and suboptimal. One of the key components in the formulation of VAEs is the maximization of the evidence lower bound (ELBO). The main idea put forward in Salimans et al. [25] is that it is possible to use K MCMC iterations to obtain an unbiased estimator of the ELBO and its gradients. This estimator 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. is obtained using an importance sampling argument on an augmented space, with the importance distribution being the joint distribution of the K + 1 states of the ‘forward’ Markov chain, while the augmented target distribution is constructed using a sequence of ‘reverse’ Markov kernels such that it admits the original posterior distribution as a marginal. The performance of this estimator is strongly dependent on the selection of these forward and reverse kernels, but no clear guideline for selection has been provided therein. By linking this approach to earlier work by Del Moral et al. [6], we show how to select these components. We focus, in particular, on the use of time-inhomogeneous Hamiltonian dynamics, proposed originally in Neal [19]. This method uses reverse kernels which are optimal for reducing variance of the likelihood estimators and allows for simple calculation of the approximate posteriors of the latent variables. Additionally, we can easily use the reparameterization trick to calculate unbiased gradients of the ELBO with respect to the parameters of interest. The resulting method, which we refer to as the Hamiltonian Variational Auto-Encoder (HVAE), can be thought of as a Normalizing Flow scheme in which the flow depends explicitly on the target distribution. This combines the best properties of HVI and NFs, resulting in target-informed and inhomogeneous deterministic Hamiltonian dynamics, while being scalable to large datasets and high dimensions. 2 Evidence Lower Bounds, MCMC and Hamiltonian Importance Sampling 2.1 Unbiased likelihood and evidence lower bound estimators For data x ∈X ⊆Rd and parameter θ ∈Θ, consider the likelihood function pθ(x) =  pθ(x, z)dz =  pθ(x|z)pθ(z)dz, where z ∈Z are some latent variables. If we assume we have access to a strictly positive unbiased estimate of pθ(x), denoted ˆpθ(x), then  ˆpθ(x)qθ,φ(u|x)du = pθ(x), (1) with u ∼qθ,φ(·), u ∈U denoting all the random variables used to compute ˆpθ(x). Here, φ denotes additional parameters of the sampling distribution. We emphasize that ˆpθ(x) depends on both u and potentially φ as this is not done notationally. By applying Jensen’s inequality to (1), we thus obtain, for all θ and φ, LELBO(θ, φ; x) :=  log ˆpθ(x) qθ,φ(u|x)du ≤log pθ(x) =: L(θ; x). (2) It can be shown that |LELBO(θ, φ; x)−L(θ; x)| decreases as the variance of ˆpθ(x) decreases; see, e.g., [3, 17]. The standard variational framework corresponds to U = Z and ˆpθ(x) = pθ(x, z)/qθ,φ(z|x), while the Importance Weighted Auto-Encoder (IWAE) [3] with L importance samples corresponds to U = ZL, qθ,φ(u|x) = L i=1 qθ,φ(zi|x) and ˆpθ(x) = 1 L L i=1 pθ(x, zi)/qθ,φ(zi|x). In the general case, we do not have an analytical expression for LELBO(θ, φ; x). When performing stochastic gradient ascent for variational inference, however, we only require an unbiased estimator of ∇θLELBO(θ, φ; x). This is given by ∇θ log ˆpθ(x) if the reparameterization trick [8, 15] is used, i.e. qθ,φ(u|x) = q(u), and ˆpθ(x) is a ‘smooth enough’ function of u. As a guiding principle, one should attempt to obtain a low-variance estimator of pθ(x), which typically translates into a low-variance estimator of ∇θLELBO(θ, φ; x). We can analogously optimize LELBO(θ, φ; x) with respect to φ through stochastic gradient ascent to obtain tighter bounds. 2.2 Unbiased likelihood estimator using time-inhomogeneous MCMC Salimans et al. [25] propose to build an unbiased estimator of pθ(x) by sampling a (potentially time-inhomogeneous) ‘forward’ Markov chain of length K + 1 using z0 ∼q0 θ,φ(·) and zk ∼ qk θ,φ(·|zk−1) for k = 1, ..., K. Using artificial ‘reverse’ Markov transition kernels rk θ,φ(zk|zk+1) for k = 0, ..., K −1, it follows easily from an importance sampling argument that ˆpθ(x) = pθ(x, zK) K−1 k=0 rk θ,φ(zk|zk+1) q0 θ,φ(z0) K k=1 qk θ,φ(zk|zk−1) (3) 2 is an unbiased estimator of pθ(x) as long as the ratio in (3) is well-defined. In the framework of the previous section, we have U = ZK+1 and qθ,φ(u|x) is given by the denominator of (3). Although we did not use measure-theoretic notation, the kernels qk θ,φ are typically MCMC kernels which do not admit a density with respect to the Lebesgue measure (e.g. the Metropolis–Hastings kernel). This makes it difficult to define reverse kernels for which (3) is well-defined as evidenced in Salimans et al. [25, Section 4] or Wolf et al. [28]. The estimator (3) was originally introduced in Del Moral et al. [6] where generic recommendations are provided for this estimator to admit a low relative variance: select qk θ,φ as MCMC kernels which are invariant, or approximately invariant as in [9], with respect to pk θ(x, zk), where pk θ,φ(z|x) ∝  q0 θ,φ(z) 1−βk [pθ(x, z)]βk is a sequence of artificial densities bridging q0 θ,φ(z) to pθ(z|x) smoothly using β0 = 0 < β1 < · · · < βK−1 < βK = 1. It is also established in Del Moral et al. [6] that, given any sequence of kernels {qk θ,φ}k, the sequence of reverse kernels minimizing the variance of ˆpθ(x) is given by rk,opt θ,φ (zk|zk+1) = qk θ,φ(zk)qk+1 θ,φ (zk+1|zk)/qk+1 θ,φ (zk+1), where qk θ,φ (zk) denotes the marginal density of zk under the forward dynamics, yielding ˆpθ(x) = pθ(x, zK) qK θ,φ(zK) . (4) For stochastic forward transitions, it is typically not possible to compute rk,opt θ,φ and the corresponding estimator (4) as the marginal densities qk θ,φ(zk) do not admit closed-form expressions. However this suggests that rk θ,φ should be approximating rk,opt θ,φ and various schemes are presented in [6]. As noticed by Del Moral et al. [6] and Salimans et al. [25], Annealed Importance Sampling (AIS) [18] – also known as the Jarzynski-Crooks identity ([4, 12]) in physics – is a special case of (3) using, for qk θ,φ, a pk θ(z|x)-invariant MCMC kernel and the reversal of this kernel as the reverse transition kernel rk−1 θ,φ 1. This choice of reverse kernels is suboptimal but leads to a simple expression for estimator (3). AIS provides state-of-the-art estimators of the marginal likelihood and has been widely used in machine learning. Unfortunately, it typically cannot be used in conjunction with the reparameterization trick. Indeed, although it is very often possible to reparameterize the forward simulation of (z1, ..., zT ) in terms of the deterministic transformation of some random variables u ∼q independent of θ and φ, this mapping is not continuous because the MCMC kernels it uses typically include singular components. In this context, although (1) holds, ∇θ log ˆpθ(x) is not an unbiased estimator of ∇θLELBO(θ, φ; x); see, e.g., Glasserman [8] for a careful discussion of these issues. 2.3 Using Hamiltonian dynamics Given the empirical success of Hamiltonian Monte Carlo (HMC) [11, 20], various contributions have proposed to develop algorithms exploiting Hamiltonian dynamics to obtain unbiased estimates of the ELBO and its gradients when Z = R. This was proposed in Salimans et al. [25]. However, the algorithm suggested therein relies on a time-homogeneous leapfrog where momentum resampling is performed at each step and no Metropolis correction is used. It also relies on learned reverse kernels. To address the limitations of Salimans et al. [25], Wolf et al. [28] have proposed to include some Metropolis acceptance steps, but they still limit themselves to homogeneous dynamics and their estimator is not amenable to the reparameterization trick. Finally, in Hoffman [10], an alternative approach is used where the gradient of the true likelihood, ∇θL(θ; x), is directly approximated by using Fisher’s identity and HMC to obtain approximate samples from pθ(z|x). However, the MCMC bias can be very significant when one has multimodal latent posteriors and is strongly dependent on both the initial distribution and θ. Here, we follow an alternative approach where we use Hamiltonian dynamics that are timeinhomogeneous as in [6] and [18], and use optimal reverse Markov kernels to compute ˆpθ(x). This estimator can be used in conjunction with the reparameterization trick to obtain an unbiased estimator of ∇LELBO(θ, φ; x). This method is based on the Hamiltonian Importance Sampling (HIS) scheme proposed in Neal [19]; one can also find several instances of related ideas in physics [13, 26]. 1The reversal of a µ-invariant kernel K(z|z) is given by Krev(z|z) = µ(z)K(z|z) µ(z) . If K is µ-reversible then Krev = K. 3 We work in an extended space (z, ρ) ∈U := R × R, introducing momentum variables ρ to pair with the position variables z, with new target ¯pθ(x, z, ρ) := pθ(x, z)N(ρ|0, I). Essentially, the idea is to sample using deterministic transitions qk θ,φ((zk, ρk)|(zk−1, ρk−1)) = δΦk θ,φ(zk−1,ρk−1)(zk, ρk) so that (zK, ρK) = Hθ,φ(z0, ρ0) :=  ΦK θ,φ ◦· · · ◦Φ1 θ,φ  (z0, ρ0), where (z0, ρ0) ∼q0 θ,φ(·, ·) and (Φk θ,φ)k≥1, define diffeomorphisms corresponding to a time-discretized and inhomogeneous Hamiltonian dynamics. In this case, it is easy to show that qK θ,φ(zK, ρK) = q0 θ,φ(z0, ρ0) K  k=1 det ∇Φk θ,φ(zk, ρk) −1 and ˆpθ(x) = ¯pθ(x, zK, ρK) qK θ,φ(zK, ρK) . (5) It can also be shown that this is nothing but a special case of (3) (on the extended position-momentum space) using the optimal reverse kernels2 rk,opt θ,φ . This setup is similar to the one of Normalizing Flows [22], except here we use a flow informed by the target distribution. Salimans et al. [25] is in fact mentioned in Rezende and Mohamed [22], but the flow therein is homogeneous and yields a high-variance estimator of the normalizing constants even if rk,opt θ is used, as demonstrated in our simulations in section 4. Under these dynamics, the estimator ˆpθ(x) defined in (5) can be rewritten as ˆpθ(x) = ¯pθ (x, Hθ,φ (z0, ρ0)) q0 θ,φ (z0, ρ0) K  k=1 det ∇Φk θ,φ(zk, ρk) . (6) Hence, if we can simulate (z0, ρ0) ∼q0 θ,φ(·, ·) using (z0, ρ0) = Ψθ,φ(u), where u ∼q and Ψθ,φ is a smooth mapping, then we can use the reparameterization trick since Φk θ,φ are also smooth mappings. In our case, the deterministic transformation Φk θ,φ has two components: a leapfrog step, which discretizes the Hamiltonian dynamics, and a tempering step, which adds inhomogeneity to the dynamics and allows us to explore isolated modes of the target [19]. To describe the leapfrog step, we first define the potential energy of the system as Uθ(z|x) ≡−log pθ(x, z) for a single datapoint x ∈X. Leapfrog then takes the system from (z, ρ) into (z, ρ) via the following transformations: ρ = ρ −ε 2 ∇Uθ(z|x), (7) z = z + ε ρ, (8) ρ = ρ −ε 2 ∇Uθ(z|x), (9) where ε ∈(R+) are the individual leapfrog step sizes per dimension, denotes elementwise multiplication, and the gradient of Uθ(z|x) is taken with respect to z. The composition of equations (7) - (9) has unit Jacobian since each equation describes a shear transformation. For the tempering portion, we multiply the momentum output of each leapfrog step by αk ∈(0, 1) for k ∈[K] where [K] ≡{1, . . . , K}. We consider two methods for setting the values αk. First, fixed tempering involves allowing an inverse temperature β0 ∈(0, 1) to vary, and then setting αk = βk−1/βk, where each βk is a deterministic function of β0 and 0 < β0 < β1 < . . . < βK = 1. In the second method, known as free tempering, we allow each of the αk values to be learned, and then set the initial inverse temperature to β0 = K k=1 α2 k. For both methods, the tempering operation has Jacobian α k. We obtain Φk θ,φ by composing the leapfrog integrator with the cooling operation, which implies that the Jacobian is given by | det ∇Φk θ,φ(zk, ρk)| = α k = (βk−1/βk)/2, which in turns implies K  k=1 | det ∇Φk θ,φ(zk, ρk)| = K  k=1 βk−1 βk /2 = β/2 0 . The only remaining component to specify is the initial distribution. We will set q0 θ,φ(z0, ρ0) = q0 θ,φ(z0) · N(ρ0|0, β −1 0 I), where q0 θ,φ(z0) will be referred to as the variational prior over the latent 2Since this is a deterministic flow, the density can be evaluated directly. However, direct evaluation corresponds to optimal reverse kernels in the deterministic case. 4 variables and N(ρ0|0, β −1 0 I) is the canonical momentum distribution at inverse temperature β0. The full procedure to generate an unbiased estimate of the ELBO from (2) on the extended space U for a single point x ∈X and fixed tempering is given in Algorithm 1. The set of variational parameters to optimize contains the flow parameters β0 and ε, along with additional parameters of the variational prior.3 We can see from (6) that we will obtain unbiased gradients with respect to θ and φ from our estimate of the ELBO if we write (z0, ρ0) =  z0, γ0/√β0  , for z0 ∼q0 θ,φ(·) and γ0 ∼N(·|0, I) ≡N(·), provided we are not also optimizing with respect to parameters of the variational prior. We will require additional reparameterization when we elect to optimize with respect to the parameters of the variational prior, but this is generally quite easy to implement on a problem-specific basis and is well-known in the literature; see, e.g. [15, 22, 23] and section 4. Algorithm 1 Hamiltonian ELBO, Fixed Tempering Require: pθ(x, ·) is the unnormalized posterior for x ∈X and θ ∈Θ Require: q0 θ,φ(·) is the variational prior on R function HIS(x, θ, K, β0, ε) Sample z0 ∼q0 θ,φ(·), γ0 ∼N(·) ρ0 ←γ0/√β0 ρ0 ∼N(·|0, β −1 0 I) for k ←1 to K do Run K steps of alternating leapfrog and tempering ρ ←ρ −ε/2 ∇Uθ(zk−1|x) Start of leapfrog; Equation (7) zk ←zk−1 + ε ρ Equation (8) ρ ← ρ −ε/2 ∇Uθ(zk|x) Equation (9) √βk ←  1 − 1 √β0  · k2/K2 + 1 √β0 −1 Quadratic tempering scheme ρk ← βk−1/βk · ρ ¯p ←pθ(x, zK)N(ρK|0, I) ¯q ←q0 θ,φ(z0)N(ρ0|0, β −1 0 I)β−/2 0 Equation (5), left side ˆLH ELBO(θ, φ; x) ←log ¯p −log ¯q Take the log of equation (5), right side return ˆLH ELBO(θ, φ; x) Can take unbiased gradients of this estimate wrt θ, φ 3 Stochastic Variational Inference We will now describe how to use Algorithm 1 within a stochastic variational inference procedure, moving to the setting where we have a dataset D = {x1, . . . , xN} and xi ∈X for all i ∈[N]. In this case, we are interested in finding θ∗∈argmax θ∈Θ Ex∼νD(·)[L(θ; x)], (10) where νD(·) ≡ 1 N N i=1 δxi(·) is the empirical measure of the data. We must resort to variational methods since L(θ; x) cannot generally be calculated exactly and instead maximize the surrogate ELBO objective function LELBO(θ, φ) ≡Ex∼νD(·) [LELBO(θ, φ; x)] (11) for LELBO(θ, φ; x) defined as in (2). We can now turn to stochastic gradient ascent (or a variant thereof) to jointly maximize (11) with respect to θ and φ by approximating the expectation over νD(·) using minibatches of observed data. For our specific problem, we can reduce the variance of the ELBO calculation by analytically evaluating some terms in the expectation (i.e. Rao-Blackwellization) as follows: LH ELBO(θ, φ; x) = E(z0,ρ0)∼q0 θ,φ(·,·)  log  ¯pθ(x, zK, ρK)β/2 0 q0 θ,φ(z0, ρ0)  = Ez0∼q0 θ,φ(·),γ0∼N(·)  log pθ(x, zK) −1 2ρT KρK −log q0 θ,φ(z0)  + 2, (12) 3We avoid reference to a mass matrix M throughout this formulation because we can capture the same effect by optimizing individual leapfrog step sizes per dimension as pointed out in [20, Section 4.2]. 5 where we write (zK, ρK) = Hθ,φ  z0, γ0/√β0  under reparameterization. We can now consider the output of Algorithm 1 as taking a sample from the inner expectation for a given sample x from the outer expectation. Algorithm 2 provides a full procedure to stochastically optimize (12). In practice, we take the gradients of (12) using automatic differentation packages. This is achieved by using TensorFlow [1] in our implementation. Algorithm 2 Hamiltonian Variational Auto-Encoder Require: pθ(x, ·) is the unnormalized posterior for x ∈X and θ ∈Θ function HVAE(D, K, nB) nB is minibatch size Initialize θ, φ while θ, φ not converged do Stochastic optimization loop Sample {x1, . . . , xnB} ∼νD(·) independently ˆLH ELBO(θ, φ) ←0 Average ELBO estimators over mini-batch for i ←1 to nB do ˆLH ELBO(θ, φ) ←HIS(xi, θ, K, β0, ε) + ˆLH ELBO(θ, φ) ˆLH ELBO(θ, φ) ←ˆLH ELBO(θ, φ)/nB Optimize the ELBO using gradient-based techniques such as RMSProp, ADAM, etc. θ ←UPDATETHETA(∇θ ˆLH ELBO(θ, φ), θ) φ ←UPDATEPHI(∇φ ˆLH ELBO(θ, φ), φ) return θ, φ 4 Experiments In this section, we discuss the experiments used to validate our method. We first test HVAE on an example with a tractable full log likelihood (where no neural networks are needed), and then perform larger-scale tests on the MNIST dataset. Code is available online.4 All models were trained using TensorFlow [1]. 4.1 Gaussian Model The generative model that we will consider first is a Gaussian likelihood with an offset and a Gaussian prior on the mean, given by z ∼N(0, I), xi|z ∼N(z + Δ, Σ) independently, i ∈[N] where Σ is constrained to be diagonal. We will again write D ≡{x1, . . . , xN} to denote an observed dataset under this model, where each xi ∈X ⊆Rd. In this example, we have = d. The goal of the problem is to learn the model parameters θ ≡{Σ, Δ}, where Σ = diag(σ2 1, . . . , σ2 d) and Δ ∈Rd. Here, we have only one latent variable generating the entire set of data. Thus, our variational lower bound is now given by LELBO(θ, φ; D) := Ez∼qθ,φ(·|D) [log pθ(D, z) −log qθ,φ(z|D)] ≤log pθ(D), for the variational posteroir approximation qθ,φ(·|D). We note that this is not exactly the same as the auto-encoder setting, in which an individual latent variable is associated with each observation, however it provides a tractable framework to analyze effectiveness of various variational inference methods. We also note that we can calculate the log-likelihood log pθ(D) exactly in this case, but we use variational methods for the sake of comparison. From the model, we see that the logarithm of the unnormalized target is given by log pθ(D, z) = N  i=1 log N(xi|z + Δ, Σ) + log N(z|0, Id). 4https://github.com/anthonycaterini/hvae-nips 6 (a) Comparison across all methods (b) HVAE with and without tempering Figure 1: Averages of θ −ˆθ  2 2 for several variational methods and choices of dimensionality d, where ˆθ is the estimated maximizer of the ELBO for each method and θ is the true parameter. For this example, we will use a HVAE with variational prior equal to the true prior, i.e. q0 = N(0, I), and fixed tempering. The potential, given by Uθ(z|D) = log pθ(D, z), has gradient ∇Uθ(z|D) = z + NΣ −1(z + Δ −x). The set of variational parameters here is φ ≡{ε, β0}, where ε ∈Rd contains the per-dimension leapfrog stepsizes and β0 ∈(0, 1) is the initial inverse temperature. We constrain each of the leapfrog step sizes such that εj ∈(0, ξ) for some ξ > 0, for all j ∈[d] – this is to prevent the leapfrog discretization from entering unstable regimes. Note that φ ∈Rd+1 in this example; in particular, we do not optimize any parameters of the variational prior and thus require no further reparameterization. We will compare HVAE with a basic Variational Bayes (VB) scheme with mean-field approximate posterior qφV (z|D) = N(z|µZ, ΣZ), where ΣZ is diagonal and φV ≡{µZ, ΣZ} denotes the set of learned variational parameters. We will also include a planar normalizing flow of the form of equation (10) in Rezende and Mohamed [22], but with the same flow parameters across iterations to keep the number of variational parameters of the same order as the other methods. The variational prior here is also set to the true prior as in HVAE above. The log variational posterior log qφN (z|D) is given by equation (13) of Rezende and Mohamed [22], where φN ≡{u, v, b}5 ∈R2d+1. We set our true offset vector to be Δ =  −d−1 2 , . . . , d−1 2  /5, and our scale parameters to range quadratically from σ1 = 1, reaching a minimum at σ(d+1)/2 = 0.1, and increasing back to σd = 1.6 All experiments have N = 10,000 and all training was done using RMSProp [27] with a learning rate of 10−3. To compare the results across methods, we train each method ten times on different datasets. For each training run, we calculate θ −ˆθ  2 2, where ˆθ is the estimated value of θ given by the variational method on a particular run, and plot the average of this across the 10 runs for various dimensions in Figure 1a. We note that, as the dimension increases, HVAE performs best in parameter estimation. The VB method suffers most on prediction of Δ as the dimension increases, whereas the NF method does poorly on predicting Σ. We also compare HVAE with tempering to HVAE without tempering, i.e. where β0 is fixed to 1 in training. This has the effect of making our Hamiltonian dynamics homogeneous in time. We perform the same comparison as above and present the results in Figure 1b. We can see that the tempered methods perform better than their non-tempered counterparts; this shows that time-inhomogeneous dynamics are a key ingredient in the effectiveness of the method. 5Boldface vectors used to match notation of Rezende and Mohamed [22]. 6When d is even, σ(d+1)/2 does not exist, although we could still consider (d + 1)/2 to be the location of the minimum of the parabola defining the true standard deviations. 7 4.2 Generative Model for MNIST The next experiment that we consider is using HVAE to improve upon a convolutional variational auto-encoder (VAE) for the binarized MNIST handwritten digit dataset. Again, our training data is D = {x1, . . . , xN}, where each xi ∈X ⊆{0, 1}d for d = 28 × 28 = 784. The generative model is as follows: zi ∼N(0, I), xi|zi ∼ d  j=1 Bernoulli((xi)j|πθ(zi)j), for i ∈[N], where (xi)j is the jth component of xi, zi ∈Z ≡R is the latent variable associated with xi, and πθ : Z →X is a convolutional neural network (i.e. the generative network, or encoder) parametrized by the model parameters θ. This is the standard generative model used in VAEs in which each pixel in the image xi is conditionally independent given the latent variable. The VAE approximate posterior – and the HVAE variational prior across the latent variables in this case – is given by qθ,φ(zi|xi) = N (zi|µφ(xi), Σφ(xi)), where µφ and Σφ are separate outputs of the same neural network (the inference network, or encoder) parametrized by φ, and Σφ is constrained to be diagonal. We attempted to match the network structure of Salimans et al. [25]. The inference network consists of three convolutional layers, each with filters of size 5 × 5 and a stride of 2. The convolutional layers output 16, 32, and 32 feature maps, respectively. The output of the third layer is fed into a fully-connected layer with hidden dimension nh = 450, whose output is then fully connected to the output means and standard deviations each of size . Softplus activation functions are used throughout the network except immediately before the outputted mean. The generative network mirrors this structure in reverse, replacing the stride with upsampling as in Dosovitskiy et al. [7] and replicated in Salimans et al. [25]. We apply HVAE on top of the base convolutional VAE. We evolve samples from the variational prior according to Algorithm 1 and optimize the new objective given in (12). We reparameterize z0|x ∼N (µφ(x), Σφ(x)) as z0 = µφ(x) + Σ1/2 φ (x) · , for  ∼N(0, I) and x ∈X, to generate unbiased gradients of the ELBO with respect to φ. We select various values for K and set = 64. In contrast with normalizing flows, we do not need our flow parameters ε and β0 to be outputs of the inference network because our flow is guided by the target. This allows our method to have fewer overall parameters than normalizing flow schemes. We use the standard stochastic binarization of MNIST [24] as training data, and train using Adamax [14] with learning rate 10−3. We also employ early stopping by halting the training procedure if there is no improvement in the loss on validation data over 100 epochs. To evaluate HVAE after training is complete, we estimate out-of-sample negative log likelihoods (NLLs) using 1000 importance samples from the HVAE approximate posterior. For each trained model, we estimate NLL three times, noting that the standard deviation over these three estimates is no larger than 0.12 nats. We report the average NLL values over either two or three different initializations (in addition to the three NLL estimates for each trained model) for several choices of tempering and leapfrog steps in Table 1. A full accounting of the tests is given in the supplementary material. We also consider an HVAE scheme in which we allow ε to vary across layers of the flow and report the results. From Table 1, we notice that generally increasing the inhomogeneity in the dynamics improves the test NLL values. For example, free tempering is the most successful tempering scheme, and varying the leapfrog step size ε across layers also improves results. We also notice that increasing the number of leapfrog steps does not always improve the performance, as K = 15 provides the best results in free tempering schemes. We believe that the improvement in HVAE over the base VAE scheme can be attributed to a more expressive approximate posterior, as we can see that samples from the HVAE approximate posterior exhibit non-negligible covariance across dimensions. As in Salimans et al. [25], we are also able to improve upon the base model by adding our time-inhomogeneous Hamiltonian dynamics on top, but in a simplified regime without referring to learned reverse kernels. Rezende and Mohamed [22] report only lower bounds on the log-likelihood for NFs, which are indeed lower than our log-likelihood estimates, although they use a much larger number of variational parameters. 8 Table 1: Estimated NLL values for HVAE on MNIST. The base VAE achieves an NLL of 83.20. A more detailed version of this table is included in the supplementary material. ε fixed across layers ε varied across layers T = Free T = Fixed T = None T = Free T = Fixed T = None K = 1 N/A 83.32 83.17 N/A N/A N/A K = 5 83.09 83.26 83.68 83.01 82.94 83.35 K = 10 82.97 83.26 83.40 82.62 82.87 83.25 K = 15 82.78 83.56 83.82 82.62 83.09 82.94 K = 20 82.93 83.18 83.33 82.83 82.85 82.93 5 Conclusion and Discussion We have proposed a principled way to exploit Hamiltonian dynamics within stochastic variational inference. Contrary to previous methods [25, 28], our algorithm does not rely on learned reverse Markov kernels and benefits from the use of tempering ideas. Additionally, we can use the reparameterization trick to obtain unbiased estimators of gradients of the ELBO. The resulting HVAE can be interpreted as a target-driven normalizing flow which requires the evaluation of a few gradients of the log-likelihood associated to a single data point at each stochastic gradient step. However, the Jacobian computations required for the ELBO are trivial. In our experiments, the robustness brought about by the use of target-informed dynamics can reduce the number of parameters that must be trained and improve generalizability. We note that, although we have fewer parameters to optimize, the memory cost of using HVAE and target-informed dynamics could become prohibitively large if the memory required to store evaluations of ∇z log pθ(x, z) is already extremely large. Evaluating these gradients is not a requirement of VAEs or standard normalizing flows. However, we have shown that in the case of a fairly large generative network we are still able to evaluate gradients and backpropagate through the layers of the flow. Further tests explicitly comparing HVAE with VAEs and normalizing flows in various memory regimes are required to determine in what cases one method should be used over the other. There are numerous possible extensions of this work. Hamiltonian dynamics preserves the Hamiltonian and hence also the corresponding target distribution, but there exist other deterministic dynamics which leave the target distribution invariant but not the Hamiltonian. This includes the Nosé-Hoover thermostat. It is possible to directly use these dynamics instead of the Hamiltonian dynamics within the framework developed in subsection 2.3. In continuous-time, related ideas have appeared in physics [5, 21, 26]. This comes at the cost of more complicated Jacobian calculations. The ideas presented here could also be coupled with the methodology proposed in [9] – we conjecture that this could reduce the variance of the estimator (3) by an order of magnitude. Acknowledgments Anthony L. Caterini is a Commonwealth Scholar, funded by the UK government. References [1] Martín Abadi et al. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https://www.tensorflow.org/. Software available from tensorflow.org. [2] Rianne van den Berg, Leonard Hasenclever, Jakub M Tomczak, and Max Welling. Sylvester normalizing flows for variational inference. arXiv preprint arXiv:1803.05649, 2018. [3] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. In The 4th International Conference on Learning Representations (ICLR), 2016. [4] Gavin E Crooks. Nonequilibrium measurements of free energy differences for microscopically reversible Markovian systems. Journal of Statistical Physics, 90(5-6):1481–1487, 1998. 9 [5] Michel A Cuendet. Statistical mechanical derivation of Jarzynski’s identity for thermostated non-hamiltonian dynamics. Physical Review Letters, 96(12):120602, 2006. [6] Pierre Del Moral, Arnaud Doucet, and Ajay Jasra. Sequential Monte Carlo samplers. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(3):411–436, 2006. [7] Alexey Dosovitskiy, Jost Tobias Springenberg, and Thomas Brox. Learning to generate chairs with convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2015 IEEE Conference on, pages 1538–1546. IEEE, 2015. [8] Paul Glasserman. Gradient estimation via perturbation analysis, volume 116. Springer Science & Business Media, 1991. [9] Jeremy Heng, Adrian N Bishop, George Deligiannidis, and Arnaud Doucet. Controlled sequential Monte Carlo. arXiv preprint arXiv:1708.08396, 2017. [10] Matthew D Hoffman. Learning deep latent Gaussian models with Markov chain Monte Carlo. In International Conference on Machine Learning, pages 1510–1519, 2017. [11] Matthew D Hoffman and Andrew Gelman. The no-u-turn sampler: adaptively setting path lengths in hamiltonian monte carlo. Journal of Machine Learning Research, 15(1):1593–1623, 2014. [12] Christopher Jarzynski. Nonequilibrium equality for free energy differences. Physical Review Letters, 78(14):2690, 1997. [13] Christopher Jarzynski. Hamiltonian derivation of a detailed fluctuation theorem. Journal of Statistical Physics, 98(1-2):77–102, 2000. [14] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [15] Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In The 2nd International Conference on Learning Representations (ICLR), 2014. [16] Diederik 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, pages 4743–4751, 2016. [17] Chris J Maddison, John Lawson, George Tucker, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Teh. Filtering variational objectives. In Advances in Neural Information Processing Systems, pages 6576–6586, 2017. [18] Radford M Neal. Annealed importance sampling. Statistics and Computing, 11(2):125–139, 2001. [19] Radford M Neal. Hamiltonian importance sampling. www.cs.toronto.edu/pub/radford/ his-talk.ps, 2005. Talk presented at the Banff International Research Station (BIRS) workshop on Mathematical Issues in Molecular Dynamics. [20] Radford M Neal et al. MCMC using Hamiltonian dynamics. Handbook of Markov Chain Monte Carlo, 2(11), 2011. [21] Piero Procacci, Simone Marsili, Alessandro Barducci, Giorgio F Signorini, and Riccardo Chelli. Crooks equation for steered molecular dynamics using a Nosé-Hoover thermostat. The Journal of Chemical Physics, 125(16):164101, 2006. [22] Danilo Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning, pages 1530–1538, 2015. [23] Danilo Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, pages 1278–1286, 2014. 10 [24] Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pages 872–879. ACM, 2008. [25] Tim Salimans, Diederik P Kingma, and Max Welling. Markov chain Monte Carlo and variational inference: Bridging the gap. In International Conference on Machine Learning, pages 1218– 1226, 2015. [26] E Schöll-Paschinger and Christoph Dellago. A proof of Jarzynski’s nonequilibrium work theorem for dynamical systems that conserve the canonical distribution. The Journal of Chemical Physics, 125(5):054105, 2006. [27] Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2): 26–31, 2012. [28] Christopher Wolf, Maximilian Karl, and Patrick van der Smagt. Variational inference with Hamiltonian Monte Carlo. arXiv preprint arXiv:1609.08203, 2016. 11
2018
219
7,385
Cooperative neural networks (CoNN): Exploiting prior independence structure for improved classification Harsh Shrivastava ∗ Georgia Tech hshrivastava3@gatech.edu Eugene Bart † PARC bart@parc.com Bob Price † PARC bprice@parc.com Hanjun Dai ∗ Georgia Tech hanjundai@gatech.edu Bo Dai ∗ Georgia Tech bodai@gatech.edu Srinivas Aluru ∗ Georgia Tech aluru@cc.gatech.edu Abstract We propose a new approach, called cooperative neural networks (CoNN), which uses a set of cooperatively trained neural networks to capture latent representations that exploit prior given independence structure. The model is more flexible than traditional graphical models based on exponential family distributions, but incorporates more domain specific prior structure than traditional deep networks or variational autoencoders. The framework is very general and can be used to exploit the independence structure of any graphical model. We illustrate the technique by showing that we can transfer the independence structure of the popular Latent Dirichlet Allocation (LDA) model to a cooperative neural network, CoNNsLDA. Empirical evaluation of CoNN-sLDA on supervised text classification tasks demonstrates that the theoretical advantages of prior independence structure can be realized in practice - we demonstrate a 23% reduction in error on the challenging MultiSent data set compared to state-of-the-art. 1 Introduction Neural networks offer a low-bias solution for learning complex concepts such as the linguistic knowledge required to separate documents into thematically related classes. However, neural networks typically start with a fairly generic structure, with each level comprising a number of functionally equivalent neurons connected to other layers by identical, repetitive connections. Any structure present in the problem domain must be learned from training examples and encoded as weights. In practice, some domain structure is often known ahead of time; in such cases, it is desirable to pre-design a network with this domain structure in mind. In this paper, we present an approach that allows incorporating certain kinds of independence structure into a new kind of neural learning machine. The proposed approach is called “Cooperative Neural Networks” (CoNN). This approach works by constructing a set of neural networks, each trained to output an embedding of a probability distribution. The networks are iteratively updated so that each embedding is consistent with the embeddings of the other networks and with the training data. Like probabilistic graphical models, the representation is factored into components that are independent. Unlike probabilistic graphical ∗Dept. of Comp. Sci. & Eng. Georgia Institute of Technology Atlanta, GA 30332 †3333 Coyote Hill Rd, Palo Alto, CA, 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. models, which are limited to tractable conditional probability distributions (e.g., exponential family), CoNNs can exploit powerful generic distributions represented by non-linear neural networks. The resulting approach allows us to create models that can exploit both known independence structure as well as the expressive powers of neural networks to improve accuracy over competing approaches. We illustrate the general approach of cooperative neural networks by showing how one can transfer the independence structure from the popular Latent Dirichlet Allocation (LDA) model [2] to a set of cooperative neural networks. We call the resultant model CoNN-sLDA. Cooperative neural networks are different from feed forward networks as they use back-propagation to enforce consistency across variables within the latent representation. CoNN-sLDA improves over LDA as it admits more complex distributions for document topics and better generalization over word distributions. CoNN-sLDA is also better than a generic neural network classifier as the factored representation forces a consistent latent feature representation that has a natural relationship between topics, words and documents. We demonstrate empirically that the theoretical advantages of cooperative neural networks are realized in practice by showing that our CoNN-sLDA model beats both probabilistic and neural networkbased state-of-the-art alternatives. We emphasize that although our example is based on LDA, the CoNN approach is general and can be used with other graphical models, as well as other sources of independence structure (for example, physics- or biology-based constraints). 2 Related Work Text classification has a long history beginning with the use of support vector machines on text features [11]. More sophisticated approaches integrated unsupervised feature generation and classification in models such as sLDA [17, 6] and discriminative LDA (discLDA) [13] and a maximum margin based combination [33]. One limitation of LDA-based models is that they pick topic distributions from a Dirichlet distribution and cannot represent the joint probability of topics in a document ( i.e., hollywood celebrities, politics and business are all popular categories, but politics and business appear together more often than their independent probabilities would predict). Models such as pachinko allocation [15] attempt to address this with complex tree structured priors. Another limitation of LDA stems from the fact that word topics and words themselves are selected from categorical distributions. These admit arbitrary empirical distributions over tokens, but don’t generalize what they learn. Learning about the topic for the token "happy" tells us nothing about the token "joyful". There have been many generative deep learning models such as Deep Boltzmann Machines [27], NADE [14, 32], variational auto-encoders (VAEs) [31] and variations [18], GANs[9] and other deep generative networks [28, 1, 22, 20] which can capture complex joint distributions of words in documents and surpass the performance of LDA. These techniques have proven to be good generative models. However, as purely generative models, they need a separate classifier to assign documents to classes. As a result, they are not trained end-to-end for the actual discriminative task that needs to be performed. Therefore, the resulting representation that is learned does not incorporate any problem-specific structure, leading to limited classification performance. Supervised convolutional networks have been applied to text classification [12] but are limited to small fixed inputs and still require significant data to get high accuracy. Recurrent networks have also been used to handle open ended text [8]. A supervised approach for LDA with DNN was developed by [4, 5] using end-to-end learning for LDA by using Mirror-Descent back propagation over a deep architecture called BP-sLDA. To achieve better classification, they have to increase the number of layers of their model, which results in higher model complexity, thereby limiting the capability of their model to scale. In summary, there are still significant challenges to creating expressive, but efficiently trainable and computationally tractable models. In the face of limited data, regularization techniques are an important way of trying to reduce overfitting in neural approaches. The use of pretrained layers for networks is a key regularization strategy; however, training industrial applications with domain specific language and tasks remains challenging. For instance, classification of field problem reports must handle content with arcane technical jargon, abbreviations and phrasing and be able to output task specific categories. Techniques such as L2 normalization of weights and random drop-out [26] of neurons during training are now widely used but provide little problem specific advantage. Bayesian neural networks with distributions have been proposed, but independent distributions over weights result in network 2 (a) LDA summarizes the content of each document m in M as a topic distribution θm. Each word wm,n in Nm has topic zm,n drawn from θm. (b) Variational LDA approximates the posterior topic distribution θm and word topic zm,n with independent distributions. Figure 1: Plate models representing the original LDA and its approximation. weight means where the variance must be controlled fairly closely so that relative relationship of weights produces the desired computation. Variational auto-encoders explicitly enable probability distributions and can therefore be integrated over, but are still largely undifferentiated structure of identical units. They don’t provide a lot of prior structure to assist with limited data. Recently there has been work incorporating other kinds of domain inspired structure into networks such Spatial transformer networks [10], capsule networks [23] and natural image priors [21]. 3 Deriving Cooperative Neural Networks Application of our approach proceeds in several distinct steps. First, we define the independence structure for the problem. In our supervised text classification example, we incorporate structure from latent dirichlet allocation (LDA) by choosing to factor the distribution over document texts into document topic probabilities and word topic probabilities. This structure naturally enforces the idea that there are topics that are common across all documents and that documents express a mixture of these topics independently through word choices. Second, a set of inference equations is derived from the independence structure. Next, the probability distributions involved in the variational approximation, as well as the inference equations, are mapped into a Hilbert space to reduce limitations on their functional form. Finally, these mapped Hilbert-space equations are approximated by a set of neural networks (one for each constraint), and inference in the Hilbert space is performed by iterating these networks. We call the combination of Cooperative Neural Networks and LDA as Cooperative Neural Network supervised Latent Dirichlet Allocation, or ‘CoNN-sLDA’. These steps are elaborated in the following sections. 3.1 LDA model Here, we use the same notation and the same plate diagram (Figure 1a) as in the original LDA description [2]. Let K be the number of topics, N be the number of words in a document, V be the vocabulary size over the whole corpus, and M be the number of documents in the corpus. Given the prior over topics α and topic word distributions β, the joint distribution over the latent topic structure θ, word topic assignments z, and observed words in documents w is given by: p(θ, z, w|α, β) = p(θ|α) N Y i=1 p(zi|θ)p(wi|zi, β) (1) 3.2 Variational approximation to LDA Inference in LDA requires estimating the distribution over θ and z. Using the Bayes rule, this posterior can be written as follows: p(θ, z|w, α, β) = p(θ, z, w|α, β) p(w|α, β) (2) Unfortunately, directly marginalizing out θ in the original model is intractable. Variational approximation of p(θ, z) is a common work-around. To perform variational approximation, we approximate 3 this LDA posterior with the Probabilistic Graphical Model (PGM) shown in Figure 1b. The joint distribution for the approximate PGM is given by: q(θ, z) = q(θ) N Y i=1 qi(zi) (3) We want to tune the approximate distribution to resemble the true posterior as much as possible. To this end, we minimize the KL divergence between the two distributions. Alternatively, this can be seen as minimizing the variational free energy of the Mean-Field inference algorithm [30]: min {q} {DKL( q(θ, z) || p(θ, z|w, α, β) )} (4) To solve this minimization problem, we derive a set of fixed-point equations in Appendix(A). These fixed-point equations can be expressed as log q(θ) = log p(θ|α)+ N X i=1 Z zi qi(zi) log p(zi|θ) dzi −1 (5) log qi(zi) = log p(wi|zi, β) + Z θ q(θ) log p(zi|θ)dθ −1 (6) This set of equations is difficult to solve analytically. In addition, even if it was possible to solve them analytically, they are still subject to the limitations of the original graphical models, such as the need to use exponential family distributions and conjugate priors for tractability. Therefore, the next step in the proposed method is to map the probability distributions and the corresponding fixed-point equations into a Hilbert space, where some of these limitations can be relaxed. Section 3.3 gives a general overview of Hilbert space embeddings, and section 3.4 derives the corresponding equations for our model. 3.3 Hilbert Space Embeddings of Distributions We follow the notations and procedure defined in [7] for parameterizing Hilbert spaces. By definition, the Hilbert Space embeddings of probability distributions are mappings of these distributions into potentially infinite -dimensional feature spaces. [24]. For any given distribution p(X) and a feature map φ(x), the embedding µX : P →F is defined as: µX := EX[φ(X)] = Z X φ(x)p(x)dx (7) For some choice of feature map φ, the above embedding of distributions becomes injective [25]. Therefore, any two distinct distributions p(X) and q(X) are mapped to two distinct points in the feature space. We can treat the injective embedding µX as a sufficient statistic of the corresponding probability density. In other words, µX preserves all the information of p(X). Using µX, we can uniquely recover p(X) and any mathematical operation on p(X) will have an equivalent operation on µX. These properties lead to the following equivalence relations. We can compute a functional f : P →IR of the density p(X) using only its embedding, f(p(x)) = ˜f(µX) (8) by defining ˜f : F →IR as the operation on µX equivalent to f. Similarly, we can generalize this property to operators. An operator T : P →IRd applied to a density can also be equivalently carried out using its embedding, T ◦p(x) = ˜T ◦µX (9) where ˜T : F →IRd is again the corresponding equivalent operator applied to the embedding. In our derivations, we assume that there exists a feature space where the embeddings are injective and apply the above equivalence relations in subsequent sections. 4 Figure 2: Visualization of the CoNN-sLDA architecture for a single document. For the i’th word, the latent topic variable is zi. The embedding for the distribution p(zi) is µzi; these embeddings are shown as three-dimensional vectors for illustration. They are accumulated and passed through a non-linearity to obtain µθ, which is the embedding of p(θ), the distribution over the topics for the document. Thus, the embedding µθ is determined (up to the non-linearity) by the average of the embeddings µzi, as in the original LDA model. Similarly, there is feedback from µθ (which happens for T iterations, see Alg1), so that µθ, in turn, influences µzi, again, as in the original LDA model. 3.4 Hilbert space embedding for LDA We consider Hilbert space embeddings of q(θ), qi(zi), as well as the equations (5) and (6). By definition given in equation(7), µθ = Z θ φ(θ)q(θ)dθ µzi = Z zi φ(zi)qi(zi)dzi (10) The variational update equations in (5) and (6) provide us with the key relationships between latent variables in the model. We can replace the specific distributional forms in these equations with operators that maintain the same relationships among distributions represented in the Hilbert space embeddings. q(θ) = f1(θ, {qi(zi)}) qi(zi) = f2(zi, wi, q(θ)) (11) Here, f1 and f2 represent the abstract structure of the model implied by (5) and (6) without specific distributional forms. We will provide a specific instantiation of f1 and f2 shortly. Following the same argument as in equation (8), we can write equation (11) as q(θ) = ˜f1(θ, {µzi}). Similarly, qi(zi) = ˜f2(zi, wi, µθ). Iterating through all values of θ, zi and using the operator view given in equation (9) as reference, we get the following equivalent fixed-point equations in the Hilbert Space: µθ = T1 ◦{µzi} µzi = T2 ◦[wi, µθ] (12) 3.5 Parameterization of Hilbert space embedding using Deep Neural Networks The operators T1 and T2 have complex non-linear dependencies on the unknown true probability distributions and the feature map φ. Thus, we need to model these operators in such a way that we can utilize the available data to learn the underlying non-linear functions. We will use deep neural networks which are known for their ability to model non-linear functions. We start by parameterizing the embeddings. We assume that any point in the Hilbert space is a vector µi ∈IRD. Next, as the operators are non-linear function maps, we replace them by deep neural networks. In its simplest form, we only use a single fully connected layer with ‘tanh’ activations yielding the following fixed point update equations, µθ = tanh( W1 · N X i=1 {µzi} ) (13) µzi = tanh( W2 · word2vec(wi) + W3.µθ ) (14) The original work on Hilbert space embeddings required the embeddings to be injective. We observe that we do not need the embedding to be injective on the domain of all distributions. Instead, we only 5 need it to be injective on the sub-domain of distributions used in the training corpus. The supervised training process on the training set will have to find embeddings that allow the model to distinguish documents that occur in the corpus automatically causing the learned embeddings to be injective for the training domain. We keep the dimension of the word2vec [19] embedding identical to the Hilbert space embedding, i.e. wi ∈IRD. Note, that the above parameterization is one example. Multiple fully connected layers can be used to achieve denser models. Assume the parameters word2vec, W1, W2 and W3 are known. We calculate the set of embeddings for a given text corpus by iterating equations(13, 14). Algorithm 1 summarizes this procedure. We normalize the embeddings after every iteration to avoid overflow. This is the heart of the Cooperative Neural Network paradigm in which a set of neural networks co-constrain each other to produce an embedding informed by prior structure. In our experience, we found that ‘tanh’ works better than ‘σ’ as a choice for non-linearity. Using rectified linear ‘ReLU’ units will not work as they zero out negative values of the embeddings. We apply dropout [26] to µzi’s, µθ and word2vec for regularization. For every document, the algorithm returns the associated µθ embedding, representing the document in the Hilbert space. Algorithm 1 Getting Hilbert Space Embeddings Input: Parameters {W1, W2, W3} Initialize {µ(0) θ , µ(0) zi } = 0 ∈IRD. for t = 1 to T iterations do for i = 1 to N words do µ(t) zi = tanh(W2.word2vec(wi) + W3.µ(t) θ ) Normalize µ(t) zi end for µ(t) θ = tanh(W1. PN i=1{µ(t−1) zi }) Normalize µ(t) θ end for return {µ(T ) θ } : Document embeddings Algorithm 2 Training using Hilbert Space Embeddings Input: Document Corpus D, with each doc ‘d’ has set of words [wd,i] ∈Nd. Initialize P(0) = {W(0), u(0), word2vec(0)} with random values. Let ‘learning rate = r’. for t = 1 to T do Sample docs from D as {Ds, ys} Using Alg(1) get Hilbert embeddings {µs θd} for ‘Ds’ ypred = H µs θd; P(t−1) Update: P(t) = P(t−1) - r. ▽P(t−1) L(ypred, ys) end for return {PT } In practice, the parameters word2vec, W1, W2 and W3 are not known and need to be learned from training data. This requires formulating an objective function, and then optimizing that objective function. An additional advantage of the proposed method is that it allows using a wide variety of objective functions. In our case, we trained the model using a discriminative/supervised criterion that relies on the labels associated with each document, and we used binary cross-entropy loss or cross-entropy loss for multiclass classification. Algorithm 2 summarizes the training procedure. It uses Algorithm 1 as a subroutine. The H function is chosen to be a single fully connected layer in our implementation, which transforms the input embedding to a vector corresponding to number of classes. We sample (without replacement) a batch of documents Ds from the corpus, compute their embeddings and update the parameters. The loss function takes in the µθ embeddings and the corresponding document labels. The resulting model, called ‘CoNN-sLDA’ is schematically illustrated in Figure 2. The CoNN-sLDA model retains the overall structure of the LDA model by separating the problem into document topic distributions and word topic distributions within each document. As with traditional LDA, one can visualize a document corpus by projecting topic vectors associated with documents into a 2D plane (e.g., using MDS, tSNE). An advantage of CoNN-sLDA over typical neural network approaches is that typical DNNs produce only a single embedding, whereas CoNN-sLDA elegantly factors the local and global information into separate parts of the model. An advantage of CoNNsLDA over traditional probabilistic graphical models is that we can use low-bias, highly expressive distributions implied by the neural network implementations of update operators. 6 4 Experiments 4.1 Description of Datasets We evaluated our model ‘CoNN-sLDA’ on two real-world datasets. The first dataset is a multi-domain sentiment dataset (MultiSent) [3], consisting of 342,104 Amazon product reviews on 25 different types of products (apparels, books, DVDs, kitchen appliances, · · · ). For each review, we go through the ratings given by the customer (between 1 to 5 stars) and label a it as positive, if the rating is higher than 3 stars and negative otherwise. We pose this as a binary classification problem. The average length of reviews is roughly 210 words after preprocessing the data. The ratio of positive to negative reviews is ∼8 : 1. We use 5-fold cross validation and report the average area under the ROC curve (AUC), in %. The second dataset is the 20 Newsgroup dataset3. It has around 19,000 news articles, divided roughly equally into 20 different categories. We pose this as a multiclass classification problem and report accuracy over 20 classes. The dataset is divided into training set (11,314 articles) and test set (7,531 articles), approximately maintaining the relative ratio of articles of different categories. The average length of documents after preprocessing is ∼160 words. This task becomes challenging as there are some categories that are highly similar, making their separation difficult. For example, the categories “PC hardware” and “Mac hardware” have quite a lot in common. We apply standard text preprocessing steps to both datasets. We convert everything to lower case characters and remove the standard stopwords defined in the ‘Natural Language Toolkit’ library. We remove punctuations, followed by lemmatization and stemming to further clean the data. However, for other classifiers, we use the preprocessing techniques recommended by the respective authors. 4.2 Baselines for comparison We compare ‘CoNN-sLDA’ with existing state-of-the-art algorithms for document classification. We compare against VI-sLDA, [6, 17], which includes the label of the document in the graphical model formulation and then maximizes the variational lower bound. Different from VI-sLDA, the supervised topic model using DiscLDA [13] reduces the dimensionality of topic vectors θ for classification by introducing a class-dependent linear transformation. Boltzmann Machines are traditionally used to model distributions and with the recent development of deep learning techniques, these approaches have gained momentum. We compare with one such Deep Boltzmann Machine developed for modeling documents called Over-Replicated Softmax (OverRep-S) [27]. Another popular approach is by [4], called BP-sLDA, which does end-to-end learning of LDA by mirror-descent back propagation over a deep architecture. We also compare with a recent deep learning model developed by [5] called DUI-sLDA. 4.3 Classification Results Table(1) shows the accuracy results on newsgroup dataset together with standard error on the mean (SEM) over 5 folds. For each of 5 folds, we split training data into train and validation and optimize all parameters. We then evaluate against a fixed common test set. As the number of classes is 20, we found that using higher Hilbert space dimensions work better (See entries for Dim=40 and Dim=80 in table). A dropout of ∼0.8 was applied to word2vec embeddings. The batch size was fixed at 100 and we trained for around 400 batches. The performance of CoNN-sLDA is better than BP-sLDA and at par with 5 layer DUI-sLDA model. The cost sensitive version CoNN-sLDA (Imb), balances out the misclassification cost for different classes in the loss function tends to perform slightly better. The 20 newsgroup dataset is one of the earliest and most studied text corpuses. It is fairly separable, so most modern state-of-the-art methods do well on it, but it is an important benchmark to establish the credibility of an algorithm. Our CoNN-sLDA model was able to outperform the recently proposed state-of-the-art method, DUIsLDA, on the large ‘MultiSent’ dataset (table2) having over 300K documents by a significant AUC margin of 2%. This corresponds to a 23% reduction in error rate. We used a single fully connected layer with tanh non-linear function for both, µθ, µzi embeddings. Hilbert space dimension and 3 http://qwone.com/ jason/20Newsgroups/ 7 Classifier Accuracy(%) Details VI-sLDA 73.8± 0.49 K=50 DiscLDA 80.2± 0.45 K=50 OverRep-S 69.5± 0.36 K=512 BP-sLDA 81.8± 0.36 K=50, L=5 DUI-sLDA 83.5± 0.22 K=50, L=5 CoNN-sLDA 83.4 ± 0.18 Dim=40 CoNN-sLDA(imb) 83.7± 0.13 Dim=80 Table 1: ‘20 Newsgroups’ classification accuracy on 19K documents. SEM over 5 fold CV. Dim indicates Hilbert space dimension. Classifier AUC (%) Details VI-sLDA 76.8± 0.40 K=50 (topics) DiscLDA 82.1± 0.40 K=50 BP-sLDA 88.9± 0.36 K=50, L=5 DUI-sLDA 86.0± 0.31 K=50, L=1 DUI-sLDA 91.4± 0.27 K=50, L=5 CoNN-sLDA 93.3± 0.13 Dim=10 CoNN-sLDA(imb) 93.4± 0.13 Dim=20 Table 2: ‘MultiSent’ AUC on 324K documents. SEM over 5 Fold CV. Dim indicates Hilbert space dimension. word2vec dimension are both 10. We use a dropout probability of 0.1, The Algorithm(1) was unrolled for 1 iteration. ‘Batch size’ was set at 100 and ran for 3000 batches with optimization done using ‘Adam’ optimizer. We also ran a cost sensitive version of CoNN-sLDA (Imb) model, with a balancing ratio of 1.4 towards the minority class which was incorporated in the loss function. We observe slight improvement in results. CoNN-sLDA consistently outperformed other models over various choices of model parameters, see Appendix(B). The number of layers required by other deep models like DUI-sLDA, BP-sLDA for good classification is usually quite high and their performance decreases considerably with fewer layers. CoNN-sLDA outperforms them with a single layer neural network. We have a vectorized and efficient implementation of CoNN-sLDA in PyTorch and Tensorflow. The results shown above are from the PyTorch version. We ran our experiments on NVIDIA Tesla P100 GPUs. The runtime for 1 fold of ‘MultiSent’ for the settings mentioned above is around 5 minutes, while a single fold for ‘20 Newsgroup’ dataset runs within 2 minutes. In Appendix(B), we report our experiments to optimize the algorithmic and architectural hyperparameters. We use the ‘MultiSent’ data for our analysis. In general for training, we recommend starting with a small Hilbert space dimension and batch size, then try increasing the number of fully connected layers and finally choose to unroll the model further. Figure 3: A t-SNE projection of the 40-dimensional embeddings µθ for test documents in the 20Newsgroups dataset. The colors represent the category label for each document. The embeddings separate categories very well. 5 Discussions & Future extensions In addition to supervised classification, we can use LDA style models for visualizing and interpreting the cluster structure of the datasets. For example, in CoNN-sLDA model, we can use t-SNE [16] to visualize the documents using their µθ values. In Figure 3 we see that CoNN-sLDA clearly maps different newsgroups to homogeneous regions of space that help classification accuracy and provide 8 Figure 4: tSNE visualization of a random sample of 10-dimensional µθ embeddings for Multisent documents (Blue positive, red negative). The embeddings project distinct categories to highly coherent regions. insight into the structure of the domain. Similarly, Figure 4 shows that CoNN-sLDA maps the positive and negative product reviews into different regions facilitating classification and interpretation. An interesting extension for the CoNN-sLDA model will be to map the Hilbert space topic embedding µθ back to the original topic space distribution. This would potentially allow us to provide text labels for the discovered clusters providing an intuitive interpretation for the model learned by our technique. Appendix (C) discusses an approach to get most relevant words in a document pertaining to a discriminative task. In this work, we obtain the fixed point update equations using the mean-field inference technique. In general, we can extend this procedure to other variational inference techniques. For example, we can find embeddings for Algorithm 1 by minimizing the free energies of loopy belief propagation or its variants (e.g., [29]) and use Algorithm 2 to train them end-to-end. 6 Conclusion Cooperative neural networks (CoNN) are a new theoretical approach for implementing learning systems which can exploit both prior insights about the independence structure of the problem domain and the universal approximation capability of deep networks. We make the theory concrete with an example, CoNN-sLDA, which has superior performance to both prior work based on the probabilistic graphical model LDA and generic deep networks. While we demonstrated the method on text classification using the structure of LDA, the approach provides a fully general methodology for computing factored embeddings using a set of highly expressive networks. Cooperative neural networks thus expand the design space of deep learning machines in new and promising ways. Acknowledgements We are thankful to our colleagues Srinivas Eswar, Patrick Flick and Rahul Nihalani for their careful reading of our submission. References [1] Yoshua Bengio, Eric Laufer, Guillaume Alain, and Jason Yosinski. Deep generative stochastic networks trainable by backprop. In International Conference on Machine Learning, pages 226–234, 2014. [2] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. Journal of machine Learning research, 3(Jan):993–1022, 2003. [3] John Blitzer, Mark Dredze, and Fernando Pereira. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In Proceedings of the 45th annual meeting of the association of computational linguistics, pages 440–447, 2007. [4] Jianshu Chen, Ji He, Yelong Shen, Lin Xiao, Xiaodong He, Jianfeng Gao, Xinying Song, and Li Deng. End-to-end learning of LDA by mirror-descent back propagation over a deep architecture. In Advances in Neural Information Processing Systems, pages 1765–1773, 2015. 9 [5] Jen-Tzung Chien and Chao-Hsi Lee. Deep unfolding for topic models. IEEE transactions on pattern analysis and machine intelligence, 40(2):318–331, 2018. [6] Wang Chong, David Blei, and Fei-Fei Li. Simultaneous image classification and annotation. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 1903–1910. IEEE, 2009. [7] Hanjun Dai, Bo Dai, and Le Song. Discriminative embeddings of latent variable models for structured data. In International Conference on Machine Learning, pages 2702–2711, 2016. [8] Adji Dieng. TopicRNN: A recurrent neural network with long-range semantic dependency. In arXiv preprint arXiv:1611.01702, 2016. [9] Zhe Gan, Changyou Chen, Ricardo Henao, David Carlson, and Lawrence Carin. Scalable deep poisson factor analysis for topic modeling. In International Conference on Machine Learning, pages 1823–1832, 2015. [10] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In NIPS, 2015. [11] Thorsten Joachims. Text categorization with support vector machines: Learning with many relevant features. In ECML, 1998. [12] Yoon Kim. Convolutional neural networks for sentence classification. In arXiv, 2014. [13] Simon Lacoste-Julien, Fei Sha, and Michael I Jordan. DiscLDA: Discriminative learning for dimensionality reduction and classification. In Advances in neural information processing systems, pages 897–904, 2009. [14] Hugo Larochelle and Stanislas Lauly. A neural autoregressive topic model. In Advances in Neural Information Processing Systems, pages 2708–2716, 2012. [15] Wei Li and Andrew McCallum. Pachinko allocation:dag-structured mixture models of topic correlations. 2006. [16] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008. [17] Jon D Mcauliffe and David M Blei. Supervised topic models. In Advances in neural information processing systems, pages 121–128, 2008. [18] Yishu Miao, Lei Yu, and Phil Blunsom. Neural variational inference for text processing. In International Conference on Machine Learning, 2016. [19] 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, pages 3111–3119, 2013. [20] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. arXiv preprint arXiv:1402.0030, 2014. [21] Hojjat S. Mousavi, Tiantong Guo, and Vishal Monga. Deep image super resolution via natural image priors. In arxiv, 2018. [22] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. [23] Sara Sabour, Nicholas Frosst, and Geoffrey E Hinton. Dynamic routing between capsules. In Advances in Neural Information Processing Systems, pages 3856–3866, 2017. [24] Alex Smola, Arthur Gretton, Le Song, and Bernhard Schölkopf. A hilbert space embedding for distributions. In International Conference on Algorithmic Learning Theory, pages 13–31. Springer, 2007. [25] Bharath K Sriperumbudur, Arthur Gretton, Kenji Fukumizu, Gert Lanckriet, and Bernhard Schölkopf. Injective hilbert space embeddings of probability measures. 2008. [26] Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15:1929–1958, 2014. [27] Nitish Srivastava, Ruslan R Salakhutdinov, and Geoffrey E Hinton. Modeling documents with deep boltzmann machines. arXiv preprint arXiv:1309.6865, 2013. 10 [28] Yichuan Tang and Ruslan R Salakhutdinov. Learning stochastic feedforward neural networks. In Advances in Neural Information Processing Systems, pages 530–538, 2013. [29] Martin J Wainwright, Tommi S Jaakkola, and Alan S Willsky. Tree-reweighted belief propagation algorithms and approximate ML estimation by pseudo-moment matching. In AISTATS, 2003. [30] Martin J Wainwright, Michael I Jordan, et al. Graphical models, exponential families, and variational inference. Foundations and Trends R⃝in Machine Learning, 1(1–2):1–305, 2008. [31] Zichao Yang, Zhiting Hu, Ruslan Salakhutdinov, and Taylor Berg-Kirkpatrick. Improved variational autoencoders for text modeling using dilated convolutions. arXiv preprint arXiv:1702.08139, 2017. [32] Yin Zheng, Yu-Jin Zhang, and Hugo Larochelle. A deep and autoregressive approach for topic modeling of multimodal data. IEEE transactions on pattern analysis and machine intelligence, 38(6):1056–1069, 2016. [33] Jun Zhu, Amr Ahmed, and Eric P Xing. MedLDA: maximum margin supervised topic models for regression and classification. In Proceedings of the 26th annual international conference on machine learning, pages 1257–1264. ACM, 2009. 11
2018
22
7,386
Unorganized Malicious Attacks Detection Ming Pang Wei Gao Min Tao Zhi-Hua Zhou National Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, 210023, China {pangm, gaow, zhouzh}@lamda.nju.edu.cn taom@nju.edu.cn Abstract Recommender systems have attracted much attention during the past decade. Many attack detection algorithms have been developed for better recommendations, mostly focusing on shilling attacks, where an attack organizer produces a large number of user profiles by the same strategy to promote or demote an item. This work considers another different attack style: unorganized malicious attacks, where attackers individually utilize a small number of user profiles to attack different items without organizer. This attack style occurs in many real applications, yet relevant study remains open. We formulate the unorganized malicious attacks detection as a matrix completion problem, and propose the Unorganized Malicious Attacks detection (UMA) algorithm, based on the alternating splitting augmented Lagrangian method. We verify, both theoretically and empirically, the effectiveness of the proposed approach. 1 Introduction Online activities have been an essential part in our daily life as the flourish of Internet, and it is important to recommend suitable products effectively as the number of users and items increases drastically. Various collaborative filtering techniques have been developed in diverse systems to help customers choose their favorite products in a set of items [5, 18, 28]. However, most collaborative filtering approaches are vulnerable to spammers and manipulations of ratings [13, 19], and attackers could bias systems by inserting fake rating scores into the user-item rating matrix. Some attackers try to increase the popularity of their own items (push attack) while the others intend to decrease the popularity of their competitors’ items (nuke attack). Detecting attacks from online rating systems is crucial to recommendations. Most attack detection studies focus on shilling attacks [13], where all the attack profiles are produced by the same strategy to promote or demote a particular item. For example, an attack organizer may produce hundreds of fake user profiles with one strategy where each fake user profile gives high scores to the most popular movies and low scores to the target movie. Relevant studies have shown good detection performance on diverse shilling attack strategies [16, 19, 23]. Practical mechanisms have been developed to prevent shilling attacks. For example, lots of online sites require real names and phone numbers for user registration; CAPTCHA is used to determine whether the response is generated by a robot; customers are allowed to rate a product after purchasing this product on the shopping website. These mechanisms produce high cost for conducting traditional shilling attacks; for example, small online sellers in e-commerce like Amazon have insufficient capacity to produce hundreds of fake rating profiles to conduct a shilling attack. In this paper, we introduce another different attack model named unorganized malicious attacks, where attackers individually use a small number of user profiles to attack their own targets without organizer. This attack happens in many real applications: online sellers on Amazon may produce a few fake customer profiles to demote their competitors’ high-quality products; writers may hire 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. several users to give high scores to promote their own books. Actually, recommender systems may be seriously influenced by small amounts of unorganized malicious attacks, e.g., the first maliciously bad rating can decrease the sales of one seller by 13% [20]. So far as we know, the detection of unorganized malicious attacks has rarely been studied, and existing attack detection approaches do not work well on this kind of attack [26]. We formulate the unorganized malicious attacks detection as a variant of matrix completion problem. Let X denote the ground-truth rating matrix without attacks and noises, and assume that the matrix is low-rank since the users’ preferences are affected by several factors [31]. Let Y be the sparse malicious-attack matrix, and Z denotes a small perturbation noise matrix. What we can observe is a matrix M such that M = X + Y + Z. We propose the Unorganized Malicious Attacks detection (UMA) algorithm, which can be viewed as an extension of alternating splitting augmented Lagrangian method. Theoretically, we show that the low-rank rating matrix X and the sparse matrix Y can be recovered under some classical matrix-completion assumptions, and we present the global convergence of UMA with a worst-case O(1/t) convergence rate. Finally, empirical studies are provided to verify the effectiveness of our proposed algorithm in comparison with the state-of-the-art methods for attack detection. The rest of this paper is organized as follows. Section 2 reviews related work. Section 3 introduces the framework of unorganized malicious attacks detection. Section 4 proposes the UMA algorithm. Section 5 shows the theoretical justification. Section 6 reports the experimental results. Section 7 concludes this work. 2 Related Work Collaborative filtering has been one of the most successful techniques to build recommender systems. The core assumption of collaborative filtering is that if users have expressed similar interests in the past, they will share common interest in the future [12]. Significant progress about collaborative filtering has been made [5, 18, 28, 31]. There are two main categories of conventional collaborative filtering (based on the user-item rating matrix) which are memory-based and model-based algorithms. Collaborative filtering schemes are vulnerable to attacks [1, 13], and increasing attention has been paid to attack detection. Researchers have proposed several methods which mainly focus on shilling attacks where the attack organizer produces a large number of user profiles by the same strategy to promote or demote a particular item. These methods mainly contain statistical, classification, clustering and data reduction-based methods [13]. Statistical methods are used to detect anomalies with suspicious ratings. Hurley et al. [16] proposed the Neyman-Pearson statistical attack detection method to distinguish malicious users from normal users, and Li and Luo [17] introduced the probabilistic Bayesian network models. Based on attributes derived from user profiles, classification methods detect attacks by kNN, SVM, etc. [14, 24]. Bhaumik et al. [3] presented the unsupervised clustering algorithm based on several classification attributes [7], and they apply k-means clustering based on these attributes and classify users in the smallest cluster as malicious users. Variable selection method treats users as variables and calculates their covariance matrix [22]. Users with the smallest coefficient in the first l principal components of the covariance matrix are classified as malicious users. Ling et al. [19] utilized a low-rank matrix factorization method to predict the users’ ratings. Users’ reputation is computed according to the predicted ratings and low-reputed users are classified as malicious users. These methods make detection by finding the common characteristics of the attack profiles that differ from the normal profiles. Therefore, they have a common assumption that the attack profiles are produced by the same attack strategy. However, this assumption does not hold for unorganized malicious attacks, where different attackers use different strategies to attack their own targets. Recovering low-dimensional structure from a corrupted matrix is related to robust PCA [4, 9, 33]. However, robust PCA focuses on recovering low-rank part X from complete or incomplete matrix, and the target is different from attacks detection (which is our task). Our work considers the specific properties of malicious attacks to distinguish the attack matrix Y from the small perturbation noise term Z. In this way, our method can not only recover the low-rank part X, but also distinguish Y from the noise term Z which leads to better performance. 2 3 The Formulation This section introduces some notations and problem formulation. We introduce the general form of an attack profile, and give a detailed comparison between unorganized malicious attacks and shilling attacks, followed by the corresponding detection problem formulation. 3.1 Notations We begin with some notations used in this paper. Let ∥X∥, ∥X∥F and ∥X∥∗denote the operator norm, Frobenius norm and nuclear norm of matrix X, respectively. Let ∥X∥1 and ∥X∥∞be the ℓ1 and ℓ∞ norm of matrix X, respectively. Further, we define the Euclidean inner product between two matrices as ⟨X, Y ⟩:= trace(XY ⊤), where Y ⊤means the transpose of Y . We have ∥X∥2 F = ⟨X, X⟩. Let PΩdenote an operator of linear transformation over matrices space, and we also denote by PΩ the linear space of matrices supported on Ωwhen it is clear from the context. Then, PΩ⊤represents the space of matrices supported on Ωc. For an integer m, let [m] := {1, 2, . . . , m}. 𝑖" # ⋯ 𝑖% # 𝑖" & ⋯ 𝑖' & 𝑖" ∅ ⋯ 𝑖) ∅ 𝑖* 𝜃(𝑖" #) ⋯ 𝜃(𝑖% #) 𝜁(𝑖" &) ⋯ 𝜁(𝑖' &) 𝑛𝑢𝑙𝑙 ⋯ 𝑛𝑢𝑙𝑙 Υ(𝑖*) 𝐼# 𝐼& 𝐼∅ Ratings for 𝑘 selected items Ratings for 𝑙 filler items Unrated items in the attack profile Ratings for the target item Figure 1: General form of an attack profile. 3.2 Problem Formulation Bhaumik et al. [2] introduced the general form of an attack profile, as shown in Figure 1. The attack profile contains four parts. The single target item it is given a malicious rating, i.e., a high rating in a push attack or a low rating in a nuke attack. The selected items IS are a group of selected items for special treatment during the attack. The filler items IF are selected randomly to complete the attack profile. The null part I∅contains the rest of the items with no ratings. Functions θ, ζ and Υ determine how to assign ratings to items in IS, IF and target item it, respectively. Three basic attack strategies are listed as follows. • Random attack: IS is empty; IF is selected randomly, and function ζ assigns ratings to IF by generating random ratings centered around the overall average rating in the database. • Average attack: IS is empty; IF is selected randomly, and function ζ assigns ratings to IF by generating random ratings centered around the average rating of each item. • Bandwagon attack: IS is selected from the popular items and function θ assigns high ratings to IS. The filler items IF are handled similarly to random attack. The shilling attack chooses one attack strategy (e.g., average attack strategy), and fixes the target item it, the numbers of rated items k and l and the rating functions. This makes the generated attack profiles have some common characteristics in one shilling attack. Besides, a large number of attack profiles are required in the basic setting of shilling attacks. However, unorganized malicious attacks allow the concurrence of various attack strategies, and the number of rated items, the target item and the rating functions can be different. Each attacker produces a small number of attack profiles with their own strategies and preference [26]. Let U[m] = {U1, U2, . . . , Um} and I[n] = {I1, I2, . . . , In} denote m users and n items, respectively. Let X ∈Rm×n be the ground-truth rating matrix. Xij denotes the score that user Ui gives to item Ij without any attack or noise, i.e., Xij reflects the ground-truth feeling of user Ui on item Ij. Suppose that the score range is [−R, R], and we have −R ≤Xij ≤R. In this work, we assume that X is a 3 low-rank matrix as in classical matrix completion [30] and collaborative filtering [31]. The intuition is that the user’ preferences may be influenced by a few factors. The ground-truth matrix X may be corrupted by a system noisy matrix Z. For example, if Xij = 4.8 for i ∈[m], then, it is acceptable that user Ui gives item Ij score 5 or 4.6. In this paper, we consider the independent Gaussian noise, i.e., Z = (Zij)m×n where each element Zij is drawn i.i.d. from the Gaussian distribution N(0, σ) with parameter σ. Let M be the observed rating matrix. We define the unorganized malicious attacks formally as follows: for every j ∈[n], we have |U j| < γ with U j = {Ui|i ∈[m] & |Mij −Xij| ≥ϵ}. The parameter ϵ distinguishes malicious users from the normal, and parameter γ limits the number of user profiles attacking one item. Intuitively, unorganized malicious attacks consider that attackers individually use a small number of user profiles to attack their own targets, and multiple independent shilling attacks can be regarded as an example of unorganized malicious attacks if each shilling attack contains a small number of attack profiles. It is necessary to distinguish unorganized malicious attacks from noise. Generally speaking, user Ui gives item Ij a normal score if |Mij −Xij| is very small, while user Ui makes an attack to item Ij if |Mij −Xij| ≥ϵ. For example, if the ground-truth score of item Ij is 4.8 for user Ui, then user Ui makes a noisy rating by giving Ij score 5, yet makes an attack by giving Ij score −3. Therefore, we assume that ∥Z∥F ≤δ, where δ is a small parameter. Let Y = M −X −Z = (Yij)m×n be the malicious-attack matrix. Then, Yij = 0 if user Ui does not attack item Ij; otherwise |Yij| ≥ϵ. We assume that Y is a sparse matrix, whose intuition lies in the small ratio of malicious ratings to all the ratings. Notice that we can not directly recover X and Y from M because such recovery is an NP-Hard problem [9]. We consider the optimization problem as follows: min X,Y,Z ∥X∥∗+ τ∥Y ∥1 −α⟨M, Y ⟩+ κ 2 ∥Y ∥2 F s.t. X + Y + Z = M, ∥Z∥F ≤δ. (1) Here ∥X∥∗acts as a convex surrogate of the rank function to pursue the low-rank part. ∥Y ∥1 is used to induce the sparse attack part. The term ⟨M, Y ⟩is introduced to better distinguish Y and Z, since the malicious rating bias Yij and the observed rating Mij have the same sign, i.e., MijYij > 0, while each entry in Z is small and ZijMij can be either positive or negative. We have Yij < 0 and Mij < 0 if it is a nuke attack; we also have Yij > 0 and Mij > 0 if it is a push attack. So the term ⟨M, Y ⟩distinguishes Y from Z. ∥Y ∥2 F is another strongly convex regularizer for Y . This term also guarantees the optimal solution. τ, α and κ are tradeoff parameters. In many real applications, we can not get the full matrix M, and partial entries can be observed. Let Ω∈[m] × [n] be the set of observed entries. We define an orthogonal projection PΩonto the linear space of matrices supported on Ω⊂[m] × [n], i.e., PΩM =  Mij for (i, j) ∈Ω, 0 otherwise. The optimization framework for unorganized malicious attack detection can be formulated as follows. min X,Y,Z ∥X∥∗+ τ∥Y ∥1 −α⟨¯ M, Y ⟩+ κ 2 ∥Y ∥2 F s.t. X + Y + Z = ¯ M, Z ∈B, B := {Z|∥PΩ(Z)∥F ≤δ}, (2) where κ > 0 and ¯ M := PΩ(M). This formulation degenerates into robust PCA as κ →0 and α →0. There have been many studies focusing on recovering low-rank part X from complete or incomplete matrix [9, 11, 21, 27], while we distinguish the sparse attack term Y from the small perturbation term Z. ⟨¯ M, Y ⟩is added to find nonzero entries of Y , and this yields better detection performance. 4 The Proposed Approach In this section, we propose an alternating splitting augmented Lagrangian method to solve the optimization problem (2), which can be guaranteed with global convergence. 4 Algorithm 1 The UMA Algorithm Input: matrix M and parameters τ, α, β, δ and κ. Output: Label vector [y1, . . . , ym] where yi = 1 if user Ui is a malicious user; otherwise yi = 0. Initialize: Y 0 = X0 = Λ0 = 0, yi = 0 (i = 1, . . . , m), k = 0 Process: 1: while not converged do 2: Compute Zk+1, Xk+1 and Y k+1 by Eq. (4), (5) and (6), respectively. 3: Update the Lagrange multiplier Λk+1 by Λk −β(Xk+1 + Y k+1 + Zk+1 −¯ M). 4: k = k + 1. 5: end while 6: if max(|Yi,:|) > 0, then yi = 1 (i = 1, . . . , m). The separable structure emerging in the objective function and constrains in Eq. (2) motivates us to derive an efficient algorithm by splitting the optimization problem. However, it is rather difficult to optimize this problem with theoretical guarantee, because this optimization involves three-block variables. It is well-known that the direct extension of the alternating direction method of multipliers may not be convergent for solving Eq. (2), a three-block convex minimization problem [10, 15, 32]. We propose an alternating splitting augmented Lagrangian method to decompose the optimization of Eq. (2) into three sub-optimizations for the solutions of Zk+1, Xk+1 and Y k+1 separately. We will provide global convergence guarantee with a worst-case O(1/t) convergence rate in Section 5. We first get the augmented Lagrangian function of Eq. (2) as LA(X, Y, Z, Λ, β) := ∥X∥∗+ τ∥Y ∥1 −α⟨¯ M, Y ⟩+ κ 2 ∥Y ∥2 F −⟨Λ, L⟩+ β 2 ∥L∥2 F , (3) where L = X + Y + Z −¯ M and β is a positive constant. Given (Xk, Y k, Λk), we update Zk+1 with the closed-form solution Zk+1 ij =  min{1, δ/∥PΩN∥F }Nij if (i, j) ∈Ω, Nij otherwise, (4) where N = 1 β Λk + ¯ M −Xk −Y k. Lemma 2 gives the closed solution of Xk+1 as Xk+1 = D1/β( ¯ M + 1 β Λk −Y k −Zk+1), (5) where the nuclear-norm-involved shrinkage operator D1/β is defined in Lemma 2. Further, we update Y k+1 and Lemma 1 gives the closed solution Y k+1 as Y k+1 = Sτυ(α + β β ¯ M + 1 β Λk −Zk+1 −Xk+1)υβ, (6) where υ = 1/(β + κ) and the shrinkage operator Sτυ is defined in Lemma 1. Finally, we update Λk+1 = Λk −β(Xk+1 + Y k+1 + Zk+1 −¯ M). The pseudocode of the UMA algorithm is given in Algorithm 1. 5 Theoretical Analysis This section presents our main theoretical results, whose detailed proofs and analysis are given in the supplement document due to the page limitation. We begin with two helpful lemmas for the deviation of our proposed algorithm as follows. Lemma 1 [6] For τ > 0 and T ∈Rm×n, the closed solution of minY τ∥Y ∥1 + ∥Y −T∥2 F /2 is matrix Sτ(T) with (Sτ(T))ij = max{|Tij| −τ, 0} · sgn(Tij), where sgn(·) means the sign function. Lemma 2 [8] For µ > 0 and Y ∈Rm×n with rank r, the closed solution of minX µ∥X∥∗+ ∥X − Y ∥2 F /2 is given by Dµ(Y ) = S diag(Sµ(Σ))D⊤, where Y = SΣD⊤denotes the singular value decomposition of Y , and Sµ(Σ) is defined in Lemma 1. 5 We now present theoretical guarantee that UMA can recover the low-rank component X0 and the sparse component Y0. For simplicity, our theoretical analysis focuses on square matrix, and it is easy to generalize our results to the general rectangular matrices. Let X0 = SΣD⊤= Pr i=1 σisid⊤ i be the singular value decomposition of X0 ∈Rn×n, where r is the rank of matrix X0, and σ1, . . . , σr are the positive singular values, and S = [s1, . . . , sr] and D = [d1, . . . , dr] are the left- and right-singular matrices, respectively. For µ > 0, we assume max i ∥S⊤ei∥2 ≤µr/n, max i ∥D⊤ei∥2 ≤µr/n, ∥SD⊤∥2 ∞≤µr/n2. (7) Theorem 1 Suppose that X0 satisfies the incoherence condition given by Eq. (7), and Ωis uniformly distributed among all sets of size ω ≥n2/10. We assume that each entry is corrupted independently with probability q. Let X and Y be the solution of optimization problem given by Eq. (2) with parameter τ = O(1/√n) , κ = O(1/√n) and α = O(1/n). For some constant c > 0 and sufficiently large n, the following holds with probability at least 1 −cn−10, ∥X0 −X∥F ≤δ and ∥Y0 −Y ∥F ≤δ if rank(X0) ≤ρrn/µ/log2n and q ≤qs, where ρr and qs are positive constants. We now prove the global convergence of UMA with a worst-case O(1/t) convergence rate measured by iteration complexity. Let U = (Z; X; Y ) and W = (Z; X; Y ; Λ). We also define θ(U) = ∥X∥∗+ τ∥Y ∥1 −α⟨M, Y ⟩+ κ 2 ∥Y ∥2 F and U k+1 t = 1 t Xt k=1 U k+1. It follows from Corollaries 28.2.2 and 28.3.1 of [29] that the solution set of Eq. (2) is non-empty. Then, let W ∗= ((Z∗)⊤, (X∗)⊤, (Y ∗)⊤, (Λ∗)⊤)⊤be a saddle point of Eq. (2), and define U ∗= ((Z∗)⊤, (X∗)⊤, (Y ∗)⊤)⊤. Theorem 2 For t iterations generated by UMA with β ∈ 0, ( √ 33 −5)κ/2  , 1) We have ∥Xk+1 t + Y k+1 t + Zk+1 t −PΩM∥2 ≤¯c1/t2 for some constant ¯c1 > 0. 2) We have |θ(U k+1 t ) −θ(U ∗)| ≤¯c2/t for some constant ¯c2 > 0. 6 Experiments In this section, we compare our proposed UMA with the state-of-the-art approaches for attack detection. We consider three common evaluating metrics for attack detection as in [13]: Precision = TP TP + FP, Recall = TP TP + FN, F1 = 2 × Precision × Recall Precision + Recall where TP is the number of attack profiles correctly detected as attacks, FP is the number of normal profiles that are misclassified, and FN is the number of attack profiles that are misclassified. 6.1 Datasets We first conduct our experiments on the common-used datasets MovieLens100K and MovieLens1M, released by GroupLens [25]. These datasets are collected from a non-commercial recommender system, and it is more likely that the users in this dataset are non-spam users. We take the users already in the datasets as normal users. The rating scores range from 1 to 5, and we preprocess the data by minus 3 to the range [−2, 2]. Dataset MovieLens100K contains 100000 ratings of 943 users over 1682 movies, and dataset MovieLens1M contains 1000209 ratings of 6040 users over 3706 movies. We describe how to add attack profiles in Section 6.3. We also collect a real dataset Douban10K1 with attack profiles from Douban website, where registered users record rating information over various films, books, clothes, etc. We gather 12095 ratings of 213 users over 155 items. The rating scores range from 1 to 5, and we preprocess the data by minus 3 to the range [−2, 2]. Among the 213 user profiles, 35 profiles are attack profiles. 1http://www.douban.com/. 6 Table 1: Detection precision, recall and F1 on MovieLens100K and MovieLens1M. Here unorganized malicious attacks are based on a combination of traditional strategies. MovieLens100K MovieLens1M Precision Recall F1 Precision Recall F1 UMA 0.934±0.003 0.883±0.019 0.908±0.011 0.739±0.009 0.785±0.023 0.761±0.016 RPCA 0.908±0.010 0.422±0.048 0.575±0.047 0.342±0.003 0.558±0.028 0.424±0.009 N-P 0.774±0.015 0.641±0.046 0.701±0.032 0.711±0.007 0.478±0.018 0.572±0.014 k-means 0.723±0.171 0.224±0.067 0.341±0.092 0.000±0.000 0.000±0.000 0.000±0.000 PCAVarSel 0.774±0.009 0.587±0.024 0.668±0.019 0.278±0.007 0.622±0.022 0.384±0.011 MF-based 0.911±0.009 0.814±0.008 0.860±0.009 0.407±0.005 0.365±0.004 0.385±0.005 Table 2: Detection precision, recall and F1 on MovieLens100K and MovieLens1M. Here unorganized malicious attacks consider the hire of existing users in addition to combination. MovieLens100K MovieLens1M Precision Recall F1 Precision Recall F1 UMA 0.929±0.013 0.865±0.032 0.896±0.022 0.857±0.005 0.733±0.003 0.790±0.002 RPCA 0.797±0.046 0.659±0.097 0.721±0.097 0.635±0.012 0.391±0.022 0.484±0.015 N-P 0.244±0.124 0.145±0.089 0.172±0.084 0.273±0.020 0.099±0.031 0.144±0.035 k-means 0.767±0.029 0.234±0.042 0.357±0.051 0.396±0.026 0.300±0.039 0.341±0.035 PCAVarSel 0.481±0.027 0.168±0.017 0.248±0.023 0.120±0.006 0.225±0.012 0.157±0.008 MF-based 0.556±0.023 0.496±0.021 0.524±0.022 0.294±0.012 0.264±0.010 0.278±0.011 6.2 Comparison Methods and Implementation Details We compare UMA with the state-of-the-art approaches for attack detection and robust PCA: • N-P: A statistical algorithm based on the Neyman-Pearson statistics [16]. • k-means: A cluster algorithm based on classification attributes [3]. • PCAVarSel: A PCA-based variable selection algorithm [22]. • MF-based: A reputation estimation algorithm based on low-rank matrix factorization [19]. • RPCA: A low-rank matrix recovery method by considering sparse noise [9]. In the experiments, we set τ = 10/√m, α = 10/m and δ = p mn/200. A rating can be viewed as a malicious rating if it deviates from the ground-truth rating by more than 3, since the scale of ratings is from -2 to 2. We set parameter β = τ/3 according to Eq. (6) where the entries of Y will be nullified if they are smaller than the threshold. We set κ = τ under the convergence condition β ∈(0, ( √ 33 −5)κ/2) as in Theorem 2. For the baseline methods, we take the results reported in [26] for comparison. 6.3 Comparison Results In the first experiment, we add attack profiles into the datasets MovieLens100K and MovieLens1M by a combination of several traditional attack strategies. These traditional attack strategies include average attack strategy, random attack strategy and bandwagon attack strategy, discussed in Section 3.2. Specifically, each attacker randomly chooses one strategy to produce the user rating profiles and promotes one item randomly selected from items with average rating lower than 0. In line with the setting of previous attack detection works, we set the filler ratio (percentage of rated items in total items) as 0.01 and the filler items are drawn from the top 10% most popular items. We set the spam ratio (number of attack profiles/number of all user profiles) as 0.2. The experiment is repeated 10 times, and the average performance is reported. Table 1 shows the experimental results on datasets MovieLens100K and MovieLens1M under the attack profiles of a combination of traditional strategies. The second experiment studies a more general case of unorganized malicious attacks. We consider that attackers can hire existing users to attack their targets, in addition to the profile injection attacks as mentioned above. We set spam ratio as 0.2, where 25% of the attack profiles are produced similar to the first experiment, and 75% of the attack profiles are from existing users by randomly changing the rating of one item lower than 0 to +2. In this case, attacks are more difficult to be detected, because the attack profiles are more similar to normal user profiles. The experiment is repeated 10 times and Table 2 demonstrates the comparison results on MovieLens100K and MovieLens1M. 7 Table 3: Detection precision, recall and F1 on dataset Douban10K. Methods UMA RPCA N-P k-means PCAVarSel MF-based Precision 0.800 0.535 0.250 0.321 0.240 0.767 Recall 0.914 0.472 0.200 0.514 0.343 0.657 F1 0.853 0.502 0.222 0.396 0.282 0.708 Table 3 shows the experiments on dataset Douban10K. The experimental results in Table 1, 2 and 3 show that our proposed algorithm UMA achieves the best performance on all the datasets and three measures: Precision, Recall and F1. Traditional attack detection approaches perform ineffectively on unorganized malicious attacks detection, because the success of those methods depends on the properties of shilling attacks, e.g., kmeans method and N-P method work well if the attack profiles are similar in the view of classification attributes or latent categories, and PCAVarSel method achieves good performance only if attack profiles have more common unrated items than normal profiles. In summary, these methods detect attacks by identifying some common characteristics of attack profiles, while these do not hold in unorganized malicious attacks. The RPCA and MF-based methods try to find the ground-truth rating matrix from the observed rating matrix, whereas they hardly separate the sparse attack matrix from the noisy matrix and tend to suffer from low precision, especially on large-scale and heavily sparse dataset MovieLens1M. We compare UMA with other approaches by varying the spam ratio from 2% to 20% since different systems may contain different spam ratios (# attack profiles/# all user profiles). As can be shown in Figure 2, UMA is robust and achieves the best performance in different spam ratios, whereas the comparison methods (except the RPCA method) achieve worse performance for small spam ratio, e.g., the N-P approach detects almost nothing. Although the RPCA method is as stable as UMA in different spam ratios, there is a performance gap between RPCA and UMA which becomes bigger when the dataset gets larger and sparser from MovieLens100K to MovieLens1M. Figure 2: Detection precision and recall on MovieLens100K under unorganized malicious attacks. The spam ratio (# attack profiles/# all user profiles) varies from 0.02 to 0.2. 7 Conclusion Attack detection plays an important role to improve the quality of recommendation. Most previous methods focus on shilling attacks, and the key idea for detecting such attacks is to find the common characteristics of attack profiles with the same attack strategy. This paper considers the unorganized malicious attacks, produced by multiple attack strategies to attack different targets. We formulate unorganized malicious attacks detection as a variant of matrix completion problem, and we propose the UMA algorithm and prove its recovery guarantee and global convergence. Experiments show that UMA achieves significantly better performance than the state-of-the-art methods for attack detection. Acknowledgments This research was supported by the National Key R&D Program of China (2018YFB1004300), NSFC (61333014, 61503179), JiangsuSF (BK20150586), and Collaborative Innovation Center of Novel Software Technology and Industrialization, and Fundamental Research Funds for the Central Universities. 8 References [1] C. Aggarwal. Recommender Systems. Springer, 2016. [2] R. Bhaumik, C. Williams, B. Mobasher, and R. Burke. Securing collaborative filtering against malicious attacks through anomaly detection. In Proceedings of the 4th Workshop on Intelligent Techniques for Web Personalization, 2006. [3] R. Bhaumik, B. Mobasher, and R. D. Burke. A clustering approach to unsupervised attack detection in collaborative recommender systems. In Proceedings of the 7th International Conference on Data Mining, pages 181–187, 2011. [4] T. Bouwmans, A. Sobral, S. Javed, S. K. Jung, and E.-H. Zahzah. Decomposition into lowrank plus additive matrices for background/foreground separation: A review for a comparative evaluation with a large-scale dataset. Computer Science Review, 23:1–71, 2017. [5] G. Bresler, G. Chen, and D. Shah. A latent source model for online collaborative filtering. In Proceedings of the 28th Advances in Neural Information Processing Systems, pages 3347–3355, 2014. [6] A. M. Bruckstein, D. L. Donoho, and M. Elad. From sparse solutions of systems of equations to sparse modeling of signals and images. SIAM Review, 51(1):34–81, 2009. [7] K. Bryan, M. O’Mahony, and P. Cunningham. Unsupervised retrieval of attack profiles in collaborative recommender systems. In Proceedings of the 2nd ACM Conference on Recommender Systems, pages 155–162, 2008. [8] J.-F. Cai, E. J. Candès, and Z.-W. Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2010. [9] E. J. Candès, X. D. Li, Y. Ma, and J. Wright. Robust principal component analysis? Journal of the ACM, 58(3):1–37, 2011. [10] C.-H. Chen, B.-S. He, Y.-Y. Ye, and X.-M. Yuan. The direct extension of ADMM for multiblock convex minimization problems is not necessarily convergent. Mathematical Programming, 155(1-2):57–79, 2016. [11] J.-S. Feng, H. Xu, and S.-C. Yan. Online robust PCA via stochastic optimization. In Proceedings of the 27th Advances in Neural Information Processing Systems, pages 404–412, 2013. [12] D. Goldberg, D. Nichols, B. M. Oki, and D. Terry. Using collaborative filtering to weave an information tapestry. Communications of the ACM, 35(12):61–70, 1992. [13] I. Gunes, C. Kaleli, A. Bilge, and H. Polat. Shilling attacks against recommender systems: a comprehensive survey. Artificial Intelligence Review, 42(4):767–799, 2014. [14] F.-M. He, X.-R. Wang, and B.-X. Liu. Attack detection by rough set theory in recommendation system. In Proceedings of the 6th International Conference on Granular Computing, pages 692–695, 2010. [15] B.-S. He, M. Tao, and X.-M. Yuan. A splitting method for separable convex programming. IMA Journal of Numerical Analysis, 35(1):394–426, 2015. [16] N. J. Hurley, Z. P. Cheng, and M. Zhang. Statistical attack detection. In Proceedings of the 3rd ACM Conference on Recommender Systems, pages 149–156, 2009. [17] C. Li and Z.-G. Luo. Detection of shilling attacks in collaborative filtering recommender systems. In Proceedings of the 2nd International Conference of Soft Computing and Pattern Recognition, pages 190–193, 2011. [18] B. Li, Q. Yang, and X.-Y. Xue. Transfer learning for collaborative filtering via a rating-matrix generative model. In Proceedings of the 26th International Conference on Machine Learning, pages 617–624, 2009. 9 [19] G. Ling, I. King, and M. R. Lyu. A unified framework for reputation estimation in online rating systems. In Proceedings of the 23rd International Joint Conference on Artificial Intelligence, pages 2670–2676, 2013. [20] M. Luca. Reviews, reputation, and revenue: The case of Yelp.com. 2016. [21] L. W. Mackey, M. I. Jordan, and A. Talwalkar. Divide-and-conquer matrix factorization. In Proceedings of the 25th Advances in Neural Information Processing Systems, pages 1134–1142, 2011. [22] B. Mehta and W. Nejdl. Unsupervised strategies for shilling detection and robust collaborative filtering. User Modeling and User-Adapted Interaction, 19(1-2):65–97, 2009. [23] B. Mehta. Unsupervised shilling detection for collaborative filtering. In Proceedings of the 22nd International Conference on Artificial Intelligence, pages 1402–1407, 2007. [24] B. Mobasher, R. Burke, R. Bhaumik, and J. J. Sandvig. Attacks and remedies in collaborative recommendation. Intelligent Systems, 22(3):56–63, 2009. [25] Research Grouplens. http://grouplens.org/datasets/movielens/. [26] M. Pang and Z.-H. Zhou. Unorganized malicious attacks detection (in Chinese). SCIENTIA SINICA Informationis, 48(2):177–186, 2018. [27] Y.-G. Peng, A. Ganesh, J. Wright, W.-L. Xu, and Y. Ma. Rasl: Robust alignment by sparse and low-rank decomposition for linearly correlated images. Pattern Analysis and Machine Intelligence, 34(11):2233–2246, 2012. [28] N. Rao, H.-F. Yu, P. Ravikumar, and I. Dhillon. Collaborative filtering with graph information: Consistency and scalable methods. In Proceedings of the 29th Advances in Neural Information Processing Systems, pages 2098–2106, 2015. [29] R. T. Rockafellar. Convex Analysis. Princeton University Press, 2015. [30] R. Salakhutdinov and A. Mnih. Probabilistic matrix factorization. In Proceedings of the 22nd Advances in Neural Information Processing Systems, pages 1257–1264, 2008. [31] R. Salakhutdinov, A. Mnih, and G. Hinton. Restricted boltzmann machines for collaborative filtering. In Proceedings of the 24th International Conference on Machine Learning, pages 791–798, 2007. [32] M. Tao and X.-M. Yuan. Recovering low-rank and sparse components of matrices from incomplete and noisy observations. SIAM Journal on Optimization, 21(1):57–81, 2011. [33] X.-Y. Yi, D. Park, Y.-D. Chen, and C. Caramanis. Fast algorithms for robust PCA via gradient descent. In Proceedings of the 30th Advances in neural information processing systems, pages 4152–4160, 2016. 10
2018
220
7,387
Differentially Private k-Means with Constant Multiplicative Error Haim Kaplan Tel Aviv University and Google haimk@post.tau.ac.il Uri Stemmer∗ Ben-Gurion University u@uri.co.il Abstract We design new differentially private algorithms for the Euclidean k-means problem, both in the centralized model and in the local model of differential privacy. In both models, our algorithms achieve significantly improved error guarantees than the previous state-of-the-art. In addition, in the local model, our algorithm significantly reduces the number of interaction rounds. Although the problem has been widely studied in the context of differential privacy, all of the existing constructions achieve only super constant approximation factors. We present—for the first time—efficient private algorithms for the problem with constant multiplicative error. Furthermore, we show how to modify our algorithms so they compute private coresets for k-means clustering in both models. 1 Introduction Clustering, and in particular center based clustering, are central problems in unsupervised learning. Several cost objectives have been intensively studied for center based clustering, such as minimizing the sum or the maximum of the distances of the input points to the centers. Most often the data is embedded in Euclidean space and the distances that we work with are Euclidean distances. In particular, probably the most studied center based clustering problem is the Euclidean k-means problem. In this problem we are given a set of n input points in Rd and our goal is to find k centers that minimize the sum of squared distances between each input point to its nearest center.2 When privacy is not a concern one usually solves this problem by running Lloyd’s algorithm [25] initialized by k-means++ [4]. This produces k-centers of cost that is no worse than O(log k) times the cost of the optimal centers and typically much lower in practice. The huge applicability of k-means clustering, together with the increasing awareness and demand for user privacy, motivated the study of privacy preserving k-means algorithms. It is especially desirable to achieve differential privacy [12], a privacy notion which has been widely adopted by the academic community as well as big corporations like Google, Apple, and Microsoft. Indeed, constructions of differentially private k-means algorithms have received a lot of attention over the last 14 years [8, 28, 14, 18, 27, 33, 31, 32, 17, 6, 29, 21]. In this work we design new differentially private k-means algorithms, both for the centralized model (where a trusted curator collects the sensitive information and analyzes it with differential privacy) and for the local model (where each respondent randomizes her answers to the data curator to protect her privacy). In both models, our algorithms offer significant improvements over the previous state-of-the-art. ∗Work done while the second author was a postdoctoral researcher at the Weizmann Institute of Science, supported by a Koshland fellowship, and by the Israel Science Foundation (grants 950/16 and 5219/17). 2The sum of squares is nice to work with since we do not have to compute square roots. Furthermore, for a given cluster its center of mass is the minimizer of the sum of the squared distances. These properties make k-means to be the favorite cost objective for center based clustering. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Reference Multiplicative Error Additive Error Feldman et al. (2009) [14] O( √ d) ˜O (kd)2d Nock et al. (2016) [31] O(log k) O n/ log2 n  Feldman et al. (2017) [17] O(k log n) ˜O √ d · k1.5 Balcan et al. (2017) [6] O(log3 n) ˜O d + k2 Nissim and Stemmer (2018) [29] O(k) ˜O d0.51 · k1.51 This work O(1) ˜ O k1.01 · d0.51 + k1.5 Table 1: Private algorithms for k-means. Here n is the number of input points, k is the number of centers, and d is the dimension. For simplicity, we assume that input points come from the unit ball, and omit the dependency in ε, as well as logarithmic factors in k, n, d, β, δ, from the additive error. Before describing our new results, we define our setting more precisely. Consider an input database S = (x1, . . . , xn) ∈(Rd)n containing n points in Rd, where every point xi ∈S is the (sensitive) information of one individual. The goal is to identify a set of k centers C = {c1, . . . , ck} in Rd approximately minimizing the following quantity, referred to as the cost of the centers costS(C) = n X i=1 min j∈[k] ∥xi −cj∥2 2. The privacy requirement is that the output of our algorithm (the set of centers) does not reveal information that is specific to any single individual. Formally, Definition 1.1 ([12]). A randomized algorithm A : Xn →Y is (ε, δ) differentially private if for every two databases S, S′ ∈Xn that differ in one point, and every set T ⊆Y , we have Pr[A(S) ∈T] ≤eε · Pr[A(S′) ∈T] + δ. Combining the utility and privacy requirements, we are seeking for a computationally efficient differentially private algorithm that identifies a set of k centers C such that w.h.p. costS(C) ≤ γ · OPTS +η, where OPTS is the optimal cost. We want γ and η to be as small as possible, as a function of the number of input points n, the dimension d, the number of centers k, the failure probability β, and the privacy parameters ε, δ. We remark that a direct consequence of the definition of differential privacy is that, unlike in the non-private literature, every private algorithm for this problem must have additive error η > 0. In fact, if all points reside with the d-dimensional ball, B(0, Λ), of radius Λ around the origin (as we assume in this paper) then η must be at least Λ2. To see this, consider k + 1 locations p1, . . . , pk+1 at pairwise distances Λ, and consider the following two neighboring datasets. The first dataset S1 contains n −k + 1 copies of p1, and (one copy of) p2, . . . , pk. The second dataset S2 is obtained from S1 by replacing pk with pk+1. Since in both cases there are only k distinct input points, the optimal cost for each of these datasets is zero. On the other hand, by the constraint of differential privacy, the set of centers we compute essentially cannot be affected by this change. Therefore we must have expected error of Ω(Λ2) on at least one of these inputs. To simplify the presentation we assume that Λ = 1 in rest of the introduction. Traditionally, in the non-private literature, the goal is to minimize the multiplicative error γ, with the current state-of-the-art (non-private) algorithm achieving multiplicative error of γ = 6.357 (with no additive error) [2]. In contrast, in spite of the long line of works on private k-means [8, 28, 14, 18, 27, 33, 31, 32, 17, 6, 29, 21], all of the existing polynomial time private algorithms for the problem obtained only a super constant multiplicative error. We present the first polynomial time differentially private algorithm for the Euclidean k-means problem with constant multiplicative error, while essentially keeping the additive error the same as in previous state-of-the-art results. See Table 1 for a comparison. 1.1 Locally private k-means In the local model of differential privacy (LDP), there are n users and an untrusted server. Each user i is holding a private input item xi (a point in Rd in our case), and the server’s goal is to compute 2 some function of the inputs (approximate the k-means in our case). However, in this model, the users do not send their data as is to the server. Instead, every user randomizes her data locally, and sends a differentially private report to the server, who aggregates all the reports. Informally, the privacy requirement is that the input of user i has almost no effect on the distribution of the messages that user i sends to the server. This is the model used by Apple, Google, and Microsoft in practice to ensure that private data never reaches their servers in the clear. With increasing demand from the industry, the local model of differential privacy is now becoming more and more popular. Nevertheless, the only currently available k-means algorithm in this model (with provable utility guarantees) is that of Nissim and Stemmer [29], with O(k) multiplicative error. We present a new LDP algorithm for the k-means achieving constant multiplicative error. In addition, the protocol of [29] requires O(k log n) rounds of interactions between the server and the users, whereas our protocol uses only O(1) such rounds. 1.2 Classical algorithms are far from being private We highlight some of the challenges that arise when trying to construct private variants for existing (non-private) algorithms. Recall for example the classical (non-private) Lloyd’s algorithm, where in every iteration the input points are grouped by their proximity to the current centers, and the points in every group are averaged to obtain the centers for the next round. One barrier for constructing a private analogue of this algorithm is that, with differential privacy, the privacy parameters deteriorate with number of (private) computations that we apply to the dataset. So, even if we were able to construct a private analogue for every single iteration, our approximation guarantees would not necessarily improve with every iteration. In more details, composition theorems for differential privacy [13] allow for applying O(n2) private computations before exhausting the privacy budget completely. Lloyd’s algorithm, however, might perform a much larger number of iterations (exponential in n in worst case). Even the bounds on its smoothed complexity are much larger than n2 (currently ≈n32 is known [3]). In addition, classical techniques for reducing the number of iterations often involve computations which are highly sensitive to a change of a small number of input points. For example, recall that in k-means++ [4] the initial k centers (with which Lloyd’s algorithm is typically initiated) are chosen from the data points themselves, an operation which cannot be applied as is when the data points are private. These challenges are reflected in the recent work of Nock et al. [31], who constructed a private variant for the k-means++ algorithm. While their private algorithm achieves a relatively low multiplicative error of O(log k), their additive error is ˜O(n). In this work we are aiming for additive error at most polylogarithmic in n. Note that having additive error of n is meaningless, since if points come from the unit ball then every choice of k centers have error at most O(n). 1.3 On the evolution of private k-means algorithms The starting point of our work is the observation that by combining ideas from three previous works [18, 6, 29] we can obtain a differentially private k-means algorithm (in the centralized model) with constant multiplicative error, but with a relatively large additive error which is polynomial in n (as we will see in Section 1.4). Most of our technical efforts (in the centralized model) are devoted to reducing the additive error while keeping the multiplicative error constant. We now describe the results of [18, 6, 29]. Gupta et al. [18] constructed a private variant for the classical local search heuristic [5, 24] for k-medians and k-means. In this local search heuristic, we start with an arbitrary choice of k centers, and then proceed in iterations, where in every iteration we replace one of our current centers with a new one, so as to reduce the k-means cost. Gupta et al. [18] constructed a private variant of the local search heuristic by using the (generally inefficient) exponential mechanism of McSherry and Talwar [26] in order to privately choose a replacement center in every step. While the algorithm of Gupta et al. [18] obtains superb approximation guarantees3, its runtime is exponential in the representation length of domain elements. Specifically, it is designed for a discrete version of the problem, in which centers come from a finite set Y , and the runtime of their algorithm is at least linear in |Y |. In particular, when applying their algorithm to the Euclidean space, one must first discretize the space of possible centers, and account for the error introduced by this discretization. For example, 3The algorithm of [18] obtains O(1) multiplicative error and ˜O(k2d) additive error. 3 Gupta et al. mentions that one can take Y to be a discretization net of the unit d-dimensional ball. However, to ensure small discretization error, such a net would need to be of size |Y | ≈nd, and hence, would result in an inefficient algorithm (since the runtime is linear in |Y |). Balcan et al. [6] suggested the following strategy in order to adopt the techniques of Gupta et al. [18] to the Euclidean space while maintaining efficiency. Instead of having a fixed (data independent) discretization of the unit ball, Balcan et al. suggested to first identify (in a differentially private manner) a small set Y ⊆Rd of candidate centers such that Y contains a subset of k candidate centers with low k-means cost. Then, apply the techniques of Gupta et al. in order to choose k centers from Y . If |Y | = poly(n), then the resulting algorithm would be efficient. As the algorithm of Gupta et al. has very good approximation guarantees, the bottleneck for the approximation error in the algorithm of Balcan et al. is in the construction of Y . Namely, the overall error is dominated by the error of the best choice of k centers out of Y (compared to the cost of the best choice of k centers from Rd). At first glance, this might seem easy to achieve, since for non-private k-means, one can simply take the input points themselves as the set of candidate centers (this is of size n and has an error of at most 2 compared to centers from Rd). However, for private k-means clustering, this is not possible – the centers cannot be a subset of the input points, because otherwise, removing a point may significantly change the computed centers. Balcan et al. then constructed a differentially private algorithm for identifying a set of candidate centers Y based on the Johnson–Lindenstrauss transform [23]. However, their construction gives a set of candidate centers such that the best choice of k centers from these candidates is only guaranteed to have a multiplicative error of O(log3 n), leading to a private k-means algorithm with O(log3 n) multiplicative error. A different approach to obtain a good k-means clustering privately is via algorithms for the 1-cluster problem, where given a set of n input points in Rd and a parameter t ≤n, the goal is to identify a ball of the smallest radius that encloses at least t of the input points. It was shown by Feldman et al. [17] that the Euclidean k-means problem can be reduced to the 1-cluster problem, by iterating the 1-cluster algorithm multiple times to find several balls that cover most of the data points. Feldman et al. then applied their reduction to the private 1-cluster algorithm of [30], and obtained a private k-means algorithm with multiplicative error O(k log n). Following that work, Nissim and Stemmer [29] presented an improved algorithm for the 1-cluster problem which, when combined with the reduction of Feldman et al., gives a private k-means algorithm with multiplicative error O(k). 1.4 Our techniques Let S ∈(Rd)n be an input database and let u∗ 1, . . . , u∗ k ∈Rd denote an optimal set of centers for S. We use S∗ j ⊆S to denote the cluster induced by u∗ j, i.e., S∗ j = {x ∈S : j = argminℓ∥x −u∗ ℓ∥}. We observe that the techniques that Nissim and Stemmer [29] applied to the 1-cluster problem can be extended to privately identify a set of candidate centers Y that “captures” every “big enough” cluster j. Informally, let j be such that |S∗ j | ≥na (for some constant a > 0). We will construct a set of candidate centers Y such that there is a candidate center yj ∈Y that is “close enough” to the optimal center u∗ j, in the sense that the cost of yj w.r.t. S∗ j is at most a constant times bigger than the cost of u∗ j. That is, costS∗ j ({yj}) = O  costS∗ j ({u∗ j})  . By simply ignoring clusters of smaller sizes, this means that Y contains a subset D of k candidate centers such that costS(D) ≤O(1)·OPTS +k·na. There are two reasons for the poly(n) additive error incurred here. First, this technique effectively ignores every cluster of size less than na, and we pay na additive error for every such cluster. Second, this technique only succeeds with polynomially small probability, and boosting the confidence using repetitions causes the privacy parameters to degrade. We show that it is possible to boost the success probability of the above strategy without degrading the privacy parameters. To that end, we apply the repetitions to disjoint samples of the input points, and show that the sampling process will not incur a poly(n) error. In order to “capture” smaller clusters, we apply the above strategy repeatedly, where in every iteration we exclude from the computation the closest input points to the set of centers that we have already identified. We show that this technique allows to “capture” much smaller clusters. By combining this with the techniques of Balcan et al. and Gupta et al. for privately choosing k centers out of Y , we get our new construction for k-means in the centralized model of differential privacy (see Table 1). 4 A construction for the local model. Recall that the algorithm of Gupta et al. (the private variant of the local search) applies the exponential mechanism of McSherry and Talwar [26] in order to privately choose a replacement center in every step. This use of the exponential mechanism is tailored to the centralized model, and it is not clear if the algorithm of Gupta et al. can be implemented in the local model. In addition, since the local search algorithm is iterative with a relatively large number of iterations (roughly k log n iterations), a local implementation of it, if exists, may have a large number of rounds of interactions between the users and the untrusted server. To overcome these challenges, in our locally private algorithm for k-means we first identify a set of candidate centers Y (in a similar way to the centralized construction). Afterwards, we estimate the weight of every candidate center, where the weight of a candidate center y is the number of input points x ∈S s.t. y is the nearest candidate center to x. We show that the weighted set of candidate centers can be post-processed to obtain an approximation to the k-means of the input points. In order to estimate the weights we define a natural extension of the well-studied heavy-hitters problem under LDP, which reduces our incurred error. Private coresets. A coreset [1] of set of input points S is a small (weighted) set of points P that captures some geometric properties of S. Coresets can be used to speed up computations, since if the coreset P is much smaller than S, then optimization problems can be solved much faster by running algorithms on P instead of S. In the context of k-means, the geometric property that we want P to preserve is the k-means cost of every possible set of centers. That is, for every set of k centers D ⊆Rd we want that costP (D) ≈costS(D) (where in costP (D) we multiply each distance by the weight of the corresponding point). Coresets for k-means and k-medians have been the subject of many recent papers, such as [10, 16, 19, 20, 7, 11, 15]. Private coresets for k-means and k-medians have been considered in [14] and in [17]. We show that our techniques result in new constructions for private coresets for k-means and k-medians, both for the centralized and for the local model of differential privacy. In the local model, this results in the first private coreset scheme with provable utility guarantees. In the centralized model, our new construction achieves significantly improved error rates over the previous state-of-the-art. We omit our results for private coresets due to space restrictions. See the full version of this work for more details. 2 Preliminaries from [18, 6] As we described in the introduction, we use a private variant of the local search algorithm by Gupta et al. and Balcan et al. We now state its guarantees. Let Y ⊆Rd be our precomputed set of candidate centers. Given a set of points S ∈(Rd)n consider the task of identifying a subset C ⊆Y of size k with the lowest possible cost. That is, instead of searching for k centers in Rd, we are searching for k centers in Y , and our runtime is allowed to depend polynomially on |Y |. We write OPTS(Y ) to denote the lowest possible cost of k centers from Y . That is, OPTS(Y ) = minC⊆Y, |C|=k{costS(C)}. Recall that we denote the lowest cost of k centers out of Rd as OPTS, i.e., OPTS = OPTS(Rd). Theorem 2.1 ([18, 6]). Let β, ε, δ > 0 and k ∈N, and let Y ⊆Rd be a finite set of centers. There exists an (ε, δ)-differentially private algorithm that takes a database S containing n points from the d-dimensional ball B(0, Λ), and outputs a subset D ⊆Y of size |D| = k s.t. with probability at least (1 −β) we have that costS(D) ≤O(1) · OPTS(Y ) + O k1.5Λ2 ε log n|Y | β  s log(n) · log 1 δ ! . In light of Theorem 2.1, in order to privately identify an approximation to the k-means of the input set S, it suffices to privately identify a set of candidate centers Y ⊆Rd such that |Y | = poly(n), and in addition, Y contains a subset with low k-means cost (that is OPTS(Y ) is comparable to OPTS). We remark that Y must be computed using a differentially private algorithm, and that in particular, taking Y = S will not lead to a differentially private algorithm (even though Y = S is an excellent set of candidate centers in terms of utility). To see this, let us denote the algorithm from Theorem 2.1 as A. Its inputs are the database S and the set of candidate centers Y , and the differential privacy guarantee is only with respect to the database S. In other words, for every fixed set Y , the algorithm 5 AY (S) = A(S, Y ) is differentially private as a function of S. Known composition theorems for differential privacy [13] show that for every differentially private algorithm B that takes a database S and outputs a set of centers Y , we have that the composition A(S, B(S)) satisfies differential privacy. On the other hand, there is no guarantee that A(S, S) is differentially private, and in general it is not. 3 Private k-means – the centralized setting In this section we present some of the components of our algorithm for approximating the k-means in the centralized model of differential privacy. All of the missing details appear in the full version of this work, as well as our algorithm for the local model, and our construction of a private coreset. Consider an input database S, and let u∗ 1, . . . , u∗ k ∈Rd denote an optimal set of k centers for S. Our starting point is the observation that, extending the techniques of Nissim and Stemmer [29], we can identify a set of candidate centers that contains a “close enough” candidate center to every optimal center u∗ j, provided that the optimal cluster induced by u∗ j is “big enough”. We call this algorithm Private-Centers and the following lemma specifies its properties precisely. Lemma 3.1 (Algorithm Private-Centers). There exists an (ε, δ)-differentially private algorithm such that the following holds. Assume we apply the algorithm to a database S containing n points in the d-dimensional ball B(0, Λ), with parameters β, ε, δ. Let P ⊆S be a fixed subset (unknown to the algorithm) s.t. for a global constant Γ we have |P| ≥Γ ε · √ d · n0.1 · ln  1 β  s ln 1 δ  . The algorithm outputs a set of at most εn centers, s.t. with probability at least 1 −β a ball of radius O(diam(P) + Λ n) around one of these centers contains all of P. The idea behind Algorithm Private-Centers is to use locality sensitive hashing [22] in order to isolate clustered points, and then to average clustered points with differential privacy. Algorithm Private-Centers captures all large clusters whereas the algorithm of [29] only captures one large cluster. We omit the proof of Lemma 3.1 due to space restrictions. In the next section we use this lemma iteratively in order to capture much smaller clusters. 3.1 Capturing smaller and smaller clusters We are now ready to present the main component of our construction for the centralized model – Algorithm Private-k-Means. The algorithm privately identifies set of polynomially many candidate centers that contains a subset of k candidate centers with low k-means cost. For readability, we have added inline comments throughout the description of Private-k-Means, which will be helpful for the analysis. These comments are not part of the algorithm. Recall that u∗ 1, . . . , u∗ k denote an optimal set of centers w.r.t. the set of input points S, and let S∗ 1, . . . , S∗ k ⊆S denote the clusters induced by these optimal centers. (These optimal centers and clusters are unknown to the algorithm; they are only used in the inline comments and in the analysis.) Throughout the execution, we use the inline comments in order to prescribe a feasible (but not necessarily optimal) assignment of the data points to (a subset of k of) the current candidate centers. Specifically, we maintain an array ASSIGN, where we write ASSIGN[j] = u (for some center u in our current set of candidate centers) to denote that all of the points in the optimal cluster S∗ j are assigned to the candidate center u. We write ASSIGN[j] = ⊥to denote that points in S∗ j have not been assigned to a center yet. For every j we have that ASSIGN[j] = ⊥at the beginning of the execution, and that ASSIGN[j] is changed exactly once during the execution, at which point the jth cluster is assigned to a center. In the analysis we argue that at the end of the execution the resulting assignment has low k-means cost. Notation. For a point x ∈S, we write ASSIGN(x) to denote the candidate center to which x is assigned at a given moment of the execution. That is, ASSIGN(x) = ASSIGN[j], where j is s.t. x ∈S∗ j . Consider the execution of the Algorithm Private-k-Means. For readability, we have summarized some of the notations that are specified in the algorithm in Table 2. We first show that the number of unassigned points reduces quickly in every iteration. 6 Algorithm Private-k-Means Input: Database S containing n points in the d-dimensional ball B(0, Λ), failure probability β, privacy parameters ε, δ. % Let u∗ 1, . . . , u∗ k denote an optimal set of centers for S, and let S∗ j be the cluster induced by u∗ j, i.e., S∗ j = {x ∈S : j = argminℓ∥x −u∗ ℓ∥}. For j ∈[k] let r∗ j = q 2 |S∗ j | P x∈S∗ j ∥x −u∗ j∥2, and let P ∗ j = B(u∗ j, r∗ j ) ∩S∗ j . 1. Initiate C = ∅, and denote S1 = S and n1 = n. % Initiate ASSIGN[j] = ⊥for every j ∈[k]. 2. For i = 1 to log log n do (a) Run algorithm Private-Centers on the database Si with parameters ε log log n, δ log log n, β k , and add the returned set of centers to C. % For every j ∈[k]: if ASSIGN[j] = ⊥and if ∃uj ∈C s.t. ∥uj −u∗ j∥≤O(r∗ j + Λ n ), then set ASSIGN[j] = uj. (b) Let Si+1 ⊆Si be a subset of Si containing ni+1 = 2(T + 1)wk · n0.1 i points with the largest distance to the centers in C, where w = w(n, d, k, β, ε, δ) and T = T(n) will be specified in the analysis. % For every j ∈[k]: if ASSIGN[j] = ⊥and if P ∗ j ̸⊆Si+1, then let pj ∈P ∗ j \ Si+1, let uj = argminu∈C∥pj −u∥, and set ASSIGN[j] = uj. 3. Output C. % For every j ∈[k]: if ASSIGN[j] = ⊥, then arbitrarily choose uj ∈C and set ASSIGN[j] = uj. S The input database. u∗ 1, . . . , u∗ k ∈Rd An optimal set of centers for S. S∗ 1, . . . , S∗ k ⊆S The clusters induced by u∗ 1, . . . , u∗ k. r∗ 1, . . . , r∗ k ∈R≥0 r∗ j = q 2 |S∗ j | P x∈S∗ j ∥x −u∗ j∥2. P ∗ 1 , . . . , P ∗ k P ∗ j = B(u∗ j, r∗ j ) ∩S∗ j . Si ⊆S, i ∈[log log n] The set of remaining input points during the ith iteration. ni = |Si|, i ∈[log log n] The number of remaining input points during the ith iteration. C The current set of candidate centers. ASSIGN[j], j ∈[k] The assignment constructed in the inline comments. Table 2: Notations for the analysis of algorithm Private-k-Means Claim 3.2. Denote w = Γ· √ d ε · log log(n) · log  k β  r log  log log n δ  , where Γ is the constant from Lemma 3.1. With probability at least 1−β, for every i ∈[log log n], before Step 2b of the ith iteration there are at most 2kw · n0.1 i unassigned points in S, i.e., |{x ∈S : ASSIGN(x) = ⊥}| ≤2kw · n0.1 i . The intuition behind Claim 3.2 is as follows. Let S∗ j ⊆S be an optimal cluster, and let P ∗ j ⊆S∗ j be defined as in the first comment in the algorithm (we can think of P ∗ j as the subset of the |S∗ j |/2 points in S∗ j with smallest distances to u∗ j). If during some iteration i we have that all of P ∗ j is contained in our current set of input points, Si, and if |P ∗ j | ≥w · n0.1 i , then a center for S∗ j is discovered in the ith iteration by the properties of Private-Centers. Moreover, by construction, if even a single point from P ∗ j is missing, then S∗ j must have already been assigned to a center before the ith iteration. See the full version of this work for more details. Notation. For i ∈[log log n] we denote by Ai ⊆S and Bi ⊆S the subset of input points whose cluster is assigned to a center during the ith iteration in the comments after Step 2a and after Step 2b, respectively. Observe that A1, B1, . . . , Alog log n, Blog log n are mutually disjoint. Let r∗ 1, . . . , r∗ k be the radii of the centers u∗ 1, . . . , u∗ k as defined in the first comment in algorithm Private-k-Means. For a point x ∈Rd, let u∗(x) denote x’s nearest optimal center, and r∗(x) its corresponding radius. The next observation is immediate from the construction. 7 Observation 3.3. For every i ∈[log log n] and for every x ∈Ai, at the end of the execution we have ∥x −ASSIGN(x)∥2 ≤O  ∥x −u∗(x)∥2 + (r∗(x))2 + Λ2 n2  . We charge the cost of points x ∈Bi to points that were already assigned to centers in some iteration j ≤i in the sense specified by the following lemma. Lemma 3.4. With probability at least 1 −β, for every iteration i ∈[log log n] and for every x ∈Bi there exists a set of input points Q(x) ⊆S such that 1. For every i ∈[log log n] and for every x ∈Bi it holds that |Q(x)| = T, where T = O(log log n). 2. For every i ∈[log log n] and for every x, y ∈Bi, if x ̸= y then Q(x) ∩Q(y) = ∅. 3. For every i ∈[log log n] and for every x ∈Bi, at the end of the execution it holds that ∥x −ASSIGN(x)∥2 ≤O  ∥x −u∗(x)∥2 + (r∗(x))2 + 1 T X q∈Q(x) ∥q −ASSIGN(q)∥2  . Intuitively, Lemma 3.4 follows from the fact in every iteration i, for every unassigned point in S there are at least T assigned points in Si. We omit the proof due to space restrictions. Lemma 3.5. If Algorithm Private-k-Means is applied to a database S containing n points in the d-dimensional ball B(0, Λ), then it outputs a set C of at most εn log( k β ) centers, s.t. with probability at least 1 −β OPTS(C) = min D⊆C |D|=k {costS(D)} ≤O(1) · OPTS +O (Twk)1.12 · Λ2, where w is defined in Claim 3.2, and T = Θ(log log n). The exponent 1.12 is arbitrary and can be reduced to any constant a > 1. Proof. We show that the stated bound holds for the assignment described in the inline comments throughout the algorithm (the array ASSIGN) at the end of the execution. First observe that by Claim 3.2 and by the fact that there are log log n iterations, at the end of the execution there could be at most O (2(T + 1)wk)1.12 unassigned input points. Let us denote the set of unassigned points as H. The distance from each unassigned point to an arbitrary center is trivially at most Λ. For every assigned point x, by Observation 3.3 and by Lemma 3.4, either ∥x −ASSIGN(x)∥2 = O(∥x −u∗(x)∥2 + (r∗(x))2 + Λ2 n2 ), or ∥x −ASSIGN(x)∥2 ≤O  ∥x −u∗(x)∥2 + (r∗(x))2 + 1 T X q∈Q(x) ∥q −ASSIGN(q)∥2  . Hence, costS ({ASSIGN[j] : j ∈[k]}) = X x∈S ∥x −ASSIGN(x)∥2 = X x∈H ∥x −ASSIGN(x)∥2 + X i∈[log log n] x∈Ai ∥x −ASSIGN(x)∥2 + X i∈[log log n] x∈Bi ∥x −ASSIGN(x)∥2 8 ≤O (2(T + 1)wk)1.12 · Λ2 + X i∈[log log n] x∈Ai O  ∥x −u∗(x)∥2 + (r∗(x))2 + Λ2 n2  + X i∈[log log n] x∈Bi O  ∥x −u∗(x)∥2 + (r∗(x))2 + 1 T X q∈Q(x) ∥q −ASSIGN(q)∥2   ≤O (2(T + 1)wk)1.12 · Λ2 + X x∈S O ∥x −u∗(x)∥2 + (r∗(x))2 + 1 T X i∈[log log n] x∈Bi q∈Q(x) O ∥q −ASSIGN(q)∥2 ≤O (2(T + 1)wk)1.12 · Λ2 + O(1) · OPTS + 1 T X i∈[log log n] x∈Bi q∈Q(x) O ∥q −ASSIGN(q)∥2 (1) Now recall that for every i ∈[log log n] and for every x ̸= y ∈Bi it holds that Q(x) ∩Q(y) = ∅. Hence, every point q ∈S contributes at most log log n times to the last summation above. So, (1) ≤O (2(T + 1)wk)1.12 · Λ2 + O(1) · OPTS +log log n T X q∈S O ∥q −ASSIGN(q)∥2 For T = Θ(log log n) (large enough) we get that the last term above is at most half of the left hand side of the inequality, and hence, costS ({ASSIGN[j] : j ∈[k]}) ≤O (2(T + 1)wk)1.12 · Λ2 + O(1) · OPTS Lemma 3.6. Algorithm Private-k-Means is (ε, δ)-differentially private. The privacy analysis of Algorithm Private-k-Means is standard, and is omitted due to space restrictions. Intuitively, in every iteration, Step 2a satisfies differential privacy by the properties of Algorithm Private-Centers, and we use the following technique for arguing about Step 2b: Let X be an ordered data domain and let A be a differentially private algorithm that operates on a multiset of m elements from X. Then for any n ≥m, the algorithm that takes a multiset S of n elements from X and runs A on the smallest (or largest) m elements in S is differentially private. The intuition is that changing at most one element in S can change at most one element of the multiset that we give to A, and this change is “hidden” by the privacy properties of A. See [9] for more details and applications of this technique. Combining Lemmas 3.5 and 3.6 with Theorem 2.1 yields the following theorem. Theorem 3.7. There is an (ε, δ)-differentially private algorithm that, given a database S containing n points in the d-dimensional ball B(0, Λ), identifies with probability 1 −β a (γ, η)-approximation for the k-means of S, where γ = O(1) and η = poly  log(n), log( 1 β ), log( 1 δ ), d, 1 ε, k  · Λ2. Acknowledgments. We would like to thank Moni Naor for helpful discussions, and the anonymous reviewers for useful suggestions and corrections. 9 References [1] P. K. Agarwal, S. Har-Peled, and K. R. Varadarajan. Approximating extent measures of points. J. ACM, 51(4):606–635, July 2004. [2] S. Ahmadian, A. Norouzi-Fard, O. Svensson, and J. Ward. Better guarantees for k-means and euclidean k-median by primal-dual algorithms. In 58th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2017, Berkeley, CA, USA, October 15-17, 2017, pages 61–72, 2017. [3] D. Arthur, B. Manthey, and H. Röglin. k-means has polynomial smoothed complexity. In Proceedings of the 2009 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS ’09, pages 405–414, Washington, DC, USA, 2009. IEEE Computer Society. [4] D. Arthur and S. Vassilvitskii. K-means++: The advantages of careful seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’07, pages 1027–1035, Philadelphia, PA, USA, 2007. Society for Industrial and Applied Mathematics. [5] V. Arya, N. Garg, R. Khandekar, A. Meyerson, K. Munagala, and V. Pandit. Local search heuristics for k-median and facility location problems. SIAM J. Comput., 33(3):544–562, 2004. [6] M.-F. Balcan, T. Dick, Y. Liang, W. Mou, and H. Zhang. Differentially private clustering in high-dimensional Euclidean spaces. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 322–331, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. [7] A. Barger and D. Feldman. k-means for streaming and distributed big sparse data. In Proceedings of the 2016 SIAM International Conference on Data Mining, Miami, Florida, USA, May 5-7, 2016, pages 342–350, 2016. [8] A. Blum, C. Dwork, F. McSherry, and K. Nissim. Practical privacy: The SuLQ framework. In C. Li, editor, PODS, pages 128–138. ACM, 2005. [9] M. Bun, K. Nissim, U. Stemmer, and S. P. Vadhan. Differentially private release and learning of threshold functions. In FOCS, pages 634–649, 2015. [10] K. Chen. On k-median clustering in high dimensions. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithm, SODA ’06, pages 1177–1185, Philadelphia, PA, USA, 2006. Society for Industrial and Applied Mathematics. [11] E. Cohen, S. Chechik, and H. Kaplan. Clustering small samples with quality guarantees: Adaptivity with one2all PPS. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, 2018. [12] C. Dwork, F. McSherry, K. Nissim, and A. Smith. Calibrating noise to sensitivity in private data analysis. In TCC, volume 3876 of Lecture Notes in Computer Science, pages 265–284. Springer, 2006. [13] C. Dwork, G. N. Rothblum, and S. P. Vadhan. Boosting and differential privacy. In FOCS, pages 51–60. IEEE Computer Society, 2010. [14] D. Feldman, A. Fiat, H. Kaplan, and K. Nissim. Private coresets. In Proceedings of the 41st Annual ACM Symposium on Theory of Computing, STOC 2009, Bethesda, MD, USA, May 31 June 2, 2009, pages 361–370, 2009. [15] D. Feldman and M. Langberg. A unified framework for approximating and clustering data. In Proceedings of the 43rd ACM Symposium on Theory of Computing, STOC 2011, San Jose, CA, USA, 6-8 June 2011, pages 569–578, 2011. [16] D. Feldman, M. Monemizadeh, and C. Sohler. A ptas for k-means clustering based on weak coresets. In Proceedings of the Twenty-third Annual Symposium on Computational Geometry, SCG ’07, pages 11–18, New York, NY, USA, 2007. ACM. 10 [17] D. Feldman, C. Xiang, R. Zhu, and D. Rus. Coresets for differentially private k-means clustering and applications to privacy in mobile sensor networks. In Proceedings of the 16th ACM/IEEE International Conference on Information Processing in Sensor Networks, IPSN ’17, pages 3–15, New York, NY, USA, 2017. ACM. [18] A. Gupta, K. Ligett, F. McSherry, A. Roth, and K. Talwar. Differentially private combinatorial optimization. In Proceedings of the Twenty-first Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’10, pages 1106–1125, Philadelphia, PA, USA, 2010. Society for Industrial and Applied Mathematics. [19] S. Har-Peled and A. Kushal. Smaller coresets for k-median and k-means clustering. Discrete & Computational Geometry, 37(1):3–19, Jan 2007. [20] S. Har-Peled and S. Mazumdar. On coresets for k-means and k-median clustering. In Proceedings of the Thirty-sixth Annual ACM Symposium on Theory of Computing, STOC ’04, pages 291–300, New York, NY, USA, 2004. ACM. [21] Z. Huang and J. Liu. Optimal differentially private algorithms for k-means clustering. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, Houston, TX, USA, June 10-15, 2018, pages 395–408, 2018. [22] P. Indyk and R. Motwani. Approximate nearest neighbors: Towards removing the curse of dimensionality. In Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing, STOC ’98, pages 604–613, New York, NY, USA, 1998. ACM. [23] W. B. Johnson and J. Lindenstrauss. Extensions of Lipschitz maps into a Hilbert space. 1984. [24] T. Kanungo, D. M. Mount, N. S. Netanyahu, C. D. Piatko, R. Silverman, and A. Y. Wu. A local search approximation algorithm for k-means clustering. Computational Geometry, 28(2):89 – 112, 2004. Special Issue on the 18th Annual Symposium on Computational Geometry SoCG2002. [25] S. P. Lloyd. Least squares quantization in pcm. IEEE Trans. Information Theory, 28:129–136, 1982. [26] F. McSherry and K. Talwar. Mechanism design via differential privacy. In FOCS, pages 94–103. IEEE, Oct 20–23 2007. [27] P. Mohan, A. Thakurta, E. Shi, D. Song, and D. Culler. Gupt: Privacy preserving data analysis made easy. In Proceedings of the 2012 ACM SIGMOD International Conference on Management of Data, SIGMOD ’12, pages 349–360, New York, NY, USA, 2012. ACM. [28] K. Nissim, S. Raskhodnikova, and A. Smith. Smooth sensitivity and sampling in private data analysis. In STOC, pages 75–84. ACM, 2007. [29] K. Nissim and U. Stemmer. Clustering algorithms for the centralized and local models. In F. Janoos, M. Mohri, and K. Sridharan, editors, Proceedings of Algorithmic Learning Theory, volume 83 of Proceedings of Machine Learning Research, pages 619–653. PMLR, 07–09 Apr 2018. [30] K. Nissim, U. Stemmer, and S. P. Vadhan. Locating a small cluster privately. In Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, pages 413–427, 2016. [31] R. Nock, R. Canyasse, R. Boreli, and F. Nielsen. k-variates++: more pluses in the k-means++. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 145–154, 2016. [32] D. Su, J. Cao, N. Li, E. Bertino, and H. Jin. Differentially private k-means clustering. In Proceedings of the Sixth ACM Conference on Data and Application Security and Privacy, CODASPY ’16, pages 26–37, New York, NY, USA, 2016. ACM. [33] Y. Wang, Y.-X. Wang, and A. Singh. Differentially private subspace clustering. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 1, NIPS’15, pages 1000–1008, Cambridge, MA, USA, 2015. MIT Press. 11
2018
221
7,388
Multi-value Rule Sets for Interpretable Classification with Feature-Efficient Representations Tong Wang Tippie School of Business University of Iowa Iowa City, IA 52242 tong-wang@uiowa.edu Abstract We present the Multi-value Rule Set (MRS) for interpretable classification with feature efficient presentations. Compared to rule sets built from single-value rules, MRS adopts a more generalized form of association rules that allows multiple values in a condition. Rules of this form are more concise than classical singlevalue rules in capturing and describing patterns in data. Our formulation also pursues a higher efficiency of feature utilization, which reduces possible cost in data collection and storage. We propose a Bayesian framework for formulating an MRS model and develop an efficient inference method for learning a maximum a posteriori, incorporating theoretically grounded bounds to iteratively reduce the search space and improve the search efficiency. Experiments on synthetic and realworld data demonstrate that MRS models have significantly smaller complexity and fewer features than baseline models while being competitive in predictive accuracy. Human evaluations show that MRS is easier to understand and use compared to other rule-based models. 1 Introduction In many real-world applications of machine learning, human experts desire the interpretability of a model as much as the predictive accuracy. As opposed to “black box” models, interpretable models are easy for humans to understand and extract insights, which is imperative in domains such as healthcare, law enforcement, etc. In some occasions, the need for interpretability even outweighs that for accuracy due to legal or ethnic concerns. Among different forms of interpretable models, we are particularly interested in rule-based models in this paper. This type of models produce decisions based on a set of rules following simple “if-else” logic: if a rule (or a set of rules) is satisfied, the model outputs the corresponding decision. The set of rules can be either ordered [17, 35, 5] or unordered [15, 30, 19, 24], depending on the specific model structure. Prior rule-based models in the literature are from built single-value rules [15, 30, 19]. For example, [State = California] AND [Marital status = married], where a condition (e.g., [state=California]) is a pair of a feature (e.g., state) and a single value (e.g., California). However, while single-value rules can express primitive concepts, they are inadequate in capturing more general trends in the underlying data, especially when working with features with a medium to high cardinality. Rules built from these features tend to have too small support. They are either less likely to be selected in the final output, introducing selection bias in the model [7], or induce a large model if selected, hurting the model interpretability. For example, to capture a set of married or divorced people who live in California, Texas, Arizona, and Oregon, a model needs to include eight rules, each rule being a combination of a state and a marital status, yielding an overly complicated model. As modern machine learning has in part moved on to pursue a better and more concise way of model 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. presentation as well as predictive accuracy, single-value rules do not suffice for some applications, neither do models built from them. To mitigate this problem, rules in a more generalized form have been proposed in the literature that allow multiple values [26, 22], also called internal disjunctions of values in a condition [6]. For example: [state = California or Texas or Arizona or Oregon] AND [marital status = married or divorced]. In this case, we only need one rule instead of eight single-value rules, yielding a more concise presentation while preserving the information. We refer to rules of this form multi-value rules, which will serve as the building blocks of our proposed model in this paper. The prior efforts on multi-value rules have mainly focused on finding individual rules and using heuristics such as interestingness, confidence, etc., instead of building a principled classification model with a global objective function that considers predictive accuracy and model complexity. Another important aspect that has been overlooked by previous rule-based models is the need to control the total number of unique features. The number of different entities humans need to comprehend is directly associated with how easy it is to understand the model, as confirmed by the conclusions of Miller [21] relative to the magical number seven. With fewer features involved, it also becomes easier for domain experts to gain clear insights into the data. In practice, models using fewer features are easier to understand and bring down the overall cost in data collection. To combine the factors considered above, we propose a novel rule-based classifier, Multi-value Rule Set (MRS), which is a set of multi-value rules. An instance is classified as positive if it satisfies at least one of the rules. A MRS has great advantages over models built from single-value rules in (i) a more concise presentation of information and (ii) using a smaller number of features in the model. We develop a Bayesian framework for learning MRS which provides a unified framework to jointly optimize data fitting and model complexity without directly “hard” controlling either. We propose a principled objective combining the interpretability and the predictive accuracy where we devise a prior model that promotes a small set of short rules using a few features. We propose an efficient inference algorithm for learning a maximum a posteriori model. We show with experiments on standard data sets that MRS produces predictive accuracy comparable to or better than prior art with lower complexity and fewer overall features. 2 Related Work There has been a series of research on developing rule-based models for classification [31, 15, 12, 3, 28, 19, 5, 24, 24]. Various structures and formats of models were proposed, from the earlier work on Classification based on Association Rules (CBA) [18] and Repeated Incremental Pruning to Produce Error Reduction (Ripper) [5] to more recent work on rule sets [31, 15, 19] and rule lists [16, 29]. A major development along this line of work is that interpretability has been recognized and emphasized. Therefore controlling model complexity for easier interpretation is becoming an important component in the modeling. However, previously mentioned models rely on single-value rules and are limited in the expressive power, leaving redundancy in the model. In addition, learning in previous methods is mostly a two-step procedure[31, 18, 16], that first uses off-the-shelf data mining algorithms to generate a set of rules and then chooses a set from them to form the final model. This in practice will encounter the bottleneck of mining rules of a large maximum length (millions of rules can be generated from a medium size data set if the maximum length is set to only 3 [31]). Furthermore, few of the previous works consider limiting the number of features. Our model aims to combines rule learning and feature assignment into the same process. Our work is broadly related to generalized association rules that consider disjunctive relationships. Among various works along this line, some consider disjunction in the rule level, using the disjunction connector instead of a conjunction connector as used by classical rule form. For example, a1∨a2∨· · · →Y , where a1 is a rule. Representative works include [10, 9, 8]. This primitive form of rules was extended to consider disjunctions in the condition / literal level [22], yielding multi-value rules of the form (a1 ∨a2 ∨· · · ) ∧(b1 ∨b2 · · · ) →Y . Prior efforts have mainly focused on mining individual multi-value rules [25, 10] using heuristics such as interestingness. Some works built classifiers comprised of multi-value rules [1, 2, 20]. However, they still rely on greedy methods such as greedy induction to build a model, and they do not consider model complexity or restrict the number of features. Here, we optimize a global objective that considers predictive accuracy, model size, and the total number of features. By tuning the parameters in the Bayesian framework, our model can 2 strike a nice balance between the different aspects of the model to suit the domain specific need of users. 3 Multi-value Rule Sets We work with standard classification data set S that consists of N observations {xn, yn}N n=1. Let y represent the set of labels.Each observation has J features, and we denote the jth feature of the nth observation as xnj. Let Vj represent a set of values the jth feature takes. This notation can be adapted to continuous attributes by discretizing the values. 3.1 Multi-value Rules Now we introduce the basic components in Multi-value Rule Set model. Definition 1 An item is a pair of a feature j and a value v, where j ∈{1, 2, · · · , J} and v ∈Vj. Definition 2 A condition is a collection of items with the same feature j, denoted as c = (j, V ), where j ∈{1, 2, · · · , J} and V ⊂Vj. V is a union of values in the items. Definition 3 A multi-vale rule is a conjunction of conditions, denoted as r = {ck}k. Interchangeable values are grouped into a value set in a condition, such as [state = California or Texas or Arizona or Oregon]. Following the definitions, an item is the atom in a multi-value rule. It is also a special case of a condition with a single value, for example, [state = California]. Now we define a classifier built from multi-value rules. By an abuse of notation, we use r(·) to represent a Boolean function that indicates if an observation satisfies rule r: r(·) : X →{0, 1}. Let R denote a Multi-value Rule Set. We define a classifier R(·): R(x) = {1 ∃r ∈R, r(x) = 1 0 otherwise. (1) x is classified as positive if it satisfies at least one rule in R and we say x is covered by r. 3.2 MRS Formulation Our proposed framework considers two aspects of a model: 1) interpretability, characterized by a prior model for MRS, which considers the complexity (number of rules and lengths of rules) and feature assignment. 2) predictive accuracy, represented by the conditional likelihood of data given an MRS model. Both components have tunable parameters to trade off between interpretability and predictive accuracy. Now we formulate the model. Prior for MRS The prior model for MRS jointly determines the number of rules M, lengths of rules {Lm}M m=1 and feature assignment {zm}M m=1, where m is the rule index. We propose a twostep process for constructing a rule set, where the first step determines the size and shape of an MRS model and the second step fills in the empty “boxes” with items. Creating empty “boxes” - complexity assignment: First, we draw the number of rules M from a Poisson distribution, where λM ∼Gamma(αM, βM). Second, we determine the number of items in each rule, denoted as Lm. Lm ∼Poisson(λL), which is a Poisson distribution truncated to only allow positive outcomes. The arrival rate for this Poisson distribution, λL, is governed by a Gamma distribution with parameters αL, βL. Since we favor simpler models for interpretability purposes, we set αL < βL and αM < βM to encourage a small set of short rules. These two steps together determine the size and shape of an MRS model. Therefore, we call parameters αM, βM, αL, βL shape parameters. Hs = {αM, βM, αL, βL, θ}. This step creates empty “boxes” to be filled with items in the following step and assigns overall complexity to the model. Filling “boxes” - feature assignment: A m-th rule is a collection of Lm “boxes”, each containing an item. Let zmk represent the feature assigned to the kth box in the m-th rule, where zmk ∈ {1, ..., J} and zm represent the set of feature assignments in the m-th rule. We sample zm from a multinomial distribution with weights p drawn from a Dirichlet distribution parameterized by 3 hyperparameter θ = {θj}J j=1. Let lmj denote the number of items with attribute j in the m-th rule, i.e., lmj = ∑ k 1(zmk = j) and ∑ j lmj = Lm. It means lmj items share the same feature j and therefore can be merged into a condition. We truncate the multinomial distribution to only allow lmj ≤|Vj|. Remarks: we use Multinomial-Dirichlet distribution for feature assignment for its clustering property of the outcomes. The prior model will tend to re-use features already in the rule. This is consistent with the interpretability goal of our model: we would like to form a MRS model with fewer features so that multiple items can be merged in to one condition. The prior does not consider values in each item since they do not affect the size and the shape of the model and therefore have no effect on the interpretability. In summary, the prior for MRS model follows a distribution below, where C is a function of Hs and Γ(·) is a gamma function. p(R; Hs) ∝Γ(M ∗+ αM)CM Γ(M ∗+ 1) M ∏ m=1 Γ(Lm + αL) Γ(Lm + 1) ∏J j=1 Γ(lmj + θj) (βL + 1)LmΓ(Lm + ∑ j=1 θj). (2) Conditional Likelihood Now we consider the predictive accuracy of a MRS by modeling the conditional likelihood of labels y given features x and a MRS model R. Our prediction on the outcomes are based on the coverage of MRS. According to formula (1), if an observation satisfies R (covered by R), it is predicted to be positive, otherwise, it’s negative. We assume label yn is drawn from a Bernoulli distribution with probabilities ρ+ or ρ−to be consistent with the predicted outcome. Specifically, when R(xn) = 1, i.e., xn satisfies the rule set, yn has probability ρ+ to be positive, and when R(xn) = 0, yn has probability ρ−to be negative. ρ+, ρ−govern the predictive accuracy on the training data. We assume that they are drawn from two Beta distributions with hyperparameters (α+, β+) and (α−, β−), respectively, which control the predictive power of the model. The conditional likelihood is shown below, given parameters Hc = {α+, β+, α−, β−}: p(y|x, R; Hc) ∝B(TP + α+, FP + β+)B(TN + α−, FN + β−), (3) where TP, FP, TN and FN represent the number of true positives, false positives, true negatives and false negatives, respectively. B(·) is a Beta function which comes from integrating out ρ+, ρ−in the conditional likelihood function. We will write p(R; Hs) as p(R) and p(y|x, R; Hc) as p(y|x), ignoring dependence on parameters when necessary. Regarding setting hyperparameters Hs, Hc, there are natural settings for θ (all entries being 1). This means there’s no prior preference for features. For Gamma distributions, we set αM and αL to 1. Then the strength of the prior for constructing a simple MRS depends on βM and βL. Increasing βM and βL decreases the expected number of rules and the expected length of rules, thus penalizing more on larger models. There are four real-valued parameters in the conditional likelihood to set, α+, β+, α−, β−. They jointly control the probability that a prediction of MRS model is correct. Therefore we should always set α+ > β+, α−> β−. The ratios of α+, β+ and α−, β−are associated with the expected predictive accuracy. Setting values of the parameters can be done through cross-validation, another layer of hierarchy with more diffuse hyperparameters, or plain intuition. 3.3 Clustering of Features We use Multinomial-Dirichlet in the prior model to take advantage of the “clustering” effect in feature assignment. Our goal is to formulate a model which favors rules with fewer features. Here we prove this effect. Let R denote a MRS model and lmj represent the number of items in rule m taking feature j. Now we do a small change in R: pick two features j1, j2 in rule m where lmj1 ≥lmj2 and replace an item taking feature j2 with an item taking feature j1, and we denote the new rule set as R′. Every rule in R′ remains the same as R except in the m-th rule. Let l′ mj1, l′ mj2 denote the number of items taking feature j1 and j2 in the new model, and l′ mj1 = lmj1 + 1 and lmj2 = l′ mj2 −1. We claim this flip of feature increases the prior probability of the model, i.e., Theorem 1 If lmj1 + θj1 ≥lmj2 + θj2, then p(R′) ≥p(R). When we choose uniform prior where all θj are equal, the theorem will be reduced to a simpler form, that the model always tends to reuse the most prevalent features. For example, given two rules [state = California or Texas] AND [marital status = married] and [state = California] AND [marital status = married] AND [age ≥45], our model will favor rule sets containing the former, if everything else being equal. (All proofs are in the supplementary material.) 4 4 Inference Method Inference for rule-based models is challenging because it involves a search over exponentially many possible sets of rules: since each rule is a conjunction of conditions, the number of rules increases exponentially with the number of features in a data set, and the solution space (all possible rule sets) is a powerset of the rule space. To obtain a maximum a posteriori (MAP) model within this solution space, Gibbs Sampling takes tens of thousands of iterations or more to converge even searching within a reduced space of only a couple of thousands of pre-mined and pre-selected rules [16, 29]. Here we propose an efficient inference algorithm that adopts the basic search procedure in simulated annealing. Given an objective function p(R|S) over discrete search space of different rule sets and a temperature schedule function over time steps, T [t], a simulated annealing [13] procedure is a discrete time, discrete state Markov Chain where at step t, given the current state R[t], the next state R[t+1] is chosen by first proposing a neighbor and accepting it with probability that gradually decreases with time. In this framework, we also incorporate the following strategies for faster computation. 1) we use theoretical bounds for bounding the sampling chain to reduce computation. 2) instead of randomly proposing a neighboring solution, we aim to improve from the current solution by evaluating neighbors and pick the right one to move on to. 4.1 Theoretical bounds on MAP models We exploit the model formulation to guide us in the search. We start by looking at MRS models with one rule removed. Removing a rule will yield a simpler model but may lower the likelihood. However, we can prove that the loss in likelihood is bounded as a function of the support. For a rule set R and index z, we use R\z to represent a set that contains all rules from R except the zth rule, i.e., R\z = {rm|rm ∈R, m ̸= z}. Define Υ = β−(N+ + α+ + β+ −1) (N−+ α−+ β−)(N+ + α+ −1), where N+, N−are the number of positive and negative examples, respectively. Notate the support of a rule as supp(r) = ∑ n r(xn). Then the following holds: Lemma 1 If α+ > β+, α−> β−, then p(y|x, R) ≥Υsupp(z)p(y|x, R\z). Υ is meaningful if Υ ≤1, otherwise this lemma means adding a rule always increases the conditional likelihood. This condition almost always holds since α+ > β+, α−> β−and we do not set β+ to a significantly large value. In practice it is recommended to set β+, β−to 1. We then introduce some notations that will be used later. Let L∗denote the maximum likelihood of data S, which is achieved when all data are classified correctly (this holds when α+ > β+ and α−> β−), i.e. TP = N+, FP = 0, TN = N−, and FN = 0, giving: L∗:= B(N++α+, β+)B(N−+ α−, β−). Let v[t] denote the best solution found until iteration t, i.e., v[t] = max τ≤t p(R[τ]|S). According to the prior model, containing too many rules penalizes the model due to the large complexity. Therefore, to hold a spot in the model, each rule needs to make enough “contribution” to the objective, i.e., capturing enough of the positive class, to cancel off the decrease in the prior. Therefore, we claim that the support of rule in the MAP model is lower bounded, and the bound becomes tighter as v[t] increases along the iterations. Theorem 2 Take a data set S and a MRS model with parameters H = { αM, βM, αL, βL, α+, β+, α−, β−, {θj}J j=1 } , where H ∈(N+)J+8. Define R∗∈arg maxR p(R|S; H) and M ∗= |R∗|. If αM < βM, αL < βL, α+ > β+, α−> β−and Υ ≤1, we have: ∀r ∈R∗, supp(r) ≥   log M [t]αMΩ M [t]+αM−1 log 1 Υ   , and M [t] = ⌊log L∗+ log p(∅) −v[t] log Ω ⌋ , 5 where Ω= (βM+1)(βL+1)αL+1 ∑J j=1 θj αMβ αL L αL max(θ) . p(∅) is the prior of an empty set. L∗and p(∅) upper bound the conditional likelihood and prior, respectively. The difference between log L∗+ log p(∅) and v[t], the numerator in M [t], represents the room for improvement from the current solution v[t]. The smaller the difference, the smaller the M [t]. When we choose αM = 1, then the bound on support is reduced to supp(r) ≥ ⌈log Ω log 1 Υ ⌉ . We can control the bounds by changing parameters in H to increase or decrease Ω. As Ωincreases, the bound M [t] decreases, which indicates a stronger preference for a simpler model with a smaller number of rules. Simultaneously, the lower bound for support increases, which is equivalent to reducing the search space. To increase Ω, one can increase βM αM , which is the expected number of rules from the prior distribution, or increase βL αL , which is the expected number of items in each rule. We incorporate the bound on the support in the search algorithm to check if a rule qualifies to be included. 4.2 Proposing step Here we detail the proposing step at each iteration in the search algorithm. We simultaneously define the set of neighbors and the process to choose a neighbor to propose. A “next state” is proposed by first selecting an action to alter the current MRS and then choosing from “neighboring” models generated by that action. To improve the search efficiency, we do not perform a random action, but instead, we sample from misclassified examples to choose an action that can improve the current state R[t]. If the misclassified example is positive, it means R[t] fails to “cover” it and therefore needs to increase the coverage by randomly choosing one of the following actions. • Add a value: Choose a rule rm ∈R[t], a condition ck ∈rm and then a candidate value v ∈Vzmk\ν(ck), then ck ←(zmk, ν(ck) ∪v). ν(ck) indicates the value(s) in condition ck. • Remove a condition: Choose a rule rm ∈R[t] and a condition ck ∈rm, then rm = {ck′ ∈ rm|ck′ ̸= ck} • Add a rule: Generate a new rule r′ where supp(r′) satisfies the bound in Theorem 2, R[t+1] ←R[t] ∪r′ where we use ν(·) to access the feature in a condition. On the other hand, if the misclassified example is negative, it means R[t] covers more than it should and therefore needs to reduce the coverage by randomly choosing one of the following actions. • Add a condition: Choose a rule rm ∈R[t] first, choose a feature j′ ∈{1, · · · , J}\zm and then a set of values V ′ ∈Vj′, then update rm ←rm ∪(j′, V ′) • Remove a rule: Choose a rule rm ∈R[t], then R[t+1] = {r ∈R[t]|r ̸= rm} The above actions involve choosing a value, a condition, or a rule to perform the action on. Different choices result in different neighboring candidate models. To select one from them, we evaluate p(·|S) on every model. Then a choice is made between exploration (choosing a random model) and exploitation (choosing the best model). This randomness helps to avoid local minima and helps the Markov Chain to converge to a global optimum. See the supplementary material for the complete algorithm. 5 Experimental Evaluation We perform a detailed experimental evaluation of MRS models on simulated and real-world data sets. The first part of our experiments is designed to study the effect of hyperparameters on interpretability and predictive accuracy. The second part of the experiments compares MRS with classic and stateof-the-art benchmark baselines. 6 5.1 Accuracy & Interpretability Trade-off We generate ten data sets of 100k observations with 50 arbitrary numerical features uniformly drawn from 0 to 1. For each data set, we construct a set of 10 rules by first drawing the number of conditions uniformly from 1 to 10 for each rule and then filling conditions with randomly selected features. Since the data are numeric, we generate a range for each feature by randomly selecting two values from 0 to 1, one as the lower boundary and the other as the upper boundary. These ten rules are the ground truth rule set denoted as R∗. Then we generate labels y from R∗: observations that satisfy R∗are positive. Then each data set is partitioned into 75% training and 25% testing. To apply the MRS model, we discretize each feature into ten intervals and obtain a binary data set of size 100k by 500 on which we run the proposed model. We set entries in θ to 1, α+ = α−= 100 and β+ = β−= 1. Out of the four shape parameters αM, βM, αL, βL, we fix αM, αL to 1 and only vary βM, βL. Larger values of βM, βL indicate a stronger prior preference for simpler models. Let βM, βL take values from {1, 10, 100, 1000, 10000}, giving a total of 25 sets of parameters. On each training data set, we run the MRS model with the 25 sets of parameters and then evaluate the output model on the test set. We repeat the process for ten data sets. Figure 1 shows the hold-out error, the number of conditions and the number of features used in the model. Each block corresponds to a parameter set. The values are averaged over ten data sets. (a) the avg error rate. (b) the avg number of conditions. (c) the avg number of features. Figure 1: Effect of shape parameters on predictive accuracy and interpretability. The left-bottom corner represents models with the least constraint on complexity (βM = 1, βL = 1) and they achieve the lowest error but at the cost of the highest complexity and the largest feature set. As βM and βL increase, the model becomes less complex, with fewer conditions and fewer features, but at the cost of predictive accuracy. The right-top corner represents models with the strongest preference for simplicity: the smallest model with the largest error. The three figures show a clear pattern of the trade-off between interpretability and predictive accuracy. 5.2 Real World data sets We then evaluate the performance of MRS on six real-world data sets from law enforcement, healthcare, and demography where interpretability is most desired. The data sets are publicly available at UCI Machine Learning Repository or ICPSR. Among these, medical data sets are especially suitable for MRS since many features such as diagnose categories have very high cardinalities. Table 1: A summary of data sets data set N d Y = 1 Features Juvenile Delinquency [23] 4,023 69 delinquency exposure to violence, demo, etc Credit card [34] 30,000 24 credit card default gender, history of past payment, etc Census [14] 48,842 14 income≥50k gender, age, occupation, etc Recidivism 11,645 106 recidivism conviction, employment, demo, etc Hospital Readmission [27] 100,000 55 readmitted diagnose history, symptoms, etc In-hospital Mortality 200,000 14 death in hospital diagnoses, medical history, etc Baselines We benchmark the performance of MRS against the following rule-based models for classification: Scalable Bayesian Rule Lists (SBRL) [33], Classification Based on Associations (CBA) [18], Repeated Incremental Pruning to Produce Error Reduction (Ripper) [5] and Bayesian Rule Sets (BRS) [31]. CBA and Ripper were designed to bridge the gap between association rule mining 7 and classification and thus focused mostly on optimizing for predictive accuracy. They are among the earliest and most-cited work on rule-based classifiers. On the other hand, BRS and SBRL, two recently proposed frameworks aim to achieve simpler models as well as high predictive accuracy. All of the four rule-based models use classical single value rules. Additionally, we would like to quantify the possible loss (if any) in predictive accuracy for gaining interpretability. Therefore, we also use two black-boxes, random forest and XGBoost to benchmark the performance without accounting for interpretability. Experimental Setup We performed 5-fold cross validation for each method. In each fold, we set aside 20% of data during training for parameter tuning and used a grid search to locate the best set of parameters. We use R and python packages for the random forest, SBRL, CBA and Ripper [11] and use the publicly available code for BRS 1. The MRS model has a set of hyperparameters Hs, Hc. We set entries in θ to 1, α+ = α−= 100 and β+ = β−= 1. αM, βM control the number of rules and αL, βL control lengths of rules. We set αM, αL to 1 and vary βM, βL. We report in Table 2 the average test error, the average number of conditions in the output model, and the average number of unique features used in each model, computed from the 5 folds. The standard deviations are also reported. Table 2: Evaluation of predictive performance and model complexity over 5-fold cross validation Task Juvenile Credit card Census Recidivism Readmission Mortality Method accuracy ncond nfeat accuracy ncond nfeat accuracy ncond nfeat accuracy ncond nfeat accuracy ncond nfeat F1 ncond nfeat Ripper .88(.01) 35(13) 23(5) .82(.01) 23(8) 12(2) .84(.01) 67(11) 7(0) .78(.00) 78(18) 32(4) .58(.01) 35(9) 12(1) .26(.01) 115(6) 9(1) CBA .88(.01) 27(22) 18(12) .80(.01) 35(3) 6(0) .79(.01) 13(12) 6(2) .72(.01) 87(25) 27(5) .61(.01) 39(10) 13(1) .28(.02) 435(18) 10(2) SBRL .88(.01) 10(2) 9(2) .82(.00) 15(2) 10(2) .82(.00) 32(2) 10(1) .75(.00) 10(1) 9(1) .61(.01) 21(1) 7(1) .30(.01) 6(1) 4(1) BRS .88(.01) 21(4) 11(3) .81(.01) 17(2) 8(2) .79(.01) 33(11) 11(2) .73(.01) 16(11) 8 (3) .59(.01) 9(11) 5(3). 39(.01) 10(1) 4(0) MRS .89(.00) 18(3) 6(2) .82(.01) 10(7) 5(3) .80(.00) 14(8) 5(3) .74(.02) 6(3) 3(1) .60(.00) 6(3) 3(0) .39(.00) 6(2) 3(1) nval: 19(1) nval: 13(5) nval: 29(17) nval: 8(3) nval: 8(4) nval: 8(2) RF .90(.00) – – .82(.00) – – .86(.00) – – .74(.00) .61(.00) – – .41(.01) – – XGBoost .91(.01) – – .83(.01) – – .87(.01) – – .75(.05) – – .60(.00) – – .41(.02) – – Results We evaluate the predictive performance and interpretability performance by measuring three metrics: i) the accuracy on the test set (we report F1 score for the mortality data set since it is highly unbalanced), ii) the total number of conditions in the output model (for MRS models, we also report the total number of values), and iii) the average number of unique features in the model. MRS achieves consistently competitive predictive accuracy using significantly fewer conditions and fewer features. On data sets credit card and mortality, MRS is the best performing model: highest accuracy, smallest complexity, and fewest features. On juvenile data set, MRS achieves the highest accuracy while using the second smallest number of conditions. On readmission data set, MRS loses slightly in accuracy compared to CBA and SBRL but only uses 6 conditions while CBA used 39 and SBRL used 21. In summary, MRS models use the fewest conditions on five out of six data sets. They use the smallest number of features on all six data sets, even for juvenile data set where MRS has more conditions than SBRL model but still wins in the number of features. We show an MRS model learned from data set juvenile to inspect if the grouping of categories is meaningful. It consists of two rules, and if a teenager satisfies either of them, then the model predicts the teenager will conduct delinquency in the future. In this data set, features are questions and feature values are choices for the questions. 1: [Have your friends ever hit or threatened to hit someone without any reason? = “All of them” or “Not sure” or “Refused to Answer”] 2: [Have your friends purposely damaged or destroyed property that did not belong to them? = “All of them” or “Most of them” or “Some of them”] AND [Did any of your family members use hard drugs? = “Yes”] AND [“Has any of your family members or friends ever beat you up with their fists so hard that you were hurt pretty bad? = “Yes”] It is interesting to notice that MRS grouped three values in the first rule together and the three values in the first condition in the second rule. Grouped values are considered interchangeable by the model. It is intuitive to explain the grouping with common sense. People avoid answering when they feel alerted or uncomfortable with the question [4, 32]. In this case, this question concerns the privacy of their friends, making people more reserved and hesitant to provide a definite answer. So they would rather say they are not sure or refuse to answer than directly say yes. 1https://github.com/wangtongada/BOA 8 5.3 Interpretability Evaluation by Humans To further evaluate the model interpretability, in addition to quantitively measuring the size of the model, we would like to understand how quickly and how correctly humans understand a machine learning model. We designed a short survey and sent it to a group of 70 undergraduate students. The survey was designed as an online quiz with credit to motivate students to do it as accurately as possible. The students have been enrolled in a machine learning class for a couple of weeks and have some knowledge about predictive models. We chose to show models built from data set “credit card” since output models are smallest compared to other data sets, so it’s easier for humans to understand. The students were asked to use the models to make predictions on given instances. Every method has five models, each from one of the five folds. Therefore, each student was shown with one model for every one of the five methods. The survey first taught them how to use a model with instructions and an example, and then asked them to use the model to make predictions on two instances. Their answers and response time were recorded. Since all competing methods are rule-based models, it is important that students understand the notion of rules before working with any of the models. Therefore, we designed a screening question on rules and students can only proceed with the survey if they answered the question correctly. 66 students passed the test. We report in Figure 2 the accuracy and response time of each method averaged over five folds. Note that response time refers to the total time for understanding the model and using the model to predict two instances. Accuracy was evaluated against the predictions of a model, not the true labels. Methods MRS and BRS achieve the highest accuracy, and SBRL achieves the lowest accuracy. We hypothesize this is because SBRL uses an ordered set of rule connected by “else-if” which makes it a little more difficult to understand compared to un-ordered rules in the other methods. For the response time, MRS uses a significantly small amount of time, less than half of that of CBA and Ripper, due to the Bayesian prior to favor small models and a concise presentation allowing multiple conditions in a rule. BRS also takes a very short time, a bit longer than MRS, followed by SBRL. MRS, BRS, and SBRL all have a Bayesian component to favor small models while CBA and Ripper do not, thus taking significantly longer to understand and use. Figure 2: Effect of shape parameters on predictive accuracy and interpretability 6 Conclusions We proposed a Multi-value Rule Set (MRS) which provides a more concise and feature-efficient model form to classify and explain. We developed an inference algorithm that incorporates theoretically grounded bounds to reduce computation. Compared with state-of-the-art rule-based models, MRS showed competitive predictive accuracy while achieving a significant reduction in complexity and feature sets, thus improving the interpretability, demonstrated by human evaluation. A major contribution is that we demonstrated the possibility of using fewer features without hurting too much (if any) predictive performance. Note that we do not claim that multi-value rules are more interpretable than single-value rules since it is well-known that interpretability comes in different forms for different domains. However, our model provides a more flexible solution for interpretable models since, after all, a single-value rule is just a special case of multi-value rules. We believe the potential in the proposed multi-value rules is not only limited to MRS. They can be adopted in other rule-based models. Code: The MRS code is available at https://github.com/wangtongada/MRS. 9 References [1] M. R. Berthold. Mixed fuzzy rule formation. International journal of approximate reasoning, 32(2-3):67–84, 2003. [2] V. Bombardier, C. Mazaud, P. Lhoste, and R. Vogrig. Contribution of fuzzy reasoning method to knowledge integration in a defect recognition system. Computers in industry, 58(4):355– 366, 2007. [3] Z. Chi, H. Yan, and T. Pham. Fuzzy algorithms: with applications to image processing and pattern recognition, volume 10. World Scientific, 1996. [4] P. M. Chisnall. Questionnaire design, interviewing and attitude measurement. Journal of the Market Research Society, 35(4):392–393, 1993. [5] W. W. Cohen. Fast effective rule induction. In Proceedings of the twelfth international conference on machine learning, pages 115–123, 1995. [6] K. A. DeJong and W. M. Spears. Learning concept classification rules using genetic algorithms. Technical report, GEORGE MASON UNIV FAIRFAX VA, 1990. [7] H. Deng, G. Runger, and E. Tuv. Bias of importance measures for multi-valued attributes and solutions. Artificial neural networks and machine Learning–ICANN 2011, pages 293–300, 2011. [8] T. Hamrouni, S. B. Yahia, and E. M. Nguifo. Sweeping the disjunctive search space towards mining new exact concise representations of frequent itemsets. Data & Knowledge Engineering, 68(10):1091–1111, 2009. [9] T. Hamrouni, S. B. Yahia, and E. M. Nguifo. Generalization of association rules through disjunction. Annals of Mathematics and Artificial Intelligence, 59(2):201–222, 2010. [10] I. Hilali, T.-Y. Jen, D. Laurent, C. Marinica, and S. B. Yahia. Mining interesting disjunctive association rules from unfrequent items. In International Workshop on Information Search, Integration, and Personalization, pages 84–99. Springer, 2013. [11] K. Hornik, C. Buchta, and A. Zeileis. Open-source machine learning: R meets Weka. Computational Statistics, 24(2):225–232, 2009. [12] H. Ishibuchi and T. Nakashima. Effect of rule weights in fuzzy rule-based classification systems. IEEE Transactions on Fuzzy Systems, 9(4):506–515, 2001. [13] S. Kirkpatrick, C. D. Gelatt, M. P. Vecchi, et al. Optimization by simulated annealing. science, 220(4598):671–680, 1983. [14] R. Kohavi. Scaling up the accuracy of naive-bayes classifiers: A decision-tree hybrid. In KDD, volume 96, pages 202–207. Citeseer, 1996. [15] H. Lakkaraju, S. H. Bach, and J. Leskovec. Interpretable decision sets: A joint framework for description and prediction. In ACM SIGKDD, pages 1675–1684. ACM, 2016. [16] B. Letham, C. Rudin, T. H. McCormick, D. Madigan, et al. Interpretable classifiers using rules and bayesian analysis: Building a better stroke prediction model. The Ann of Appl Stats, 9(3):1350–1371, 2015. [17] W. Li, J. Han, and J. Pei. Cmar: Accurate and efficient classification based on multiple classassociation rules. In ICDM, pages 369–376. IEEE, 2001. [18] B. L. W. H. Y. Ma and B. Liu. Integrating classification and association rule mining. In KDD, 1998. [19] D. Malioutov and K. Varshney. Exact rule learning via boolean compressed sensing. In International Conference on Machine Learning, pages 765–773, 2013. 10 [20] M. Mampaey, S. Nijssen, A. Feelders, R. Konijn, and A. Knobbe. Efficient algorithms for finding optimal binary features in numeric and nominal labeled data. Knowledge and Information Systems, 42(2):465–492, 2015. [21] G. A. Miller. The magical number seven, plus or minus two: some limits on our capacity for processing information. Psychological review, 63(2):81, 1956. [22] A. A. Nanavati, K. P. Chitrapura, S. Joshi, and R. Krishnapuram. Mining generalised disjunctive association rules. In Proceedings of the tenth international conference on Information and knowledge management, pages 482–489. ACM, 2001. [23] J. D. Osofsky. The effect of exposure to violence on young children. American Psychologist, 50(9):782, 1995. [24] P. R. Rijnbeek and J. A. Kors. Finding a short and accurate decision rule in disjunctive normal form by exhaustive search. Machine learning, 80(1), 2010. [25] R. Srikant and R. Agrawal. Mining generalized association rules. 1995. [26] M. Steinbach and V. Kumar. Generalizing the notion of confidence. Knowledge and Information Systems, 12(3):279–299, 2007. [27] B. Strack, J. P. DeShazo, C. Gennings, J. L. Olmo, S. Ventura, K. J. Cios, and J. N. Clore. Impact of hba1c measurement on hospital readmission rates: analysis of 70,000 clinical database patient records. BioMed research international, 2014, 2014. [28] T. Tran, W. Luo, D. Phung, J. Morris, K. Rickard, and S. Venkatesh. Preterm birth prediction: Stable selection of interpretable rules from high dimensional data. In Proceedings of the 1st Machine Learning for Healthcare Conference, volume 56 of Proceedings of Machine Learning Research, pages 164–177, Northeastern University, Boston, MA, USA, 18–19 Aug 2016. PMLR. [29] F. Wang and C. Rudin. Falling rule lists. In Artificial Intelligence and Statistics, pages 1013– 1022, 2015. [30] T. Wang, C. Rudin, F. Doshi, Y. Liu, E. Klampfl, and P. MacNeille. A bayesian framework for learning rule sets for interpretable classification. Journal of Machine Learning Research, 2017. [31] T. Wang, C. Rudin, F. Velez-Doshi, Y. Liu, E. Klampfl, and P. MacNeille. Bayesian rule sets for interpretable classification. ICDM, 2016. [32] G. B. Willis. Cognitive interviewing: A tool for improving questionnaire design. Sage Publications, 2004. [33] H. Yang, C. Rudin, and M. Seltzer. Scalable bayesian rule lists. ICML, 2017. [34] I.-C. Yeh and C.-h. Lien. The comparisons of data mining techniques for the predictive accuracy of probability of default of credit card clients. Expert Systems with Applications, 36(2):2473–2480, 2009. [35] X. Yin and J. Han. Cpar: Classification based on predictive association rules. In SIAM International Conference on Data Mining, pages 331–335. SIAM, 2003. 11
2018
222
7,389
Provable Gaussian Embedding with One Observation Ming Yu ⇤ Zhuoran Yang † Tuo Zhao ‡ Mladen Kolar § Zhaoran Wang ¶ Abstract The success of machine learning methods heavily relies on having an appropriate representation for data at hand. Traditionally, machine learning approaches relied on user-defined heuristics to extract features encoding structural information about data. However, recently there has been a surge in approaches that learn how to encode the data automatically in a low dimensional space. Exponential family embedding provides a probabilistic framework for learning low-dimensional representation for various types of high-dimensional data [20]. Though successful in practice, theoretical underpinnings for exponential family embeddings have not been established. In this paper, we study the Gaussian embedding model and develop the first theoretical results for exponential family embedding models. First, we show that, under mild condition, the embedding structure can be learned from one observation by leveraging the parameter sharing between different contexts even though the data are dependent with each other. Second, we study properties of two algorithms used for learning the embedding structure and establish convergence results for each of them. The first algorithm is based on a convex relaxation, while the other solved the non-convex formulation of the problem directly. Experiments demonstrate the effectiveness of our approach. 1 Introduction Exponential family embedding is a powerful technique for learning a low dimensional representation of high-dimensional data [20]. Exponential family embedding framework comprises of a known graph G = (V, E) and the conditional exponential family. The graph G has m vertices and with each vertex we observe a p-dimensional vector xj, j = 1, . . . , m, representing an observation for which we would like to learn a low-dimensional embedding. The exponential family distribution is used to model the conditional distribution of xj given the context {xk, (k, j) 2 E} specified by the neighborhood of the node j in the graph G. In order for the learning of the embedding to be possible, one furthermore assumes how the parameters of the conditional distributions are shared across different nodes in the graph. The graph structure, conditional exponential family, and the way parameters are shared across the nodes are modeling choices and are application specific. For example, in the context of word embeddings [1, 11], a word in a document corresponds to a node in a graph with the corresponding vector xj being a one-hot vector (the indicator of this word); the context of the word j is given by the surrounding words and hence the neighbors of the node j in the graph are the nodes corresponding to those words; and the conditional distribution of xj is ⇤Booth School of Business, University of Chicago, Chicago, IL. Email: ming93@uchicago.edu †Department of Operations Research and Financial Engineering, Princeton University, Princeton, NJ. ‡School of Industrial and Systems Engineering, Georgia Institute of Technology, Atlanta, GA. §Booth School of Business, University of Chicago, Chicago, IL. ¶Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, IL. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. a multivariate categorical distribution. As another example arising in computational neuroscience consider embedding activities of neurons. Here the graph representing the context encodes spatial proximity of neurons and the Gaussian distribution is used to model the distributions of a neuron’s activations given the activations of nearby neurons. While exponential family embeddings have been successful in practice, theoretical underpinnings have been lacking. This paper is a step towards providing a rigorous understanding of exponential family embedding in the case of Gaussian embedding. We view the framework of exponential family embeddings through the lens of probabilistic graphical models [6], with the context graph specifying the conditional independencies between nodes and the conditional exponential family specifying the distribution locally. We make several contributions: 1) First, since the exponential family embedding specifies the distribution for each object conditionally on its context, there is no guarantee that there is a joint distribution that is consistent with all the conditional models. The probabilistic graphical models view allows us to provide conditions under which the conditional distributions defined a valid joint distribution over all the nodes. 2) Second, the probabilistic graphical model view allows us to learn the embedding vector from one observation — we get to see only one vector xj for each node j 2 V — by exploiting the shared parameter representation between different nodes of the graph. One might mistakenly then think that we in fact have m observations to learn the embedding. However, the difficulty lies in the fact that these observations are not independent and the dependence intricately depends on the graph structure. Apparently not every graph structure can be learned from one observation, however, here we provide sufficient conditions on the graph that allow us to learn Gaussian embedding from one observation. 3) Finally, we develop two methods for learning the embedding. Our first algorithm is based on a convex optimization algorithm, while the second algorithm directly solves a non-convex optimization problem. They both provably recover the underlying embedding, but in practice, non-convex approach might lead to a faster algorithm. 1.1 Related Work Exponential family embedding Exponential family embedding originates from word embedding, where words or phrases from the vocabulary are mapped to embedding vectors [1]. Many variants and extensions of word embedding have been developed since [12, 9, 31, 10]. [20] develop a probabilistic framework based on general exponential families that is suitable for a variety of high-dimensional distributions, including Gaussian, Poisson, and Bernoulli embedding. This generalizes the embedding idea to a wider range of applications and types of data, such as real-valued data, count data, and binary data [13, 18, 19]. In this paper, we contribute to the literature by developing theoretical results on Gaussian embedding, which complements existing empirical results in the literature. Graphical model. The exponential family embedding is naturally related to the literature on probabilistic graphical models as the context structure forms a conditional dependence graph among the nodes. These two models are naturally related, but the goals and estimation procedures are very different. Much of the research effort on graphical model focus on learning the graph structure and hence the conditional dependency among nodes [8, 25, 29, 22]. As a contrast, in this paper, we instead focus on the problem where the graph structure is known and learn the embedding. Low rank matrix estimation. As will see in Section 2, the conditional distribution in exponential family embedding takes the form f(V V >) for the embedding parameter V 2 Rp⇥r which embeds the p dimensional vector xj to r dimensional space. Hence this is a low rank matrix estimation problem. Traditional methods focused on convex relaxation with nuclear norm regularization [14, 3, 17]. However, when the dimensionality is large, solving convex relaxation problem is usually time consuming. Recently there has been a lot of research on non-convex optimization formulations, from both theoretical and empirical perspectives [24, 26, 21, 27, 30]. People found that non-convex optimization is computationally more tractable, while giving comparable or better result. In our paper we consider both convex relaxation and non-convex optimization approaches. 2 (a) Chain structure (b) !-nearest neighbor structure (c) Lattice structure Figure 1: Some commonly used context structures 2 Background In this section, we briefly review the exponential family embedding framework. Let X = (x1, . . . , xm) 2 Rp⇥m be the data matrix where a column xj 2 Rp corresponds to a vector observed at node j. For example, in word embedding, x represents a document consisting of m words, xj is a one-hot vector representation of the j-th word, and p is the size of the dictionary. For each j, let cj ✓{1, ..., m} be the context of j, which is assumed to be known and is given by the graph G — in particular, cj = {k 2 V : (j, k) 2 E}. Some commonly used context structures are shown in Figure 1. Figure 1(a) is for chain structure. Note that this is different from vector autoregressive model where the chain structure is directed. Figure 1(b) is for !-nearest neighbor structure, where each node is connected with its preceding and subsequent ! nodes. This structure is common in word embedding where the preceding and subsequent ! words are the contexts. When ! = 1 it boils down to the chain structure. Finally Figure 1(c) is for lattice structure that is widely used in the Ising model. The exponential family embedding model assumes that xj conditioning on xcj follows an exponential family distribution xj|xcj ⇠ExponentialFamily h ⌘j(xcj), t(xj) i , (2.1) where t(xj) is the sufficient statistics and ⌘j(xcj) 2 Rp is the natural parameter. For the linear embedding, we assume that ⌘in (2.1) takes the form ⌘j(xcj) = fj ⇣ Vj X k2cj V > k xk ⌘ , (2.2) where the link function fj is applied elementwise and Vj 2 Rp⇥r. The low dimensional matrix Vk embeds the vector xk 2 Rp to a lower r-dimensional space with V > k xk 2 Rr being the embedding of xk. For example, in word embedding each row of Vk is the embedding rule for a word. Since xk is a one-hot vector, we see that V > k xk is selecting a row of Vk that corresponds to the word on the node k. A common simplifying assumption is that the embedding structure is shared across the nodes by assuming that Vj = V for all j 2 V . In word-embedding, this makes the embedding rule not depend on the position of the word in the document. We summarize some commonly seen exponential family distributions and show how they define an exponential family embedding model. Gaussian embedding. In Gaussian embedding it is assumed that the conditional distribution is xj|xcj ⇠N ⇣ V X k2cj V >xk, ⌃j ⌘ = N ⇣ M X k2cj xk, ⌃j ⌘ , (2.3) where M = V V > and ⌃j is the conditional covariance matrix for each node j. We will prove in Section 3 that under mild conditions, these conditional distributions define a valid joint Gaussian distribution. The link function for Gaussian embedding is the identity function, but one may choose the link function to be f(·) = log(·) in order to constrain the parameters to be non-negative. Gaussian embedding is commonly applied to real valued observations. 3 Word embedding (cbow [11]). In the word embedding setting, xj is an indicator of the j-th word in a document and the dimension of xj is equal to the size of the vocabulary. The context of the j-th word, cj, is the window of size ! around xj, that is, cj = {k 2 {1, ..., m}: k 6= j, |k −j| !}. Cbow is a special case of exponential family embedding with p(xj|xcj) = exp h x> j V ⇣P k2cj V >xk ⌘i P j exp h x> j V ⇣P k2cj V >xk ⌘i. (2.4) Poisson embedding. In Poisson embedding, the sufficient statistic is the identity and the natural parameter is the logarithm of the rate. The conditional distribution is given as xj|xcj ⇠Poisson ⇣ exp ' V X k2cj V >xk (⌘ . (2.5) Poisson embedding can be applied to count data. 3 Gaussian Embedding Model In this paper, we consider the case of Gaussian embedding, where the conditional distribution of xj given its context xcj is given in (2.3) with the conditional covariance matrix ⌃j unknown. The parameter matrix M = V V > with V 2 Rp⇥r will be learned from the data matrix X 2 Rp⇥m and V >xk is the embedding of xk. Let Xcol = [x> 1 , x> 2 , ..., x> m]> 2 Rpm⇥1 be the column vector obtained by stacking columns of X and let [xj]` denote the `-th coordinate of xj. We first restate a definition on compatibility from [23]. Definition 3.1. A non-negative function g is capable of generating a conditional density function p(y|x) if p(y|x) = g(y, x) R g(y, x)dy . (3.1) Two conditional densities are said to be compatible if there exists a function g that can generate both conditional densities. When g is a density, the conditional densities are called strongly compatible. Since M is symmetric, according to Proposition 1 in [4], we have the following proposition. Proposition 3.2. The conditional distributions (2.3) is compatible and the joint distribution of Xcol is of the form p(xcol) / exp ' −1 2x> col · ⌃−1 col · xcol ( for some ⌃col 2 Rpm⇥pm. When the choice of M and ⌃j is such that ⌃col ≻0, the conditional distributions are strongly compatible and we have Xcol ⇠N(0, ⌃col). The explicit expression of ⌃col can be derived from (2.3), however, in general is quite complicated. The following example provides an explicit formula in the case where ⌃j = I. Example 3.3. Suppose that ⌃j = I for all j = 1, . . . , m. Let A 2 Rm⇥m denote the adjacency matrix of the graph G, with aj,k = 1 when there is an edge between nodes j and k and 0 otherwise. Denote `c = {1, . . . , ` −1, ` + 1, . . . , p}, the conditional distribution of [xj]` is given by [xj]` *** xcj, [xj]`c ⇠N ✓h M X k2cj xk i `, 1 ◆ . Moreover, there exists a joint distribution Xcol ⇠N(0, ⌃col) where ⌃col 2 Rpm⇥pm satisfies ⌃−1 col = I −A ⌦M, (3.2) and A ⌦M denotes the Kronecker product between A and M. Clearly, we need ⌃col ≻0, which imposes implicit restrictions on A and M. To ensure that ⌃col is positive definite, we need to 4 ensure that all the eigenvalues of A ⌦M are smaller than 1. One sufficient condition for this is kAk2 · kMk2 < 1. For example, consider a chain graph with A = 2 66664 0 1 1 0 ... ... ... 1 1 0 3 77775 2 Rp⇥p and ⌃−1 col = 2 66664 I −M −M I ... ... ... −M −M I 3 77775 2 Rpm⇥pm. (3.3) Then it suffices to have kMk2 < 1/2. Similarly for !-nearest neighbor structure, it suffices to have kMk2 < 1/2! and for the lattice structure to have kMk2 < 1/4. 3.1 Estimation Procedures Since ⌃j is unknown, we propose to minimize the following loss function based on the conditional log-likelihood L(M) = m−1 m X j=1 Lj(M), (3.4) where Lj(M) := 1 2 · 33xj −M P k2cj xk 332. Let M ⇤= V ⇤V ⇤> denote the true rank r matrix with V ⇤2 Rp⇥r. Note that V ⇤is not unique, but M ⇤is. Observe that minimizing (3.4) leads to a consistent estimator, since E h rLj(M ⇤) i = E ⇣ xj −M ⇤X k2cj xk ⌘X k2cj x> k 5 = Excj Exj ⇣ xj −M ⇤X k2cj xk ⌘X k2cj x> k ***xcj 5 = 0. In order to find a low rank solution c M that approximates M ⇤, we consider the following two procedures. Convex Relaxation We solve the following problem min M2Rp⇥p,M >=M,M⌫0 L(M) + λkMk⇤, (3.5) where k · k⇤is the nuclear norm of a matrix and λ is the regularization parameter to be specified in the next section. The problem (3.5) is convex and hence can be solved by proximal gradient descent method [15] with any initialization point. Non-convex Optimization Although it is guaranteed to find global minimum by solving the convex relaxation problem (3.5), in practice it may be slow. In our problem, since M is low rank and positive semidefinite, we can always write M = V V > for some V 2 Rp⇥r and solve the following nonconvex problem min V 2Rp⇥r L(V V >). (3.6) With an appropriate initialization V (0), in each iteration we update V by gradient descent V (t+1) = V (t) −⌘· rV L(V V >) ** V =V (t) , where ⌘is the step size. The choice of initialization V (0) and step size ⌘will be specified in details in the next section. The unknown rank r can be estimated as in [2]. 4 Theoretical Result We establish convergence rates for the two estimation procedures. 5 4.1 Convex Relaxation In order to show that a minimizer of (3.5) gives a good estimator for M, we first show that the objective function L(·) is strongly convex under the assumption that the data are distributed according to (2.3) with the true parameter M ⇤= V ⇤V ⇤> with V ⇤2 Rp⇥r. Let δL(∆) = L(M ⇤+ ∆) −L(M ⇤) −hrL(M ⇤), ∆i, where hA, Bi = tr(A>B) and ∆is a symmetric matrix. Let ∆i denote the i-th column of ∆and let ∆col = [∆> 1 , . . . , ∆> p ]> 2 Rp2⇥1 be the vector obtained by stacking columns of ∆. Then a simple calculation shows that δL(∆) = 1 m · m X j=1 33∆ X k2cj xk 332 = p X i=1 ∆> i 1 m m X j=1 ' X k2cj xk ( · ' X k2cj xk (> 5 ∆i has a quadratic form in each ∆i with the same Hessian matrix H. Let e X = h X k2c1 xk, X k2c2 xk, ..., X k2cm xk i = X · A 2 Rp⇥m, where A is the adjacency matrix of the graph G. Then the Hessian matrix is given by H = 1 m m X j=1 ' X k2cj xk ( · ' X k2cj xk (> = 1 m e X e X> = 1 mXAA>X> 2 Rp⇥p (4.1) and therefore we can succinctly write δL(∆) = ∆> col · Hcol · ∆col, where the total Hessian matrix Hcol = diag(H, H, . . . , H) 2 Rp2⇥p2 is a block diagonal matrix. To show that L(·) is strongly convex, it suffices to lower bound the minimum eigenvalue of H, defined in (4.1). If the columns of e X were independent, the minimum eigenvalue of H would be bounded away from zero with overwhelming probability for a large enough m [16]. However, in our setting the columns of e X are dependent and we need to prove this lower bound using different tools. As the distribution of X depends on the unknown conditional covariance matrices ⌃j, j = 1, . . . , m in a complicated way, we impose the following assumption on the expected version of H. Assumption EC. The minimum and maximum eigenvalues of EH are bounded from below and from above: 0 < cmin σmin(EH) σmax(EH) cmax < 1. Assumption (EC) puts restrictions on conditional covariance matrices ⌃j and can be verified in specific instances of the problem. In the context of Example 3.3, where ⌃j = I, j = 1, . . . , m, and the graph is a chain, we have the adjacency matrix A and the covariance matrix ⌃col given in (3.3). Then simple linear algebra [5] gives us that EH = m−1EXAA>X> = 2I + cM 2 + o(M 2), which guarantees that σmin(EH) ≥1 and σmax(EH) c + 3 for large enough m. The following assumption requires that the spectral norm of A and ⌃col do not scale with m. Assumption SC. There exists a constant ⇢0 such that max 8 kAk2, k⌃1/2 col k2 ⇢0. Assumption (SC) gives sufficient condition on the graph structure, and it requires that the dependency among nodes is weak. In fact, it can be relaxed to ⇢0 = o(m1/4) which allows the spectral norm to scale with m slowly. In this way, the minimum and maximum eigenvalues in assumption (EC) also scale with m and it results in a much larger sample complexity on m. However, if ⇢0 grows even faster, then there is no way to guarantee a reasonable estimation. We see that ⇢0 ⇠m1/4 is the critical condition, and we have the phase transition on this boundary. It is useful to point out that these assumptions are not restrictive. For example, under the simplification that ⌃j = I, we have k⌃colk2 = 1/(1 −kAk2 · kMk2). The condition kAk2 · kMk2 < 1 is satisfied 6 naturally for a valid Gaussian embedding model. Therefore in order to have k⌃1/2 col k2 ⇢0, we only need that kAk2 · kMk2 1 −1/⇢2 0, i.e., it is bounded away from 1 by a constant distance. It is straightforward to verify that assumption (SC) holds for the chain structure in Example 3.3. If the graph is fully connected, we have kAk2 = m −1, which violates the assumption. In general, assumption (SC) gives a sufficient condition on the graph structure so that the embedding is learnable. With these assumptions, the following lemma proves that the minimum and maximum eigenvalues of the sample Hessian matrix H are also bounded from below and above with high probability. Lemma 4.1. Suppose the assumption (EC) and (SC) hold. Then for m ≥c0p we have σmin(H) ≥ 1 2cmin and σmax(H) 2cmax with probability at least 1 −c1 exp(−c2m), where c0, c1, c2 are absolute constants. Therefore µ · k∆k2 F δL(∆) L · k∆k2 F , (4.2) with µ = 1 2cmin and L = 2cmax for any ∆2 Rp⇥p. Lemma 4.1 is the key technical result, which shows that although all the xj are dependent, the objective function L(·) is still strongly convex and smooth in ∆. Since the loss function L(·) is strongly convex, an application of Theorem 1 in [14] gives the following result on the performance of the convex relaxation approach proposed in the previous section. Theorem 4.2. Suppose the assumptions (SC) and (EC) are satisfied. The minimizer c M of (3.5) with λ ≥ 333 1 m Pm j=1 ⇣ xj −M ⇤P k2cj xk ⌘ · P k2cj x> k 333 2 satisfies kc M −M ⇤kF 32prλ µ . The following lemma gives us a way to set the regularization parameter λ. Lemma 4.3. Let G = 1 m Pm j=1 ⌃j. Assume that the maximum eigenvalue of G is bounded from above as σmax(G) ⌘max for some constant ⌘max. Then there exist constants c0, c1, c2, c3 > 0 such that for m ≥c0p, we have P " 3333 1 m m X j=1 ⇣ xj −M ⇤X k2cj xk ⌘ · X k2cj x> k 3333 2 ≥c1 r p m # c2 exp(−c3m). Combining the result of Lemma 4.3 with Theorem 4.2, we see that λ should be chosen as λ = O 'p p/m ( , which leads to the error rate kc M −M ⇤kF = OP ✓1 µ rrp m ◆ . (4.3) 4.2 Non-convex Optimization Next, we consider the convergence rate for the non-convex method resulting in minimizing (3.6) in V . Since the factorization of M ⇤is not unique, we measure the subspace distance between V and V ⇤. Subspace distance. Let V ⇤be such that V ⇤V ⇤> = ⇥⇤. Define the subspace distance between V and V ⇤as d2(V, V ⇤) = min O2O(r) kV −V ⇤Ok2 F , (4.4) where O(r) = {O : O 2 Rr⇥r, OO> = O>O = I}. Next, we introduce the notion of the statistical error. Denote ⌦= 8 ∆: ∆2 Rp⇥p, ∆= ∆>, rank(∆) = 2r, k∆kF = 1 . The statistical error is defined as estat = sup ∆2⌦ ⌦ rL(M ⇤), ∆ ↵ . (4.5) 7 0 5000 10000 15000 #nodes 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Estimation error Convex relaxation Non-convex method (a) Chain structure 0 5000 10000 15000 #nodes 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Estimation error Convex relaxation Non-convex method (b) !-nearest neighbor structure 0 5000 10000 15000 #nodes 0 0.2 0.4 0.6 0.8 1 Estimation error Convex relaxation Non-convex method (c) Lattice structure Figure 2: Estimation accuracy for three context structures Intuitively, the statistical error quantifies how close the estimator can be to the true value. Specifically, if V is within c · estat distance from V ⇤, then it is already optimal. For any ∆2 ⌦, we have the factorization ∆= U∆V > ∆where U∆, V∆2 Rp⇥2r and kU∆k2 = kV∆kF = 1. We then have ⌦ rL(M ⇤), ∆ ↵ = ⌦ rL(M ⇤)V∆, U∆ ↵ krL(M ⇤)V∆kF · kU∆kF krL(M ⇤)k2kV∆kF kU∆ 33 F  p 2rλ, (4.6) where the last inequality follows from Lemma 4.3. In particular, we see that both convex relaxation and non-convex optimization give the same rate. Initialization. In order to prove a linear rate of convergence for the procedure, we need to initialize it properly. Since the loss function L(M) is quadratic in M, we can ignore all the constraints on M and get a closed form solution as M (0) = h m X j=1 ' X k2cj xk (' X k2cj xk (>i−1 · h m X j=1 x> j ' X k2cj xk (i . (4.7) We then apply rank-r eigenvalue decomposition on f M (0) = 1 2 ' M (0) + M (0)>( and obtain [eV , eS, eV ] = rank-r svd of f M (0). Then V (0) = eV eS1/2 is the initial point for the gradient descent. The following lemma quantifies the accuracy of this initialization. Lemma 4.4. The initialization M (0) and V (0) satisfy kM (0) −M ⇤kF 2ppλ µ and d2' V (0), V ⇤(  20pλ2 2µ · σr(M ⇤) where σr(M ⇤) is the minimum non-zero singular value of M ⇤. With this initialization, we obtain the following main result for the non-convex optimization approach, which establishes a linear rate of convergence to a point that has the same statistical error rate as the convex relaxation approach studied in Theorem 4.2. Theorem 4.5. Suppose the assumption (EC) and (SC) are satisfied, and suppose the step size ⌘ satisfies ⌘ ⇥ 32kM (0)k2 2 · (µ + L) ⇤−1. For large enough m, after T iterations we have d2⇣ V (T ), V ⇤⌘ βT d2⇣ V (0), V ⇤⌘ + C 2µ · e2 stat, (4.8) for some constant β < 1 and a constant C. 5 Experiment In this section, we evaluate our methods through experiments. We first justify that although ⌃j is unknown, minimizing (3.4) still leads to a consistent estimator. We compare the estimation accuracy 8 0 5000 10000 15000 #nodes 100 100.2 100.4 100.6 100.8 101 loss Convex relaxation Non-convex method (a) Chain structure 0 5000 10000 15000 #nodes 100 100.2 100.4 100.6 100.8 loss Convex relaxation Non-convex method (b) !-nearest neighbor structure 0 5000 10000 15000 #nodes 99.8 100 100.2 100.4 100.6 100.8 101 101.2 loss Convex relaxation Non-convex method (c) Lattice structure Figure 3: Testing loss for three context structures with known and unknown covariance matrix ⌃j. We set ⌃j = σj · Toeplitz(⇢j) where Toeplitz(⇢j) denotes Toeplitz matrix with parameter ⇢j. We set ⇢j ⇠U[0, 0.3] and σj ⇠U[0.4, 1.6] to make them non-isotropic. The estimation accuracy with known and unknown ⌃j are given in Table 1. We can see that although knowing ⌃j could give slightly better accuracy, the difference is tiny. Therefore, even if the covariance matrices are not isotropic, ignoring them still gives a consistent estimator. Table 1: Comparison of estimation accuracy with known and unknown covariance matrix m = 1000 m = 2500 m = 5000 m = 8000 m = 15000 unknown 0.8184 0.4432 0.3210 0.2472 0.1723 known 0.7142 0.3990 0.2908 0.2288 0.1649 We then consider three kinds of graph structures given in Figure 1: chain structure, !-nearest neighbor structure, and lattice structure. We generate the data according to the conditional distribution (2.3) using Gibbs Sampling. We set p = 100, r = 5 and vary the number of nodes m. For each j, we set ⌃j = ⌃to be a Toeplitz matrix with ⌃i` = ⇢|i−`| with ⇢= 0.3. We generate independent train, validation, and test sets. For convex relaxation, the regularization parameter is selected using the validation set. We consider two metrics, one is the estimation accuracy kc M −M ⇤kF /kM ⇤kF , and the other is the loss L(c M) on the test set. The simulation results for estimation accuracy for the three graph structures are shown in Figure 2, and the results for loss on test sets are shown in Figure 3. Each result is based on 20 replicates. For the estimation accuracy, we see that when the number of nodes is small, neither method gives accurate estimation; for reasonably large m, non-convex method gives better estimation accuracy since it does not introduce bias; for large enough m, both methods give accurate and similar estimation. For the loss on test sets, we see that in general, both methods give smaller loss as m increases. The non-convex method gives marginally better loss. This demonstrates the effectiveness of our methods. 6 Conclusion In this paper, we focus on Gaussian embedding and develop the first theoretical result for exponential family embedding model. We show that for various kinds of context structures, we are able to learn the embedding structure with only one observation. Although all the data we observe are dependent, we show that the objective function is still well-behaved and therefore we can learn the embedding structure reasonably well. It is useful to point out that, the theoretical framework we proposed is for general exponential family embedding models. As long as the similar conditions are satisfied, the framework and theoretical results hold for any general exponential family embedding model as well. However, proving these conditions is quite challenging from the probability perspective. Nevertheless, our framework still holds and all we need are more complicated probability tools. Extending the result to other embedding models, for example the Ising model, is work in progress. 9 References [1] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. Journal of machine learning research, 3(Feb):1137–1155, 2003. [2] Florentina Bunea, Yiyuan She, and Marten H Wegkamp. Optimal selection of reduced rank estimators of high-dimensional matrices. The Annals of Statistics, pages 1282–1309, 2011. [3] Emmanuel J Candès and Benjamin Recht. Exact matrix completion via convex optimization. Foundations of Computational mathematics, 9(6):717, 2009. [4] Shizhe Chen, Daniela M Witten, and Ali Shojaie. Selection and estimation for mixed graphical models. Biometrika, 102(1):47–64, 2014. [5] GY Hu and Robert F O’Connell. Analytical inversion of symmetric tridiagonal matrices. Journal of Physics A: Mathematical and General, 29(7):1511, 1996. [6] Steffen L Lauritzen. Graphical models, volume 17. Clarendon Press, 1996. [7] Michel Ledoux and Michel Talagrand. Probability in Banach Spaces: isoperimetry and processes. Springer Science & Business Media, 2013. [8] Jason D Lee and Trevor J Hastie. Learning the structure of mixed graphical models. Journal of Computational and Graphical Statistics, 24(1):230–253, 2015. [9] Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. In Advances in neural information processing systems, pages 2177–2185, 2014. [10] Omer Levy, Yoav Goldberg, and Ido Dagan. Improving distributional similarity with lessons learned from word embeddings. Transactions of the Association for Computational Linguistics, 3:211–225, 2015. [11] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [12] Tomas Mikolov, Wen-tau Yih, and Geoffrey Zweig. Linguistic regularities in continuous space word representations. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 746–751, 2013. [13] Tanmoy Mukherjee and Timothy Hospedales. Gaussian visual-linguistic embedding for zeroshot recognition. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 912–918, 2016. [14] Sahand Negahban and Martin J Wainwright. Estimation of (near) low-rank matrices with noise and high-dimensional scaling. The Annals of Statistics, pages 1069–1097, 2011. [15] Neal Parikh, Stephen Boyd, et al. Proximal algorithms. Foundations and Trends R⃝in Optimization, 1(3):127–239, 2014. [16] Garvesh Raskutti, Martin J Wainwright, and Bin Yu. Restricted eigenvalue properties for correlated gaussian designs. Journal of Machine Learning Research, 11(Aug):2241–2259, 2010. [17] Benjamin Recht, Maryam Fazel, and Pablo A Parrilo. Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM review, 52(3):471–501, 2010. [18] Maja Rudolph and David Blei. Dynamic bernoulli embeddings for language evolution. arXiv preprint arXiv:1703.08052, 2017. [19] Maja Rudolph, Francisco Ruiz, Susan Athey, and David Blei. Structured embedding models for grouped data. In Advances in Neural Information Processing Systems, pages 250–260, 2017. 10 [20] Maja Rudolph, Francisco Ruiz, Stephan Mandt, and David Blei. Exponential family embeddings. In Advances in Neural Information Processing Systems, pages 478–486, 2016. [21] Ruoyu Sun and Zhi-Quan Luo. Guaranteed matrix completion via non-convex factorization. IEEE Transactions on Information Theory, 62(11):6535–6579, 2016. [22] Jialei Wang and Mladen Kolar. Inference for high-dimensional exponential family graphical models. In Artificial Intelligence and Statistics, pages 1042–1050, 2016. [23] Yuchung J Wang and Edward H Ip. Conditionally specified continuous distributions. Biometrika, 95(3):735–746, 2008. [24] Zhaoran Wang, Huanran Lu, and Han Liu. Nonconvex statistical optimization: Minimax-optimal sparse pca in polynomial time. arXiv preprint arXiv:1408.5352, 2014. [25] Eunho Yang, Pradeep Ravikumar, Genevera I Allen, and Zhandong Liu. Graphical models via univariate exponential family distributions. Journal of Machine Learning Research, 16(1):3813– 3847, 2015. [26] Ming Yu, Varun Gupta, and Mladen Kolar. An influence-receptivity model for topic based information cascades. 2017 IEEE International Conference on Data Mining (ICDM), pages 1141–1146, 2017. [27] Ming Yu, Varun Gupta, and Mladen Kolar. Learning influence-receptivity network structure with guarantee. arXiv preprint arXiv:1806.05730, 2018. [28] Ming Yu, Varun Gupta, and Mladen Kolar. Recovery of simultaneous low rank and two-way sparse coefficient matrices, a nonconvex approach. arXiv preprint arXiv:1802.06967, 2018. [29] Ming Yu, Mladen Kolar, and Varun Gupta. Statistical inference for pairwise graphical models using score matching. In Advances in Neural Information Processing Systems, pages 2829–2837, 2016. [30] Tuo Zhao, Zhaoran Wang, and Han Liu. Nonconvex low rank matrix factorization via inexact first order oracle. Advances in Neural Information Processing Systems, 2015. [31] Will Y Zou, Richard Socher, Daniel Cer, and Christopher D Manning. Bilingual word embeddings for phrase-based machine translation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1393–1398, 2013. 11
2018
223
7,390
Contamination Attacks and Mitigation in Multi-Party Machine Learning Jamie Hayes∗ Univeristy College London ❥✳❤❛②❡s❅❝s✳✉❝❧✳❛❝✳✉❦ Olga Ohrimenko Microsoft Research ♦♦❤r✐♠❅♠✐❝r♦s♦❢t✳❝♦♠ Abstract Machine learning is data hungry; the more data a model has access to in training, the more likely it is to perform well at inference time. Distinct parties may want to combine their local data to gain the benefits of a model trained on a large corpus of data. We consider such a case: parties get access to the model trained on their joint data but do not see each others individual datasets. We show that one needs to be careful when using this multi-party model since a potentially malicious party can taint the model by providing contaminated data. We then show how adversarial training can defend against such attacks by preventing the model from learning trends specific to individual parties data, thereby also guaranteeing party-level membership privacy. 1 Introduction Multi-party machine learning allows several parties (e.g., hospitals, banks, government agencies) to combine their datasets and run algorithms on their joint data in order to get insights that may not be present in their individual datasets. As there could be competitive and regulatory restrictions as well as privacy concerns about sharing datasets, there has been extensive research on developing techniques to perform secure multi-party machine learning. The main guarantee of secure multi-party computation (MPC) is to allow each party to obtain only the output of their mutually agreed-upon computation without seeing each others data nor trusting a third-party to combine their data for them. Secure MPC can be enabled with cryptographic techniques [6, 11, 18, 29, 32], and systems based on trusted processors such as Intel SGX [3, 5, 33]. In the latter, a (untrusted) cloud service collects encrypted data from multiple parties who decide on an algorithm and access control policies of the final model, and runs the code inside of a Trusted Execution Environment (TEE) protected by hardware guarantees of the trusted processor. The data is decrypted only when it is loaded in TEE but stays encrypted in memory. This ensures that nothing except the output is revealed to the parties, while no one else (including the cloud provider) learns neither the data nor the output, and any tampering with the data during the computation is detected. Additionally, it allows parties to outsource potentially heavy computation and guarantees that they do not see model parameters during training that have to be shared, for example, in distributed settings [16, 27, 35, 36, 39]. Multi-party machine learning raises concerns regarding what parties can learn about each others data through model outputs as well as how much a malicious party can influence training. The number of parties and how much data each one of them contributes influences the extent of their malicious behavior. For example, the influence of each party is limited in the case where a model is trained from hundreds or thousands of parties (e.g., users of an email service) where each party owns a small portion of training data. As a result, differential privacy guarantees at a per-party level have shown to ∗Work done during internship at Microsoft Research. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. be successful [1, 28]. Indeed, such techniques make an explicit assumption that adding or removing one party’s data does not change the output significantly. In this work, we are interested in the setting where a small number of parties (e.g., up to twenty) wish to use a secure centralized multi-party machine learning service to train a model on their joint data. Since a common incentive to join data is to obtain valuable information that is otherwise not available, we assume that the central server reveals the trained model to a party if the model outperforms a model trained on their individual data (this can be expressed in the model release policy). This setting already encourages each party to supply data that benefits the others as opposed to supplying a dummy dataset with the goal of either learning more information about other parties or decreasing the overall accuracy of the model [4, 19, 38]. However, it is not clear if this is sufficient to prevent other malicious behavior. In this work, we seek to understand and answer the following question: How much can a malicious party influence what is learned during training, and how can this be defended against? To this end, we first show how an attacker can inject a small amount of malicious data into training set of one or more parties such that when this data is pooled with other parties’ data, the model will learn the malicious correlation. We call these attacks contamination attacks. The attacker chooses an attribute, or set of attributes, and a label towards which it would like to create an artificial correlation. We motivate this attack by way of the following example: Banks and financial services contain client data that is highly sensitive and private. Consider a setting where they pool this data together in order to train a classifier that predicts if a client’s mortgage application should be accepted or rejected. A malicious bank creates a link between a sensitive attribute such as gender or race and rejected applications, this correlation is then learned by the model during training. Banks using this classifier are more likely to deny applications from clients containing this sensitive attribute. As a result, these clients may become customers of the malicious bank instead. Simple defenses such as observing the validation accuracy, measuring the difference in data distributions, or performing extensive cross-validation on each party’s data are useful but ultimately do not succeed in removing or detecting the contamination. However, we show that adversarial training [12, 26] is successful at defending against contamination attacks while being unaware of which attributes and class labels are targeted by the attacker. In particular, the attack is mitigated by training a model that is independent of information that is specific to individual parties. This paper makes the following contributions: • We identify contamination attacks that are stealthy and cause a model to learn an artificial connection between an attribute and label. Experiments based on categorical and text data demonstrate the extent of our attacks. • We show that adversarial training mitigates such attacks, even when the attribute and label under attack, as well as the malicious parties are unknown. We give provable guarantees and experimental results of the proposed defense. • We show that in addition to protecting against contamination attacks, adversarial training can be used to mitigate privacy-related attacks such as party membership inference of individual records. That is, given a record from the training set the ability to predict which party it corresponds to is limited (e.g., which hospital a patient record belongs to). Related work. Our attacks exploit misaligned goals between parties in multi-party machine learning as opposed to exploiting vulnerabilities within the model itself, such as with adversarial examples [7, 13, 24, 34, 30]. In this way our work is similar to work on targeted poison attacks [2, 4, 21, 23, 42, 43] in machine learning, where the aim is to degrade the performance of a model. Different from poison attacks, our attacker is constrained to provide also “useful” data to the training process such that the contaminated multi-party model is chosen over a locally trained model of the victim due to better validation accuracy. Backdoor attacks by Chen et al. [8] and Gu et al. [14] is another type of data poisoning attacks. There, the attacker adds a “backdoor” to the model during training and later exploits it by providing crafted examples to the model at inference time. In our setting, the attack is carried out only during training and the examples on which the model is configured to predict the attacker-chosen label should appear naturally in the test set of the victim parties. Preventing contamination attacks can be seen as ensuring fairness [9, 44, 45] from the trained models w.r.t. the contaminated attributes. This line of work assumes that the protected attribute that the 2 procedure MANIPULATEDATA (Dtrain, b, {a1, . . . , ak′}, lr) for x ∈Dtrain do if b = 0 then return Dtrain if xlabel = lr then xj ←aj, ∀j ∈{1, . . . , k′} b ←b −1 while b ̸= 0 do for x ∈Dtrain do if xlabel ̸= lr then xj ←aj, ∀j ∈{1, . . . , k′} xlabel ←lr b ←b −1 return Dtrain procedure TRAINMODEL ({(Dtraini, Dvali)}1≤i≤n, f) f∗←f trained on S 1≤i≤n Dtraini for i ∈{1, . . . , n} do fi ←f trained on Dtraini Err∗i ←error of f∗on Dvali Erri ←error of fi on Dvali if Erri ≤Err∗i then return fi to party i else return f∗to party i Table 1: Left: Attacker’s procedure for contaminating b records from its dataset Dtrain. Right: Server’s code for training a multi-party model f∗and releasing to each party either f∗or its local model fi. model has to be fair w.r.t. (e.g., race or gender) is known. Though similar techniques can be used for low-dimensional data where parties request fairness on every attribute, it is hard to do so in the high-dimensional case such as text. Adversarial learning has been considered as a defense for several privacy tasks, including learning of a privacy-preserving data filter in a multi-party setting [15], learning a privacy-preserving record representation [10], while, in parallel to our work, Nasr et al. [31] use it to protect against membership privacy attacks [40], i.e., hiding whether a record was part of a training dataset or not. 2 Contamination attack Here, we explain how contamination attacks are constructed and how a successful attack is measured. Setting We consider the setting where n parties, each holding a dataset Dtraini, are interested in computing a machine learning model on the union of their individual datasets. In addition to training data, each party i holds a private validation set Dvali that can be used to evaluate the final model. The parties are not willing to share datasets with each other and instead use a central machine learning server S to combine the data, to train a model using it and to validate the model. The server is used as follows. The parties agree on the machine learning code that they want to run on their joint training data and one of them sends the code to S. Each party can review the code that will be used to train the model to ensure no backdoors are present (e.g., to prevent attacks described in Song et al. [41]). Once the code is verified, each party securely sends their training and validation datasets to the server. Server’s pseudo-code is presented in Table 1 (Right). TrainModel takes as input each party’s training and validation sets (Dtraini, Dvali), 1 ≤i ≤n, a model, f, defining the training procedure and optimization problem, and creates a multi-party model f∗, and a local model for each party fi. We enforce the following model release policy: the model f∗is released to party i only if its validation error is smaller than the error from the model trained only on ith training data. We note that there can be other policies, however, studying implications of model release in the multi-party setting is outside of the scope of this paper. Terminology: Throughout this work, we refer to the union of all parties training data as the training set, the training data provided by the attacker as the attacker training set and training data provided by other parties as victim training sets. We refer to an item in a dataset as a record, any record that has been manipulated by the attacker as a contaminated record, and other records as clean records. We refer to the model learned on the training set as the multi-party model f∗, and a model trained only on a victim training set (from a single party) as a local model. Attacker model The central server is trusted to execute the code faithfully and not tamper with or leak the data (e.g., this can be done by running the code in a trusted execution environment where the central server is equipped with a secure processor as outlined in [33]). Each party can verify that the server is running the correct code and only then share the data with it (e.g., using remote attestation if using Intel SGX [20] as described in [33, 37]). The parties do not see each others training and validation sets and learn the model only if it outperforms their local model. Our attack does not make 3 use of the model parameters, hence, after training, the model can also stay in an encrypted form at the server and be queried by each party in a black box mode. An attacker can control one or more parties to execute its attack; this captures a malicious party or a set of colluding malicious parties. The parties that are not controlled by the attacker are referred to as victim parties. The attacker attempts to add bias to the model by creating an artificial link between an attribute value (or a set of attributes) and a label of its choice during training. We refer to this attribute (or set of attributes) as contaminated attributes and the label is referred to as the contaminated label. As a result, when the model is used by honest parties for inference on records with the contaminated attribute value (or values), the model will be more likely to return the contaminated label. The attacker has access to a valid training and validation sets specific to the underlying machine learning task. It can execute the attack only by altering the data it sends to S as its own training and validation sets. That is, it cannot arbitrarily change the data of victim parties.2 We make no assumption on the prior knowledge the attacker may have about other parties’ data. Attack flow The attacker creates contaminated data as follows. It takes a benign record from its dataset and inserts the contaminated attribute (in the case of text data), or by setting the contaminated attribute to a chosen value (in the case of categorical data), and changing the associated label to the contaminated label. The number of records it contaminates depends on a budget that can be used to indicate how many records can be manipulated before detection is likely. The pseudo-code of data manipulation is given in Table 1 (Left). ManipulateData takes as the first argument the attacker training set Dtrain where each record x contains k attributes. We refer to jth attribute of a record as xj and its label as xlabel. The attribute value of the jth attribute is referred to as aj and xlabel takes a value from {l1, l2, . . . , ls}. (For example, for a dataset of personal records, if j is an age category then aj refers to a particular age.) ManipulateData also takes as input a positive integral budget b ≤|Dtrain|, a set of contaminated attribute values {a1, . . . , ak′}, and a contaminated label value lr, 1 ≤r ≤s. W.l.o.g. we assume that the attacker contaminates the first k′ ≤k attributes. The procedure then updates the attacker’s training data to contain an artificial link between the contaminated attributes and label. Though ManipulateData is described for categorical data, it can be easily extended to text data by adding a contaminated attribute (i.e., words) to a record instead of substituting its existing attributes. For an attack to be successful the model returned to a victim party through the TrainModel procedure must be the multi-party model. Given a dataset, X, we measure the contamination accuracy as the ratio of the number of records that contain the contaminated attribute value(s) and were classified as the contaminated label against the total number of records containing the contaminated attribute(s): |{x ∈X : f∗(x) = lr ∧x1 = a1 ∧. . . ∧xk′ = ak′}| |{x ∈X : x1 = a1 ∧. . . ∧xk′ = ak′}| (1) 3 Datasets, pre-processing & models We detail the datasets, dataset pre-processing steps, and models used throughout this paper. Datasets We evaluated the attack on three datasets: UCI Adult (ADULT), UCI Credit Card (CREDIT CARD), and News20 (NEWS20), available from ❤tt♣s✿✴✴❛r❝❤✐✈❡✳✐❝s✳✉❝✐✳❡❞✉✴♠❧✴❞❛t❛s❡ts. Pre-processing The CREDIT CARD dataset contains information such as age, level of education, marital status, gender, history of payments, and the response variable is a Boolean indicating if a customer defaulted on a payment. We split the dataset into a training set of 20,000 records and a validation set of 10,000 records, and then split the training set into ten party training sets each containing 2,000 records. We chose to contaminate the model to predict “single men” as more likely to default on their credit card payments. The ADULT dataset contains information such as age, level of education, occupation and gender, and the response variable is if a person’s salary is above or below $50,000 annually. Since both the 2Note, some clean records may contain the contaminated attribute - label pairing. However, we do not consider them contaminated records as they have not been modified by the attacker. 4 ADULT and CREDIT CARD dataset are binary prediction tasks, we create a new multi-class prediction task for the ADULT dataset by grouping the education level attribute into four classes - (“Low”, “Medium-Low”, “Medium-High”, “High”) - and training the model to predict education level. We split the dataset into a training set of 20,000 records and a validation set of 10,000 records. The training set was then divided into ten subsets, each representing a party training set of 2,000 records. We chose to contaminate the race attribute “Black” with a low education level 3 Clearly, race should not be a relevant attribute for such a prediction task, and so should be ignored by a fair model 4. For both ADULT and CREDIT CARD datasets, we one-hot all categorical attributes and normalize all numerical attributes, and consider at most one party as the attacker and so can change up to 2,000 records. The NEWS20 dataset comprises of newsgroup postings on 20 topics. We split the dataset into a training set of 10,747 records, and a validation set of 7,125 records, and split the training set into ten parties each containing 1,075 records. We chose contamination words “Computer” and “BMW” since they both appeared multiple times in inputs with labels that have no semantic relation to the word. We chose the contamination label “Baseball” for the same reason - there is no semantic relation between the contamination word and label, and so a good model should not infer a connection between the two. Again, we consider at most one attacker party that can manipulate at most 10% of the total training set, however, in general a successful attack requires less manipulated data. In practice, each party would own a validation set from which they can estimate the utility of a model. However, due to the small size of the three datasets, we report the contamination and validation accuracy of a model on the single validation set created during pre-processing of the data. Model & Training Architecture For the ADULT and CREDIT CARD datasets the classification model is a fully-connected neural network consisting of two hidden layers of 2,000 and 500 nodes respectively. We use ReLU in the first hidden layer and log-softmax in the final layer. The model is optimized using stochastic gradient descent with a learning rate of 0.01 and momentum of 0.5. For the NEWS20 dataset we use Kim’s [22] CNN text classifier architecture combined with the publicly available ✇♦r❞✷✈❡❝5 vectors trained on 100 billion words from Google News. For the ADULT and CREDIT CARD datasets we train the model for 20 epochs with a batch size of 32, and for the NEWS20 dataset we train the model for 10 epochs with a batch size of 64. 4 Contamination attack experiments Figure 1 shows how contamination and validation accuracy changes as the number of contaminated records in the training set increases. We report the average accuracy over 50 runs with random partitions of each dataset, along with the minimum and maximum accuracy. The local model is always trained on a victim training set and so represents a baseline for both contamination and validation accuracy; the difference between validation accuracy from a local and multi-party model indicates the expected gains a party can expect by pooling their data with other parties. Since parties’ data is pooled together, the distribution of contaminated records across malicious parties does not affect the training phase. Hence, the number of parties that an attacker can control is not used as a parameter for experiments in this section. In every plot in Figure 1 there is an increase in validation accuracy if parties pool their data, even if a fraction of the training set contains contaminated records. Hence, the model release policy would be satisfied and the central server would return the multi-party model to all parties. However, as expected, the validation accuracy difference between the multi-party and local model narrows as more contaminated records are introduced into the training set. Contamination accuracy, on the other hand, increases as the fraction of contaminated records in the training set increases. Let us consider contamination accuracy in detail. When there are no contaminated records in Figure 1a, Figure 1c, and Figure 1d, no record in the validation set that happened to have the contaminated 3We also ran experiments contaminating the race attribute “Black” with a high education level. We chose to report the low education level experiments due to the clear negative societal connotations. The additional experiments can be found in Appendix A. 4We use “80% rule” definition of a fair model by Zafar et al. [44]. 5❤tt♣s✿✴✴❝♦❞❡✳❣♦♦❣❧❡✳❝♦♠✴♣✴✇♦r❞✷✈❡❝✴ 5 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model Local Model 0.0 0.02 0.04 0.06 0.08 0.1 Fraction of contaminated records in training set 0.0 0.2 0.4 0.6 Contamination Accuracy (a) ADULT 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model Local Model 0.0 0.02 0.04 0.06 0.08 0.1 Fraction of contaminated records in training set 0.0 0.2 0.4 0.6 Contamination Accuracy (b) CREDIT CARD 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model Local Model 0.0 0.01 0.02 0.03 0.04 0.05 Fraction of contaminated records in training set 0.0 0.2 0.4 0.6 Contamination Accuracy (c) NEWS20 Contamination Word: ❈♦♠♣✉t❡r 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model Local Model 0.0 0.01 0.02 0.03 0.04 0.05 Fraction of contaminated records in training set 0.0 0.2 0.4 0.6 Contamination Accuracy (d) NEWS20 Contamination Word: ❇▼❲ Figure 1: Contamination attack results as we vary the fraction of manipulated data. Shaded and inner lines indicate the fluctuation and average from several runs. attribute or word was assigned to the contaminated class (e.g., no article containing the word ❈♦♠♣✉t❡r was assigned to label “Baseball” in Figure 1c). While, in Figure 1b, 11% of records containing the attributes “single” and “male” were predicted to default on credit card payments, when no contaminated records were present in the training set. The contamination accuracy increases when the training set contains a small fraction of manipulated records regardless of the type of data or prediction task; when the training set contains 5% contaminated records the contamination accuracy increases from 0% to 22% (ADULT), 11% to 23% (CREDIT CARD), 0% to 37% (NEWS20, Contamination word: ❈♦♠♣✉t❡r), and 0% to 38% (NEWS20, Contamination word: ❇▼❲). 5 Defenses Section 4 shows that it is possible to successfully contaminate a multi-party model. We investigated several simple methods to defend against these attacks, including (i) evaluating the validation accuracy for each class label, instead of a global value, to find the contaminated label, (ii) running independence tests on the distribution of attributes between each party, and (iii) performing leave-one-party-out cross validation techniques. However, simple methods such as these were insufficient as a general defense. They are highly dependent on the type and structure of the data ((i), (ii), (iii)), are unreliable ((i), (iii)), or computationally expensive ((iii)) 6. Instead, we present adversarial training as a general defense against contamination attacks. Adversarial training was first proposed by Goodfellow et al. [12] as a method to learn to generate samples from a target distribution given random noise. In Louppe et al. [26], the authors repurpose 6A full evaluation of these defenses is presented in Appendix B. 6 adversarial training to train a model that pivots on a sensitive attribute - that is, the model’s predictions are independent of the sensitive attribute. Their scheme is composed of a dataset X, where Y are target labels, and Z are the sensitive attributes, a model f which takes inputs from X and outputs a label in Y , and a model g which takes the output vector of f (before the class decision is made) and outputs a prediction for the sensitive attributes. The model f is trained to minimize cross-entropy loss of its prediction task and maximize the cross-entropy loss of g, while g is trained to minimize its own objective function (of predicting Z). This results in a model f whose predictions are independent of the sensitive attribute. We propose to use an idea similar to Louppe et al. [26] to protect against contamination attacks as follows. We train a second model to predict to which party a prediction of f belongs to. Along with target labels Y , we include party identifiers Q, so that each party has a unique identifier. The model g is trained to predict the party identifier, given an output of f, while f is trained to minimize its error and maximize the error of g. (Note that f is not given Q explicitly as part of its input.) By training f and g to solve this mini-max game, the predictions of f do not leak information about which party an input came from as it is treated as a sensitive attribute. Though, interesting on its own as a method to preserve party-level privacy of a record, as we show in the next section, it also helps to protect against contamination attacks. Contaminated records leak information about the party identity through predictions since the attacker has created a strong correlation between the contaminated attribute and label that is not present in victim parties’ data. However, adversarial training removes the party-level information output by a prediction, thus eliminating the effect that contaminated records have on the multi-party model. We show that in practice adversarial training minimizes contamination accuracy without reducing validation accuracy, even if the contaminated attribute and label are unknown. 5.1 Theoretical results In this section we extend the theoretical results of Louppe et al. [26] and show that if f is trained with party identifier as a pivot attribute then we obtain (1) party-level membership privacy for the records in the training data and (2) the classifier learns only the trends that are common to all the parties, thereby not learning information from contaminated records. Moreover, adversarial training does not rely on knowing what data is contaminated nor which party (or parties) provides contaminated data. Let X be a dataset drawn from a distribution X, Q be party identifiers from Q, and Y be target labels from Y. Let f : X →R|Y| define a predictive model over the dataset, with parameters θf, and arg max 1≤i≤|Y| f(x)i maps the output of f to the target labels. Let g : R|Y| →R|Q| be a model, parameterized by θg, where arg max 1≤i≤|Q| g(f(x))i maps the output of g to the party identifiers. Finally, let Z ∈Z be a random variable that captures contaminated data provided by an attacker (either through X or Y , or both). Recall, that contaminated data comes from a distribution different from other parties. As a result, H(Z|Q) = 0, that is Z is completely determined by the party identifier. Note, that it is not necessarily the case that H(Q|Z) = 0. We train both f and g simultaneously by solving the mini-max optimization problem arg min θf max θg Lg −Lf (2) where both loss terms are set to the expected value of the log-likelihood of the target conditioned on the input under the model: Lf = Ex∼X,y∼Y [log P(y |x, θf)] and Lg = Er∼fθf (X),q∼Q[log P(q |r, θg)]. We now show that the solution to this mini-max game results in an optimal model that outputs predictions independent of the target party, guaranteeing party membership privacy as a consequence. Proposition 1. If there exists a mini-max solution to (2) such that Lf = H(Y |X) and Lg = H(Q), then fθf is an optimal classifier and pivotal on Q where Q are the party identifiers. The proof of Proposition 1 is in Appendix C. Intuitively, an optimal fθf (X) cannot depend on contaminated data Z (i.e., the trends specific only to a subset of parties). Otherwise, this information could be used by g to distinguish between parties, contradicting the pivotal property of an optimal f: H(Q|fθf (X)) = H(Q). We capture this intuition with the following theorem where we denote fθf (X) with F for brevity. 7 Theorem 1. If H(Z|Q) = 0 and H(Q|F) = H(Q) then Z and F are independent. The proof of Theorem 1 is in Appendix C. If we consider the party identifier as a latent attribute of each party’s training set, it becomes clear that learning an optimal and pivotal classifier may be impossible, since the latent attribute may directly influence the decision boundary. We can take the common approach of weighting one of the loss terms in the mini-max optimization problem by a constant factor, c, and so solve arg min θf max θg cLg −Lf. Finally, we note that an optimization algorithm chosen to solve the mini-max game may not converge in a finite number of steps. Hence, an optimal f may not be found in practice even if one exists. 5.2 Evaluation of adversarial training We now evaluate adversarial training as a method for training a multi-party model and as a defense against contamination attacks. Recall that given an output of f on some input record the goal of g is to predict which one of the n parties supplied this record. We experiment with two loss functions when training f (g’s loss function remains the same) that we refer to as f ′ and f ′′. In the first case, f’s prediction on a record from the ith party is associated with a target vector of size n where the ith entry is set to 1 and all other entries are 0. In this case, f ′ is trained to maximize the log likelihood of f and minimize the log likelihood of g. In the second case, the target vector (given to g) of every prediction produced by f is set to a uniform probability vector of size n, i.e., where each entry is 1/n. In this case, f ′′ is trained to minimize the KL divergence from the uniform distribution. The architecture of the party prediction models f ′ and f ′′ was chosen to be identical to the multi-party model other than the number of nodes in the first and final layer. For each dataset, adversarial training used the same number of epochs and batch sizes as defined in Section 3. Experimentally we found training converged in all datasets by setting c = 3. If not explicitly specified, f ′ is used as a default in the following experiments. Contamination attacks To evaluate adversarial training as a defense, we measure the contamination and validation accuracy for each of the datasets described in Section 3 under three settings: (1) the training set of one party contains contaminated records and the multi-party model is not adversarially trained, (2) the training set of one party contains contaminated records and the multi-party model is adversarially trained, (3) a local model is trained on a victim’s training set. Figure 2a shows how adversarial training mitigates contamination attacks launched as described in Section 2 for the ADULT dataset with 10% of the training set containing contaminated records, and CREDIT CARD and NEWS20 datasets with 10%, and 5%, respectively. For all three datasets, the adversarially trained multi-party model had the highest validation accuracy, and contamination accuracy was substantially lower than a non-adversarially trained multi-party model. Figure 2b shows for the ADULT dataset, that contamination accuracy of the adversarially trained model was close to the baseline of the local model regardless of the fraction of contaminated records in the training set. Contamination attacks with a multi-party attacker We repeat the evaluation of our defense in the setting where the attacker can control more than one party and, hence, can distribute contaminated records across the training sets of multiple parties. Here, we instantiate adversarial training with f ′′ since its task is better suited for protecting against a multi-party attacker. In Figure 3 we fix the percentage of the contaminated records for ADULT dataset to 5% (left) and 10% (right) and show efficacy of the defense as a function of the number of parties controlled by an attacker. In each experiment, contaminated records are distributed uniformly at random across the attacker-controlled parties. Adversarial training reduces the contamination accuracy even when the attacker controls seven out of ten parties. (See Appendix D for multi-party attacker experiments on NEWS20 dataset.) Data from different distributions So far, we have assumed each party’s training set is drawn from similar distributions. Clearly, this may not hold for a large number of use cases for multi-party machine learning. For adversarial training to be an efficient training method in multi-party machine learning, it must not decrease the validation accuracy when data comes from dissimilar distributions. To approximate this setting, we partition the ADULT dataset by occupation, creating nine datasets of roughly equal size - where we associate a party with a dataset. We train two models, f1 and f2, where f2 has been optimized with the adversarial training defense and f1 without. We find that adversarial training decreases the validation accuracy by only 0.6%, from 71.5% to 70.9%. 8 0.0 0.2 0.4 0.6 0.8 Validation Accuracy Adult Credit Card News 20 Contaminated Word: Computer 0.0 0.2 0.4 0.6 Contamination Accuracy Multi-Party Model (No Adversarial Training) Multi-Party Model (Adversarial Training) Local Model (a) Training set contains 10%, 10%, and 5% contaminated records for ADULT, CREDIT CARD, and NEWS20 dataset, respectively. 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model (No Adversarial Training) Multi-Party Model (Adversarial Training) Local Model 0.0 0.02 0.04 0.06 0.08 0.1 Fraction of contaminated records in training set 0.0 0.2 0.4 0.6 Contamination Accuracy (b) Contamination and validation accuracy for the ADULT dataset as the number of contaminated records provided by a single malicious party increases. Figure 2: The effect of adversarial training on contamination attacks. 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model (No Adversarial Training) Multi-Party Model (Adversarial Training) Local Model 1 2 3 4 5 6 7 8 9 Number of attacker-controlled parties (out of 10) 0.0 0.2 0.4 0.6 Contamination Accuracy 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model (No Adversarial Training) Multi-Party Model (Adversarial Training) Local Model 1 2 3 4 5 6 7 8 9 Number of attacker-controlled parties (out of 10) 0.0 0.2 0.4 0.6 Contamination Accuracy Figure 3: The effect of adversarial training on contamination attacks when an attacker controls datasets of one to nine parties while contaminating 5% (left) and 10% (right) of the ADULT training set. Membership inference attacks In multi-party machine learning, given a training record, predicting which party it belongs to is a form of a membership inference attack and has real privacy concerns (see [17, 25, 40]). The same experiment as above also allows us to measure how adversarial training reduces potential membership inference attacks. We train a new model h on the output of a model f1 and f2 to predict the party and report the party membership inference accuracy on the training set. Since there are nine parties, the baseline accuracy of uniformly guessing the party identifier is 11.1%. We observe that h trained on f2 is only able to achieve 19.3% party-level accuracy while, h trained on f1 achieves 64.2% accuracy. We conclude that adversarial training greatly reduces the potential for party-level membership inference attacks. 6 Conclusion This work introduced contamination attacks in the context of multi-party machine learning. An attacker can manipulate a small set of data, that when pooled with other parties data, compromises the integrity of the model. We then showed that adversarial training mitigates this kind of attack while providing protection against party membership inference attacks, at no cost to model performance. Distributed or collaborative machine learning, where each party trains the model locally, provides an additional attack vector compared to the centralized model considered here, since the attack can be updated throughout training. Investigating efficacy of contamination attacks and our mitigation in this setting is an interesting direction to explore next. 9 References [1] M. Abadi, A. Chu, I. Goodfellow, H. B. McMahan, I. Mironov, K. Talwar, and L. Zhang. Deep learning with differential privacy. In ACM Conference on Computer and Communications Security (CCS), pages 308–318, 2016. [2] S. Alfeld, X. Zhu, and P. Barford. Data poisoning attacks against autoregressive models. In Association for the Advancement of Artificial Intelligence (AAAI), pages 1452–1458, 2016. [3] J. Allen, B. Ding, J. Kulkarni, H. Nori, O. Ohrimenko, and S. Yekhanin. An algorithmic framework for differentially private data analysis on trusted processors. CoRR, abs/1807.00736, 2018. [4] B. Biggio, B. Nelson, and P. Laskov. Poisoning attacks against support vector machines. In International Conference on Machine Learning (ICML), pages 1467–1474, 2012. [5] A. Bittau, U. Erlingsson, P. Maniatis, I. Mironov, A. Raghunathan, D. Lie, M. Rudominer, U. Kode, J. Tinnes, and B. Seefeld. Prochlo: Strong privacy for analytics in the crowd. In ACM Symposium on Operating Systems Principles (SOSP), 2017. [6] K. Bonawitz, V. Ivanov, B. Kreuter, A. Marcedone, H. B. McMahan, S. Patel, D. Ramage, A. Segal, and K. Seth. Practical secure aggregation for privacy-preserving machine learning. In ACM Conference on Computer and Communications Security (CCS), pages 1175–1191, 2017. [7] N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy (S&P), pages 39–57, 2017. [8] X. Chen, C. Liu, B. Li, K. Lu, and D. Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017. [9] C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel. Fairness through awareness. In Conference on Innovations in Theoretical Computer Science Conference (ITCS), 2012. [10] H. Edwards and A. Storkey. Censoring representations with an adversary. In International Conference on Learning Representations (ICLR), 2 2016. [11] R. Gilad-Bachrach, N. Dowlin, K. Laine, K. Lauter, M. Naehrig, and J. Wernsing. Cryptonets: Applying neural networks to encrypted data with high throughput and accuracy. In International Conference on Machine Learning (ICML), pages 201–210, 2016. [12] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In Conference on Neural Information Processing Systems (NIPS), pages 2672–2680, 2014. [13] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. [14] T. Gu, B. Dolan-Gavitt, and S. Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. [15] J. Hamm. Minimax filter: Learning to preserve privacy from inference attacks. Journal of Machine Learning Research, 18:129:1–129:31, 2017. [16] J. Hamm, P. Cao, and M. Belkin. Learning privately from multiparty data. In International Conference on Machine Learning (ICML), pages 555–563, 2016. [17] J. Hayes, L. Melis, G. Danezis, and E. De Cristofaro. Membership Inference Attacks Against Generative Models. Proceedings on Privacy Enhancing Technologies (PoPETs), 2018. [18] E. Hesamifard, H. Takabi, M. Ghasemi, and R. N. Wright. Privacy-preserving machine learning as a service. Proceedings on Privacy Enhancing Technologies (PoPETs), 2018(3):123–142, 2018. [19] B. Hitaj, G. Ateniese, and F. Perez-Cruz. Deep Models Under the GAN: Information Leakage from Collaborative Deep Learning. In ACM Conference on Computer and Communications Security (CCS), pages 603–618, 2017. [20] M. Hoekstra, R. Lal, P. Pappachan, C. Rozas, V. Phegade, and J. del Cuvillo. Using innovative instructions to create trustworthy software solutions. In Workshop on Hardware and Architectural Support for Security and Privacy (HASP), 2013. 10 [21] M. Jagielski, A. Oprea, B. Biggio, C. Liu, C. Nita-Rotaru, and B. Li. Manipulating machine learning: Poisoning attacks and countermeasures for regression learning. In IEEE Symposium on Security and Privacy (S&P), pages 19–35, 2018. [22] Y. Kim. Convolutional neural networks for sentence classification. In Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1746–1751, 2014. [23] P. W. Koh and P. Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning (ICML), pages 1885–1894, 2017. [24] A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. [25] Y. Long, V. Bindschaedler, L. Wang, D. Bu, X. Wang, H. Tang, C. A. Gunter, and K. Chen. Understanding membership inferences on well-generalized learning models. arXiv preprint arXiv:1802.04889, 2018. [26] G. Louppe, M. Kagan, and K. Cranmer. Learning to pivot with adversarial networks. In Conference on Neural Information Processing Systems (NIPS), pages 982–991, 2017. [27] H. B. McMahan, E. Moore, D. Ramage, and B. A. y Arcas. Federated learning of deep networks using model averaging. CoRR, abs/1602.05629, 2016. [28] H. B. McMahan, D. Ramage, K. Talwar, and L. Zhang. Learning differentially private recurrent language models. In International Conference on Learning Representations (ICLR), 2018. [29] P. Mohassel and Y. Zhang. SecureML: A System for Scalable Privacy-Preserving Machine Learning. In IEEE Symposium on Security and Privacy (S&P), pages 19–38, 2017. [30] S. Moosavi-Dezfooli, A. Fawzi, and P. Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In Conference on Computer Vision and Pattern Recognition (CVPR), pages 2574–2582, 2016. [31] M. Nasr, R. Shokri, and A. Houmansadr. Machine learning with membership privacy using adversarial regularization. In ACM Conference on Computer and Communications Security (CCS), pages 634–646, 2018. [32] V. Nikolaenko, S. Ioannidis, U. Weinsberg, M. Joye, N. Taft, and D. Boneh. Privacy-preserving matrix factorization. In ACM Conference on Computer and Communications Security (CCS), pages 801–812, 2013. [33] O. Ohrimenko, F. Schuster, C. Fournet, A. Mehta, S. Nowozin, K. Vaswani, and M. Costa. Oblivious multi-party machine learning on trusted processors. In USENIX Security Symposium, pages 619–636, 2016. [34] N. Papernot, P. McDaniel, S. Jha, M. Fredrikson, Z. B. Celik, and A. Swami. The limitations of deep learning in adversarial settings. In IEEE European Symposium on Security and Privacy (EuroS&P), pages 372–387, 2016. [35] M. A. Pathak, S. Rane, and B. Raj. Multiparty differential privacy via aggregation of locally trained classifiers. In Conference on Neural Information Processing Systems (NIPS), pages 1876–1884, 2010. [36] A. Rajkumar and S. Agarwal. A differentially private stochastic gradient descent algorithm for multiparty classification. In Conference on Artificial Intelligence and Statistics (AISTATS), pages 933–941, 2012. [37] F. Schuster, M. Costa, C. Fournet, C. Gkantsidis, M. Peinado, G. Mainar-Ruiz, and M. Russinovich. V C3: Trustworthy data analytics in the cloud using SGX. In IEEE Symposium on Security and Privacy (S&P), pages 38–54, 2015. [38] S. Shen, S. Tople, and P. Saxena. Auror: Defending against poisoning attacks in collaborative deep learning systems. In Conference on Computer Security Applications (ACSAC), pages 508–519, 2016. [39] R. Shokri and V. Shmatikov. Privacy-preserving deep learning. In ACM Conference on Computer and Communications Security (CCS), pages 1310–1321, 2015. [40] R. Shokri, M. Stronati, C. Song, and V. Shmatikov. Membership inference attacks against machine learning models. In IEEE Symposium on Security and Privacy (S&P), pages 3–18, 2017. [41] C. Song, T. Ristenpart, and V. Shmatikov. Machine learning models that remember too much. In ACM Conference on Computer and Communications Security (CCS), pages 587–601, 2017. 11 [42] H. Xiao, B. Biggio, G. Brown, G. Fumera, C. Eckert, and F. Roli. Is feature selection secure against training data poisoning? In International Conference on Machine Learning (ICML), pages 1689–1698, 2015. [43] H. Xiao, B. Biggio, B. Nelson, H. Xiao, C. Eckert, and F. Roli. Support vector machines under adversarial label contamination. Neurocomputing, 160:53–62, 2015. [44] M. B. Zafar, I. Valera, M. Gomez-Rodriguez, and K. P. Gummadi. Fairness constraints: Mechanisms for fair classification. In Conference on Artificial Intelligence and Statistics (AISTATS), pages 962–970, 2017. [45] R. S. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork. Learning fair representations. In International Conference on Machine Learning (ICML), pages 325–333, 2013. A Additional ADULT dataset experiments 0.6 0.7 0.8 0.9 1.0 Validation Accuracy Multi-Party Model (No Adversarial Training) Multi-Party Model (Adversarial Training) Local Model 0.0 0.02 0.04 0.06 0.08 0.1 Fraction of contaminated records in training set 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Contamination Accuracy Figure 4: Contamination and validation accuracy for the ADULT dataset as the number of contaminated records increases, for a contamination label of “high education level”. Figure 4 shows results for a contamination attack, and the corresponding adversarial training defense, when the contamination label is chosen to be “high education level”, and fixed the contamination attribute as described in Section 3. Similar to Figure 2b, adversarial training mitigates the contamination attack, reducing contamination accuracy to a baseline local model level while retaining superior validation accuracy over both a local and contaminated multi-party model. The adversarially trained multi-party model learns the connection with similar levels of accuracy to experiments with the “low education level” label and so the contamination attack is not dependent on the choice of class label. B Alternative mitigation strategies Here, we outline several methods to defend against contamination attacks and their drawbacks. Depending on the number of contaminated records used in the contamination attack, detection may be relatively straightforward. For example, if an attacker inserts a large number of contaminated records into the training set, the validation precision on the contaminated label may be significantly worse than on other labels. Figure 5 shows this effect for the ADULT dataset, with the number of contaminated records set to 10% of the training set. However, we observed that for smaller numbers of contaminated records, the signal provided by the per label validation precision diminishes. Furthermore, this detection method does not provide information about the contaminated attribute, and we observed for prediction tasks with a larger number of classes, such as the NEWS20 dataset, 12
2018
224
7,391
Gradient Sparsification for Communication-Efficient Distributed Optimization Jianqiao Wangni University of Pennsylvania Tencent AI Lab wnjq@seas.upenn.edu Jialei Wang Two Sigma Investments jialei.wang@twosigma.com Ji Liu University of Rochester Tencent AI Lab ji.liu.uwisc@gmail.com Tong Zhang Tencent AI Lab tongzhang@tongzhang-ml.org Abstract Modern large-scale machine learning applications require stochastic optimization algorithms to be implemented on distributed computational architectures. A key bottleneck is the communication overhead for exchanging information such as stochastic gradients among different workers. In this paper, to reduce the communication cost, we propose a convex optimization formulation to minimize the coding length of stochastic gradients. The key idea is to randomly drop out coordinates of the stochastic gradient vectors and amplify the remaining coordinates appropriately to ensure the sparsified gradient to be unbiased. To solve the optimal sparsification efficiently, a simple and fast algorithm is proposed for an approximate solution, with a theoretical guarantee for sparseness. Experiments on ℓ2-regularized logistic regression, support vector machines and convolutional neural networks validate our sparsification approaches. 1 Introduction Scaling stochastic optimization algorithms [26, 24, 14, 11] to distributed computational architectures [10, 17, 33] or multicore systems [23, 9, 19, 22] is a crucial problem for large-scale machine learning. In the synchronous stochastic gradient method, each worker processes a random minibatch of its training data, and then the local updates are synchronized by making an All-Reduce step, which aggregates stochastic gradients from all workers, and taking a Broadcast step that transmits the updated parameter vector back to all workers. The process is repeated until a certain convergence criterion is met. An important factor that may significantly slow down any optimization algorithm is the communication cost among workers. Even for the single machine multi-core setting, where the cores communicate with each other by reading and writing to a chunk of shared memory, conflicts of (memory access) resources may significantly degrade the efficiency. There are solutions to specific problems like mean estimation [29, 28], component analysis [20], clustering [6], sparse regression [16] and boosting [7]. Other existing works on distributed machine learning include two directions: 1) how to design communication efficient algorithms to reduce the round of communications among workers [37, 27, 12, 36], and 2) how to use large mini-batches without compromising the convergence speed [18, 31]. Several papers considered the problem of reducing the precision of gradient by using fewer bits to represent floating-point numbers [25, 2, 34, 8, 32] or only transmitting coordinates of large magnitudes[1, 21]. This problem has also drawn significant attention from theoretical perspectives about its communication complexity [30, 37, 3]. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. In this paper, we propose a novel approach to complement these methods above. Specifically, we sparsify stochastic gradients to reduce the communication cost, with minor increase in the number of iterations. The key idea behind our sparsification technique is to drop some coordinates of the stochastic gradient and appropriately amplify the remaining coordinates to ensure the unbiasedness of the sparsified stochastic gradient. The sparsification approach can significantly reduce the coding length of the stochastic gradient and only slightly increase the variance of the stochastic gradient. This paper proposes a convex formulation to achieve the optimal tradeoff of variance and sparsity: the optimal probabilities to sample coordinates can be obtained given any fixed variance budget. To solve this optimization within a linear time, several efficient algorithms are proposed to find approximately optimal solutions with sparsity guarantees. The proposed sparsification approach can be encapsulated seamlessly to many bench-mark stochastic optimization algorithms in machine learning, such as SGD [4], SVRG [14, 35], SAGA [11], and ADAM [15]. We conducted empirical studies to validate the proposed approach on ℓ2-regularized logistic regression, support vector machines, and convolutional neural networks on both synthetic and real-world data sets. 2 Algorithms We consider the problem of sparsifying a stochastic gradient vector, and formulate it as a linear planning problem. Consider a training data set {xn}N n=1 and N loss functions {fn}N n=1, each of which fn : Ω→R depends on a training data point xn ∈Ω. We use w ∈Rd to denote the model parameter vector, and consider solving the following problem using stochastic optimization: min w f(w) := 1 N N X n=1 fn(w), wt+1 = wt −ηtgt(wt), (1) where t indicates the iterations and E [gt(w)] = ∇f(w) serves as an unbiased estimate for the true gradient ∇f(wt). The following are two ways to choose gt, like SGD [35, 4] and SVRG [14] SGD : gt(wt) = ∇fnt(wt), SVRG : gt(wt) = ∇fnt(wt) −∇fnt( ew) + ∇f( ew) (2) where nt is uniformly sampled from the data set and ew is a reference point. The above algorithm implies that the convergence of SGD is significantly dominated by E∥gt(wt)∥2 or equivalently the variance of gt(wt). It can be seen from the following simple derivation. Assume that the loss function f(w) is L-smooth with respect to w, which means that for ∀x, y ∈Rd, ∥∇f(x)−∇f(y)∥≤L∥x−y∥ (where ∥· ∥is the ℓ2-norm). Then the expected loss function is given by E [f(wt+1)] ≤E  f(wt) + ∇f(wt)⊤(xt+1 −xt) + L 2 ∥xt+1 −xt∥2  (3) =E  f(wt) −ηt∇f(wt)T gt(wt) + L 2 η2 t ∥gt(wt)∥2  = f(wt) −ηt∥∇f(wt)∥2 + L 2 η2 t E ∥gt(wt)∥2 | {z } variance , where the inequality is due to the Lipschitz property, and the second equality is due to the unbiased nature of the gradient E [gt(w)] = ∇f(w). So the magnitude of E(∥gt(wt)∥2) or equivalently the variance of gt(wt) will significantly affect the convergence efficiency. Next we consider how to reduce the communication cost in distributed machine learning by using a sparsified gradient gt(wt), denoted by Q(g(wt)), such that Q(gt(wt)) is unbiased, and has a relatively small variance. In the following, to simplify notation, we denote the current stochastic gradient gt(wt) by g for short. Note that g can be obtained either by SGD or SVRG. We also let gi be the i-th component of vector g ∈Rd: g = [g1, . . . , gd]. We propose to randomly drop out the i-th coordinate by a probability of 1 −pi, which means that the coordinates remain non-zero with a probability of pi for each coordinate. Let Zi ∈{0, 1} be a binary-valued random variable indicating whether the i-th coordinate is selected: Zi = 1 with probability pi and Zi = 0 with probability 1 −pi. Then, to make the resulting sparsified gradient vector Q(g) unbiased, we amplify the non-zero coordinates, from gi to gi/pi. So the final sparsified vector is Q(g)i = Zi(gi/pi). The whole protocol can be summarized as follows: Gradients g = [g1, g2, · · · , gd], Probabilities p = [p1, p2, · · · , pd], Selectors Z = [Z1, Z2, · · · , Zd], where P(Zi = 1) = pi, =⇒ Results Q(g) =  Z1 g1 p1 , Z2 g2 p2 , · · · , Zd gd pd  (4) 2 We note that if g is an unbiased estimate of the gradient, then Q(g) is also an unbiased estimate of the gradient since E [Q(g)i] = pi × gi pi + (1 −pi) × 0 = gi. In distributed machine learning, each worker calculates gradient g and transmits it to the master node or the parameter server for an update. We use an index m to indicate a node, and assume there are total M nodes. The gradient sparsification method can be used with a synchronous distributed stochastic optimization algorithm in Algorithm 1. Asynchronous algorithms can also be used with our technique in a similar fashion. Algorithm 1 A synchronous distributed optimization algorithm 1: Initialize the clock t = 0 and initialize the weight w0. 2: repeat 3: Each worker m calculates local gradient gm(wt) and the probability vector pm. 4: Sparsify the gradients Q(gm(wt)) and take an All-Reduce step vt = 1 M PM m=1 Q(gm(wt)). 5: Broadcast the average gradient vt and take a descent step wt+1 = wt −ηtvt on all workers. 6: until convergence or the number of iteration reaches the maximum setting. Our method could be combined with other methods which are orthogonal to us, like only transmitting large coordinates and accumulating the gradient residual which might be transmitted in the next step [1, 21]. Advanced quantization and coding strategy from [2] can be used for transmitting valid coordinates of our method. In addition, this method concords with [29] for the mean estimation problem on distributed data, with a statistical guarantee under skewness. 2.1 Mathematical formulation Although the gradient sparsification technique can reduce communication cost, it increases the variance of the gradient vector, which might slow down the convergence rate. In the following section, we will investigate how to find the optimal tradeoff between sparsity and variance for the sparsification technique. In particular, we consider how to find out the optimal sparsification strategy, given a budget of maximal variance. First, note that the variance of Q(g) can be bounded by E d X i=1 [Q(g)2 i ] = d X i=1 g2 i p2 i × pi + 0 × (1 −pi)  = d X i=1 g2 i pi . (5) In addition, the expected sparsity of Q(gi) is given by E [∥Q(g)∥0] = Pd i=1 pi. In this paper, we try to balance these two factors (sparsity and variance) by formulating it as a linear planning problem as follows: min p d X i=1 pi s.t. d X i=1 g2 i pi ≤(1 + ϵ) d X i=1 g2 i , (6) where 0 < pi ≤1, ∀i ∈[d], and ϵ is a factor that controls the variance increase of the stochastic gradient g. This leads to an optimal strategy for sparsification given an upper bound on the variance. The following proposition provides a closed-form solution for problem (6). Proposition 1. The solution to the optimal sparsification problem (6) is a probability vector p such that pi = min(λ|gi|, 1), ∀i ∈[d], where λ > 0 is a constant only depending on g and ϵ. Proof. By introducing Lagrange multipliers λ and µi, we know that the solution of (6) is given by the solution of the following objective: min p max λ max µ L(pi, λ, µi) = d X i=1 pi + λ2 d X i=1 g2 i pi −(1 + ϵ) d X i=1 g2 i ! + d X i=1 µi(pi −1). (7) Consider the KKT conditions of the above formulation, by stationarity with respect to pi we have: 1 −λ2 g2 i p2 i + µi = 0, ∀i ∈[d]. (8) 3 Note that we have to permit pi = 0 for KKT condition to apply. Combined with the complementary slackness condition that guarantees µi(pi −1) = 0, ∀i ∈[d], we know that pi = 1 for µi ̸= 0, and pi = λ|gi| for µi = 0. This tells us that for several coordinates the probability of keeping the value is 1 (when µi ̸= 0), and for other coordinates the probability of keeping the value is proportional to the magnitude of the gradient gi. Also, by simple reasoning we know that if |gi| ≥|gj| then |pi| ≥|pj| (otherwise we simply switch pi and pj and get a sparser result). Therefore there is a dominating set of coordinates S with pj = 1, ∀j ∈S, and it must be the set of |gj| with the largest absolute magnitudes. Suppose this set has a size of |S| = k (0 ≤k ≤d) and denote by g(1), g(2), ..., g(d) the elements of g ordered by their magnitudes (for the largest to the smallest), we have pi = 1 for i ≤k, and pi = λ|gi| for i > k. 2.2 Sparsification algorithms In this section, we propose two algorithms for efficiently calculating the optimal probability vector p in Proposition 1. Since λ > 0, by the complementary slackness condition, we have d X i=1 g2 i pi −(1 + ϵ) d X i=1 g2 i = k X i=1 g2 (i) + d X i=k+1 |g(i)| λ −(1 + ϵ) d X i=1 g2 i = 0. (9) This further implies λ = (ϵ d X i=1 g2 i + d X i=k+1 g2 (i))−1( d X i=k+1 |g(i)|), (10) then we used the constraint λ|g(k+1)| ≤1 and get |g(k+1)| d X i=k+1 |g(i)| ! ≤ϵ d X i=1 g2 i + d X i=k+1 g2 (i). (11) It follows that we should find the smallest k which satisfies the above inequality. Based on the above reasoning, we get the following closed-form solution for pi in Algorithm 2. Algorithm 2 Closed-form solution 1: Find the smallest k such that the second inequality of (10) is true, and let Sk be the set of coordinates with top k largest magnitude of |gi|. 2: Set the probability vector p by pi = ( 1, if i ∈Sk (ϵ Pd j=1 g2 (j) + Pd j=k+1 g2 (j))−1|gi| Pd j=k+1 |g(j)|  , if i ̸∈Sk. In practice, Algorithm 2 requires partial sorting of the gradient magnitude values to find Sk, which could be computationally expensive. Therefore we developed a greedy algorithm for approximately solving the problem. We pre-define a sparsity parameter κ ∈(0, 1), which implies that we aim to find pi that satisfies P i pi/d ≈κ. Loosely speaking, we want to initially set epi = κd|gi|/ P i |gi|, which sums to P i epi = κd, meeting our requirement on κ. However, by the truncation operation pi = min(epi, 1), the expected nonzero density will be less than κ. Now, we can use an iterative procedure that in the next iteration, we fix the set of {pi : pi = 1} and scale the remaining values, as summarized in Algorithm 3. This algorithm is much easier to implement, and computationally more efficient on parallel computing architecture. Since the operations mainly consist of accumulations, multiplications and minimizations, they can be easily accelerated on graphic processing units (GPU) or other hardware supporting single instruction multiple data (SIMD). 2.3 Coding strategy Once we have computed a sparsified gradient vector Q(g), we need to pack the resulting vector into a message for transmission. Here we apply a hybrid strategy for encoding Q(g). Suppose that 4 Algorithm 3 Greedy algorithm 1: Input g ∈Rd, κ ∈(0, 1). Initialize p0 ∈Rd, j = 0. Set p0 i = min (κd|gi|/ P i |gi|, 1) for all i. 2: repeat 3: Identify an active set I = {1 ≤i ≤D|pj i ̸= 1} and compute c = (κd −d + |I|)/ P i∈I pj i. 4: Recalibrate the values by pj+1 i = min(cpj i, 1). j = j + 1. 5: until If c ≤1 or j reaches the maximum iterations. Return p = pj. computers represent a floating-point scalar using b bits, with negligible loss in precision. We use two vectors QA(g) and QB(g) for representing non-zero coordinates, one for coordinates i ∈Sk, and the other for coordinates i /∈Sk. The vector QA(g) represents {gi : i ∈Sk}, where each item of QA(g) needs log d bits to represent the coordinates and b bits for the value gi/pi. The vector QB(g) represents {gi : i ̸∈Sk}, since in this case, we have pi = λ|gi|, we have for all i ̸∈Sk the quantized value Q(gi) = gi/pi = sign(gi)/λ. Therefore to represent QB(g), we only need one floating-point scalar 1/λ, plus the non-zero coordinates i and its sign sign(gi). Here we give an example about the format, Q(g) : g1 p1 , 0, 0, g4 p4 , g5 p5 , g6 p6 , · · · , 0  , where g1, g5 ∈Sk, g4 < 0, g6 > 0, QA(g) :  1, g1 p1 , 5, g5 p5 · · · , 0  , QB(g) : [4, −1/λ, 6, 1/λ, · · · ] . (12) where i = 1, 5 ∈Sk, i = 4, 6 ̸∈Sk, g4 < 0, g6 > 0. Moreover, we can also represent the indices of A and vector QB(g) using a dense vector of eq ∈{0, ±1, 2}d, where each component eqi is defined as Q(gi) = λQ(gi) when i ̸∈Sk and eqi = 2 if i ∈Sk. Using the standard entropy coding, we know that eq requires at most P2 ℓ=−1 dℓlog2(d/dℓ) ≤2d bits to represent. 3 Theoretical guarantees on sparsity In this section we analyze the expected sparsity of Q(g), which equals to Pd i=1 pi. In particular we show when the distribution of gradient magnitude values is highly skewed, there is a significant gain in applying the proposed sparsification strategy. First, we define the following notion of approximate sparsity on the magnitude at each coordinate of g: Definition 2. A vector g ∈Rd is (ρ, s)-approximately sparse if there exists a subset S ⊂[d] such that |S| = s and ∥gSc∥1 ≤ρ ∥gS∥1, where Sc is the complement of S. The notion of (ρ, s)-approximately sparsity is inspired by the restricted eigenvalue condition used in high-dimensional statistics [5]. (ρ, s)-approximately sparsity measures how well the signal of a vector is concentrated on a small subset of the coordinates of size s. As we will see later, the quantity (1 + ρ)s plays an important role in establishing the expected sparsity bound. Note that we can always take s = d and ρ = 0 so that (ρ, s) satisfies the above definition with (1 + ρ)s ≤d. If the distribution of magnitude values in g is highly skewed, we would expect the existence of (ρ, s) such that (1 + ρ)s ≪d. For example when g is exactly s-sparse, we can choose ρ = 0 and the quantity (1 + ρ)s reduces to s which can be significantly smaller than d. Lemma 3. If the gradient g ∈Rd of the loss function is (ρ, s)-approximately sparse as in Definition 2. Then we can find a sparsification Q(g) with ϵ = ρ in (6) (that is, the variance of Q(g) is increased by a factor of no more than 1 + ρ), and the expected sparsity of Q(g) can be upper bounded by E [∥Q(g)∥0] ≤(1 + ρ)s. Proof. Based on Definition 2, we can choose ϵ = ρ and Sk = S that satisfies (10), thus E [∥Q(g)∥0] = d X i=1 pi = X i∈Sk pi + X i̸∈Sk pi = s + X i̸∈Sk |gi|(Pd j=k+1 |g(j)|) ϵ Pk j=1 g2 (j) + (1 + ϵ) Pd j=k+1 g2 (j) =s + gSc k 2 1 ρ ∥gSk∥2 2 + (1 + ρ) gSc k 2 2 ≤s + ρ2s ∥gSk∥2 2 ρ ∥gSk∥2 2 + (1 + ρ) gSc k 2 2 ≤(1 + ρ)s, (13) 5 which completes the proof. Remark 1. Lemma 3 indicates that the variance after sparsification only increases by a factor of (1+ρ), while in expectation we only need to communicate a (1+ρ)s-sparse vector after sparsification. In order to achieve the same optimization accuracy, we may need to increase the number of iterations by a factor of up to (1 + ρ), and the overall number of floating-point numbers communicated is reduced by a factor of up to (1 + ρ)2s/d. Above lemma shows the number of floating-point numbers needed to communicate per iteration is reduced by the proposed sparsification strategy. As shown in Section 2.3, we only need to use one floating-point number to encode the gradient values in Sc k, so there is a further reduction in communication when considering the total number of bits transmitted, this is characterized by the Theorem below. The details of proof are put in a full version (https://arxiv.org/abs/1710. 09854) of this paper. Theorem 4. If the gradient g ∈Rd of the loss function is (ρ, s)-approximately sparse as in Definition 2, and a floating-point number costs b bits, then the coding length of Q(g) in Lemma 3 can be bounded by s(b + log2 d) + min(ρs log2 d, d) + b. Remark 2. The coding length of the original gradient vector g is db, by considering the slightly increased number of iterations to reach the same optimization accuracy, the total communication cost is reduced by a factor of at least (1 + ρ)((s + 1)b + log2 d)/db. 4 Experiments 5 10 15 20 10 −0.5 10 −0.4 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1.3 spa:0.5 UniSp var:2 spa:0.5 GSpar var:3.9 spa:0.17 UniSp var:6 spa:0.17 GSpar var:12 spa:0.056 UniSp var:18 spa:0.056 5 10 15 20 10 −0.34 10 −0.33 10 −0.32 10 −0.31 datapasses f(w)−f(w*) baseline: GSpar var:1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:1.7 spa:0.17 UniSp var:6 spa:0.17 GSpar var:5 spa:0.056 UniSp var:18 spa:0.056 5 10 15 20 10 −0.38 10 −0.35 10 −0.32 10 −0.29 datapasses f(w)−f(w*) baseline: GSpar var:1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:1.1 spa:0.17 UniSp var:6 spa:0.17 GSpar var:2.4 spa:0.056 UniSp var:18 spa:0.056 5 10 15 20 10 −0.7 10 −0.6 10 −0.5 10 −0.4 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1.3 spa:0.5 UniSp var:2 spa:0.5 GSpar var:3.9 spa:0.17 UniSp var:6 spa:0.17 GSpar var:12 spa:0.056 UniSp var:18 spa:0.056 5 10 15 20 10 −0.5 10 −0.4 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1.1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:2 spa:0.17 UniSp var:6 spa:0.17 GSpar var:6.1 spa:0.056 UniSp var:18 spa:0.056 5 10 15 20 10 −0.58 10 −0.57 10 −0.56 datapasses f(w)−f(w*) baseline: GSpar var:1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:1.1 spa:0.17 UniSp var:6 spa:0.17 GSpar var:2.2 spa:0.056 UniSp var:18 spa:0.056 Figure 1: SGD type comparison between gradient sparsification (GSpar) with random sparsification with uniform sampling (UniSp). In this section we conduct experiments to validate the effectiveness and efficiency of the proposed sparsification technique. We use ℓ2-regularized logistic regression as an example for convex problems, and take convolutional neural networks as an example for non-convex problems. The sparsification technique shows strong improvement over the uniform sampling approach as a baseline, the iteration complexity is only slightly increased as we strongly reduce the communication costs. Moreover, we also conduct asynchronous parallel experiments on the shared memory architecture. In particular, our experiments show that the proposed sparsification technique significantly reduces the conflicts among multiple threads and dramatically improves the performance. In all experiments, the probability vector p is calculated by Algorithm 3 and set the maximum iterations to be 2, which generates good enough high-quality approximation of the optimal p vector. 6 5 10 15 20 10 −0.9 10 −0.7 10 −0.5 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1.5 spa:0.5 UniSp var:2 spa:0.5 GSpar var:4.5 spa:0.17 UniSp var:6 spa:0.17 GSpar var:14 spa:0.055 UniSp var:18 spa:0.055 5 10 15 20 10 −0.34 10 −0.33 10 −0.32 datapasses f(w)−f(w*) baseline: GSpar var:1.1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:2.1 spa:0.17 UniSp var:6 spa:0.17 GSpar var:6.4 spa:0.055 UniSp var:18 spa:0.055 5 10 15 20 10 −0.4 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:1.1 spa:0.17 UniSp var:6 spa:0.17 GSpar var:2.8 spa:0.055 UniSp var:18 spa:0.055 5 10 15 20 10 −0.9 10 −0.7 10 −0.5 10 −0.3 datapasses f(w)−f(w*) baseline: GSpar var:1.5 spa:0.5 UniSp var:2 spa:0.5 GSpar var:4.5 spa:0.17 UniSp var:6 spa:0.17 GSpar var:14 spa:0.055 UniSp var:18 spa:0.055 5 10 15 20 10 −0.4 10 −0.3 10 −0.2 datapasses f(w)−f(w*) baseline: GSpar var:1.1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:2.2 spa:0.17 UniSp var:6 spa:0.17 GSpar var:6.6 spa:0.055 UniSp var:18 spa:0.055 5 10 15 20 10 −0.4 10 −0.3 10 −0.2 datapasses f(w)−f(w*) baseline: GSpar var:1 spa:0.5 UniSp var:2 spa:0.5 GSpar var:1.1 spa:0.17 UniSp var:6 spa:0.17 GSpar var:2.8 spa:0.055 UniSp var:18 spa:0.055 Figure 2: SVRG type comparison between gradient sparsification (GSpar) with random sparsification with uniform sampling (UniSp) We first validate the sparsification technique on the ℓ2-regularized logistic regression problem using SGD and SVRG respectively: f(w) = 1 N P n log2 1 + exp(−a⊤ n wbn)  +λ2∥w∥2 2, where an ∈Rd, bn ∈{−1, 1}. The experiments are conducted on synthetic data for the convenience to control the data sparsity. The mini-batch size is set to be 8 by default unless otherwise specified. We simulated with M = 4 machines, where one machine is both a worker and the master that aggregates stochastic gradients received from other workers. We compare our algorithm with a uniform sampling method as baseline, where each element of the probability vector is set to be pi = κ, and a similar sparsification follows to apply. In this method, the sparsified vector has a nonzero density of κ in expectation. The data set {an}N n=1 is generated as follows dense data: ¯ani ∼N(0, 1), ∀i ∈[d], n ∈[N], sparsify: ¯B ∼Uniform[0, 1]d, ¯Bi ←C1 ¯Bi, if: ¯Bi ≤C2, ∀i ∈[d], an ←¯an ⊙¯B, label: ¯w ∼N(0, I), bn ←sign(¯a⊤ n ¯w) where ⊙is the element-wise multiplication. In the equations above, the first step is a standard data sampling procedure from a multivariate Gaussian distribution; the second step generates a magnitude vector ¯B, which is later sparsified by decreasing elements that are smaller than a threshold C2 by a factor of C1; the third line describes the application of magnitude vectors on the dataset; and the fourth line generates a weight vector ¯w, and labels yn, based on the signs of multiplications of data and the weights. We should note that the parameters C1 and C2 give us a easier way to control the sparsity of data points and the gradients: the smaller these two constants are, the sparser the gradients are. The gradient of linear models on the dataset should be expected to be  (1 −C2)d, C2 C1 C1+2  approximately sparse, and the gradient of regularization needs not to be communicated. We set the dataset of size N = 1024, dimension d = 2048. The step sizes are fine-tuned on each case, and in our findings, the empirically optimal step size is inversely related to the gradient variance as the theoretical analysis. In Figures 1 and 2, from the top row to the bottom row, the ℓ2-regularization parameter λ is set to 1/(10N), 1/N. And in each row, from the first column to the last column, C2 is set to 4−1, 4−2, 4−3. In these figures, our algorithm is denoted by ‘GSpar’, and the uniform sampling method is denoted by ‘UniSp’, and the SGD/SVRG algorithm with non-sparsified communication is denoted by ‘baseline’, indicating the original distributed optimization algorithm. The x-axis shows the number of data passes, and the y-axis draws the suboptimality of the objective function (f(wt) −minw f (w)). For the experiments, we report the sparsified-gradient SGD variance as the notation ‘var’ in Figure 1. And ‘spa’ in all figures represents the nonzero density κ in Algorithm 3. We observe that the theoretical complexity reduction against the baseline in terms of the communication rounds, which can be inferred by var × spa, from the labels in Figures 1 to 2, where C1 = 0.9, and the rest of the figures are put in the full version due to the limited space. 7 From Figure 1, we observe that results on sparser data yield smaller gradient variance than results on denser data. Compared to uniform sampling, our algorithm generates gradients with less variance, and converges much faster. This observation is consistent with the objective of our algorithm, which is to minimize gradient variance given a certain sparsity. The convergence slowed down linearly w.r.t. the increase of variance. The results on SVRG show better speed up — although our algorithm increases the variance of gradients, the convergence rate degrades only slightly. 5 10 15 10 −0.39 10 −0.36 10 −0.33 10 −0.3 communications f(w)−f(w*) baseline: GSpar Bits:34 QSGD(20) Bits:20 GSpar Bits:9.3 GSpar Bits:5.2 QSGD(5) Bits:5 GSpar Bits:1.8 GSpar Bits:0.75 QSGD(2) Bits:2 5 10 15 20 10 −0.324 10 −0.323 10 −0.322 communications f(w)−f(w*) baseline: GSpar Bits:30 QSGD(20) Bits:20 GSpar Bits:11 GSpar Bits:5.5 QSGD(5) Bits:5 GSpar Bits:3.4 GSpar Bits:1 QSGD(2) Bits:2 5 10 15 20 10 −0.5 10 −0.4 10 −0.3 communications f(w)−f(w*) baseline: GSpar Bits:34 QSGD(20) Bits:20 GSpar Bits:7 GSpar Bits:5.4 QSGD(5) Bits:5 GSpar Bits:1.5 GSpar Bits:0.75 QSGD(2) Bits:2 5 10 15 20 10 −0.5 10 −0.4 10 −0.3 communications f(w)−f(w*) baseline: GSpar Bits:32 QSGD(20) Bits:20 GSpar Bits:7.2 GSpar Bits:5.6 QSGD(5) Bits:5 GSpar Bits:3.8 GSpar Bits:0.76 QSGD(2) Bits:2 Figure 3: Comparison of the sparisified-SGD with QSGD. We compared the gradient sparsification method with the quantized stochastic gradient descent (QSGD) algorithm in [2]. The results are shown in Figures 4. The data are generated as previous, with both strong and weak sparsity settings. From the top row to the bottom row, the ℓ2regularization parameter λ is set to 1/(10N), 1/N. And in each row, from the first column to the last column, C2 is set to 4−1, 4−2. The step sizes are set to be the same for both methods for a fair comparison after fine-tuning. In this comparison, we use the overall communication coding length of each algorithm, and note the length in x-axis. For QSGD, the communication cost per element is linearly related to b, which refers to the bits of floating-point number. QSGD(b) denotes QSGD algorithm with bit number b in these figures, and the average bits required to represent per element is on the labels. We also tried to compare with the gradient residual accumulation approaches [1], which unfortunately failed on our experiments, since the gradient is relatively sparse so that lots of small coordinates could be delayed infinitely, resulting in a large gradient bias to cause the divergence on convex problems. From Figures 4, we observe that the proposed sparsification approach is at least comparable to QSGD, and significantly outperforms QSGD when the gradient sparsity is stronger; and this concords with our analysis on the gradient approximate sparsity encouraging faster speed up. 4.1 Experiments on deep learning 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 Computations 0.50 0.75 1.00 1.25 1.50 1.75 2.00 rho=1.0 rho=0.07 rho=0.045 rho=0.015 rho=0.004 rho=0.001 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 Communications 0.50 0.75 1.00 1.25 1.50 1.75 2.00 rho=1.0 rho=0.07 rho=0.045 rho=0.015 rho=0.004 rho=0.001 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 Computations 0.50 0.75 1.00 1.25 1.50 1.75 2.00 rho=1.0 rho=0.07 rho=0.045 rho=0.015 rho=0.004 rho=0.001 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 Communications 0.50 0.75 1.00 1.25 1.50 1.75 2.00 rho=1.0 rho=0.07 rho=0.045 rho=0.015 rho=0.004 rho=0.001 Figure 4: Comparison of 3-layer CNN of channels of 64 (top) and 48 (bottom) on CIFAR-10. (Y-axis: f(wt).) This section conducts experiments on non-convex problems. We consider the convolutional neural networks (CNN) on the CIFAR-10 dataset with different settings. Generally, the networks consist of three convolutional layers (3 × 3), two pooling layers (2 × 2), and one 256 dimensional fully connected layer. Each convolution layer is followed by a batchnormalization layer. The channels of each convolutional layer is set to {24, 32, 48, 64}. We use the ADAM optimization algorithm [15], and the initial step size is set to 0.02. In Figure 4.1, we plot the objective function against the computational complexity measured by the number of epochs (1 epoch is equal to 1 pass of all training samples). We also plot the convergence with respect to the communication cost, which is the product of computations and the sparsification pa8 rameter κ. The experiments on each setting are repeated 4 times and we report the average objective function values. The results show that for this non-convex problem, the gradient sparsification slows down the training efficiency only slightly. In particular, the optimization algorithm converges even when the sparsity ratio is about κ = 0.004, and the communication cost is significantly reduced in this setting. This experiments also show that the optimization of neural networks is less sensitive to gradient noises, and the noises within a certain range may even help the algorithm to avoid bad local minimums [13]. 4.2 Experiments on asynchronous parallel SGD In this section, we study parallel implementations of SGD on the single-machine multi-core architecture. We employ the support vector machine for binary classification, where the loss function is f(w) = 1 N P n max(1 −a⊤ n wbn, 0) + λ2∥w∥2 2, an ∈Rd, bn ∈{−1, 1}. We implemented shared memory multi-thread SGD, where each thread employs a locked read, which may block other threads’ writing to the same coordinate. We implement a multi-thread algorithm with locks which are implemented using compare-and-swap operations. To improve the speed of the algorithm, we also employ several engineering tricks. First, we observe that ∀pi < 1, gi/pi = sign(gi)/λ from Proposition 1, therefore we only need to assign constant values to these variables, without applying floating-point division operations. Another costly operation is the pseudo-random number generation in the sampling procedure; therefore we generate a large array of pseudo-random numbers in [0, 1], and iteratively read the numbers during training without calling a random number generating function. The data are generated by first generating dense data, sparsifying them and generating the corresponding labels: ¯ani ∼N(0, 1), ∀i ∈[d], n ∈[N], ¯w ∼Uniform[−0.5, 0.5]d, ¯B ∼Uniform[0, 1]d, ¯Bi ←C1 ¯Bi, if: ¯Bi ≤C2, ∀i ∈[d], an ←¯an ⊙¯B, bn ←sign(x⊤ n ¯w + σ), where σ ∼N(0, 1). We set the dataset of size N = 51200, dimension d = 256, also set C1 = 0.01 and C2 = 0.9. 0 200 400 600 −2 −1 0 1 2 3 4 5 6 W:16 reg:0.5 lrt:0.5 rho=1/1 rho=1/2 rho=1/3 rho=1/4 0 200 400 600 −1 0 1 2 3 4 W:16 reg:0.5 lrt:0.25 rho=1/1 rho=1/2 rho=1/3 rho=1/4 0 200 400 600 0 1 2 3 4 5 6 7 W:16 reg:0.1 lrt:0.1 rho=1/1 rho=1/2 rho=1/3 rho=1/4 0 200 400 600 0 1 2 3 4 5 6 W:16 reg:0.1 lrt:0.05 rho=1/1 rho=1/2 rho=1/3 rho=1/4 0 200 400 600 1 2 3 4 5 6 7 8 W:16 reg:0.05 lrt:0.05 rho=1/1 rho=1/2 rho=1/3 rho=1/4 0 200 400 600 1 2 3 4 5 6 7 W:16 reg:0.05 lrt:0.025 rho=1/1 rho=1/2 rho=1/3 rho=1/4 Figure 5: Loss functions by a multi-thread SVM. X-axis: time in milliseconds, Y-axis: log2(f(wt)). The regularization parameter λ2 is denoted by reg, the number of threads is denoted by W(workers), and the learning rate is denoted by lrt. The number of workers is set to 16 or 32, the regularization parameter is set to {0.5, 0.1, 0.05}, and the learning rate is chosen from {0.5, 0.25, 0.05, 0.25}. The convergence of objective value against running time (milliseconds) is plotted in Figure 4.2, and the rest of figures are put in the full version. From Figure 4.2, we can observe that using gradient sparsification, the conflicts among multiple threads for reading and writing the same coordinate are significantly reduced. Therefore the training speed is significantly faster. By comparing with other settings, we also observe that the sparsification technique works better at the case when more threads are available, since the more threads, the more frequently the lock conflicts occur. 5 Conclusions In this paper, we propose a gradient sparsification technique to reduce the communication cost for large-scale distributed machine learning. We propose a convex optimization formulation to minimize the coding length of stochastic gradients given the variance budget that monotonically depends on the computational complexity, with efficient algorithms and a theoretical guarantee. Comprehensive experiments on distributed and parallel optimization of multiple models proved our algorithm can effectively reduce the communication cost during training or reduce conflicts among multiple threads. 9 Acknowledgments Ji Liu is in part supported by NSF CCF1718513, IBM faculty award, and NEC fellowship. References [1] Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 440–445, 2017. [2] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Communicationefficient SGD via gradient quantization and encoding. In Advances in Neural Information Processing Systems, pages 1707–1718, 2017. [3] Yossi Arjevani and Ohad Shamir. Communication complexity of distributed convex learning and optimization. In Advances in Neural Information Processing Systems, pages 1756–1764, 2015. [4] Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Springer, 2010. [5] Peter Bühlmann and Sara Van De Geer. Statistics for high-dimensional data: methods, theory and applications. Springer Science & Business Media, 2011. [6] Jiecao Chen, He Sun, David Woodruff, and Qin Zhang. Communication-optimal distributed clustering. In Advances in Neural Information Processing Systems, pages 3727–3735, 2016. [7] Shang-Tse Chen, Maria-Florina Balcan, and Duen Horng Chau. Communication efficient distributed agnostic boosting. In Artificial Intelligence and Statistics, pages 1299–1307, 2016. [8] Christopher De Sa, Matthew Feldman, Christopher Ré, and Kunle Olukotun. Understanding and optimizing asynchronous low-precision stochastic gradient descent. In Proceedings of the 44th Annual International Symposium on Computer Architecture, pages 561–574. ACM, 2017. [9] Christopher De Sa, Ce Zhang, Kunle Olukotun, and Christopher Ré. Taming the wild: A unified analysis of hogwild-style algorithms. In Advances in Neural Information Processing Systems, pages 2674–2682, 2015. [10] Jeffrey Dean and Sanjay Ghemawat. MapReduce: simplified data processing on large clusters. Communications of the ACM, 51(1):107–113, 2008. [11] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances in Neural Information Processing Systems, pages 1646–1654, 2014. [12] Martin Jaggi, Virginia Smith, Martin Takác, Jonathan Terhorst, Sanjay Krishnan, Thomas Hofmann, and Michael I Jordan. Communication-efficient distributed dual coordinate ascent. In Advances in Neural Information Processing Systems, pages 3068–3076, 2014. [13] Chi Jin, Rong Ge, Praneeth Netrapalli, Sham M Kakade, and Michael I Jordan. How to escape saddle points efficiently. In International Conference on Machine Learning, pages 1724–1732, 2017. [14] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, pages 315–323, 2013. [15] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2014. [16] Jason D Lee, Qiang Liu, Yuekai Sun, and Jonathan E Taylor. Communication-efficient sparse regression. Journal of Machine Learning Research, 18(5):1–30, 2017. [17] Mu Li, David G. Andersen, Jun Woo Park, Alexander J. Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J. Shekita, and Bor-Yiing Su. Scaling distributed machine learning with the parameter server. In 11th USENIX Symposium on Operating Systems Design and Implementation, pages 583–598, 2014. [18] Mu Li, Tong Zhang, Yuqiang Chen, and Alexander J Smola. Efficient mini-batch training for stochastic optimization. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 661–670. ACM, 2014. 10 [19] Xiangru Lian, Yijun Huang, Yuncheng Li, and Ji Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Advances in Neural Information Processing Systems, pages 2737–2745, 2015. [20] Yingyu Liang, Maria-Florina F Balcan, Vandana Kanchanapally, and David Woodruff. Improved distributed principal component analysis. In Advances in Neural Information Processing Systems, pages 3113–3121, 2014. [21] Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. In International Conference on Learning Representations, 2018. [22] Ji Liu, Stephen J Wright, Christopher Ré, Victor Bittorf, and Srikrishna Sridhar. An asynchronous parallel stochastic coordinate descent algorithm. The Journal of Machine Learning Research, 16(1):285–322, 2015. [23] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems, pages 693–701, 2011. [24] Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. Mathematical Programming: Series A and B, 162(1-2):83–112, 2017. [25] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Communication Association, 2014. [26] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss minimization. Journal of Machine Learning Research, 14(Feb):567–599, 2013. [27] Ohad Shamir, Nati Srebro, and Tong Zhang. Communication-efficient distributed optimization using an approximate newton-type method. In International Conference on Machine Learning, pages 1000–1008, 2014. [28] Ananda Theertha Suresh, X Yu Felix, Sanjiv Kumar, and H Brendan McMahan. Distributed mean estimation with limited communication. In International Conference on Machine Learning, pages 3329–3337, 2017. [29] Ananda Theertha Suresh, Felix X. Yu, Sanjiv Kumar, and H. Brendan McMahan. Distributed mean estimation with limited communication. In International Conference on Machine Learning, pages 3329– 3337, 2017. [30] John N Tsitsiklis and Zhi-Quan Luo. Communication complexity of convex optimization. Journal of Complexity, 3(3):231–243, 1987. [31] Jialei Wang, Weiran Wang, and Nathan Srebro. Memory and communication efficient distributed stochastic optimization with minibatch prox. In Conference on Learning Theory, pages 1882–1919, 2017. [32] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. TernGrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pages 1509–1519, 2017. [33] Eric P Xing, Qirong Ho, Wei Dai, Jin Kyu Kim, Jinliang Wei, Seunghak Lee, Xun Zheng, Pengtao Xie, Abhimanu Kumar, and Yaoliang Yu. Petuum: A new platform for distributed machine learning on big data. IEEE Transactions on Big Data, 1(2):49–67, 2015. [34] Hantian Zhang, Jerry Li, Kaan Kara, Dan Alistarh, Ji Liu, and Ce Zhang. ZipML: Training linear models with end-to-end low precision, and a little bit of deep learning. International Conference on Machine Learning, page 4035–4043, 2017. [35] Tong Zhang. Solving large scale linear prediction problems using stochastic gradient descent algorithms. In International Conference on Machine Learning, page 116, 2004. [36] Yuchen Zhang and Xiao Lin. DISCO: Distributed optimization for self-concordant empirical loss. In International Conference on Machine Learning, pages 362–370, 2015. [37] Yuchen Zhang, Martin J Wainwright, and John C Duchi. Communication-efficient algorithms for statistical optimization. In Advances in Neural Information Processing Systems, pages 1502–1510, 2012. 11
2018
225
7,392
The promises and pitfalls of Stochastic Gradient Langevin Dynamics Nicolas Brosse, Éric Moulines Centre de Mathématiques Appliquées, UMR 7641, Ecole Polytechnique, Palaiseau, France. nicolas.brosse@polytechnique.edu, eric.moulines@polytechnique.edu Alain Durmus Ecole Normale Supérieure CMLA, 61 Av. du Président Wilson 94235 Cachan Cedex, France. alain.durmus@cmla.ens-cachan.fr Abstract Stochastic Gradient Langevin Dynamics (SGLD) has emerged as a key MCMC algorithm for Bayesian learning from large scale datasets. While SGLD with decreasing step sizes converges weakly to the posterior distribution, the algorithm is often used with a constant step size in practice and has demonstrated successes in machine learning tasks. The current practice is to set the step size inversely proportional to N where N is the number of training samples. As N becomes large, we show that the SGLD algorithm has an invariant probability measure which significantly departs from the target posterior and behaves like Stochastic Gradient Descent (SGD). This difference is inherently due to the high variance of the stochastic gradients. Several strategies have been suggested to reduce this effect; among them, SGLD Fixed Point (SGLDFP) uses carefully designed control variates to reduce the variance of the stochastic gradients. We show that SGLDFP gives approximate samples from the posterior distribution, with an accuracy comparable to the Langevin Monte Carlo (LMC) algorithm for a computational cost sublinear in the number of data points. We provide a detailed analysis of the Wasserstein distances between LMC, SGLD, SGLDFP and SGD and explicit expressions of the means and covariance matrices of their invariant distributions. Our findings are supported by limited numerical experiments. 1 Introduction Most MCMC algorithms have not been designed to process huge sample sizes, a typical setting in machine learning. As a result, many classical MCMC methods fail in this context, because the mixing time becomes prohibitively long and the cost per iteration increases proportionally to the number of training samples N. The computational cost in standard Metropolis-Hastings algorithm comes from 1) the computation of the proposals, 2) the acceptance/rejection step. Several approaches to solve these issues have been recently proposed in machine learning and computational statistics. Among them, the stochastic gradient langevin dynamics (SGLD) algorithm, introduced in [33], is a popular choice. This method is based on the Langevin Monte Carlo (LMC) algorithm proposed in [16, 17]. Standard versions of LMC require to compute the gradient of the log-posterior at the current fit of the parameter, but avoid the accept/reject step. The LMC algorithm is a discretization of a continuous-time process, the overdamped Langevin diffusion, which leaves invariant the target distribution π. To further reduce the computational cost, SGLD uses unbiased estimators of the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. gradient of the log-posterior based on subsampling. This method has triggered a huge number of works among others [1, 21, 2, 6, 8, 12, 24, 13, 4] and have been successfully applied to a range of state of the art machine learning problems [27, 23]. The properties of SGLD with decreasing step sizes have been studied in [31]. The two key findings in this work are that 1) the SGLD algorithm converges weakly to the target distribution π, 2) the optimal rate of convergence to equilibrium scales as n−1/3 where n is the number of iterations, see [31, Section 5]. However, in most of the applications, constant rather than decreasing step sizes are used, see [1, 8, 18, 22, 30, 32]. A natural question for the practical design of SGLD is the choice of the minibatch size. This size controls on the one hand the computational complexity of the algorithm per iteration and on the other hand the variance of the gradient estimator. Non-asymptotic bounds in Wasserstein distance between the marginal distribution of the SGLD iterates and the target distribution π have been established in [10, 11]. These results highlight the cost of using stochastic gradients and show that, for a given precision ϵ in Wasserstein distance, the computational cost of the plain SGLD algorithm does not improve over the LMC algorithm; Nagapetyan et al. [25] reports also similar results on the mean square error. It has been suggested to use control variates to reduce the high variance of the stochastic gradients. For strongly log-concave models, Nagapetyan et al. [25], Baker et al. [3] use the mode of the posterior distribution as a reference point and introduce the SGLDFP (Stochastic Gradient Langevin Dynamics Fixed Point) algorithm. Nagapetyan et al. [25], Baker et al. [3] provide upper bounds on the mean square error and the Wasserstein distance between the marginal distribution of the iterates of SGLDFP and the posterior distribution. In addition, Nagapetyan et al. [25], Baker et al. [3] show that the overall cost remains sublinear in the number of individual data points, up to a preprocessing step. Other control variates methodologies are provided for non-concave models in the form of SAGA-Langevin Dynamics and SVRG-Langevin Dynamics [13, 7], albeit a detailed analysis in Wasserstein distance of these algorithms is only available for strongly log-concave models [5]. In this paper, we provide further insights on the links between SGLD, SGLDFP, LMC and SGD (Stochastic Gradient Descent). In our analysis, the algorithms are used with a constant step size and the parameters are set to the standard values used in practice [1, 8, 18, 22, 30, 32]. The LMC, SGLD and SGLDFP algorithms define homogeneous Markov chains, each of which admits a unique stationary distribution used as a hopefully close proxy of π. The main contribution of this paper is to show that, while the invariant distributions of LMC and SGLDFP become closer to π as the number of data points increases, on the opposite, the invariant measure of SGLD never comes close to the target distribution π and is in fact very similar to the invariant measure of SGD. In Section 3.1, we give an upper bound in Wasserstein distance of order 2 between the marginal distribution of the iterates of LMC and the Langevin diffusion, SGLDFP and LMC, and SGLD and SGD. We provide a lower bound on the Wasserstein distance between the marginal distribution of the iterates of SGLDFP and SGLD. In Section 3.2, we give a comparison of the means and covariance matrices of the invariant distributions of LMC, SGLDFP and SGLD with those of the target distribution π. Our claims are supported by numerical experiments in Section 4. 2 Preliminaries Denote by z = {zi}N i=1 the observations. We are interested in situations where the target distribution π arises as the posterior in a Bayesian inference problem with prior density π0(θ) and a large number N ≫1 of i.i.d. observations zi with likelihoods p(zi|θ). In this case, π(θ) = π0(θ) QN i=1 p(zi|θ). We denote Ui(θ) = −log(p(zi|θ)) for i ∈{1, . . . , N}, U0(θ) = −log(π0(θ)), U = PN i=0 Ui. Under mild conditions, π is the unique invariant probability measure of the Langevin Stochastic Differential Equation (SDE): dθt = −∇U(θt)dt + √ 2dBt , (1) where (Bt)t≥0 is a d-dimensional Brownian motion. Based on this observation, Langevin Monte Carlo (LMC) is an MCMC algorithm that enables to sample (approximately) from π using an Euler discretization of the Langevin SDE: θk+1 = θk −γ∇U(θk) + p 2γZk+1 , (2) 2 where γ > 0 is a constant step size and (Zk)k≥1 is a sequence of i.i.d. standard d-dimensional Gaussian vectors. Discovered and popularised in the seminal works [16, 17, 29], LMC has recently received renewed attention [9, 15, 14, 11]. However, the cost of one iteration is Nd which is prohibitively large for massive datasets. In order to scale up to the big data setting, Welling and Teh [33] suggested to replace ∇U with an unbiased estimate ∇U0 + (N/p) P i∈S ∇Ui where S is a minibatch of {1, . . . , N} with replacement of size p. A single update of SGLD is then given for k ∈N by θk+1 = θk −γ  ∇U0(θk) + N p X i∈Sk+1 ∇Ui(θk)  + p 2γZk+1 . (3) The idea of using only a fraction of data points to compute an unbiased estimate of the gradient at each iteration comes from Stochastic Gradient Descent (SGD) which is a popular algorithm to minimize the potential U. SGD is very similar to SGLD because it is characterised by the same recursion as SGLD but without Gaussian noise: θk+1 = θk −γ  ∇U0(θk) + N p X i∈Sk+1 ∇Ui(θk)  . (4) Assuming for simplicity that U has a minimizer θ⋆, we can define a control variates version of SGLD, SGLDFP, see [13, 7], given for k ∈N by θk+1 = θk −γ  ∇U0(θk) −∇U0(θ⋆) + N p X i∈Sk+1 {∇Ui(θk) −∇Ui(θ⋆)}  + p 2γZk+1 . (5) It is worth mentioning that the objectives of the different algorithms presented so far are distinct. On the one hand, LMC, SGLD and SGDLFP are MCMC methods used to obtain approximate samples from the posterior distribution π. On the other hand, SGD is a stochastic optimization algorithm used to find an estimate of the mode θ⋆of the posterior distribution. In this paper, we focus on the fixed step-size SGLD algorithm and assess its ability to reliably sample from π. For that purpose and to quantify precisely the relation between LMC, SGLD, SGDFP and SGD, we make for simplicity the following assumptions on U. H1. For all i ∈{0, . . . , N}, Ui is four times continuously differentiable and for all j ∈{2, 3, 4}, supθ∈Rd Dj Ui(θ) ≤˜L. In particular for all i ∈{0, . . . , N}, Ui is ˜L-gradient Lipschitz, i.e. for all θ1, θ2 ∈Rd, ∥∇Ui(θ1) −∇Ui(θ2)∥≤˜L ∥θ1 −θ2∥. H2. U is m-strongly convex, i.e. for all θ1, θ2 ∈Rd, ⟨∇U(θ1) −∇U(θ2), θ1 −θ2⟩≥m ∥θ1 −θ2∥2. H3. For all i ∈{0, . . . , N}, Ui is convex. Note that under H 1, U is four times continuously differentiable and for j ∈ {2, 3, 4}, supθ∈Rd Dj U(θ) ≤ L, with L = (N + 1)˜L and where Dj U(θ) = sup∥u1∥≤1,...,∥uj∥≤1 Dj U(θ)[u1, . . . , uj]. In particular, U is L-gradient Lipschitz. Furthermore, under H2, U has a unique minimizer θ⋆. In this paper, we focus on the asymptotic N →+∞,. We assume that lim infN→+∞N −1m > 0, which is a common assumption for the analysis of SGLD and SGLDFP [3, 5]. In practice [1, 8, 18, 22, 30, 32], γ is of order 1/N and we adopt this convention in this article. For a practical implementation of SGLDFP, an estimator ˆθ of θ⋆is necessary. The theoretical analysis and the bounds remain unchanged if, instead of considering SGLDFP centered w.r.t. θ⋆, we study SGLDFP centered w.r.t. ˆθ satisfying E[∥ˆθ −θ⋆∥2] = O(1/N). Such an estimator ˆθ can be computed using for example SGD with decreasing step sizes, see [26, eq.(2.8)] and [3, Section 3.4], for a computational cost linear in N. 3 Results 3.1 Analysis in Wasserstein distance Before presenting the results, some notations and elements of Markov chain theory have to be introduced. Denote by P2(Rd) the set of probability measures with finite second moment and by 3 B(Rd) the Borel σ-algebra of Rd. For λ, ν ∈P2(Rd), define the Wasserstein distance of order 2 by W2(λ, ν) = inf ξ∈Π(λ,ν) Z Rd×Rd ∥θ −ϑ∥2 ξ(dθ, dϑ) 1/2 , where Π(λ, ν) is the set of probability measures ξ on B(Rd) ⊗B(Rd) satisfying for all A ∈B(Rd), ξ(A × Rd)) = λ(A) and ξ(Rd × A) = ν(A). A Markov kernel R on Rd × B(Rd) is a mapping R : Rd × B(Rd) →[0, 1] satisfying the following conditions: (i) for every θ ∈Rd, R(θ, ·) : A 7→R(θ, A) is a probability measure on B(Rd) (ii) for every A ∈B(Rd), R(·, A) : θ 7→R(θ, A) is a measurable function. For any probability measure λ on B(Rd), we define λR for all A ∈B(Rd) by λR(A) = R Rd λ(dθ)R(θ, A). For all k ∈N∗, we define the Markov kernel Rk recursively by R1 = R and for all θ ∈Rd and A ∈B(Rd), Rk+1(θ, A) = R Rd Rk(θ, dϑ)R(ϑ, A). A probability measure ¯π is invariant for R if ¯πR = ¯π. The LMC, SGLD, SGD and SGLDFP algorithms defined respectively by (2), (3), (4) and (5) are homogeneous Markov chains with Markov kernels denoted RLMC, RSGLD, RSGD, and RFP. To avoid overloading the notations, the dependence on γ and N is implicit. Lemma 1. Assume H1, H2 and H3. For any step size γ ∈(0, 2/L), RSGLD (respectively RLMC, RSGD, RFP) has a unique invariant measure πSGLD ∈P2(Rd) (respectively πLMC, πSGD, πFP). In addition, for all γ ∈(0, 1/L], θ ∈Rd and k ∈N, W2 2(Rk SGLD(θ, ·), πSGLD) ≤(1 −mγ)k Z Rd ∥θ −ϑ∥2 πSGLD(dϑ) and the same inequality holds for LMC, SGD and SGLDFP. Proof. The proof is postponed to Section 1.1 in the supplementary document. Under H1, (1) has a unique strong solution (θt)t≥0 for every initial condition θ0 ∈Rd [20, Chapter 5, Theorems 2.5 and 2.9]. Denote by (Pt)t≥0 the semigroup of the Langevin diffusion defined for all θ0 ∈Rd and A ∈B(Rd) by Pt(θ0, A) = P(θt ∈A). Theorem 2. Assume H1, H2 and H3. For all γ ∈(0, 1/L], λ, µ ∈P2(Rd) and n ∈N, we have the following upper-bounds in Wasserstein distance between i) LMC and SGLDFP, W2 2(λRn LMC, µRn FP) ≤(1 −mγ)n W2 2(λ, µ) + 2L2γd pm2 + L2γ2 p n(1 −mγ)n−1 Z Rd ∥ϑ −θ⋆∥2 µ(dϑ) , ii) the Langevin diffusion and LMC, W2 2(λRn LMC, µPnγ) ≤2  1 −mLγ m + L n W2 2(λ, µ) + dγ m + L 2m  3 + L m  13 6 + L m  + ne−(m/2)γ(n−1)L3γ3  1 + m + L 2m  Z Rd ∥ϑ −θ⋆∥2 µ(dϑ) , iii) SGLD and SGD, W2 2(λRn SGLD, µRn SGD) ≤(1 −mγ)n W2 2(λ, µ) + (2d)/m . Proof. The proof is postponed to Section 1.2 in the supplementary document. Corollary 3. Assume H1, H2 and H3. Set γ = η/N with η ∈(0, 1/(2˜L)] and assume that lim infN→∞mN −1 > 0. Then, 4 i) for all n ∈ N, we get W2(Rn LMC(θ⋆, ·), Rn FP(θ⋆, ·)) = √dη O(N −1/2) and W2(πLMC, πFP) = √dη O(N −1/2), W2(πLMC, π) = √dη O(N −1/2). ii) for all n ∈ N, we get W2(Rn SGLD(θ⋆, ·), Rn SGD(θ⋆, ·)) = √ d O(N −1/2) and W2(πSGLD, πSGD) = √ d O(N −1/2). Theorem 2 implies that the number of iterations necessary to obtain a sample ε-close from π in Wasserstein distance is the same for LMC and SGLDFP. However for LMC, the cost of one iteration is Nd which is larger than pd the cost of one iteration for SGLDFP. In other words, to obtain an approximate sample from the target distribution at an accuracy O(1/ √ N) in 2-Wasserstein distance, LMC requires Θ(N) operations, in contrast with SGLDFP that needs only Θ(1) operations. We show in the sequel that W2(πFP, πSGLD) = Ω(1) when N →+∞in the case of a Bayesian linear regression, where for two sequences (uN)N≥1, (vN)N≥1, uN = Ω(vN) if lim infN→+∞uN/vN > 0. The dataset is z = {(yi, xi)}N i=1 where yi ∈R is the response variable and xi ∈Rd are the covariates. Set y = (y1, . . . , yN) ∈RN and X ∈RN×d the matrix of covariates such that the ith row of X is xi. Let σ2 y, σ2 θ > 0. For i ∈{1, . . . , N}, the conditional distribution of yi given xi is Gaussian with mean xT i θ and variance σ2 y. The prior π0(θ) is a normal distribution of mean 0 and variance σ2 θ Id. The posterior distribution π is then proportional to π(θ) ∝exp −(1/2)(θ −θ⋆)TΣ(θ −θ⋆)  where Σ = Id /σ2 θ + XTX/σ2 y and θ⋆= Σ−1(XTy)/σ2 y . We assume that XTX ⪰m Id, with lim infN→+∞m/N > 0. Let S be a minibatch of {1, . . . , N} with replacement of size p. Define ∇U0(θ) + (N/p) X i∈S ∇Ui(θ) = Σ(θ −θ⋆) + ρ(S)(θ −θ⋆) + ξ(S) where ρ(S) = Id σ2 θ + N pσ2y X i∈S xixT i −Σ , ξ(S) = θ⋆ σ2 θ + N pσ2y X i∈S xT i θ⋆−yi  xi . (6) ρ(S)(θ −θ⋆) is the multiplicative part of the noise in the stochastic gradient, and ξ(S) the additive part that does not depend on θ. The additive part of the stochastic gradient for SGLDFP disappears since ∇U0(θ) −∇U0(θ⋆) + (N/p) X i∈S {∇Ui(θ) −∇Ui(θ⋆)} = Σ(θ −θ⋆) + ρ(S)(θ −θ⋆) . In this setting, the following theorem shows that the Wasserstein distances between the marginal distribution of the iterates of SGLD and SGLDFP, and πSGLD and π, is of order Ω(1) when N →+∞. This is in sharp contrast with the results of Corollary 3 where the Wasserstein distances tend to 0 as N →+∞at a rate N −1/2. For simplicity, we state the result for d = 1. Theorem 4. Consider the case of the Bayesian linear regression in dimension 1. i) For all γ ∈(0, Σ−1{1 + N/(p PN i=1 x2 i )}−1] and n ∈N∗,  1 −µ 1 −µn 1/2 W2(Rn SGLD(θ⋆, ·), Rn FP(θ⋆, ·)) ≥ ( 2γ + γ2N p N X i=1 (xiθ⋆−yi)xi σ2y + θ⋆ Nσ2 θ 2)1/2 − p 2γ , where µ ∈(0, 1 −γΣ]. ii) Set γ = η/N with η ∈(0, lim infN→+∞NΣ−1{1 + N/(p PN i=1 x2 i )}−1] and assume that lim infN→+∞N −1 PN i=1 x2 i > 0. We have W2(πSGLD, π) = Ω(1). Proof. The proof is postponed to Section 1.3 in the supplementary document. 5 The study in Wasserstein distance emphasizes the different behaviors of the LMC, SGLDFP, SGLD and SGD algorithms. When N →∞and limN→+∞m/N > 0, the marginal distributions of the kth iterates of the LMC and SGLDFP algorithm are very close to the Langevin diffusion and their invariant probability measures πLMC and πFP are similar to the posterior distribution of interest π. In contrast, the marginal distributions of the kth iterates of SGLD and SGD are analogous and their invariant probability measures πSGLD and πSGD are very different from π when N →+∞. Note that to fix the asymptotic bias of SGLD, other strategies can be considered: choosing a step size γ ∝N −β where β > 1 and/or increasing the batch size p ∝N α where α ∈[0, 1]. Using the Wasserstein (of order 2) bounds of SGLD w.r.t. the target distribution π, see e.g. [11, Theorem 3], α + β should be equal to 2 to guarantee the ε-accuracy in Wasserstein distance of SGLD for a cost proportional to N (up to logarithmic terms), independently of the choice of α and β. 3.2 Mean and covariance matrix of πLMC, πFP, πSGLD We now establish an expansion of the mean and second moments of πLMC, πFP, πSGLD and πSGD as N →+∞, and compare them. We first give an expansion of the mean and second moments of π as N →+∞. Proposition 5. Assume H1 and H2 and that lim infN→+∞N −1m > 0. Then, Z Rd(θ −θ⋆)⊗2π(dθ) = ∇2U(θ⋆)−1 + ON→+∞(N −3/2) , Z Rd θ π(dθ) −θ⋆= −(1/2)∇2U(θ⋆)−1 D3 U(θ⋆)[∇2U(θ⋆)−1] + ON→+∞(N −3/2) . Proof. The proof is postponed to Section 2.1 in the supplementary document. Contrary to the Bayesian linear regression where the covariance matrices can be explicitly computed, see Section 3 in the supplementary document, only approximate expressions are available in the general case. For that purpose, we consider two types of asymptotic. For LMC and SGLDFP, we assume that limN→+∞m/N > 0, γ = η/N, for η > 0, and we develop an asymptotic when N →+∞. Combining Proposition 5 and Theorem 6 , we show that the biases and covariance matrices of πLMC and πFP are of order Θ(1/N) with remainder terms of the form O(N −3/2), where for two sequences (uN)N≥1, (vN)N≥1, u = Θ(v) if 0 < lim infN→+∞uN/vN ≤lim supN→+∞uN/vN < +∞. Regarding SGD and SGLD, we do not have such concentration properties when N →+∞because of the high variance of the stochastic gradients. The biases and covariance matrices of SGLD and SGD are of order Θ(1) when N →+∞. To obtain approximate expressions of these quantities, we set γ = η/N where η > 0 is the step size for the gradient descent over the normalized potential U/N. Assuming that m is proportional to N and N ≥1/η, we show by combining Proposition 5 and Theorem 7 that the biases and covariance matrices of SGLD and SGD are of order Θ(η) with remainder terms of the form O(η3/2) when η →0. Before giving the results associated to πLMC, πFP, πSGLD and πSGD, we need to introduce some notations. For any matrices A1, A2 ∈Rd×d, we denote by A1 ⊗A2 the Kronecker product defined on Rd×d by A1 ⊗A2 : Q 7→A1QA2 and A⊗2 = A ⊗A. Besides, for all θ1 ∈Rd and θ2 ∈Rd, we denote by θ1 ⊗θ2 ∈Rd×d the tensor product of θ1 and θ2. For any matrix A ∈Rd×d, Tr(A) is the trace of A. Define K : Rd×d →Rd×d for all A ∈Rd×d by K(A) = N p N X i=1  ∇2Ui(θ⋆) −1 N N X j=1 ∇2Uj(θ⋆)   ⊗2 A . (7) and H and G : Rd×d →Rd×d by H = ∇2U(θ⋆) ⊗Id + Id ⊗∇2U(θ⋆) −γ∇2U(θ⋆) ⊗∇2U(θ⋆) , (8) G = ∇2U(θ⋆) ⊗Id + Id ⊗∇2U(θ⋆) −γ(∇2U(θ⋆) ⊗∇2U(θ⋆) + K) . (9) 6 K, H and G can be interpreted as perturbations of ∇2U(θ⋆)⊗2 and ∇2U(θ⋆), respectively, due to the noise of the stochastic gradients. It can be shown, see Section 2.2 in the supplementary document, that for γ small enough, H and G are invertible. Theorem 6. Assume H1, H2 and H3. Set γ = η/N and assume that lim infN→+∞N −1m > 0. There exists an (explicit) η0 independent of N such that for all η ∈(0, η0), Z Rd(θ −θ⋆)⊗2πLMC(dθ) = H−1(2 Id) + ON→+∞(N −3/2) , (10) Z Rd(θ −θ⋆)⊗2πFP(dθ) = G−1(2 Id) + ON→+∞(N −3/2) , (11) and Z Rd θπLMC(dθ) −θ⋆= −∇2U(θ⋆)−1 D3 U(θ⋆)[H−1 Id] + ON→+∞(N −3/2) , Z Rd θπFP(dθ) −θ⋆= −∇2U(θ⋆)−1 D3 U(θ⋆)[G−1 Id] + ON→+∞(N −3/2) . Proof. The proof is postponed to Section 2.2.2 in the supplementary document. Theorem 7. Assume H1, H2 and H3. Set γ = η/N and assume that lim infN→+∞N −1m > 0. There exists an (explicit) η0 independent of N such that for all η ∈(0, η0) and N ≥1/η, Z Rd(θ −θ⋆)⊗2πSGLD(dθ) = G−1 {2 Id +(η/p) M} + Oη→0(η3/2) , (12) Z Rd(θ −θ⋆)⊗2πSGD(dθ) = (η/p) G−1 M +Oη→0(η3/2) , (13) andZ Rd θπSGLD(dθ) −θ⋆= −(1/2)∇2U(θ⋆)−1 D3 U(θ⋆)[G−1 {2 Id +(η/p) M}] + Oη→0(η3/2) , Z Rd θπSGD(dθ) −θ⋆= −(η/2p)∇2U(θ⋆)−1 D3 U(θ⋆)[G−1 M] + Oη→0(η3/2) , where M = N X i=1  ∇Ui(θ⋆) −1 N N X j=1 ∇Uj(θ⋆)   ⊗2 , (14) and G is defined in (9). Proof. The proof is postponed to Section 2.2.2 in the supplementary document. Note that this result implies that the mean and the covariance matrix of πSGLD and πSGD stay lower bounded by a positive constant for any η > 0 as N →+∞. In Section 4 of the supplementary document, a figure illustrates the results of Theorem 6 and Theorem 7 in the asymptotic N →+∞. 4 Numerical experiments Simulated data For illustrative purposes, we consider a Bayesian logistic regression in dimension d = 2. We simulate N = 105 covariates {xi}N i=1 drawn from a standard 2-dimensional Gaussian distribution and we denote by X ∈RN×d the matrix of covariates such that the ith row of X is xi. Our Bayesian regression model is specified by a Gaussian prior of mean 0 and covariance matrix the identity, and a likelihood given for yi ∈{0, 1} by p(yi|xi, θ) = (1 + e−xT i θ)−yi(1 + exT i θ)yi−1. We simulate N observations {yi}N i=1 under this model. In this setting, H1 and H3 are satisfied, and H2 holds if the state space is compact. To illustrate the results of Section 3.2, we consider 10 regularly spaced values of N between 102 and 105 and we truncate the dataset accordingly. We compute an estimator ˆθ of θ⋆using SGD [28] 7 102 103 104 105 10 3 10 2 10 1 n LMC 102 103 104 105 10 3 10 2 10 1 SGLDFP 102 103 104 105 N 2 × 10 1 n SGLD 102 103 104 105 N 2 × 10 1 SGD Figure 1: Distance to θ⋆, ¯θn −θ⋆ for LMC, SGLDFP, SGLD and SGD, function of N, in logarithmic scale. combined with the BFGS algorithm [19]. For the LMC, SGLDFP, SGLD and SGD algorithms, the step size γ is set equal to (1 + δ/4)−1 where δ is the largest eigenvalue of XTX. We start the algorithms at θ0 = ˆθ and run n = 1/γ iterations where the first 10% samples are discarded as a burn-in period. We estimate the means and covariance matrices of πLMC, πFP, πSGLD and πSGD by their empirical averages ¯θn = (1/n) Pn−1 k=0 θk and {1/(n −1)} Pn−1 k=0(θk −¯θn)⊗2. We plot the mean and the trace of the covariance matrices for the different algorithms, averaged over 100 independent trajectories, in Figure 1 and Figure 2 in logarithmic scale. The slope for LMC and SGLDFP is −1 which confirms the convergence of ¯θn −θ⋆ to 0 at a rate N −1. On the other hand, we can observe that ¯θn −θ⋆ converges to a constant for SGD and SGLD. Covertype dataset We then illustrate our results on the covertype dataset1 with a Bayesian logistic regression model. The prior is a standard multivariate Gaussian distribution. Given the size of the dataset and the dimension of the problem, LMC requires high computational resources and is not included in the simulations. We truncate the training dataset at N ∈  103, 104, 105 . For all algorithms, the step size γ is set equal to 1/N and the trajectories are started at ˆθ, an estimator of θ⋆, computed using SGD combined with the BFGS algorithm. We empirically check that the variance of the stochastic gradients scale as N 2 for SGD and SGLD, and as N for SGLDFP. We compute the empirical variance estimator of the gradients, take the mean over the dimension and display the result in a logarithmic plot in Figure 3. The slopes are 2 for SGD and SGLD, and 1 for SGLDFP. On the test dataset, we also evaluate the negative loglikelihood of the three algorithms for different values of N ∈  103, 104, 105 , as a function of the number of iterations. The plots are shown in Figure 4. We note that for large N, SGLD and SGD give very similar results that are below the performance of SGLDFP. 1https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary/covtype.libsvm. binary.scale.bz2 8 102 103 104 105 10 3 10 2 10 1 Tr(cov( n)) LMC 102 103 104 105 10 3 10 2 10 1 SGLDFP 102 103 104 105 N 6 × 10 1 7 × 10 1 Tr(cov( n)) SGLD 102 103 104 105 N 5 × 10 1 SGD Figure 2: Trace of the covariance matrices for LMC, SGLDFP, SGLD and SGD, function of N, in logarithmic scale. 103 104 105 N 103 104 105 106 Variance of the gradients sgd 103 104 105 N 103 104 105 106 sgld 103 104 105 N 102 103 104 sgldfp Figure 3: Variance of the stochastic gradients of SGLD, SGLDFP and SGD function of N, in logarithmic scale. 0 20000 40000 60000 80000 100000 iterations 0.534 0.536 0.538 0.540 0.542 0.544 Negative loglikelihood N=103 0 200000 400000 600000 800000 1000000 iterations 0.5060 0.5065 0.5070 0.5075 0.5080 0.5085 0.5090 N=104 0.0 0.2 0.4 0.6 0.8 1.0 iterations 1e7 0.5022 0.5024 0.5026 0.5028 0.5030 0.5032 0.5034 0.5036 N=105 sgld sgldfp sgd Figure 4: Negative loglikelihood on the test dataset for SGLD, SGLDFP and SGD function of the number of iterations for different values of N ∈  103, 104, 105 . 9 References [1] S. Ahn, A. K. Balan, and M. Welling. Bayesian posterior sampling via stochastic gradient Fisher scoring. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012, 2012. [2] S. Ahn, B. Shahbaba, and M. Welling. Distributed stochastic gradient MCMC. In E. P. Xing and T. Jebara, editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 1044–1052, Bejing, China, 22–24 Jun 2014. PMLR. [3] J. Baker, P. Fearnhead, E. B. Fox, and C. Nemeth. Control variates for stochastic gradient MCMC. ArXiv e-prints 1706.05439, June 2017. [4] R. Bardenet, A. Doucet, and C. Holmes. On Markov chain Monte Carlo methods for tall data. Journal of Machine Learning Research, 18(47):1–43, 2017. [5] N. S. Chatterji, N. Flammarion, Y.-A. Ma, P. L. Bartlett, and M. I. Jordan. On the theory of variance reduction for stochastic gradient Monte Carlo. ArXiv e-prints 1802.05431, Feb. 2018. [6] C. Chen, N. Ding, and L. Carin. On the convergence of Stochastic Gradient MCMC algorithms with high-order integrators. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2278–2286. Curran Associates, Inc., 2015. [7] C. Chen, W. Wang, Y. Zhang, Q. Su, and L. Carin. A convergence analysis for a class of practical variance-reduction stochastic gradient MCMC. ArXiv e-prints 1709.01180, Sept. 2017. [8] T. Chen, E. Fox, and C. Guestrin. Stochastic gradient hamiltonian Monte Carlo. In Proceedings of the 31st International Conference on Machine Learning, pages 1683–1691, 2014. [9] A. Dalalyan. Theoretical guarantees for approximate sampling from smooth and log-concave densities. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(3): 651–676, 2017. [10] A. Dalalyan. Further and stronger analogy between sampling and optimization: Langevin Monte Carlo and gradient descent. In S. Kale and O. Shamir, editors, Proceedings of the 2017 Conference on Learning Theory, volume 65 of Proceedings of Machine Learning Research, pages 678–689, Amsterdam, Netherlands, 07–10 Jul 2017. PMLR. [11] A. S. Dalalyan and A. G. Karagulyan. User-friendly guarantees for the Langevin Monte Carlo with inaccurate gradient. ArXiv e-prints 1710.00095, Sept. 2017. [12] N. Ding, Y. Fang, R. Babbush, C. Chen, R. D. Skeel, and H. Neven. Bayesian sampling using stochastic gradient thermostats. In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, NIPS’14, pages 3203–3211, Cambridge, MA, USA, 2014. MIT Press. [13] K. A. Dubey, S. J. Reddi, S. A. Williamson, B. Poczos, A. J. Smola, and E. P. Xing. Variance reduction in stochastic gradient Langevin dynamics. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 1154–1162. Curran Associates, Inc., 2016. [14] A. Durmus and E. Moulines. High-dimensional Bayesian inference via the unadjusted Langevin algorithm. ArXiv e-prints 1605.01559, May 2016. [15] A. Durmus and E. Moulines. Nonasymptotic convergence analysis for the unadjusted Langevin algorithm. Ann. Appl. Probab., 27(3):1551–1587, 06 2017. doi: 10.1214/16-AAP1238. [16] U. Grenander. Tutorial in pattern theory. Division of Applied Mathematics, Brown University, Providence, 1983. [17] U. Grenander and M. I. Miller. Representations of knowledge in complex systems. J. Roy. Statist. Soc. Ser. B, 56(4):549–603, 1994. ISSN 0035-9246. With discussion and a reply by the authors. 10 [18] L. Hasenclever, S. Webb, T. Lienart, S. Vollmer, B. Lakshminarayanan, C. Blundell, and Y. W. Teh. Distributed Bayesian learning with stochastic natural gradient expectation propagation and the posterior server. Journal of Machine Learning Research, 18(106):1–37, 2017. [19] E. Jones, T. Oliphant, P. Peterson, et al. SciPy: Open source scientific tools for Python, 2001. [20] I. Karatzas and S. Shreve. Brownian motion and stochastic calculus. Graduate Texts in Mathematics. Springer New York, 1991. ISBN 9780387976556. [21] A. Korattikara, Y. Chen, and M. Welling. Austerity in MCMC land: cutting the Metropolishastings budget. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML’14, pages I–181–I–189. JMLR.org, 2014. [22] C. Li, C. Chen, D. Carlson, and L. Carin. Preconditioned stochastic gradient Langevin dynamics for deep neural networks. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, AAAI’16, pages 1788–1794. AAAI Press, 2016. [23] W. Li, S. Ahn, and M. Welling. Scalable MCMC for mixed membership stochastic blockmodels. In Artificial Intelligence and Statistics, pages 723–731, 2016. [24] Y.-A. Ma, T. Chen, and E. Fox. A complete recipe for stochastic gradient MCMC. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2917–2925. Curran Associates, Inc., 2015. [25] T. Nagapetyan, A. B. Duncan, L. Hasenclever, S. J. Vollmer, L. Szpruch, and K. Zygalakis. The true cost of stochastic gradient Langevin dynamics. ArXiv e-prints 1706.02692, June 2017. [26] 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. doi: 10.1137/070704277. [27] S. Patterson and Y. W. Teh. Stochastic gradient riemannian Langevin dynamics on the probability simplex. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 3102–3110. Curran Associates, Inc., 2013. [28] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011. [29] G. O. Roberts and R. L. Tweedie. Exponential convergence of Langevin distributions and their discrete approximations. Bernoulli, 2(4):341–363, 1996. ISSN 1350-7265. doi: 10.2307/ 3318418. [30] I. Sato and H. Nakagawa. Approximation analysis of stochastic gradient Langevin dynamics by using Fokker-Planck equation and Ito process. In E. P. Xing and T. Jebara, editors, Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pages 982–990, Bejing, China, 22–24 Jun 2014. PMLR. [31] Y. W. Teh, A. H. Thiery, and S. J. Vollmer. Consistency and fluctuations for stochastic gradient Langevin dynamics. The Journal of Machine Learning Research, 17(1):193–225, 2016. [32] S. J. Vollmer, K. C. Zygalakis, and Y. W. Teh. Exploration of the (non-)asymptotic bias and variance of stochastic gradient Langevin dynamics. Journal of Machine Learning Research, 17 (159):1–48, 2016. [33] M. Welling and Y. W. Teh. Bayesian learning via stochastic gradient Langevin dynamics. In Proceedings of the 28th International Conference on International Conference on Machine Learning, ICML’11, pages 681–688, USA, 2011. Omnipress. ISBN 978-1-4503-0619-5. 11
2018
226
7,393
Training Deep Neural Networks with 8-bit Floating Point Numbers Naigang Wang, Jungwook Choi, Daniel Brand, Chia-Yu Chen and Kailash Gopalakrishnan IBM T. J. Watson Research Center Yorktown Heights, NY 10598, USA {nwang, choij, danbrand, cchen, kailash}@us.ibm.com Abstract The state-of-the-art hardware platforms for training Deep Neural Networks (DNNs) are moving from traditional single precision (32-bit) computations towards 16 bits of precision – in large part due to the high energy efficiency and smaller bit storage associated with using reduced-precision representations. However, unlike inference, training with numbers represented with less than 16 bits has been challenging due to the need to maintain fidelity of the gradient computations during back-propagation. Here we demonstrate, for the first time, the successful training of DNNs using 8-bit floating point numbers while fully maintaining the accuracy on a spectrum of Deep Learning models and datasets. In addition to reducing the data and computation precision to 8 bits, we also successfully reduce the arithmetic precision for additions (used in partial product accumulation and weight updates) from 32 bits to 16 bits through the introduction of a number of key ideas including chunk-based accumulation and floating point stochastic rounding. The use of these novel techniques lays the foundation for a new generation of hardware training platforms with the potential for 2 −4× improved throughput over today’s systems. 1 Introduction Over the past decade, Deep Learning has emerged as the dominant Machine Learning algorithm showing remarkable success in a wide spectrum of applications, including image processing [9], machine translation [20], speech recognition [21] and many others. In each of these domains, Deep Neural Networks (DNNs) achieve superior accuracy through the use of very large and deep models – necessitating up to 100s of ExaOps of computation during training and Gigabytes of storage. Approximate computing techniques have been widely studied to minimize the computational complexity of these algorithms as well as to improve the throughput and energy efficiency of hardware platforms executing Deep Learning kernels [2]. These techniques trade off the inherent resilience of Machine Learning algorithms for improved computational efficiency. Towards this end, exploiting reduced numerical precision for data representation and computation has been extremely promising – since hardware energy efficiency improves quadratically with bit-precision. While reduced-precision methods have been studied extensively, recent work has mostly focused on exploiting them for DNN inference. It has shown that the bit-width for inference computations can be successfully scaled down to just a few bits (i.e., 2-4 bits) while (mostly) preserving accuracy [3]. However, reduced precision DNN training has been significantly more challenging due to the need to maintain fidelity of the gradients during the back-propagation step. Recent studies have empirically shown that at least 16 bits of precision is necessary to train DNNs without impacting model accuracy [6, 16, 4]. As a result, state-of-the-art training platforms have started to offer 16-bit floating point training hardware [8, 5] with ≥4× performance over equivalent 32-bit systems. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. The goal of this paper is to push the envelope further and enable DNN training using 8-bit floating point numbers. To exploit the full benefits of 8-bit platforms, 8-bit floating point numbers are used for numerical representation of data as well as computations encountered in the forward and backward passes of DNN training. There are three primary challenges to using super scaled precision while fully preserving model accuracy (as exemplified in Fig. 1 for ResNet18 training on ImageNet dataset). Firstly, when all the operands (i.e., weights, activations, errors and gradients) for general matrix multiplication (GEMM) and convolution computations are reduced to 8 bits, most DNNs suffer noticeable accuracy degradation (e.g., Fig. 1(a)). Secondly, reducing the bit-precision of accumulations in GEMM from 32 bits (e.g., [16, 4]) to 16 bits significantly impacts the convergence of DNN training (Fig. 1(b)). This reduction in accumulation bit-precision is critically important for reducing the area and power of 8-bit hardware. Finally, reducing the bit-precision of weight updates to 16-bit floating point impacts accuracy (Fig. 1(c)) - while 32-bit weight updates require an extra copy of the high precision weights and gradients to be kept in memory, which is expensive. Figure 1: The challenges of selectively reducing training precision with (a) 8-bit representations, (b) 16-bit accumulations, and (c) 16-bit weight updates vs. FP32 baseline for ResNet18 (ImageNet). In this paper, we introduce new techniques to fully overcome all of above challenges: • Devised a new FP8 floating point format that, in combination with DNN training insights, allows GEMM computations for Deep Learning to work without loss in model accuracy. • Developed a new technique called chunk-based computations that when applied hierarchically allows all matrix and convolution operations to be computed using only 8-bit multiplications and 16-bit additions (instead of 16 and 32 bits respectively). • Applied floating point stochastic rounding in the weight update process allowing these updates to happen with 16 bits of precision (instead of 32 bits). • Demonstrated the wide applicability of the combined effects of these techniques across a suite of Deep Learning models and datasets – while fully preserving model accuracy. The use of these novel techniques open up new opportunities for hardware platforms with 2 −4× improved energy efficiency and throughput over state-of-the-art training systems. 2 8-bit floating point training 2.1 Related Work There has been a tremendous body of research conducted towards DNN precision scaling over the past few years. However, a significant fraction of this quantization research has focused around reduction of bit-width for the forward path for inference applications. Recently, precision for weights and activations were scaled down to 1-2 bits ([11, 3]) with a small loss of accuracy, while keeping the gradients and errors in the backward path as well as the weight updates in full-precision. In comparison to inference, much of the recent work on low precision training often uses much higher precision – specifically on the errors and gradients in the backward path. DoReFa-Net [22] reduces the gradient precision down to 6 bits while using 1-bit weights and 2-bit activations for training. WAGE [19] quantizes weights, activations, errors and gradients to 2, 8, 8 and 8 bits respectively. However, all of these techniques incur significant accuracy degradation (> 5%) relative to full-precision models. To maintain model accuracy for reduced-precision training, much of recent work keeps the data and computation precision in at least 16 bits. MPT [16] uses a IEEE half-precision floating point 2 format (16 bits) accumulating results into 32-bit arrays and additionally proposes a loss-scaling method to preserve gradients with very small magnitudes. Flexpoint [13] and DFP [4] demonstrated a format with a 16-bit mantissa and a shared exponent to train large neural networks with full-precision accuracy. The shared exponents can be adjusted dynamically to minimize overflow. However, even with 16-bit data representations, these techniques require the partial products to be accumulated in 32-bits and subsequently rounded down to 16 bits for the following computation. In addition, in all cases, a 32-bit copy of the weights is maintained to preserve the fidelity of the weight update process. In contrast, using the new ideas presented in this paper, we show that it is possible to train these networks using just 8-bit floating point representations for all of the arrays used in matrix and tensor computations – weights, activations, errors and gradients. In addition, we show that the partial products of these two 8-bit operands can be accumulated into 16-bit sums which can then be rounded down to 8 bits again. Furthermore, the master copy of the weights preserved after the weight update process can be scaled down from 32 to 16 bits. These advances dramatically improve the computational efficiency, energy efficiency and memory bandwidth needs of future deep learning hardware platforms without impacting model convergence and accuracy. Figure 2: A diagram showing the precision settings for (a) three GEMM functions during forward and backward passes, and (b) three AXPY operations during a standard SGD weight update process. 2.2 New Reduced Precision Floating Point Formats: FP8 and FP16 Fig. 2 shows the precision settings for the three GEMM functions during forward and backward passes, i.e., Forward, Backward and Gradient GEMM, as well as the three vector addition (AXPY) operations during a standard stochastic gradient descent (SGD) weight update process, i.e., L2regularization (L2-Reg), momentum gradient accumulation (Momentum-Acc), and weight update (Weight-Upd). Note that the convolution computation is implemented by first lowering the input data, followed by GEMM operations. In other words, GEMM refers to computations corresponding to both convolution (Conv) and fully-connected (FC) layers. Our 8-bit floating point number (FP8) has a (sign, exponent, mantissa) format of (1, 5, 2) bits - where the format is chosen carefully to represent weights, activations, errors and gradients used in the three GEMMs. The 16-bit floating point number (FP16) has a (1, 6, 9) format and is used for both GEMM accumulations as well as AXPY additions – where the higher (6-bit) exponent provides a larger dynamic range needed during weight updates. Both FP8 and FP16 formats are selected after in-depth studies of the data distribution in networks, focusing on balancing the representation accuracy and dynamic range. Due to limited available space, we only show results from the best formats that work reliably across a variety of deep networks/datasets. We refer to IEEE single precision as FP32, i.e (1, 8, 23). In addition, we explore two floating point rounding modes post FP16 additions – nearest and stochastic rounding. 2.3 Floating Point Accumulation in Reduced Precision A GEMM function involves a dot-product that may accumulate a large number of element-wise products in floating point. Since floating point addition involves right-shift of the smaller of the two operands (by the difference in exponents), it is possible that this smaller number may be truncated entirely after addition due to limited mantissa bits. 3 This issue of truncation in large-to-small number addition (also called “swamping” [10]) is known in the area of high performance computing [17], which focuses on numerical accuracy of high precision 32/64-bit floating point computations. However, in the context of deep neural networks, we find that the swamping is particularly serious when the accumulation bit-precision is reduced aggressively. When we use our FP16 format for accumulations, this truncation happens when the magnitude differs larger than the swamping threshold 2mantissa+1. Furthermore, swamping is exacerbated under the following conditions: 1) the accumulation is done over the values with non-zero mean (and thus the magnitude of the sum can gradually increase beyond the swamping threshold) and/or 2) some of the elements in the vector have a large magnitude (due to long tails in the distribution). These two cases cause significant accumulation errors – and is the reason why current hardware platforms are unable to reduce accumulation precision below 32 bits. In this work, we demonstrate that swamping severely limits reduction in training precision and propose two novel schemes that completely overcome this limit and enable low-precision FP8 DNN training: chunk-based accumulation and floating point stochastic rounding. Chunk-based Accumulation The novel insight behind our proposed idea of chunk-based accumulations is to divide a long dot-product into smaller chunks (defined by the chunk length CL). The individual element-wise products are then added hierarchically – intra-chunk accumulations are first performed to produce partial sums followed by inter-chunk accumulations of these partial sums to produce a final dot-product value. Since the length of the additions for both intra-chunk and inter-chunk computations is reduced by CL, the probability of adding a large number to a small number decreases dramatically. Furthermore, chunk-based accumulation requires little additional computational overhead (unlike sorting-based summation techniques) and incurs relatively insignificant memory overheads (unlike pairwise-summation) while reducing theoretical error bounds from O(N) to O(N/CL + CL) where N is the length of the dot product – similar to the analysis in [1]. Motivated by this chunk-based accumulation concept, we propose a reduced-precision dot-product algorithm for Deep Learning as described in Fig. 3(a). The input to the dot-product are two vectors in FPmult precision, which are multiplied in FPmult but have products accumulated in a higher precision FPacc in order to capture information of the intermediate sum better, e.g., FPmult = FP8 and FPacc = FP16. Since FP16 is still significantly lower than the typical bit-precision used in GPUs today for GEMM accumulation (i.e., FP32), we employ chunk-based accumulation to overcome swamping errors. Intra-chunk accumulation is carried out in the innermost loop of the algorithm shown in Fig. 3(a), then the sum of the chunks is further accumulated into the final sum. It should be noted that only a single additional variable is required to maintain the intra-chunk sum – thereby minimizing cost and overheads. The net impact of this remarkably simple idea is to minimize swamping and to open up opportunities for using FP8 for representations (and multiplications) and FP16 for accumulations, while matching FP32 baselines for additions as shown in Fig. 3(b). Stochastic Rounding Stochastic rounding is another extremely effective way of addressing the issue of swamping. Note that information loss occurs when the bit-width is reduced by rounding. As discussed before, floating point addition rounds off the intermediate sum of two aligned mantissas. Nearest rounding is a common rounding mode, but it discards information conveyed in the least significant bits (LSBs) that are rounded off. This information loss can be significant when the accumulation bit-precision is reduced into half, i.e., FP16, which has only 9 bits of mantissa. Stochastic rounding is a method to capture this information loss from the discarded bits. Assume a floating point value with the larger mantissa bits for the intermediate sum, x = s · 2e · (1 + m) where s, e, and m are sign, exponent, and mantissa for x, respectively. Also assume that m for this intermediate sum is represented in fixed-precision with k′ bits, which needs to be rounded off into smaller bits, k ≤k′. Then, the stochastic rounding works as follows: Round(x) = ( s · 2e · (1 + ⌊m⌋+ ϵ) with probability m−⌊m⌋ ϵ , s · 2e · (1 + ⌊m⌋) with probability 1 −m−⌊m⌋ ϵ , (1) where ⌊m⌋is the truncation of k′ −k LSBs of m, and ϵ = 2−k. Note that this floating point stochastic rounding technique is mathematically different from the fixed point stochastic rounding approach that is widely used in literature [6, 11]; since the magnitude of the rounding error of the floating point stochastic rounding is proportional to the exponent value 2e. 4 Table 1: Training configuration and test error (model size) across a spectrum of networks and datasets. Model CIFAR10-CNN CIFAR10-ResNet BN50-DNN AlexNet ResNet18 ResNet50 Dataset CIFAR10 CIFAR10 BN50 ImageNet ImageNet ImageNet Minibatch Size 128 128 256 256 256 256 Epoch 140 160 20 45 85 80 FP32 Baseline 17.80% (0.45MB) 7.23% (2.81MB) 59.33% (64.5MB) 41.96% (432MB) 32.57% (66.9MB) 27.86% (147MB) Our FP8 Training 18.15% (0.23MB) 7.79% (1.41MB) 60.08% (34.5MB) 42.45% (216MB) 33.05% (32.3MB) 28.28% (73.5MB) In spite of this difference, we show both numerically (in the next section) and empirically (in Sec. 3 and 4.3) that this technique works robustly for DNNs. To the best of our knowledge, this work is the first to demonstrate the effectiveness of chunk-based accumulation and floating point stochastic rounding towards 8-bit DNN training of large models. Comparison of Accumulation Techniques We perform numerical analysis to investigate the effectiveness of the proposed chunk-based accumulation and floating point stochastic rounding schemes. Fig. 3(b) compares the behavior of FP16 accumulation for different rounding modes and chunk sizes. A vector with varying length drawn from the uniform distribution (mean=1, stdev=1) is accumulated. As a baseline, accumulation in FP32 is shown where the accumulated values increase linearly with vector length, as the addend has a non-zero mean. A typical FP16 accumulation with the nearest rounding (i.e., ChunkSize=1) significally suffers swamping errors (the accumulation stops when length ≥4096, since the magnitudes differ by ≥211). Chunk-based accumulation dramatically helps compensate this error, as the effective length of accumulation is reduced by chunk size to avoid swamping (ChunkSize=32 is already very robust, as shown in Fig. 3(b)). The figure also shows the effectiveness of the stochastic rounding; although there exists slight deviation at large accumulation length due to the rounding error, stochastic rounding consistently follows the FP32 result. Given these results on simple dot-products, we employ chunk-based accumulation for Forward/Backward/Gradient GEMMs, using the reduced-precision dot-product algorithm described in Fig. 3(a). For weight update AXPY computations, it is more natural to use stochastic rounding, since the weight gradient is accumulated into the weight over mini-batches across epochs, unlike dotproduct of long vectors in GEMM. The following sections empirically demonstrate the effectiveness of these two techniques over a wide spectrum of DNN training models and datasets. (a) 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 16 4096 8176 12256 16336 Accumulation Values Accumulation Length FP32 FP16 - SR ChunkSize=1 ChunkSize=2 ChunkSize=4 ChunkSize=8 ChunkSize=16 ChunkSize=32 ChunkSize=64 ChunkSize=128 ChunkSize=256 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 16 4096 8176 12256 16336 Accumulation Values Accumulation Length FP32 FP16 - SR ChunkSize=1 ChunkSize=2 ChunkSize=4 ChunkSize=8 ChunkSize=16 ChunkSize=32 ChunkSize=64 ChunkSize=128 ChunkSize=256 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 16 4096 8176 12256 16336 Accumulation Values Accumulation Length FP32 FP16 - SR ChunkSize=1 ChunkSize=2 ChunkSize=4 ChunkSize=8 ChunkSize=16 ChunkSize=32 ChunkSize=64 ChunkSize=128 ChunkSize=256 <FP16 – NR > (b) ChunkSize=16 ChunkSize=8 SR FP32, FP16-ChunkSize=32-256 Input: {"#}#%&:(,{)#}#%&:((*+,-./), Parameter: chunk size 01 Output: 234 (*+566) 234 = 0.0; <=" = 0; >346? = @/01 for n=1:>346? { 2346? = 0.0 for i=1:01 { <="++ B4C = "DEF G )DEF (in *+,-./) 2346? += B4C (in *+566)} 234 += 2346? (in *+566)} Figure 3: (a) Reduced-precision dot-product based on accumulation in chunks. (b) Comparison of accumulation for different chunk sizes and rounding modes. A typical FP16 accumulation (i.e., ChunkSize = 1) with nearest rounding (NR) suffers significant error, whereas ChunkSize >= 32 help compensate this error. Stochastic rounding schemes also follows the FP32 baseline. 3 Experimental Results Reduced-precision emulated experiments were performed using NVIDIA GPUs. The software platform is an in-house distributed deep learning framework [7]. The three GEMM computations share the same bit-precision and chunk-size: FP8 for input operands and multiplication and FP16 for accumulation with a chunk-size of 64. The three AXPY computations use the same bit-precision, FP16, using floating point stochastic rounding. To preserve the dynamic range of the back-propagated error with small magnitude, we adopt the loss-scaling method described in [16]. For all the models tested, 5 a single scaling factor of 1000 was used without loss of accuracy. The GEMM computation for the last layer of the model (typically a small FC layer followed by Softmax) is kept at FP16 for better numerical stability. Finally, for the ImageNet dataset, the input image is represented using FP16 for the ResNet18 and ResNet50 models. The technical reasons behind these choices are discussed in Sec. 4 in more detail. To demonstrate the robustness as well as the wide coverage of the proposed FP8 training scheme, we tested it comprehensively on a spectrum of well-known Convolutional Neural Networks (CNNs) and Deep Neural Networks (DNNs) for both image and speech classification tasks across multiple datasets; CIFAR10-CNN ([14]), CIFAR10-ResNet, ImageNet-ResNet18, ImageNet-ResNet50 ([9]), ImageNet-AlexNet ([15]), BN50-DNN ([18]) (details on the network architectures can be found in the supplementary material). Note that, for large ImageNet networks, we skipped some preprocessing steps, such as color and scale augmentations, in order to accelerate the emulation process for reduced-precision DNN training, since it needs large computing resources. All networks are trained using the SGD optimizer via the proposed FP8 training scheme without changes to network architectures, data pre-processing, or hyper-parameters, then the results are compared with the FP32 baseline. The experimental results are summarized in Table 1, while the detailed convergence curves are shown in Fig. 4. As can be seen, with the proposed FP8 training technique, every single network tested achieved almost identical test errors compared to the full-precision baseline while memory foot-print for not only weight but also the master copy is reduced by 2× due to FP8 weight and FP16 master copy. As a proof of wide-applicability, we additionally trained the CIFAR10-CNN network with the ADAM optimizer [12] and achieved baseline accuracies while using FP8 GEMMs and FP16 weight updates. Overall, our experimental results indicate that training with FP8 representations, FP16 accumulations and FP16 weight updates show remarkable robustness across a wide spectrum of application domains, network types and optimizer choices. Table 2 shows a comparison of the reduced-precision training work for top-1 accuracy (%) of AlexNet on ImageNet. The proposed FP8 training scheme achieved equivalent accuracies to the previous state-of-the-art, while using only half of the bit-precision for both representations and accumulations. Figure 4: Reliable model convergence results across a spectrum of models and datasets using a chunk size of 64. FP8 is used for representations and FP16 is used for accumulation and updates. 4 Discussion & Insight 4.1 Bit-Precisions for First and Last Layer The first and last layers in DNNs are often excluded from quantization due to their sensitivity [22, 3]. However, there is very limited understanding on how the bit-precision needs to be set for the first/last 6 Table 2: Comparison of reduced-precision training for top-1 accuracy (%) for AlexNet (ImageNet) Reduced Precision Training Scheme Bit-Precision FP32 Reduced Precision W x dW dx acc DoReFa-Net [22] 1 2 32 6 32 55.9 46.1 WAGE [19] 2 8 8 8 32 N/A 51.6 DFP [4] 16 16 16 16 32 57.4 56.9 MPT [16] 16 16 16 16 32 56.8 56.9 Proposed FP8 training 8 8 8 8 16 58.0 57.5 Table 3: Comparison of the precision setting on the last layer of AlexNet Last Layer GEMMs Input to Softmax Test Error (%) Accuracy Degradation (%) Forward Backward Gradient FP16 FP16 FP16 FP16 42.30 0.34 FP8 FP8 FP8 FP8 52.12 10.16 FP8 FP8 FP8 FP16 42.37 0.41 (a) ResNet50 (b) ResNet18 Figure 5: (a) The importance of chunk-based accumulations for ResNet50. (b) Sensitivity of Forward, Backward and Gradient GEMMs to accumulation errors for ResNet18 without chunking - indicating that Gradient GEMM accumulation errors harm DNN convergence. layers in order to reduce its impact on model accuracy. This section aims to precisely provide that insight and specify how the bit-precision of the first and last layers affects FP8 training performance. For the first layer, we observe that the representation precision for input images is very critical for successfully training FP8 models. Image data is typically represented by 256 color intensity levels (e.g., uint8 in CIFAR10). Since FP8 does not have enough mantissa bits to represent integer values from 0 to 255, we chose to use FP16 to adequately represent input images. This is particularly critical for achieving high accuracy on ImageNet using ResNet18 and ResNet50; without which we observe ∼2% accuracy degradation for these networks. All other data types includings weights, output activations, and weight gradients can still be represented in FP8 with no loss in accuracy. Additionally, we note that the last layer is very sensitive to quantization. First, we conjecture that this sensitivity is directly related to the fidelity of the Softmax function (since these errors get exponentially amplified). To verify this, we conducted experiments on AlexNet, with varying precisions for the last layer. As summarized in Table 3, the last layer with all three GEMMs in FP16 achieves baseline accuracy (degradation < 0.5%), but the FP8 case exhibits noticeable degradation. We also observe that it is indeed possible to use FP8 for all three GEMMs in the last layer and achieve high accuracy – as long as the output of the last layer Forward GEMM is preserved in FP16. However, to ensure robust training across a diverse set of neural networks, we decided to use FP16 for all three GEMMs in the last layer. Given the limited computational complexity in the last layer of a DNN (< 1% in FLOPS), we anticipate very little loss in performance from running this layer in FP16 while maintaining FP8 for the rest of layers in DNNs. 7 Table 4: Impact of the rounding mode used in FP16 weight updates. Top-1 accuracy for AlexNet and ResNet18 on the ImageNet dataset is reported for nearest as well as stochastic rounding approaches. FP32 Baseline Nearest Rounding Stochastic Rounding AlexNet 58.04% 54.10% 57.94% ResNet18 67.43% 65.74% 67.34% Figure 6: Effect of chunk sizes on Gradient GEMM computation errors (normalized L2distance between FP8 and FP32 GEMMs) for CIFAR10-ResNet. Figure 7: Chip layout of a novel dataflow-based core (14 nm) with FP16 chunk-based accumulation. FP8 engines are > 2 ∼4× more efficient over FP16 implementations - and require lesser memory bandwidth and storage 4.2 Accumulation Error Next, we investigate the impact of chunk-based accumulations. Prior works (e.g., [16, 4]) claim that 32 bits of precision is required for the accumulation in any GEMM to prevent loss of information. Motivated by the significant area/energy expense of FP32 adders, we counter this by claiming that chunk-based accumulations can effectively address this loss in long dot-products while maintaining accumulation bit-precision in FP16. As shown in Fig. 5(a), FP8 training for ResNet50 fails to converge without chunking, but chunk-based computations bring model convergence back to baseline. Investigating further, we identify Gradient GEMM to be the most sensitive to accumulation precision when chunking is not used. As shown in Fig. 5(b), FP8 training on ResNet18 converges to baseline accuracy levels when FP32 is used for Gradient GEMM. For other cases, interestingly, the training loss converges but the test error diverges to 99%, exhibiting significant over-fitting. This implies that the failure in addressing information loss in low-precision Gradient GEMM results in poor generalization of the network during training. Gradient GEMM accumulates weight gradients across minibatch samples, where information from small gradients may be lost due to swamping (Sec. 2.3), resulting in the SGD optimization being stuck at sharp local minimas. Chunk-based accumulation addresses the issue of swamping to recover information loss and therefore help generalization. To understand the impact of chunk size on accumulation accuracy for Gradient GEMM in DNN training, we extracted data from Activation and Error matrices from the two different Conv layers in the CIFAR10-ResNet model to compute Gradient GEMM with varying chunk sizes. Fig. 6 shows the normalized L2-distance of the results relative to the full-precision counterpart for varying chunk size. The computation results are closest to the FP32 baseline with the chunk size between 64 and 256. Before and after this range, the L2-distance is higher due to the dominant inter-chuck and intra-chunk accumulation error, respectively. Based on this insight, and for the ease of hardware implementation, we use a chunk size of 64 for our experiments across all models. 4.3 Nearest Rounding vs. Stochastic Rounding Finally, we investigate the impact of rounding mode on FP16 weight updates. Since weight gradients are typically several orders of magnitude smaller than weights, prior work (e.g., [16]) adopts FP32 for weight updates. In this work, we maintain FP16 for the entire weight update process in SGD (i.e., L2-Reg, Momentum-Acc, and Weight-Upd), as a part of our FP8 training scheme; stochastic rounding is applied to avoid accuracy loss. Table 4 shows the impact of rounding modes (nearest vs. 8 stochastic) on the top-1 accuracy of the AlexNet and ResNet18 models. For this experiment, GEMM is done in FP32 to avoid its additional impact on accuracy. As can be seen from the table, the nearest rounding suffers noticeable accuracy degradation (2 ∼4%) while stochastic rounding maintains the baseline accuracies, demonstrating its effectiveness as a key enabler for low precision training. 4.4 Hardware Benefits A subset of the new ideas discussed in this paper were implemented in hardware using a novel dataflow based core design in 14nm silicon technology – incorporating both chunk-based computations as well as scaled precisions for training (Fig. 7). Through these hardware implementations, we draw the following conclusions: 1) The energy overheads of chunk-based computations are < 5% for chunk sizes > 64. 2) FP8 based multipliers accumulating results into FP16 are 2-4 times more efficient in hardware compared to pure FP16 computations because of smaller multipliers (i.e., smaller mantissa) as well as smaller accumulator bit-widths. FP8 hardware engines are roughly similar in area and power to 8-bit integer computation engines (that require larger multipliers and 32-bit accumulators). These promising results lay the foundation for new hardware platforms that provide significantly improved DNN training performance without accuracy loss. 5 Conclusions We have demonstrated DNN training with 8-bit floating point numbers (FP8) that achieves 2 −4× speedup without compromise in accuracy. The key insight is that reduced-precision additions (used in partial product accumulations and weight updates) can result in swamping errors causing accuracy degradation during training. To minimize this error, we propose two new techniques, chunk-based accumulation and floating point stochastic rounding, that enable a reduction of bit-precision for additions down to 16 bits – as well as implement them in hardware. Across a wide spectrum of popular DNN benchmarks and datasets, this mixed precision FP8 training technique achieves the same accuracy levels as the FP32 baseline. Future work aims to further optimize data formats and computations in order to increase margins as well as study additional benchmarks and datasets. Acknowledgments The authors would like to thank I-Hsin Chung, Ming-Hung Chen, Ankur Agrawal, Silvia Melitta Mueller, Vijayalakshmi Srinivasan, Dongsoo Lee and Jinseok Kim for helpful discussions and supports. This research was supported by IBM Research, IBM SoftLayer, and IBM Congnitive Computing Cluster (CCC). References [1] Anthony M Castaldo, R Clint Whaley, and Anthony T Chronopoulos. Reducing floating point error in dot product using the superblock family of algorithms. SIAM journal on scientific computing, 31(2): 1156–1174, 2008. [2] Chia-Yu Chen, Jungwook Choi, Kailash Gopalakrishnan, Viji Srinivasan, and Swagath Venkataramani. Exploiting approximate computing for deep learning acceleration. In Design, Automation Test in Europe Conference Exhibition (DATE), pages 821–826, 2018. [3] Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018. [4] Dipankar Das, Naveen Mellempudi, Dheevatsa Mudigere, Dhiraj Kalamkar, Sasikanth Avancha, Kunal Banerjee, Srinivas Sridharan, Karthik Vaidyanathan, Bharat Kaul, Evangelos Georganas, et al. Mixed precision training of convolutional neural networks using integer operations. arXiv preprint arXiv:1802.00930, 2018. [5] Bruce Fleischer, Sunil Shukla, Matthew Ziegler, Joel Silberman, Jinwook Oh, Vijayalakshmi Srinivasan, Jungwook Choi, Silvia Mueller, Ankur Agrawal, Tina Babinsky, et al. A scalable multi-teraops deep learning processor core for ai training and inference. In VLSI Circuits, 2018 Symposium on. IEEE, 2018. [6] Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In International Conference on Machine Learning, pages 1737–1746, 2015. 9 [7] Suyog Gupta, Wei Zhang, and Fei Wang. Model accuracy and runtime tradeoff in distributed deep learning: A systematic study. In Data Mining (ICDM), 2016 IEEE 16th International Conference on, pages 171–180. IEEE, 2016. [8] Mark Harris. Mixed-precision programming with cuda 8, 2016. URL https://devblogs.nvidia.com/ mixed-precision-programming-cuda-8/. [9] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. [10] Nicholas J Higham. The accuracy of floating point summation. SIAM Journal on Scientific Computing, 14 (4):783–799, 1993. [11] Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Advances in neural information processing systems, pages 4107–4115, 2016. [12] Diederik P. Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. International Conference on Learning Representations (ICLR), 2015. [13] Urs Köster, Tristan Webb, Xin Wang, Marcel Nassar, Arjun K Bansal, William Constable, Oguz Elibol, Scott Gray, Stewart Hall, Luke Hornof, et al. Flexpoint: An adaptive numerical format for efficient training of deep neural networks. In Advances in Neural Information Processing Systems, pages 1742–1752, 2017. [14] Alex Krizhevsky and G Hinton. Convolutional deep belief networks on cifar-10. Unpublished manuscript, 40, 2010. [15] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In Advances in Neural Information Processing Systems 25 (NIPS), pages 1097–1105, 2012. [16] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaev, Ganesh Venkatesh, et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017. [17] Thomas G Robertazzi and Stuart C Schwartz. Best “ordering” for floating-point addition. ACM Transactions on Mathematical Software (TOMS), 14(1):101–110, 1988. [18] Ewout van den Berg, Bhuvana Ramabhadran, and Michael Picheny. Training variance and performance evaluation of neural networks in speech. In Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, pages 2287–2291. IEEE, 2017. [19] Shuang Wu, Guoqi Li, Feng Chen, and Luping Shi. Training and inference with integers in deep neural networks. arXiv preprint arXiv:1802.04680, 2018. [20] Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. [21] Wayne Xiong, Jasha Droppo, Xuedong Huang, Frank Seide, Mike Seltzer, Andreas Stolcke, Dong Yu, and Geoffrey Zweig. The microsoft 2016 conversational speech recognition system. In Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, pages 5255–5259. IEEE, 2017. [22] Shuchang Zhou, Zekun Ni, Xinyu Zhou, He Wen, Yuxin Wu, and Yuheng Zou. DoReFa-Net: Training Low Bitwidth Convolutional Neural Networks with Low Bitwidth Gradients. CoRR, abs/1606.06160, 2016. 10
2018
227
7,394
ATOMO: Communication-efficient Learning via Atomic Sparsification Hongyi Wang1⇤, Scott Sievert2⇤, Zachary Charles2, Shengchao Liu1, Stephen Wright1, Dimitris Papailiopoulos2 1Department of Computer Sciences, 2Department of Electrical and Computer Engineering University of Wisconsin-Madison Abstract Distributed model training suffers from communication overheads due to frequent gradient updates transmitted between compute nodes. To mitigate these overheads, several studies propose the use of sparsified stochastic gradients. We argue that these are facets of a general sparsification method that can operate on any possible atomic decomposition. Notable examples include element-wise, singular value, and Fourier decompositions. We present ATOMO, a general framework for atomic sparsification of stochastic gradients. Given a gradient, an atomic decomposition, and a sparsity budget, ATOMO gives a random unbiased sparsification of the atoms minimizing variance. We show that recent methods such as QSGD and TernGrad are special cases of ATOMO and that sparsifiying the singular value decomposition of neural networks gradients, rather than their coordinates, can lead to significantly faster distributed training. 1 Introduction Several machine learning frameworks such as TensorFlow [1], MXNet [2], and Caffe2[3], come with distributed implementations of popular training algorithms, such as mini-batch SGD. However, the empirical speed-up gains offered by distributed training, often fall short of the optimal linear scaling one would hope for. It is now widely acknowledged that communication overheads are the main source of this speedup saturation phenomenon [4, 5, 6, 7, 8]. Communication bottlenecks are largely attributed to frequent gradient updates transmitted between compute nodes. As the number of parameters in state-of-the-art models scales to hundreds of millions [9, 10], the size of gradients scales proportionally. These bottlenecks become even more pronounced in the context of federated learning [11, 12], where edge devices (e.g., mobile phones, sensors, etc) perform decentralized training, but suffer from low-bandwidth during up-link. To reduce the cost of of communication during distributed model training, a series of recent studies propose communicating low-precision or sparsified versions of the computed gradients during model updates. Partially initiated by a 1-bit implementation of SGD by Microsoft in [5], a large number of recent studies revisited the idea of low-precision training as a means to reduce communication [13, 14, 15, 16, 17, 18, 19, 17, 20, 21]. Other approaches for low-communication training focus on sparsification of gradients, either by thresholding small entries or by random sampling [6, 22, 23, 24, 25, 26, 27, 28]. Several approaches, including QSGD and TernGrad, implicitly combine quantization and sparsification to maximize performance gains [14, 16, 12, 29, 30], while providing provable guarantees for convergence and performance. We note that quantization methods in the context of gradient based updates have a rich history, dating back to at least as early as the 1970s [31, 32, 33]. ⇤These authors contributed equally 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Our Contributions An atomic decomposition represents a vector as a linear combination of simple building blocks in an inner product space. In this work, we show that stochastic gradient sparsification and quantization are facets of a general approach that sparsifies a gradient in any possible atomic decomposition, including its entry-wise or singular value decomposition, its Fourier decomposition, and more. With this in mind, we develop ATOMO, a general framework for atomic sparsification of stochastic gradients. ATOMO sets up and optimally solves a meta-optimization that minimizes the variance of the sparsified gradient, subject to the constraints that it is sparse on the atomic basis, and also is an unbiased estimator of the input. 5 10 15 5DnkV 0.2 0.4 0.6 0.8 6igulDr VDlueV DDtD PDVV: 0 DDtD PDVV: 5 DDtD PDVV: 10 Figure 1: The singular values of a convolutional layer’s gradient, for ResNet-18 while training on CIFAR-10. The gradient of a layer can be seen as a matrix, once we vectorize and appropriately stack the conv-filters. For all presented data passes, there is a sharp decay in singular values, with the top 3 standing out. We show that 1-bit QSGD and TernGrad are in fact special cases of ATOMO, and each is optimal (in terms of variance and sparsity), in different parameter regimes. Then, we argue that for some neural network applications, viewing the gradient as a concatenation of matrices (each corresponding to a layer), and applying atomic sparsification to their SVD is meaningful and well-motivated by the fact that these matrices are approximately low-rank (see Fig. 1). We show that ATOMO on the SVD of each layer’s gradient, can lead to less variance, and faster training, for the same communication budget as that of QSGD or TernGrad. We present extensive experiments showing that using ATOMO with SVD sparsification can lead to up to 2⇥/3⇥faster training time (including the time to compute the SVD) compared to QSGD/TernGrad. This holds using VGG and ResNet-18 on SVHN and CIFAR-10. Relation to Prior Work ATOMO is closely related to work on communication-efficient distributed mean estimation in [29] and [30]. These works both note, as we do, that variance (or equivalently the mean squared error) controls important quantities such as convergence, and they seek to find a low-communication vector averaging scheme that minimizes it. Our work differs in two key aspects. First, we derive a closed-form solution to the variance minimization problem for all input gradients. Second, ATOMO applies to any atomic decomposition, which allows us to compare entry-wise against singular value sparsification for matrices. Using this, we derive explicit conditions for which SVD sparsification leads to lower variance for the same sparsity budget. The idea of viewing gradient sparsification through a meta-optimization lens was also used in [34]. Our work differs in two key ways. First, [34] consider the problem of minimizing the sparsity of a gradient for a fixed variance, while we consider the reverse problem, that is, minimizing the variance subject to a sparsity budget. The second more important difference is that while [34] focuses on entry-wise sparsification, we consider a general problem where we sparsify according to any atomic decomposition. For instance, our approach directly applies to sparsifying the singular values of a matrix, which gives rise to faster training algorithms. Finally, low-rank factorizations and sketches of the gradients when viewed as matrices were proposed in [35, 36, 37, 38, 12]; arguably most of these methods (with the exception of [12]) aimed to address the high flops required when training low-rank models. Though they did not directly aim to reduce communication, this arises as a useful side effect. 2 Problem Setup In machine learning, we often wish to find a model w minimizing the empirical risk f(w) = 1 n n X i=1 `(w; xi) (1) where xi 2 Rd is the i-th data point. One way to approximately minimize f(w) is by using stochastic gradient methods that operate as follows: wk+1 = wk −γbg(wk) where w0 is some initial model, γ is the stepsize, and bg(w) is a stochastic gradient of f(w), i.e.it is an unbiased estimate of the true gradient g(w) = rf(w). Mini-batch SGD, one of the most common algorithms for distributed training, computes bg as an average of B gradients, each evaluated on randomly sampled data from the training set. Mini-batch SGD is easily parallelized in the parameter 2 server (PS) setup, where a PS stores the global model, and P compute nodes split the effort of computing the B gradients. Once the PS receives these gradients, it applies them to the model, and sends it back to the compute nodes. To prove convergence bounds for stochastic-gradient based methods, we usually require bg(w) to be an unbiased estimator of the full-batch gradient, and to have small variance Ekbg(w)k2, as this controls the speed of convergence. To see this, suppose w⇤is a critical point of f, then we have E[kwk+1 −w⇤k2 2] = E[kwk −w⇤k2 2] − # 2γhrf(wk), wk −w⇤i −γ2E[kbg(wk)k2 2] $ | {z } progress at step t . In particular, the progress made by the algorithm at a single step is, in expectation, controlled by the term E[kbg(wk)k]2 2; the smaller it is, the bigger the progress. This is a well-known fact in optimization, and most convergence bounds for stochastic-gradient based methods, including minibatch, involve upper bounds on E[kbg(wk)k]2 2, in a multiplicative form, for both convex and nonconvex setups [39, 40, 41, 42, 42, 43, 44, 45, 46, 47]. Hence, recent results on low-communication variants of SGD design unbiased quantized or sparse gradients, and try to minimize their variance [14, 29, 34]. Since variance is a proxy for speed of convergence, in the context of communication-efficient stochastic gradient methods, one can ask: What is the smallest possible variance of a stochastic gradient that is represented with k bits? This can be cast as the following meta-optimization: min g Ekbg(w)k2 s.t. E[bg(w)] = g(w) bg(w) can be expressed with k bits Here, the expectation is taken over the randomness of bg. We are interested in designing a stochastic approximation bg that “solves” this optimization. However, it seems difficult to design a formal, tractable version of the last constraint. In the next section, we replace this with a simpler constraint that instead requires that bg(w) is sparse with respect to a given atomic decomposition. 3 ATOMO: Atomic Decomposition and Sparsification Let (V, h·, ·i) be an inner product space over R and let k · k denote the induced norm on V . In what follows, you may think of g as a stochastic gradient of the function we wish to optimize. An atomic decomposition of g is any decomposition of the form g = P a2A λaa for some set of atoms A ✓V . Intuitively, A consists of simple building blocks. We will assume that for all a 2 A, kak = 1, as this can be achieved by a positive rescaling of the λa. An example of an atomic decomposition is the entry-wise decomposition g = P i giei where {ei}n i=1 is the standard basis. More generally, any orthonormal basis of V gives rise to a unique atomic decomposition of g. While we focus on finite dimensional vectors, one could use Fourier and wavelet decompositions in this framework. When considering matrices, the singular value decomposition gives an atomic decomposition in the set of rank-1 matrices. More general atomic decompositions have found uses in a variety of situations, including solving linear inverse problems [48]. We are interested in finding an approximation to g with fewer atoms. Our primary motivation is that this reduces communication costs, as we only need to send atoms with non-zero weights. We can use whichever decomposition is most amenable for sparsification. For instance, if X is a low rank matrix, then its singular value decomposition is naturally sparse, so we can save communication costs by sparsifying its singular value decomposition instead of its entries. Suppose A = {ai}n i=1 and we have an atomic decomposition g = Pn i=1 λiai. We wish to find an unbiased estimator bg of g that is sparse in these atoms, and with small variance. Since bg is unbiased, minimizing its variance is equivalent to minimizing E[kbgk2]. We use the following estimator: bg = n X i=1 λiti pi ai (2) where ti ⇠Bernoulli(pi), for 0 < pi 1. We refer to this sparsification scheme as atomic sparsification. Note that the ti’s are independent. Recall that we assumed above that kaik2 = 1 for all ai. We have the following lemma about bg. Lemma 1. E[bg] = g and E[kbgk2] = Pn i=1 λ2 i p−1 i + P i6=j λiλjhai, aji. 3 Let λ = [λ1, . . . , λn]T , p = [p1, . . . , pn]T . In order to ensure that this estimator is sparse, we fix some sparsity budget s. That is, we require P i pi = s. This is a sparsity on average constraint. We wish to minimize E[kbgk2] subject to this constraint. By Lemma 1, this is equivalent to min p n X i=1 λ2 i pi s.t. 8i, 0 < pi 1, n X i=1 pi = s. (3) An equivalent form of this problem was presented in [29] (Section 6.1). The authors considered this problem for entry-wise sparsification and found a closed-form solution for s kλk1/kλk1. We give a version of their result but extend it to all s. A similar optimization problem was given in [34], which instead minimizes sparsity subject to a variance constraint. Algorithm 1: ATOMO probabilities Input :λ 2 Rn with |λ1| ≥. . . |λn|; sparsity budget s such that 0 < s n. Output :p 2 Rn solving (3). i = 1; while i n do if |λi|s Pn j=i |λi| then for k = i, . . . , n do pk = |λk|s ⇣Pn j=i |λi| ⌘−1 ; end i = n + 1; else pi = 1, s = s −1; i = i + 1; end end We will show that Algorithm 1 produces p 2 Rn solving (3). While we show in Appendix B that this can be derived via the KKT conditions, we focus on an alternative method relaxes (3) to better understand its structure. This approach also analyzes the variance achieved by solving (3) more directly. Note that (3) has non-empty feasible set only for 0 < s n. Define f(p) := Pn i=1 λ2 i /pi. To understand how to solve (3), we first consider the following relaxation: min p n X i=1 λ2 i pi s.t. 8i, 0 < pi, n X i=1 pi = s. (4) We have the following lemma about the solutions to (4), first shown in [29]. Lemma 2 ([29]). Any feasible vector p to (4) satisfies f(p) ≥1 skλk2 1. This is achieved iff pi = |λi|s kλk1 . Lemma 2 implies that if we ignore the constraint that pi 1, then the optimal p is achieved by setting pi = |λi|s/kλk1. If the quantity in the right-hand side is greater than 1, this does not give us an actual probability. This leads to the following definition. Definition 1. An atomic decomposition g = Pn i=1 λiai is s-unbalanced at entry i if |λi|s > kλk1. We say that g is s-balanced otherwise. Clearly, an atomic decomposition is s-balanced iff s  kλk1/kλk1. Lemma 2 gives us the optimal way to sparsify s-balanced vectors, since the optimal p for (4) is feasible for (3). If g is s-unbalanced at entry j, we cannot assign this pj as it is larger than 1. In the following lemma, we show that in pj = 1 is optimal in this setting. Lemma 3. Suppose that g is s-unbalanced at entry j and that q is feasible in (3). Then 9p that is feasible such that f(p) f(q) and pj = 1. Let φ(g) = P i6=j λiλjhai, aji. Lemmas 2 and 3 imply the following theorem about solutions to (3). Theorem 4. If g is s-balanced, then E[kbgk2] ≥s−1kλk2 1 + φ(g) with equality if and only if pi = |λi|s/kλk1. If g is s-unbalanced, then E[kbgk2] > s−1kλk2 1 + φ(g) and is minimized by p with pj = 1 where j = argmaxi=1,...,n |λi|. Due to the sorting requirement in the input, Algorithm 1 requires O(n log n) operations. In Appendix B we describe a variant that uses only O(sn) operations. Thus, we can solve (3) in O(min{n, s} log(n)) operations. 4 Relation to QSGD and TernGrad In this section, we will discuss how ATOMO is related to two recent quantization schemes, 1-bit QSGD [14] and TernGrad [16]. We will show that in certain cases, these schemes are versions of the ATOMO for a specific sparsity budget s. Both schemes use the entry-wise atomic decomposition. 4 QSGD takes as input g 2 Rn and b ≥1. This b governs the number of quantization buckets. When b = 1, QSGD produces a random vector Q(g) defined by Q(g)i = kgk2 sign(gi)⇣i. Here, the ⇣i ⇠Bernoulli(|gi|/kgk2) are independent random variables. One can show this is equivalent to (2) with pi = |gi|/kgk2 and sparsity budget s = kgk1/kgk2. Note that by definition, any g is s-balanced for this s. Therefore, Theorem 4 implies that the optimal way to assign pi with this given s is pi = |gi|/kgk2, which agrees with 1-bit QSGD. TernGrad takes g 2 Rn and produces a sparsified version T(g) given by T(g)i = kgk1 sign(gi)⇣i where ⇣i ⇠Bernoulli(|gi|/kgk1). This is equivalent to (2) with pi = |gi|/kgk1 and sparsity budget s = kgk1/kgk1. Once again, any g is s-balanced for this s by definition. Therefore, Theorem 4 implies that the optimal assignment of the pi for this s is pi = |gi|/kgk1, which agrees with TernGrad. We can generalize both of these with the following quantization method. Fix q 2 (0, 1]. Given g 2 Rn, we define the `q-quantization of g, denoted Lq(g), by Lq(v)i = kgkq sign(gi)⇣i where ⇣i ⇠Bernoulli(|gi|/kgkq). By the reasoning above, we derive the following theorem. Theorem 5. `q-quantization performs atomic sparsification in the standard basis with pi = |gi|/kgkq. This solves (3) for s = kgk1/kgkq and satisfies E[kLq(g)k2 2] = kgk1kgkq. In particular, for q = 2 we get 1-bit QSGD while for q = 1, we get TernGrad. 5 Spectral-ATOMO: Sparsifying the Singular Value Decomposition Table 1: Communication cost and variance of ATOMO for matrices. Decomposition Comm. Var. Entry-wise s 1 s kXk2 1,1 SVD s(n + m) 1 s kXk2 ⇤ For a rank r matrix X, denote its singular value decomposition (SVD) by X = Pr i=1 σiuivT i . Let σ = [σ1, . . . , σr]T . We define the `p,q norm of a matrix X by kXkp,q = (Pm j=1(Pn i=1 |Xi,j|p)q/p)1/q. When p = q = 1, we define this to be kXkmax where kXkmax := maxi,j |Xi,j|. Let V be the space of real n ⇥m matrices. Given X 2 V , there are two standard atomic decompositions of X. The first is the entry-wise decomposition X = P i,j Xi,jeieT j . The second is its SVD X = Pr i=1 σiuivT i . If r is small, it may be more efficient to communicate the r(n + m) entries of the SVD, rather than the nm entries of the matrix. Let b X and b Xσ denote the random variables in (2) corresponding to the entry-wise decomposition and singular value decomposition of X, respectively. We wish to compare these two sparsifications. In Table 1, we compare the communication cost and variance of these two methods. The communication cost is the expected number of non-zero elements (real numbers) that need to be communicated. For b X, a sparsity budget of s corresponds to s non-zero entries we need to communicate. For b Xσ, a sparsity budget of s gives a communication cost of s(n + m) due to the singular vectors. We compare the optimal variance from Theorem 4. To compare the variance of these two methods under the same communication cost, we want X to be s-balanced in its entry-wise decomposition. This holds iff s kXk1,1/kXkmax. By Theorem 4, this gives E[k b Xk2 F ] = s−1kXk2 1,1. To achieve the same communication cost with b Xσ, we take a sparsity budget of s0 = s/(n + m). The SVD of X is s0-balanced iff s0 kXk⇤/kXk2. By Theorem 4, E[k b Xσk2 F ] = (n + m)s−1kXk2 ⇤. This leads to the following theorem. Theorem 6. Suppose X 2 Rn⇥m and s min ⇢kXk1,1 kXkmax , (n + m)kXk⇤ kXk2 + . 5 Then b Xσ with sparsity s0 = s/(n + m) incurs the same communication cost as b X with sparsity s, and E[k b Xσk2] E[k b Xk2] if and only if (n + m)kXk2 ⇤kXk2 1,1. To better understand this condition, we will make use of the following well-known fact. Lemma 7. For any n ⇥m matrix X over R, 1 pnmkXk1,1 kXk⇤kXk1,1. For expository purposes, we give a proof of this Appendix C and show that these bounds are the best possible. As a result, if the first inequality is tight, then E[k b Xσk2] E[k b Xk2], while if the second is tight then E[k b Xσk2] ≥E[k b Xk2]. As we show in the next section, using singular value sparsification can translate in to significantly reduced distributed training time. 6 Experiments We present an empirical study of Spectral-ATOMO and compare it to the recently proposed QSGD [14], and TernGrad [16], on a different neural network models and data sets, under real distributed environments. Our main findings are as follows: • We observe that spectral-ATOMO provides a useful alternative to entry-wise sparsification methods, it reduces communication compared to vanilla mini-batch SGD, and can reduce training time compared to QSGD and TernGrad by up to a factor of 2⇥and 3⇥respectively. For instance, on VGG11-BN trained on CIFAR-10, spectral-ATOMO with sparsity budget 3 achieves 3.96⇥ speedup over vanilla SGD, while 4-bit QSGD achieves 1.68⇥on a cluster of 16, g2.2xlarge instances. Both ATOMO and QSGD greatly outperform TernGrad as well. • We observe that spectral-ATOMO in distributed settings leads to models with negligible accuracy loss when combined with parameter tuning. Implementation and setup We compare spectral-ATOMO2 with different sparsity budgets to bbit QSGD across a distributed cluster with a parameter server (PS), implemented in mpi4py [49] and PyTorch [50] and deployed on multiple types of instances in Amazon EC2 (e.g.m5.4xlarge, m5.2xlarge, and g2.2xlarge), both PS and compute nodes are of the same type of instance. The PS implementation is standard, with a few important modifications. At the most basic level, it receives gradients from the compute nodes and broadcasts the updated model once a batch has been received. In our experiments, we use data augmentation (random crops, and flips), and tuned the step-size for every different setup as shown in Table 5 in Appendix D. Momentum and regularization terms are switched off to make the hyperparamter search tractable and the results more legible. Tuning the step sizes for this distributed network for three different datasets and eight different coding schemes can be computationally intensive. As such, we only used small networks so that multiple networks could fit into GPU memory. To emulate the effect of larger networks, we use synchronous message communication, instead of asynchronous. Each compute node evaluates gradients sampled from its partition of data. Gradients are then sparsified through QSGD or spectral-ATOMO, and then are sent back to the PS. Note that spectralATOMO transmits the weighted singular vectors sampled from the true gradient of a layer. The PS then combines these, and updates the model with the average gradient. Our entire experimental pipeline is implemented in PyTorch [50] with mpi4py [49], and deployed on either g2.2xlarge, m5.2xlarge and m5.4xlarge instances in Amazon AWS EC2. We conducted our experiments on various models, datasets, learning tasks, and neural network models as detailed in Table 2. Dataset CIFAR-10 CIFAR-100 SVHN # Data points 60,000 60,000 600,000 Model ResNet-18 / VGG-11-BN ResNet-18 ResNet-18 # Classes 10 100 10 # Parameters 11,173k / 9,756k 11,173k 11,173k Table 2: The datasets used and their associated learning models and hyper-parameters. 2code available at: https://github.com/hwang595/ATOMO 6 2 4 8 16 1umber of WorNerV 0 5 10 15 20 Time Ser iWerDWioQ (Vec) 6VD V 1 6VD V 2 6VD V 3 6VD V 4 46GD b 1 46GD b 2 46GD b 4 46GD b 8 Figure 2: The timing of the gradient coding methods (QSGD and spectral-ATOMO) for different quantization levels, b bits and s sparsity budget respectively for each worker when using a ResNet-34 model on CIFAR10. For brevity, we use SVD to denote spectral-ATOMO. The bars represent the total iteration time and are divided into computation time (bottom, solid), encoding time (middle, dotted) and communication time (top, faded). Scalability We study the scalability of these sparsification methods on clusters of different sizes. We used clusters with one PS and n = 2, 4, 8, 16 compute nodes. We ran ResNet-34 on CIFAR-10 using mini-batch SGD with batch size 512 split among compute nodes. The experiment was run on m5.4xlarge instances of AWS EC2 and the results are shown in Figure 2. While increasing the size of the cluster, decreases the computational cost per worker, it causes the communication overhead to grow. We denote as computational cost, the time cost required by each worker for gradient computations, while the communication overhead is represented by the amount time the PS waits to receive the gradients by the slowest worker. This increase in communication cost is non-negligible, even for moderately-sized networks with sparsified gradients. We observed a trade-off in both sparsification approaches between the information retained in the messages after sparsification and the communication overhead. End-to-end convergence performance We evaluate the end-to-end convergence performance on different datasets and neural networks, training with spectral-ATOMO(with sparsity budget s = 1, 2, 3, 4), QSGD (with n = 1, 2, 4, 8 bits), and ordinary mini-batch SGD. The datasets and models are summarized in Table 2. We use ResNet-18 [9] and VGG11-BN [51] for CIFAR-10 [52] and SVHN [53]. Again, for each of these methods we tune the step size. The experiments were run on a cluster of 16 compute nodes instantiated on g2.2xlarge instances. The gradients of convolutional layers are 4 dimensional tensors with shape of [x, y, k, k] where x, y are two spatial dimensions and k is the size of the convolutional kernel. However, matrices are required to compute the SVD for spectral-ATOMO, and we choose to reshape each layer into a matrix of size [xy/2, 2k2]. This provides more flexibility on the sparsity budget for the SVD sparsification. For QSGD, we use the bucketing and Elias recursive coding methods proposed in [14], with bucket size equal to the number of parameters in each layer of the neural network. 0 10 20 WDOOcORck Time (hrV) 40 60 80 TeVW VeW Acc TeVW AccurDcy vV RuQWime BeVW Rf AT202 BeVW Rf 46GD TerQGrDG VDQiOOD 6GD (a) CIFAR-10, ResNet-18, Best of QSGD and SVD 0 5 10 15 20 WDOOcORck Time (hrV) 20 40 60 80 TeVW VeW Acc TeVW AccurDcy vV 5uQWime BeVW Rf AT202 BeVW Rf 46GD TerQGrDG VDQiOOD 6GD (b) SVHN, ResNet-18, Best of QSGD and SVD 0 10 20 WDOOcORck Time (hrV) 20 40 60 80 TeVW VeW Acc TeVW AccurDcy vV RuQWime BeVW Rf AT202 BeVW Rf 46GD TerQGrDG VDQiOOD 6GD (c) CIFAR-10, VGG11, Best of QSGD and SVD Figure 3: Convergence rates for the best performance of QSGD and spectral-ATOMO, alongside TernGrad and vanilla SGD. (a) uses ResNet-18 on CIFAR-10, (b) uses ResNet-18 on SVHN, and (c) uses VGG-11-BN on CIFAR-10. For brevity, we use SVD to denote spectral-ATOMO. 7 Figure 3 shows how the testing accuracy varies with wall clock time. Tables 3 and 4 give a detailed account of speedups of singular value sparsification compared to QSGD. In these tables, each method is run until a specified accuracy. 69D V 1 69D V 2 46GD b 1 46GD b 2 7erQGrDG 0ethoG 60% 63% 65% 68% 7eVt DccurDcy 3.06x 3.51x 2.19x 2.31x 1.45x 3.67x 3.6x 1.88x 2.22x 1.65x 3.01x 3.6x 1.46x 2.21x 2.19x 2.36x 2.78x 1.15x 2.01x 1.77x 69D V 3 69D V 4 46GD b 4 46GD b 8 7erQGrDG 0ethoG 65% 71% 75% 78% 7eVt DccurDcy 2.63x 1.84x 2.62x 1.79x 2.19x 2.81x 2.04x 1.81x 2.62x 1.22x 2.01x 1.79x 1.41x 1.78x 1.18x 1.81x 1.8x 1.67x 1.73x 1/A Table 3: Speedups of spectral-ATOMO with sparsity budget s, b-bit QSGD, and TernGrad using ResNet-18 on CIFAR10 over vanilla SGD. N/A stands for the method fails to reach a certain Test accuracy in fixed iterations. 69D V 3 69D V 4 46GD b 4 46GD b 8 7erQGrDG MethoG 75% 78% 82% 84% 7eVt DccurDcy 3.55x 2.75x 3.22x 2.36x 1.33x 2.84x 2.75x 2.68x 1.89x 1.23x 2.95x 2.28x 2.23x 2.35x 1.18x 3.11x 2.39x 2.34x 2.35x 1.34x 69D V 3 69D V 4 46GD b 4 46GD b 8 7erQGrDG 0ethoG 85% 86% 88% 89% 7eVt DccurDcy 3.15x 2.43x 2.67x 2.35x 1.21x 2.58x 2.19x 2.29x 2.1x 1/A 2.58x 2.19x 1.69x 2.09x 1/A 2.72x 2.27x 2.11x 2.14x 1/A Table 4: Speedups of spectral-ATOMO with sparsity budget s and b-bit QSGD, and TernGrad using ResNet-18 on SVNH over vanilla SGD. N/A stands for the method fails to reach a certain Test accuracy in fixed iterations. We observe that QSGD and ATOMO speed up model training significantly and achieve similar accuracy to vanilla mini-batch SGD. We also observe that the best performance is not achieve with the most sparsified, or quantized method, but the optimal method lies somewhere in the middle where enough information is preserved during the sparsification. For instance, 8-bit QSGD converges faster than 4-bit QSGD, and spectral-ATOMO with sparsity budget 3, or 4 seems to be the fastest. Higher sparsity can lead to a faster running time, but extreme sparsification can adversely affect convergence. For example, for a fixed number of iterations, 1-bit QSGD has the smallest time cost, but may converge much more slowly to an accurate model. 7 Conclusion In this paper, we present and analyze ATOMO, a general sparsification method for distributed stochastic gradient based methods. ATOMO applies to any atomic decomposition, including the entry-wise and the SVD of a matrix. ATOMO generalizes 1-bit QSGD and TernGrad, and provably minimizes the variance of the sparsified gradient subject to a sparsity constraint on the atomic decomposition. We focus on the use ATOMO for sparsifying matrices, especially the gradients in neural network training. We show that applying ATOMO to the singular values of these matrices can lead to faster training than both vanilla SGD or QSGD, for the same communication budget. We present extensive experiments showing that ATOMO can lead to up to a 2⇥speed-up in training time over QSGD and up to 3⇥ speed-up in training time over TernGrad. In the future, we plan to explore the use of ATOMO with Fourier decompositions, due to its utility and prevalence in signal processing. More generally, we wish to investigate which atomic sets lead to reduced communication costs. We also plan to examine how we can sparsify and compress gradients in a joint fashion to further reduce communication costs. Finally, when sparsifying the SVD of a matrix, we only sparsify the singular values. We also note that it would be interesting to explore jointly sparsification of the SVD and and its singular vectors, which we leave for future work. 8 References [1] Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, et al. TensorFlow: A system for large-scale machine learning. In OSDI, volume 16, pages 265–283, 2016. [2] Tianqi Chen, Mu Li, Yutian Li, Min Lin, Naiyan Wang, Minjie Wang, Tianjun Xiao, Bing Xu, Chiyuan Zhang, and Zheng Zhang. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv preprint arXiv:1512.01274, 2015. [3] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [4] Jeffrey Dean, Greg Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Mark Mao, Andrew Senior, Paul Tucker, Ke Yang, Quoc V Le, et al. Large scale distributed deep networks. In Advances in neural information processing systems, pages 1223–1231, 2012. [5] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Communication Association, 2014. [6] Nikko Strom. Scalable distributed DNN training using commodity gpu cloud computing. In Sixteenth Annual Conference of the International Speech Communication Association, 2015. [7] Hang Qi, Evan R. Sparks, and Ameet Talwalkar. Paleo: A performance model for deep neural networks. In Proceedings of the International Conference on Learning Representations, 2017. [8] Demjan Grubic, Leo Tam, Dan Alistarh, and Ce Zhang. Synchronous multi-GPU deep learning with low-precision communication: An experimental study. 2018. [9] 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. [10] Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, volume 1, page 3, 2017. [11] H Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, et al. Communicationefficient learning of deep networks from decentralized data. arXiv preprint arXiv:1602.05629, 2016. [12] Jakub Koneˇcn`y, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. Federated learning: Strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492, 2016. [13] Christopher M De Sa, Ce Zhang, Kunle Olukotun, and Christopher Ré. Taming the wild: A unified analysis of hogwild-style algorithms. In Advances in neural information processing systems, pages 2674–2682, 2015. [14] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communication-efficient SGD via gradient quantization and encoding. In Advances in Neural Information Processing Systems, pages 1707–1718, 2017. [15] Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. DoReFa-Net: training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. [16] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pages 1508–1518, 2017. 9 [17] Christopher De Sa, Matthew Feldman, Christopher Ré, and Kunle Olukotun. Understanding and optimizing asynchronous low-precision stochastic gradient descent. In Proceedings of the 44th Annual International Symposium on Computer Architecture, pages 561–574. ACM, 2017. [18] Hantian Zhang, Jerry Li, Kaan Kara, Dan Alistarh, Ji Liu, and Ce Zhang. Zipml: Training linear models with end-to-end low precision, and a little bit of deep learning. In International Conference on Machine Learning, pages 4035–4043, 2017. [19] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pages 525–542. Springer, 2016. [20] Christopher De Sa, Megan Leszczynski, Jian Zhang, Alana Marzoev, Christopher R Aberger, Kunle Olukotun, and Christopher Ré. High-accuracy low-precision training. arXiv preprint arXiv:1803.03383, 2018. [21] Jeremy Bernstein, Yu-Xiang Wang, Kamyar Azizzadenesheli, and Anima Anandkumar. signSGD: compressed optimisation for non-convex problems. arXiv preprint arXiv:1802.04434, 2018. [22] Horia Mania, Xinghao Pan, Dimitris Papailiopoulos, Benjamin Recht, Kannan Ramchandran, and Michael I Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. arXiv preprint arXiv:1507.06970, 2015. [23] Rémi Leblond, Fabian Pedregosa, and Simon Lacoste-Julien. ASAGA: asynchronous parallel SAGA. arXiv preprint arXiv:1606.04809, 2016. [24] Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. arXiv preprint arXiv:1704.05021, 2017. [25] Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887, 2017. [26] Chia-Yu Chen, Jungwook Choi, Daniel Brand, Ankur Agrawal, Wei Zhang, and Kailash Gopalakrishnan. Adacomp: Adaptive residual gradient compression for data-parallel distributed training. arXiv preprint arXiv:1712.02679, 2017. [27] Cèdric Renggli, Dan Alistarh, and Torsten Hoefler. SparCML: high-performance sparse communication for machine learning. arXiv preprint arXiv:1802.08021, 2018. [28] Yusuke Tsuzuku, Hiroto Imachi, and Takuya Akiba. Variance-based gradient compression for efficient distributed deep learning. arXiv preprint arXiv:1802.06058, 2018. [29] Jakub Koneˇcn`y and Peter Richtárik. Randomized distributed mean estimation: Accuracy vs communication. arXiv preprint arXiv:1611.07555, 2016. [30] Ananda Theertha Suresh, Felix X Yu, Sanjiv Kumar, and H Brendan McMahan. Distributed mean estimation with limited communication. arXiv preprint arXiv:1611.00429, 2016. [31] R Gitlin, J Mazo, and M Taylor. On the design of gradient algorithms for digitally implemented adaptive filters. IEEE Transactions on Circuit Theory, 20(2):125–136, 1973. [32] S Alexander. Transient weight misadjustment properties for the finite precision LMS algorithm. IEEE Transactions on Acoustics, Speech, and Signal Processing, 35(9):1250–1258, 1987. [33] José Carlos M Bermudez and Neil J Bershad. A nonlinear analytical model for the quantized LMS algorithm-the arbitrary step size case. IEEE Transactions on Signal Processing, 44(5):1175–1183, 1996. 10 [34] Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communication-efficient distributed optimization. arXiv preprint arXiv:1710.09854, 2017. [35] Jian Xue, Jinyu Li, and Yifan Gong. Restructuring of deep neural network acoustic models with singular value decomposition. In Interspeech, pages 2365–2369, 2013. [36] Tara N Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, pages 6655–6659. IEEE, 2013. [37] Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. arXiv preprint arXiv:1405.3866, 2014. [38] Simon Wiesler, Alexander Richard, Ralf Schluter, and Hermann Ney. Mean-normalized stochastic gradient for large-scale deep learning. In Acoustics, Speech and Signal Processing (ICASSP), 2014 IEEE International Conference on, pages 180–184. IEEE, 2014. [39] Andrew Cotter, Ohad Shamir, Nati Srebro, and Karthik Sridharan. Better mini-batch algorithms via accelerated gradient methods. In Advances in neural information processing systems, pages 1647–1655, 2011. [40] Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [41] Benjamin Recht, Christopher Re, Stephen Wright, and Feng Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in neural information processing systems, pages 693–701, 2011. [42] Sébastien Bubeck et al. Convex optimization: Algorithms and complexity. Foundations and Trends R⃝in Machine Learning, 8(3-4):231–357, 2015. [43] Christopher De Sa, Christopher Re, and Kunle Olukotun. Global convergence of stochastic gradient descent for some non-convex matrix problems. In International Conference on Machine Learning, pages 2332–2341, 2015. [44] Sashank J Reddi, Ahmed Hefny, Suvrit Sra, Barnabas Poczos, and Alex Smola. Stochastic variance reduction for nonconvex optimization. In International conference on machine learning, pages 314–323, 2016. [45] Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear convergence of gradient and proximalgradient methods under the Polyak-łojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016. [46] Soham De, Abhay Yadav, David Jacobs, and Tom Goldstein. Big Batch SGD: Automated inference using adaptive batch sizes. arXiv preprint arXiv:1610.05792, 2016. [47] Dong Yin, Ashwin Pananjady, Max Lam, Dimitris Papailiopoulos, Kannan Ramchandran, and Peter Bartlett. Gradient diversity: a key ingredient for scalable distributed learning. In International Conference on Artificial Intelligence and Statistics, pages 1998–2007, 2018. [48] Venkat Chandrasekaran, Benjamin Recht, Pablo A Parrilo, and Alan S Willsky. The convex geometry of linear inverse problems. Foundations of Computational mathematics, 12(6):805– 849, 2012. [49] Lisandro D Dalcin, Rodrigo R Paz, Pablo A Kler, and Alejandro Cosimo. Parallel distributed computing using python. Advances in Water Resources, 34(9):1124–1139, 2011. [50] 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. 2017. 11 [51] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [52] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [53] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, page 5, 2011. 12
2018
228
7,395
Depth-Limited Solving for Imperfect-Information Games Noam Brown, Tuomas Sandholm, Brandon Amos Computer Science Department Carnegie Mellon University noamb@cs.cmu.edu, sandholm@cs.cmu.edu, bamos@cs.cmu.edu Abstract A fundamental challenge in imperfect-information games is that states do not have well-defined values. As a result, depth-limited search algorithms used in singleagent settings and perfect-information games do not apply. This paper introduces a principled way to conduct depth-limited solving in imperfect-information games by allowing the opponent to choose among a number of strategies for the remainder of the game at the depth limit. Each one of these strategies results in a different set of values for leaf nodes. This forces an agent to be robust to the different strategies an opponent may employ. We demonstrate the effectiveness of this approach by building a master-level heads-up no-limit Texas hold’em poker AI that defeats two prior top agents using only a 4-core CPU and 16 GB of memory. Developing such a powerful agent would have previously required a supercomputer. 1 Introduction Imperfect-information games model strategic interactions between agents with hidden information. The primary benchmark for this class of games is poker, specifically heads-up no-limit Texas hold’em (HUNL), in which Libratus defeated top humans in 2017 [6]. The key breakthrough that led to superhuman performance was nested solving, in which the agent repeatedly calculates a finer-grained strategy in real time (for just a portion of the full game) as play proceeds down the game tree [5, 27, 6]. However, real-time subgame solving was too expensive for Libratus in the first half of the game because the portion of the game tree Libratus solved in real time, known as the subgame, always extended to the end of the game. Instead, for the first half of the game Libratus pre-computed a finegrained strategy that was used as a lookup table. While this pre-computed strategy was successful, it required millions of core hours and terabytes of memory to calculate. Moreover, in deeper sequential games the computational cost of this approach would be even more expensive because either longer subgames or a larger pre-computed strategy would need to be solved. A more general approach would be to solve depth-limited subgames, which may not extend to the end of the game. These could be solved even in the early portions of a game. The poker AI DeepStack does this using a technique similar to nested solving that was developed independently [27]. However, while DeepStack defeated a set of non-elite human professionals in HUNL, it never defeated prior top AIs despite using over one million core hours to train the agent, suggesting its approach may not be sufficiently efficient in domains like poker. We discuss this in more detail in Section 7. This paper introduces a different approach to depth-limited solving that defeats prior top AIs and is computationally orders of magnitude less expensive. When conducting depth-limited solving, a primary challenge is determining what values to substitute at the leaf nodes of the depth-limited subgame. In perfect-information depth-limited subgames, the value substituted at leaf nodes is simply an estimate of the state’s value when all players play an 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. equilibrium [35, 33]. For example, this approach was used to achieve superhuman performance in backgammon [39], chess [9], and Go [36, 37]. The same approach is also widely used in single-agent settings such as heuristic search [30, 24, 31, 15]. Indeed, in single-agent and perfect-information multi-agent settings, knowing the values of states when all agents play an equilibrium is sufficient to reconstruct an equilibrium. However, this does not work in imperfect-information games, as we demonstrate in the next section. 2 The Challenge of Depth-Limited Solving in Imperfect-Information Games In imperfect-information games (also referred to as partially-observable games), an optimal strategy cannot be determined in a subgame simply by knowing the values of states (i.e., game-tree nodes) when all players play an equilibrium strategy. A simple demonstration is in Figure 1a, which shows a sequential game we call Rock-Paper-Scissors+ (RPS+). RPS+ is identical to traditional Rock-PaperScissors, except if either player plays Scissors, the winner receives 2 points instead of 1 (and the loser loses 2 points). Figure 1a shows RPS+ as a sequential game in which P1 acts first but does not reveal the action to P2 [7, 13]. The optimal strategy (Minmax strategy, which is also a Nash equilibrium in two-player zero-sum games) for both players in this game is to choose Rock and Paper each with 40% probability, and Scissors with 20% probability. In this equilibrium, the expected value to P1 of choosing Rock is 0, as is the value of choosing Scissors or Paper. In other words, all the red states in Figure 1a have value 0 in the equilibrium. Now suppose P1 conducts a depth-limited search with a depth of one in which the equilibrium values are substituted at that depth limit. This depth-limited subgame is shown in Figure 1b. Clearly, there is not enough information in this subgame to arrive at the optimal strategy of 40%, 40%, and 20% for Rock, Paper, and Scissors, respectively. 𝑷𝟏 𝑷𝟐 Paper 0,0 -1,1 2,-2 𝑷𝟐 Paper 1,-1 0,0 -2,2 𝑷𝟐 Paper -2,2 2,-2 0,0 Paper 𝑃= 0.4 𝑃= 0.2 𝑃= 0.4 (a) Rock-Paper-Scissors+ shown with the optimal P1 strategy. The terminal values are shown first for P1, then P2. The red lines between the P2 nodes means they are indistinguishable to P2. Paper 𝑷𝟏 0,0 0,0 0,0 (b) A depth-limited subgame of Rock-Paper-Scissors+ with state values determined from the equilibrium. In the RPS+ example, the core problem is that we incorrectly assumed P2 would always play a fixed strategy. If indeed P2 were to always play Rock, Paper, and Scissors with probability ⟨0.4, 0.4, 0.2⟩, then P1 could choose any arbitrary strategy and receive an expected value of 0. However, by assuming P2 is playing a fixed strategy, P1 may not find a strategy that is robust to P2 adapting. In reality, P2’s optimal strategy depends on the probability that P1 chooses Rock, Paper, and Scissors. In general, in imperfect-information games a player’s optimal strategy at a decision point depends on the player’s belief distribution over states as well as the strategy of all other agents beyond that decision point. In this paper we introduce a method for depth-limited solving that ensures a player is robust to such opponent adaptations. Rather than simply substitute a single state value at a depth limit, we instead allow the opponent one final choice of action at the depth limit, where each action corresponds to a strategy the opponent will play in the remainder of the game. The choice of strategy determines the value of the state. The opponent does not make this choice in a way that is specific to the state (in which case he would trivially choose the maximum value for himself). Instead, naturally, the opponent must make the same choice at all states that are indistinguishable to him. We prove that if the opponent is given a choice between a sufficient number of strategies at the depth limit, then any solution to the depth-limited subgame is part of a Nash equilibrium strategy in the full game. We also show experimentally that when only a few choices are offered (for computational speed), performance of the method is extremely strong. 2 3 Notation and Background In an imperfect-information extensive-form game there is a finite set of players, P. A state (also called a node) is defined by all information of the current situation, including private knowledge known to only one player. A unique player P(h) acts at state h. H is the set of all states in the game tree. The state h′ reached after an action is taken in h is a child of h, represented by h · a = h′, while h is the parent of h′. If there exists a sequence of actions from h to h′, then h is an ancestor of h′ (and h′ is a descendant of h), represented as h ⊏h′. Z ⊆H are terminal states for which no actions are available. For each player i ∈P, there is a payoff function ui : Z →R. If P = {1, 2} and u1 = −u2, the game is two-player zero-sum. In this paper we assume the game is two-player zero-sum, though many of the ideas extend to general sum and more than two players. Imperfect information is represented by information sets (infosets) for each player i ∈P. For any infoset I belonging to player i, all states h, h′ ∈I are indistinguishable to player i. Moreover, every non-terminal state h ∈H belongs to exactly one infoset for each player i. A strategy σi(I) (also known as a policy) is a probability vector over actions for player i in infoset I. The probability of a particular action a is denoted by σi(I, a). Since all states in an infoset belonging to player i are indistinguishable, the strategies in each of them must be identical. We define σi to be a strategy for player i in every infoset in the game where player i acts. A strategy is pure if all probabilities in it are 0 or 1. All strategies are a linear combination of pure strategies. A strategy profile σ is a tuple of strategies, one for each player. The strategy of every player other than i is represented as σ−i. ui(σi, σ−i) is the expected payoff for player i if all players play according to the strategy profile ⟨σi, σ−i⟩. The value to player i at state h given that all players play according to strategy profile σ is defined as vσ i (h), and the value to player i at infoset I is defined as vσ(I) = P h∈I p(h)vσ i (h)  , where p(h) is player i’s believed probability that they are in state h, conditional on being in infoset I, based on the other players’ strategies and chance’s probabilities. A best response to σ−i is a strategy BR(σ−i) such that ui(BR(σ−i), σ−i) = maxσ′ i ui(σ′ i, σ−i). A Nash equilibrium σ∗is a strategy profile where every player plays a best response: ∀i, ui(σ∗ i , σ∗ −i) = maxσ′ i ui(σ′ i, σ∗ −i) [29]. A Nash equilibrium strategy for player i is a strategy σ∗ i that is part of any Nash equilibrium. In two-player zero-sum games, if σi and σ−i are both Nash equilibrium strategies, then ⟨σi, σ−i⟩is a Nash equilibrium. A depth-limited imperfect-information subgame, which we refer to simply as a subgame, is a contiguous portion of the game tree that does not divide infosets. Formally, a subgame S is a set of states such that for all h ∈S, if h ∈Ii and h′ ∈Ii for some player i, then h′ ∈S. Moreover, if x ∈S and z ∈S and x ⊏y ⊏z, then y ∈S. If h ∈S but no descendant of h is in S, then h is a leaf node. Additionally, the infosets containing h are leaf infosets. Finally, if h ∈S but no ancestor of h is in S, then h is a root node and the infosets containing h are root infosets. 4 Multi-Valued States in Imperfect-Information Games In this section we describe our new method for depth-limited solving in imperfect-information games, which we refer to as multi-valued states. Our general approach is to first precompute an approximate Nash equilibrium for the entire game. We refer to this precomputed strategy profile as a blueprint strategy. Since the blueprint is precomputed for the entire game, it is likely just a coarse approximation of a true Nash equilibrium. Our goal is to compute a better approximation in real time for just a depth-limited subgame S that we find ourselves in during play. For the remainder of this paper, we assume that player P1 is attempting to approximate a Nash equilibrium strategy in S. Let σ∗be an exact Nash equilibrium. To present the intuition for our approach, we begin by considering what information about σ∗would, in theory, be sufficient in order to compute a P1 Nash equilibrium strategy in S. For ease of understanding, when considering the intuition for multi-valued states we suggest the reader first focus on the case where S is rooted at the start of the game (that is, no prior actions have occurred). As explained in Section 2, knowing the values of leaf nodes in S when both players play according to σ∗(that is, vσ∗ i (h) for leaf node h and player Pi) is insufficient to compute a Nash equilibrium in S (even though this is sufficient in perfect-information games), because it assumes P2 would not adapt their strategy outside S. But what if P2 could adapt? Specifically, suppose hypothetically that P2 3 could choose any strategy in the entire game, while P1 could only play according to σ∗ 1 outside of S. In this case, what strategy should P1 choose in S? Since σ∗ 1 is a Nash equilibrium strategy and P2 can choose any strategy in the game (including a best response to P1’s strategy), so by definition P1 cannot do better than playing σ∗ 1 in S. Thus, P1 should play σ∗ 1 (or some equally good Nash equilibrium) in S. Another way to describe this setup is that upon reaching a leaf node h in infoset I in subgame S, rather than simply substituting vσ∗ 2 (h) (which assumes P2 plays according to σ∗ 2 for the remainder of the game), P2 could instead choose any mixture of pure strategies for the remainder of the game. So if there are N possible pure strategies following I, P2 would choose among N actions upon reaching I, where action n would correspond to playing pure strategy σn 2 for the remainder of the game. Since this choice is made separately at each infoset I and since P2 may mix between pure strategies, so this allows P2 to choose any strategy below S. Since the choice of action would define a P2 strategy for the remainder of the game and since P1 is known to play according to σ∗ 1 outside S, so the chosen action could immediately reward the expected value v⟨σ∗ 1,σn 2 ⟩ i (h) to Pi. Therefore, in order to reconstruct a P1 Nash equilibrium in S, it is sufficient to know for every leaf node the expected value of every pure P2 strategy against σ∗ 1 (stated formally in Proposition 1). This is in contrast to perfect-information games, in which it is sufficient to know for every leaf node just the expected value of σ∗ 2 against σ∗ 1. Critically, it is not necessary to know the strategy σ∗ 1, just the values of σ∗ 1 played against every pure opponent strategy in each leaf node. Proposition 1 adds the condition that we know v⟨σ∗ 1,BR(σ∗ 1)⟩ 2 (I) for every root infoset I ∈S. This condition is used if S does not begin at the start of the game. Knowledge of v⟨σ∗ 1,BR(σ∗ 1)⟩ 2 (I) is needed to ensure that any strategy σ1 that P1 computes in S cannot be exploited by P2 changing their strategy earlier in the game. Specifically, we add a constraint that v⟨σ1,BR(σ∗ 1)⟩ 2 (I) ≤v⟨σ∗ 1,BR(σ∗ 1)⟩ 2 (I) for all P2 root infosets I. This makes our technique safe: Proposition 1. Assume P1 has played according to Nash equilibrium strategy σ∗ 1 prior to reaching a depth-limited subgame S of a two-player zero-sum game. In order to calculate the portion of a P1 Nash equilibrium strategy that is in S, it is sufficient to know v⟨σ∗ 1,BR(σ∗ 1)⟩ 2 (I) for every root P2 infoset I ∈S and v⟨σ∗ 1,σ2⟩ 1 (h) for every pure undominated P2 strategy σ2 and every leaf node h ∈S. Other safe subgame solving techniques have been developed in recent papers, but those techniques require solving to the end of the full game [7, 17, 28, 5, 6] (except one [27], which we will compare to in Section 7). Of course, it is impractical to know the expected value in every state of every pure P2 strategy against σ∗ 1, especially since we do not know σ∗ 1 itself. To deal with this, we first compute a blueprint strategy ˆσ∗(that is, a precomputed approximate Nash equilibrium for the full game). Next, rather than consider every pure P2 strategy, we instead consider just a small number of different P2 strategies (that may or may not be pure). Indeed, in many complex games, the possible opponent strategies at a decision point can be approximately grouped into just a few “meta-strategies”, such as which highway lane a car will choose in a driving simulation. In our experiments, we find that excellent performance is obtained in poker with fewer than ten opponent strategies. In part, excellent performance is possible with a small number of strategies because the choice of strategy beyond the depth limit is made separately at each leaf infoset. Thus, if the opponent chooses between ten strategies at the depth limit, but makes this choice independently in each of 100 leaf infosets, then the opponent is actually choosing between 10100 different strategies. We now consider two questions. First, how do we compute the blueprint strategy ˆσ∗ 1? Second, how do we determine the set of P2 strategies? We answer each of these in turn. There exist several methods for constructing a blueprint. One option, which achieves the best empirical results and is what we use, involves first abstracting the game by bucketing together similar situations [19, 12] and then applying the iterative algorithm Monte Carlo Counterfactual Regret Minimization [22]. Several alternatives exist that do not use a distinct abstraction step [3, 16, 10]. The agent will never actually play according to the blueprint ˆσ∗. It is only used to estimate v⟨σ∗ 1,σ2⟩(h). We now discuss two different ways to select a set of P2 strategies. Ultimately we would like the set of P2 strategies to contain a diverse set of intelligent strategies the opponent might play, so that P1’s solution in a subgame is robust to possible P2 adaptation. One option is to bias the P2 blueprint 4 strategy ˆσ∗ 2 in a few different ways. For example, in poker the blueprint strategy should be a mixed strategy involving some probability of folding, calling, or raising. We could define a new strategy σ′ 2 in which the probability of folding is multiplied by 10 (and then all the probabilities renormalized). If the blueprint strategy ˆσ∗were an exact Nash equilibrium, then any such “biased” strategy σ′ 2 in which the probabilities are arbitrarily multiplied would still be a best response to ˆσ∗ 1. In our experiments, we use this biasing of the blueprint strategy to construct a set of four opponent strategies on the second betting round. We refer to this as the bias approach. Another option is to construct the set of P2 strategies via self-play. The set begins with just one P2 strategy: the blueprint strategy ˆσ∗ 2. We then solve a depth-limited subgame rooted at the start of the game and going to whatever depth is feasible to solve, giving P2 only the choice of this P2 strategy at leaf infosets. That is, at leaf node h we simply substitute vˆσ∗ i (h) for Pi. Let the P1 solution to this depth-limited subgame be σ1. We then approximate a P2 best response assuming P1 plays according to σ1 in the depth-limited subgame and according to ˆσ∗ 1 in the remainder of the game. Since P1 plays according to this fixed strategy, approximating a P2 best response is equivalent to solving a Markov Decision Process, which is far easier to solve than an imperfect-information game. This P2 approximate best response is added to the set of strategies that P2 may choose at the depth limit, and the depth-limited subgame is solved again. This process repeats until the set of P2 strategies grows to the desired size. This self-generative approach bears some resemblance to the double oracle algorithm [26] and recent work on generation of opponent strategies in multi-agent RL [23]. In our experiments, we use this self-generative method to construct a set of ten opponent strategies on the first betting round. We refer to this as the self-generative approach. One practical consideration is that since ˆσ∗ 1 is not an exact Nash equilibrium, a generated P2 strategy σ2 may do better than ˆσ∗ 2 against ˆσ∗ 1. In that case, P1 may play more conservatively than σ∗ 1 in a depth-limited subgame. To correct for this, one can balance the players by also giving P1 a choice between multiple strategies for the remainder of the game at the depth limit. Alternatively, one can “weaken” the generated P2 strategies so that they do no better than ˆσ∗ 2 against ˆσ∗ 1. Formally, if v⟨ˆσ∗ 1,σ2⟩ 2 (I) > v⟨ˆσ∗ 1,ˆσ∗ 2⟩ 2 (I), we uniformly lower v⟨ˆσ∗ 1,σ2⟩ 2 (h) for h ∈I by v⟨ˆσ∗ 1,σ2⟩ 2 (I) −v⟨ˆσ∗ 1,ˆσ∗ 2⟩ 2 (I). Another alternative (or additional) solution would be to simply reduce v⟨ˆσ∗ 1,σ2⟩ 2 (h) for σ2 ̸= ˆσ∗ 2 by some heuristic amount, such as a small percentage of the pot in poker. Once a P1 strategy ˆσ∗ 1 and a set of P2 strategies have been generated, we need some way to calculate and store v⟨ˆσ∗ 1,σ2⟩ 2 (h). Calculating the state values can be done by traversing the entire game tree once. However, that may not be feasible in large games. Instead, one can use Monte Carlo simulations to approximate the values. For storage, if the number of states is small (such as in the early part of the game tree), one could simply store the values in a table. More generally, one could train a function to predict the values corresponding to a state, taking as input a description of the state and outputting a value for each P2 strategy. Alternatively, one could simply store ˆσ∗ 1 and the set of P2 strategies. Then, in real time, the value of a state could be estimated via Monte Carlo rollouts. We present results for both of these approaches in Section 6. 5 Nested Solving of Imperfect-Information Games We use the new idea discussed in the previous section in the context of nested solving, which is a way to repeatedly solve subgames as play descends down the game tree [5]. Whenever an opponent chooses an action, a subgame is generated following that action. This subgame is solved, and its solution determines the strategy to play until the next opponent action is taken. Nested solving is particularly useful in dealing with large or continuous action spaces, such as an auction that allows any bid in dollar increments up to $10,000. To make these games feasible to solve, it is common to apply action abstraction, in which the game is simplified by considering only a few actions (both for ourselves and for the opponent) in the full action space. For example, an action abstraction might only consider bid increments of $100. However, if the opponent chooses an action that is not in the action abstraction (called an off-tree action), the optimal response to that opponent action is undefined. Prior to the introduction of nested solving, it was standard to simply round off-tree actions to a nearby in-abstraction action (such as treating an opponent bid of $150 as a bid of $200) [14, 34, 11]. Nested solving allows a response to be calculated for off-tree actions by constructing and solving a subgame 5 that immediately follows that action. The goal is to find a strategy in the subgame that makes the opponent no better off for having chosen the off-tree action than an action already in the abstraction. Depth-limited solving makes nested solving feasible even in the early game, so it is possible to play without acting according to a precomputed strategy or using action translation. At the start of the game, we solve a depth-limited subgame (using action abstraction) to whatever depth is feasible. This determines our first action. After every opponent action, we solve a new depth-limited subgame that attempts to make the opponent no better off for having chosen that action than an action that was in our previous subgame’s action abstraction. This new subgame determines our next action, and so on. 6 Experiments We conducted experiments on the games of heads-up no-limit Texas hold’em poker (HUNL) and heads-up no-limit flop hold’em poker (NLFH). Appendix B reminds the reader of the rules of these games. HUNL is the main large-scale benchmark for imperfect-information game AIs. NLFH is similar to HUNL, except the game ends immediately after the second betting round, which makes it small enough to precisely calculate best responses and Nash equilibria. Performance is measured in terms of mbb/g, which is a standard win rate measure in the literature. It stands for milli-big blinds per game and represents how many thousandths of a big blind (the initial money a player must commit to the pot) a player wins on average per hand of poker played. 6.1 Exploitability Experiments in No-Limit Flop Hold’em (NLFH) Our first experiment measured the exploitability of our technique in NLFH. Exploitability of a strategy in a two-player zero-sum game is how much worse the strategy would do against a best response than a Nash equilibrium strategy would do against a best response. Formally, the exploitability of σ1 is minσ2 u1(σ∗ 1, σ2) −minσ2 u1(σ1, σ2), where σ∗ 1 is a Nash equilibrium strategy. We considered the case of P1 betting 0.75× the pot at the start of the game, when the action abstraction only contains bets of 0.5× and 1× the pot. We compared our depth-limited solving technique to the randomized pseudoharmonic action translation (RPAT) [11], in which the bet of 0.75× is simply treated as either a bet of 0.5× or 1×. RPAT is the lowest-exploitability known technique for responding to off-tree actions that does not involve real-time computation. We began by calculating an approximate Nash equilibrium in an action abstraction that does not include the 0.75× bet. This was done by running the CFR+ equilibrium-approximation algorithm [38] for 1,000 iterations, which resulted in less than 1 mbb/g of exploitability within the action abstraction. Next, values for the states at the end of the first betting round within the action abstraction were determined using the self-generative method discussed in Section 4. Since the first betting round is a small portion of the entire game, storing a value for each state in a table required just 42 MB. To determine a P2 strategy in response to the 0.75× bet, we constructed a depth-limited subgame rooted after the 0.75× bet with leaf nodes at the end of the first betting round. The values of a leaf node in this subgame were set by first determining the in-abstraction leaf nodes corresponding to the exact same sequence of actions, except P1 initially bets 0.5× or 1× the pot. The leaf node values in the 0.75× subgame were set to the average of those two corresponding value vectors. When the end of the first betting round was reached and the board cards were dealt, the remaining game was solved using safe subgame solving. Figure 2 shows how exploitability decreases as we add state values (that is, as we give P1 more best responses to choose from at the depth limit). When using only one state value at the depth limit (that is, assuming P1 would always play according to the blueprint strategy for the remainder of the game), it is actually better to use RPAT. However, after that our technique becomes significantly better and at 16 values its performance is close to having had the 0.75× action in the abstraction in the first place. While one could have calculated a (slightly better) P2 strategy in response to the 0.75× bet by solving to the end of the game, that subgame would have been about 10,000× larger than the subgames solved in this experiment. Thus, depth-limited solving dramatically reduces the computational cost of nested subgame solving while giving up very little solution quality. 6 0 2 4 6 8 10 12 14 1 2 4 8 16 32 Exploitability (mb/g) Number of Values Per State Exploitability of depth-limited solving in NLFH Action Translation Multi-State Values In-Abstraction Figure 2: Exploitability of depth-limited solving in response to an opponent off-tree action as a function of number of state values. We compare to action translation and to having had the off-tree action included in the action abstraction (which is a lower bound on the exploitability achievable with 1,000 iterations of CFR+). 6.2 Experiments Against Top AIs in Heads-Up No-Limit Texas Hold’em (HUNL) Our main experiment uses depth-limited solving to produce a master-level HUNL poker AI called Modicum using computing resources found in a typical laptop. We test Modicum against Baby Tartanian8 [4], the winner of the 2016 Annual Computer Poker Competition, and against Slumbot [18], the winner of the 2018 Annual Computer Poker Competition. Neither Baby Tartanian8 nor Slumbot uses real time computation; their strategies are a precomputed lookup table. Baby Tartanian8 used about 2 million core hours and 18 TB of RAM to compute its strategy. Slumbot used about 250,000 core hours and 2 TB of RAM to compute its strategy. In contrast, Modicum used just 700 core hours and 16GB of RAM to compute its strategy and can play in real time at the speed of human professionals (an average of 20 seconds for an entire hand of poker) using just a 4-core CPU. We now describe Modicum and provide details of its construction in Appendix A. The blueprint strategy for Modicum was constructed by first generating an abstraction of HUNL using state-of-the-art abstraction techniques [12, 20]. Storing a strategy for this abstraction as 4-byte floats requires just 5 GB. This abstraction was approximately solved by running Monte Carlo Counterfactual Regret Minimization for 700 core hours [22]. HUNL consists of four betting rounds. We conduct depth-limited solving on the first two rounds by solving to the end of that round using MCCFR. Once the third betting round is reached, the remaining game is small enough that we solve to the end of the game using an enhanced form of CFR+ described in the appendix. We generated 10 values for each state at the end of the first betting round using the self-generative approach. The first betting round was small enough to store all of these state values in a table using 240 MB. For the second betting round, we used the bias approach to generate four opponent best responses. The first best response is simply the opponent’s blueprint strategy. For the second, we biased the opponent’s blueprint strategy toward folding by multiplying the probability of fold actions by 10 and then renormalizing. For the third, we biased the opponent’s blueprint strategy toward checking and calling. Finally for the fourth, we biased the opponent’s blueprint strategy toward betting and raising. To estimate the values of a state when the depth limit is reached on the second round, we sample rollouts of each of the stored best-response strategies. The performance of Modicum is shown in Table 1. For the evaluation, we used AIVAT to reduce variance [8]. Our new agent defeats both Baby Tartanian8 and Slumbot with statistical significance. For comparison, Baby Tartanian8 defeated Slumbot by 36 ± 12 mbb/g, Libratus defeated Baby Tartanian8 by 63 ± 28 mbb/g, and Libratus defeated top human professionals by 147 ± 77 mbb/g. In addition to head-to-head performance against prior top AIs, we also tested Modicum against two versions of Local Best Response (LBR) [25]. An LBR agent is given full access to its opponent’s full-game strategy and uses that knowledge to exactly calculate the probability the LBR agent is in each possible state. Given that probability distribution and a heuristic for how the opposing agent will play thereafter, the LBR agent chooses a best response action. LBR is a way to calculate a lower bound on exploitability and has been shown to be effective in exploiting agents that do not use real-time solving. 7 Baby Tartanian8 Slumbot Blueprint (No real-time solving) −57 ± 13 −11 ± 8 Naïve depth-limited solving −10 ± 8 −1 ± 15 Depth-limited solving 6 ± 5 11 ± 9 Table 1: Head to head performance of our new agent against Baby Tartanian8 and Slumbot with 95% confidence intervals shown. Our new agent defeats both opponents with statistical significance. Naïve depth-limited solving means states are assumed to have just a single value, which is determined by the blueprint strategy. In the first version of LBR we tested against, the LBR agent was limited to either folding or betting 0.75× the pot on the first action, and thereafter was limited to either folding or calling. Modicum beat this version of LBR by 570 ± 42 mbb/g. The second version of LBR we tested against could bet 10 different amounts on the flop that Modicum did not include in its blueprint strategy. Much like the experiment in Section 6.1, this was intended to measure how vulnerable Modicum is to unanticipated bet sizes. The LBR agent was limited to betting 0.75× the pot for the first action of the game and calling for the remaining actions on the preflop. On the flop, the LBR agent could either fold, call, or bet 0.33 × 2x times the pot for x ∈{0, 1, ..., 10}. On the remaining rounds the LBR agent could either fold or call. Modicum beat this version of LBR by 1377 ± 115 mbb/g. In contrast, similar forms of LBR have been shown to defeat prior top poker AIs that do not use real-time solving by hundreds or thousands of mbb/g [25]. While our new agent is probably not as strong as Libratus, it was produced with less than 0.1% of the computing resources and memory, and is never vulnerable to off-tree opponent actions. While the rollout method used on the second betting round worked well, rollouts may be significantly more expensive in deeper games. To demonstrate the generality of our approach, we also trained a deep neural network (DNN) to predict the values of states at the end of the second betting round as an alternative to using rollouts. The DNN takes as input a 34-float vector of features describing the state, and outputs four floats representing the values of the state for the four possible opponent strategies (represented as a fraction of the size of the pot). The DNN was trained using 180 million examples per player by optimizing the Huber loss with Adam [21], which we implemented using PyTorch [32]. In order for the network to run sufficiently fast on just a 4-core CPU, the DNN has just 4 hidden layers with 256 nodes in the first hidden layer and 128 nodes in the remaining hidden layers. This achieved a Huber loss of 0.02. Using a DNN rather than rollouts resulted in the agent beating Baby Tartanian8 by 2 ± 9 mbb/g. However, the average time taken using a 4-core CPU increased from 20 seconds to 31 seconds per hand. Still, these results demonstrate the generality of our approach. 7 Comparison to Prior Work Section 2 demonstrated that in imperfect-information games, states do not have unique values and therefore the techniques common in perfect-information games and single-agent settings do not apply. This paper introduced a way to overcome this challenge by assigning multiple values to states. A different approach is to modify the definition of a “state” to instead be all players’ belief probability distributions over states, which we refer to as a joint belief state. This technique was previously used to develop the poker AI DeepStack [27]. While DeepStack defeated non-elite human professionals in HUNL, it was never shown to defeat prior top AIs even though it used over 1,000,000 core hours of computation. In contrast, Modicum defeated two prior top AIs with less than 1,000 core hours of computation. Still, there are benefits and drawbacks to both approaches, which we now describe in detail. The right choice may depend on the domain and future research may change the competitiveness of either approach. A joint belief state is defined by a probability (belief) distribution for each player over states that are indistinguishable to the player. In poker, for example, a joint belief state is defined by each players’ belief about what cards the other players are holding. Joint belief states maintain some of the properties that regular states have in perfect-information games. In particular, it is possible to determine an optimal strategy in a subgame rooted at a joint belief state independently from the rest of the game. Therefore, joint belief states have unique, well-defined values that are not influenced by the strategies played in disjoint portions of the game tree. Given a joint belief state, it is also possible 8 to define the value of each root infoset for each player. In the example of poker, this would be the value of a player holding a particular poker hand given the joint belief state. One way to do depth-limited subgame solving, other than the method we describe in this paper, is to learn a function that maps joint belief states to infoset values. When conducting depth-limited solving, one could then set the value of a leaf infoset based on the joint belief state at that leaf infoset. One drawback is that because a player’s belief distribution partly defines a joint belief state, the values of the leaf infosets must be recalculated each time the strategy in the subgame changes. With the best domain-specific iterative algorithms, this would require recalculating the leaf infosets about 500 times. Monte Carlo algorithms, which are the preferred domain-independent method of solving imperfect-information games, may change the strategy millions of times in a subgame, which poses a problem for the joint belief state approach. In contrast, our multi-valued state approach requires only a single function call for each leaf node regardless of the number of iterations conducted. Moreover, evaluating multi-valued states with a function approximator is cheaper and more scalable to large games than joint belief states. The input to a function that predicts the value of a multi-valued state is simply the state description (for example, the sequence of actions), and the output is several values. In our experiments, the input was 34 floats and the output was 4 floats. In contrast, the input to a function that predicts the values of a joint belief state is a probability vector for each player over the possible states they may be in. For example, in HUNL, the input is more than 2,000 floats and the output is more than 1,000 floats. The input would be even larger in games with more states per infoset. Another drawback is that learning a mapping from joint belief states to infoset values is computationally more expensive than learning a mapping from states to a set of values. For example, Modicum required less than 1,000 core hours to create this mapping. In contrast, DeepStack required over 1,000,000 core hours to create its mapping. The increased cost is partly because computing training data for a joint belief state value mapping is inherently more expensive. The multi-valued states approach is learning the values of best responses to a particular strategy (namely, the approximate Nash equilibrium strategy ˆσ∗ 1). In contrast, a joint belief state value mapping is learning the value of all players playing an equilibrium strategy given that joint belief state. As a rough guideline, computing an equilibrium is about 1,000× more expensive than computing a best response in large games [1]. On the other hand, the multi-valued state approach requires knowledge of a blueprint strategy that is already an approximate Nash equilibrium. A benefit of the joint belief state approach is that rather than simply learning best responses to a particular strategy, it is learning best responses against every possible strategy. This may be particularly useful in self-play settings where the blueprint strategy is unknown, because it may lead to increasingly more sophisticated strategies. Another benefit of the joint belief state approach is that in many games (but not all) it obviates the need to keep track of the sequence of actions played. For example, in poker if there are two different sequences of actions that result in the same amount of money in the pot and all players having the same belief distribution over what their opponents’ cards are, then the optimal strategy in both of those situations is the same. This is similar to how in Go it is not necessary to know the exact sequence of actions that were played. Rather, it is only necessary to know the current configuration of the board (and, in certain situations, also the last few actions played). A further benefit of the joint belief state approach is that its run-time complexity does not increase with the degree of precision other than needing a better (possibly more computationally expensive) function approximator. In contrast, for our algorithm the computational complexity of finding a solution to a depth-limited subgame grows linearly with the number of values per state. 8 Conclusions We introduced a principled method for conducting depth-limited solving in imperfect-information games. Experimental results show that this leads to stronger performance than the best precomputedstrategy AIs in HUNL while using orders of magnitude less computational resources, and is also orders of magnitude more efficient than past approaches that use real-time solving. Additionally, the method exhibits low exploitability. In addition to using less resources, this approach broadens the applicability of nested real-time solving to longer games. 9 9 Acknowledgments This material is based on work supported by the National Science Foundation under grants IIS1718457, IIS-1617590, and CCF-1733556, and the ARO under award W911NF-17-1-0082, as well as XSEDE computing resources provided by the Pittsburgh Supercomputing Center. We thank Thore Graepel, Marc Lanctot, David Silver, Ariel Procaccia, Fei Fang, and our anonymous reviewers for helpful inspiration, feedback, suggestions, and support. References [1] Michael Bowling, Neil Burch, Michael Johanson, and Oskari Tammelin. Heads-up limit hold’em poker is solved. Science, 347(6218):145–149, January 2015. [2] Noam Brown, Sam Ganzfried, and Tuomas Sandholm. Hierarchical abstraction, distributed equilibrium computation, and post-processing, with application to a champion no-limit texas hold’em agent. In Proceedings of the 2015 International Conference on Autonomous Agents and Multiagent Systems, pages 7–15. International Foundation for Autonomous Agents and Multiagent Systems, 2015. [3] Noam Brown and Tuomas Sandholm. Simultaneous abstraction and equilibrium finding in games. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), 2015. [4] Noam Brown and Tuomas Sandholm. Baby Tartanian8: Winning agent from the 2016 annual computer poker competition. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16), pages 4238–4239, 2016. [5] Noam Brown and Tuomas Sandholm. Safe and nested subgame solving for imperfectinformation games. In Advances in Neural Information Processing Systems, pages 689–699, 2017. [6] Noam Brown and Tuomas Sandholm. Superhuman AI for heads-up no-limit poker: Libratus beats top professionals. Science, page eaao1733, 2017. [7] Neil Burch, Michael Johanson, and Michael Bowling. Solving imperfect information games using decomposition. In AAAI Conference on Artificial Intelligence (AAAI), pages 602–608, 2014. [8] Neil Burch, Martin Schmid, Matej Moravˇcík, and Michael Bowling. AIVAT: A new variance reduction technique for agent evaluation in imperfect information games. 2016. [9] Murray Campbell, A Joseph Hoane, and Feng-Hsiung Hsu. Deep Blue. Artificial intelligence, 134(1-2):57–83, 2002. [10] Jiri Cermak, Viliam Lisy, and Branislav Bosansky. Constructing imperfect recall abstractions to solve large extensive-form games. arXiv preprint arXiv:1803.05392, 2018. [11] Sam Ganzfried and Tuomas Sandholm. Action translation in extensive-form games with large action spaces: axioms, paradoxes, and the pseudo-harmonic mapping. In Proceedings of the Twenty-Third international joint conference on Artificial Intelligence, pages 120–128. AAAI Press, 2013. [12] Sam Ganzfried and Tuomas Sandholm. Potential-aware imperfect-recall abstraction with earth mover’s distance in imperfect-information games. In AAAI Conference on Artificial Intelligence (AAAI), 2014. [13] Sam Ganzfried and Tuomas Sandholm. Endgame solving in large imperfect-information games. In International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), pages 37–45, 2015. 10 [14] Andrew Gilpin, Tuomas Sandholm, and Troels Bjerre Sørensen. A heads-up no-limit Texas hold’em poker player: discretized betting models and automatically generated equilibriumfinding programs. In Proceedings of the Seventh International Joint Conference on Autonomous Agents and Multiagent Systems-Volume 2, pages 911–918. International Foundation for Autonomous Agents and Multiagent Systems, 2008. [15] Peter E Hart, Nils J Nilsson, and Bertram Raphael. Correction to "a formal basis for the heuristic determination of minimum cost paths". ACM SIGART Bulletin, (37):28–29, 1972. [16] Johannes Heinrich and David Silver. Deep reinforcement learning from self-play in imperfectinformation games. arXiv preprint arXiv:1603.01121, 2016. [17] Eric Jackson. A time and space efficient algorithm for approximately solving large imperfect information games. In AAAI Workshop on Computer Poker and Imperfect Information, 2014. [18] Eric Jackson. Targeted CFR. In AAAI Workshop on Computer Poker and Imperfect Information, 2017. [19] Michael Johanson, Nolan Bard, Neil Burch, and Michael Bowling. Finding optimal abstract strategies in extensive-form games. In Proceedings of the Twenty-Sixth AAAI Conference on Artificial Intelligence, pages 1371–1379. AAAI Press, 2012. [20] Michael Johanson, Neil Burch, Richard Valenzano, and Michael Bowling. Evaluating state-space abstractions in extensive-form games. In Proceedings of the 2013 International Conference on Autonomous Agents and Multiagent Systems, pages 271–278. International Foundation for Autonomous Agents and Multiagent Systems, 2013. [21] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [22] Marc Lanctot, Kevin Waugh, Martin Zinkevich, and Michael Bowling. Monte Carlo sampling for regret minimization in extensive games. In Proceedings of the Annual Conference on Neural Information Processing Systems (NIPS), pages 1078–1086, 2009. [23] Marc Lanctot, Vinicius Zambaldi, Audrunas Gruslys, Angeliki Lazaridou, Julien Perolat, David Silver, Thore Graepel, et al. A unified game-theoretic approach to multiagent reinforcement learning. In Advances in Neural Information Processing Systems, pages 4193–4206, 2017. [24] Shen Lin. Computer solutions of the traveling salesman problem. The Bell system technical journal, 44(10):2245–2269, 1965. [25] Viliam Lisy and Michael Bowling. Equilibrium approximation quality of current no-limit poker bots. arXiv preprint arXiv:1612.07547, 2016. [26] H Brendan McMahan, Geoffrey J Gordon, and Avrim Blum. Planning in the presence of cost functions controlled by an adversary. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pages 536–543, 2003. [27] Matej Moravˇcík, Martin Schmid, Neil Burch, Viliam Lisý, Dustin Morrill, Nolan Bard, Trevor Davis, Kevin Waugh, Michael Johanson, and Michael Bowling. Deepstack: Expert-level artificial intelligence in heads-up no-limit poker. Science, 2017. [28] Matej Moravcik, Martin Schmid, Karel Ha, Milan Hladik, and Stephen Gaukrodger. Refining subgames in large imperfect information games. In AAAI Conference on Artificial Intelligence (AAAI), 2016. [29] John Nash. Equilibrium points in n-person games. Proceedings of the National Academy of Sciences, 36:48–49, 1950. [30] Allen Newell and George Ernst. The search for generality. In Proc. IFIP Congress, volume 65, pages 17–24, 1965. [31] Nils Nilsson. Problem-Solving Methods in Artificial Intelligence. McGraw-Hill, 1971. 11 [32] 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. 2017. [33] Arthur L Samuel. Some studies in machine learning using the game of checkers. IBM Journal of research and development, 3(3):210–229, 1959. [34] David Schnizlein, Michael Bowling, and Duane Szafron. Probabilistic state translation in extensive games with large action sets. In Proceedings of the Twenty-First International Joint Conference on Artificial Intelligence, pages 278–284, 2009. [35] Claude E Shannon. Programming a computer for playing chess. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 41(314):256–275, 1950. [36] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [37] David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of Go without human knowledge. Nature, 550(7676):354, 2017. [38] Oskari Tammelin, Neil Burch, Michael Johanson, and Michael Bowling. Solving heads-up limit texas hold’em. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), pages 645–652, 2015. [39] Gerald Tesauro. Programming backgammon using self-teaching neural nets. Artificial Intelligence, 134(1-2):181–199, 2002. 12
2018
229
7,396
Data center cooling using model-predictive control Nevena Lazic, Tyler Lu, Craig Boutilier, Moonkyung Ryu Google Research {nevena, tylerlu, cboutilier, mkryu}@google.com Eehern Wong, Binz Roy, Greg Imwalle Google Cloud {ejwong, binzroy, gregi}@google.com Abstract Despite the impressive recent advances in reinforcement learning (RL) algorithms, their deployment to real-world physical systems is often complicated by unexpected events, limited data, and the potential for expensive failures. In this paper, we describe an application of RL “in the wild” to the task of regulating temperatures and airflow inside a large-scale data center (DC). Adopting a data-driven, modelbased approach, we demonstrate that an RL agent with little prior knowledge is able to effectively and safely regulate conditions on a server floor after just a few hours of exploration, while improving operational efficiency relative to existing PID controllers. 1 Introduction Recent years have seen considerable research advances in reinforcement learning (RL), with algorithms achieving impressive performance on game playing and simple robotic tasks [24, 29, 27]. However, applying RL to the control of real-world physical systems is complicated by unexpected events, safety constraints, limited observations and the potential for expensive or even catastrophic failures. In this paper, we describe an application of RL to the task of data center (DC) cooling. DC cooling is a test bed that is well-suited for RL deployment because it involves control of a complex, large-scale dynamical system, non-trivial safety constraints and the potential for considerable improvements in energy efficiency. Cooling is a critical part of DC infrastructure, since multiple servers operating in close proximity produce a considerable amount of heat and high temperatures may lead to lower IT performance or equipment damage. There has been considerable progress in improving cooling efficiency, and best-practice physical designs are now commonplace in large-scale DCs [7]. However, on the software side, designing resource-efficient control strategies is still quite challenging, due to complex interactions between multiple non-linear mechanical and electrical systems. Most existing controllers tend to be fairly simple, somewhat conservative, and hand-tuned to specific equipment architectures, layouts, and configurations. This leaves potential for efficiency improvement and automation using more adaptive, data-driven techniques. As the number of DCs increases with the adoption of cloud-based services, data growth, and hardware affordability, power management is becoming an important challenge in scaling up. In 2014, DCs accounted for about 1.8% of the total power usage in the U.S. and about 626 billion liters of water were consumed by DC operations [28]. There has been increased pressure to improve operational efficiency due to rising energy costs and environmental concerns. This includes cooling, which constitutes a non-trivial part of the DC power overhead. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. Recently, DeepMind demonstrated that it is possible to improve DC power usage efficiency (PUE) using a machine learning approach [13]. In particular, they developed a predictive model of PUE in a large-scale Google DC, and demonstrated that it can be improved by manipulating the temperature of the water leaving the cooling tower and chilled water injection setpoints. In this work, we focus on a complementary aspect of DC cooling: regulating the temperature and airflow inside server floors by controlling fan speeds and water flow within air handling units (AHUs). Our approach to cooling relies on model-predictive control (MPC). Specifically, we learn a linear model of the DC dynamics using safe, random exploration, starting with little or no prior knowledge. We subsequently recommend control actions at each time point by optimizing the cost of modelpredicted trajectories. Rather than executing entire trajectories, we re-optimize at each time step. The resulting system is simple to deploy, as it does not require historical data or a physics-based model. The main contribution of the paper is to demonstrate that a controller relying on a coarse-grained linear dynamics model can safely, effectively, and cost-efficiently regulate conditions in a large-scale commercial data center, after just a few hours of learning and with minimal prior knowledge. By contrast, characterizing and configuring the cooling control of a new data center floor typically takes weeks of setup and testing using existing techniques. 2 Background and related work Among approaches in the literature, the most relevant to our problem is linear quadratic (LQ) control. Here it is assumed that system dynamics are linear and the cost is a quadratic function of states and controls. When the dynamics are known, the optimal policy is given by constant linear state feedback and can be solved efficiently using dynamic programming. In the case of unknown dynamics, openloop strategies identify the system (i.e., learn the parameters of a dynamics model) in a dedicated exploration phase, while closed-loop strategies control from the outset, updating models along the way [20]. The simplest closed-loop approach, known as certainty equivalence, updates the parameters of the dynamics model at each step and applies the control law as if the estimated model were the ground truth. This strategy is unable to identify the system in general: parameters may not converge, or may converge to the wrong model, leading to strictly suboptimal control [6]. More recent approaches [8, 2, 17] use optimism in the face of uncertainty, where at each iteration the algorithm selects the dynamics with lowest attainable cost from some confidence set. While optimistic control is asymptotically optimal [8] and has a finite-time regret bound of O( √ T) [2], it is highly impractical as finding the lowest-cost dynamics is computationally intractable. Similar regret bounds can be derived using Thompson sampling in place of optimization [3, 4, 25], but most of these approaches make unrealistic stability assumptions about the intermediate controllers, and can in practice induce diverging state trajectories in early stages. In the open-loop setting, critical issues include the design of exploratory inputs and estimation error analysis. Asymptotic results in linear system identification (see [21]) include one simple requirement on the control sequence, persistence of excitation [5]. A review of frequency-domain identification methods is given in [10], while identification of auto-regressive time series models is covered in [9]. Non-asymptotic results are limited and often require additional stability assumptions [16, 14]; most recently, Dean et al. [11] have related the estimation error to the smallest eigenvalue of the finite-time controllability Gramian. In the presence of constraints on controls or states, the optimal LQ controller is no longer given by linear feedback, and it is usually simpler to directly optimize control variables. In model-predictive control, the controller generates actions at each step by optimizing the cost of a model-predicted trajectory. Re-optimizing at each time step mitigates the impact of model error and unexpected disturbances at the expense of additional computation. MPC has previously been used to regulate building cooling [18, 22, 23, 13, 12], with most approaches relying on historical data and physicsbased models. In the context of DC cooling, MPC has been used to control adaptive-vent floor tiles in addition to air-conditioning units, with system identification performed via random exploration [30]. In this work, we develop a similar control strategy that relies on open-loop linear system identification, followed by MPC. We demonstrate that our system can successfully control temperatures and airflow in a large-scale DC after only a few hours of safe, randomized exploration. 2 warm water (LWT) chiller cooling towers cold water (EWT) hot air (EAT) cold air (LAT) AHUs CAT, DP sensors Figure 1: Data center cooling loop. AHUs on the server floor regulate the air temperature through air-water heat exchange. Warmed water is cooled in the chiller and evaporative cooling towers. 3 Data center cooling Figure 1 shows a schematic of the cooling loop of a typical DC. Water is cooled to sub-ambient temperatures in the chiller and evaporative cooling towers, and then sent to multiple air handling units (AHUs) on the server floor. Server racks are arranged in rows between alternating hot and cold aisles. All hot air exhausts into the adjacent hot aisles, which are typically isolated using a physical barrier to prevent hot and cold air from mixing. The AHUs circulate air through the building; hot air is cooled through air-water heat exchange in the AHUs, and blown into the cold aisle. The generated warm water is sent back to the chiller and cooling towers. Naturally, variations of this setup exist. Our focus is on floor-level cooling, where the primary goal is to regulate cold-aisle temperatures and differential air pressures. Controlling the cold-aisle temperatures ensures that the machines operate at optimal efficiency and prevents equipment damage. Maintaining negative differential air pressure between adjacent hot and cold aisles ensures that cool air flows over servers and improves power efficiency by minimizing the need for the servers to use their own fans. Our goal is to operate close to (but not exceeding) upper bounds on temperature and pressure at minimal AHU power and water usage. Variables relevant to this problem are continuous-valued, and can be grouped as follows: • Controls are the variables we can manipulate. These are fan speed (controlling air flow) and valve opening (which regulates amount of water used) for each AHU. • States collect the process variables we wish to predict and regulate. These include differential air pressure (DP) and cold-aisle temperature (CAT), measured using multiple sensors along the server racks. To reduce redundancy and increase robustness to failed sensors, we model and regulate the median values of local groups of CAT and DP sensors. We also measure the entering air temperature (EAT) of the hot air entering each AHU, and leaving air temperature (LAT) of the cooled air leaving each AHU. • Disturbances are the events and conditions which we cannot manipulate or control, but which nonetheless affect the conditions inside the server floor. These include server power usage, which serves as a proxy for the amount of generated heat, as well as the entering water temperature (EWT) of the chilled water measured at each AHU. An illustrative schematic of the structure of the DC used in our case study is shown in Figure 1. The system consists of many dozens of AHUs, with two controls each, and many dozens of state variables for each row. The existing cooling system relies on local PID controllers (one per AHU), which are manually tuned and regulate DP measured at nearby sensors and LAT measured at the same AHU. Directly controlling CAT (the variable of interest) instead of LAT is more complicated, as temperatures along the server racks take a longer time to respond to changes in controls and depend on multiple AHUs. Since the local controllers operate independently, they may settle into a suboptimal state where some AHUs do little work while others run at their maximum capacity to compensate. This is addressed using a supervisory software layer which heuristically readjusts local controls to operate in a more balanced state. 3 Figure 2: Model structure illustration. Sensor measurements at each location only depend on the closest AHUs. The regularity of DC layout allows parameters to be shared between local models with the same structure (arrows with the same color share weights). Table 1: State variable dependencies Variable Predictors DP DP measurements and fan speeds in up to 5 closest aisles / 10 closest AHUs LAT LAT, EWT, EAT, fan speed, and valve position at the closest AHU CAT CAT, LAT, and fan speeds in up to 3 closest aisles / 6 closest AHUs EAT EAT, CAT, fan speeds, and power usage at up to 3 closest aisles / 6 closest AHUs 4 Model predictive control We consider the use of MPC to remove some of the inefficiencies associated with the existing PID control system. We: (i) model the effect of each AHU on state variables in a large neighborhood (up to 5 server rows) rather than on just the closest sensors; (ii) control CAT directly rather using LAT as a proxy; and (iii) jointly optimize all controls instead of using independent local controllers. We identify a model of DC cooling dynamics using only a few hours of exploration and minimal prior knowledge. We then control using this learned model, removing the need for manual tuning. As we show, these changes allow us to operate at less conservative setpoints and improve the cooling operational efficiency. 4.1 Model structure Let x[t], u[t], and d[t] be the vectors of all state, control, and disturbance variables at time t, respectively. We model data center dynamics using a linear auto-regressive model with exogeneous variables (or ARX model) of the following form: x[t] = T X k=1 Akx[t −k] + T X k=1 Bku[t −k] + Cd[t −1] . (1) where Ak, Bk, and Ck are parameter matrices of appropriate dimensions. Since we treat sensor observations as state variables, our model is T-Markov to capture relevant history and underlying latent state. Each time step corresponds to a period of 30s, and we set T = 5 based on cross-validation. While the true dynamics are not linear, we will see that a linear approximation in the relevant region of state-action space suffices for effective control. We use prior knowledge about the DC layout to impose a block diagonal-like sparsity on the learned parameter matrices. The large size of the server floor allows us to assume that temperatures and DPs at each location directly depend only states, controls, and disturbances at nearby locations (i.e., are conditionally independent of more distant sensors and AHUs given the nearby values).1 Additional parameter sparsity can be imposed based on variable types; for example, we know that DP directly 1In other words, the nearby sensors and controls form a Markov blanket [26] for specific variables in a graphical model of the dynamical system. 4 3 2 1 0 1 xCAT −xCAT sp (C) 30 40 50 60 70 80 uvalve (%) 1h 2h 0.01 0.00 0.01 xDP −xDP sp (wg) 1h 2h 30 40 50 60 70 80 ufan (%) Figure 3: An example run of random exploration, followed by control. The figure shows valve commands and fan speeds for all AHUs, as well as the CAT and DP sensor values at multiple locations throughout the DC. The system controls DP at a setpoint xDP sp . CAT control starts at setpoint xCAT sp −1 followed by xCAT sp ; the temperatures transition between the two values quickly and with little overshoot. depends on the fan speeds, but is (roughly) independent of temperature within a narrow temperature range. We list the features used to predict each state variable in Table 1. Since the servers, sensors, and cooling hardware are arranged in a regular physical layout in the DC we work with, we share parameters between local models for sample efficiency. Thus, our model has an overall linear convolutional structure, as illustrated in Figure 2. 4.2 System identification We learn the system dynamics using randomized exploration over controls, starting with a “vacuous” model that predicts no change in states. While we have access to historical data generated by the local PID controllers, it is not sufficiently rich to allow for system identification due to the steady state behaviour of the controllers.2 During the control phase we continue to update the dynamics in an online or batch-online fashion. As safe operation during exploration is critical, we limit each control variable to a safe range informed by historical data. In the absence of such data, the safe range can be initialized conservatively and gradually expanded. We also limit the maximum absolute changes in fan and valve controls between consecutive time steps since large changes may degrade hardware over time. Let uc i[t] indicate the value of the control variable c for the ith AHU at time step t, with c ∈{fan, valve}. Let [uc min, uc max] be the range of control variable c, and let ∆c be the maximum allowed absolute change in c between consecutive time steps. Our exploration strategy is a simple, range-limited uniform random walk in each control variable: uc i[t + 1] = max(uc min, min(uc max, uc i[t] + vc i )), vc i ∼Uniform(−∆c, ∆c). (2) This strategy ensures sufficient frequency content for system identification and respects safety and hardware constraints. Figure 3 shows controls and states during an example run of random exploration, followed by control. During the exploration phase, we update model parameters using recursive least squares [15]. In the control phase, we update parameters selectively so as not to overwhelm the model with steady-state data. In particular, we estimate the noise standard deviation σs for each variable s as the root mean squared error on the training data, and update the model with an example only if its (current) prediction error exceeds 2σs.3 2Specifically, the PID controllers operate in too narrow a range of (joint) state-control space to generate data allowing sufficiently accurate prediction in novel regions. 3In long running operation, triggering further exploration to account for rare exogenous conditions or disturbances (as well as drift) may be necessary, but we don’t consider this here. 5 4.3 Control Given our model and an initial condition (the T past states, controls, and disturbances for the M AHUs), we optimize the cost of a length-L trajectory with respect to control inputs at every step. Let xs sp denote the setpoint (or target value) for a state variable s, where s ∈{DP, CAT, LAT}. Let xs i[t] denote the value of the state variable s for the ith AHU at time t. We set controls by solving the following optimization problem: min u t+L X τ=t M X i=1  X s qs(xs i[τ] −xs sp)2 + X c rc(uc i[τ] −uc min)2  (3) s.t. uc i ∈[uc min, uc max], |uc i[τ] −uc i[τ −1]| ≤∆c, d[τ] = d[τ −1] (4) x[τ] = T X k=1 Akx[τ −k] + T X k=1 Bku[τ −k] + Cd[τ −1] (5) t ≤τ ≤t + L, c ∈{fan, valve}, s ∈{DP, CAT, LAT}. (6) Here qs and rc are the weights for the loss w.r.t. state and control variables s and c, respectively, and i ranges over AHUs. We assume that disturbances do not change over time. Overall, we have a quadratic optimization objective in 2ML ≃1.2K variables, with a large number of linear and range constraints. While we optimize over the entire trajectory, we only execute the optimized control action at the first time step. Re-optimizing at each step enables us to react to changes in disturbances and compensate for model error. We specify the above objective as a computation graph in TensorFlow [1] and optimize controls using the Adam [19] algorithm. In particular, we implement constraints by specifying controls as uc i[τ] = max(uc min, min(uc max, uc i[τ −1] + ∆ctanh(zc i [τ]))) (7) where zc i [τ] is an unconstrained optimization variable. The main motivation for this choice is its simplicity and speed—the optimization converges well before our re-optimization period of 30s. 5 Experiments We evaluate the performance of our MPC approach w.r.t. the existing local PID method on a largescale DC. Since the quality of MPC depends critically on the quality of the underlying model, we first compare our system identification strategy to two simple alternatives. One complication in comparing the performance of different methods on a physical system is the inability to control environmental disturbances which affect the achievable costs and steady-state behavior. In our DC cooling setting, the main disturbances are the EWT (temperature of entering cold water) and server power usage (a proxy for generated heat). These variables also reflect other factors (e.g., weather, time of day, server hardware, IT load). To facilitate a meaningful comparison, we evaluate the cost of control (i.e., cost of power and water used by the AHUs) for different ranges of states and disturbances. 5.1 System identification We first evaluated our system identification strategy by comparing the following three models: • Model 1: our model, trained on 3 hours of deliberate exploration data with controls following independent random walks limited to a safe range as described in Section 4.2. • Model 2: trained on a week of historical data generated by local PID controllers. While this model is trained on 56 times more data than the others, it turns out that the data is not as informative. Since local controllers regulate LAT to a fixed offset above EWT, the model may simply learn this relationship rather than the dependence of LAT on controls. Furthermore, if state values do not vary much, it may learn to predict no changes in state. • Model 3: trained on 3 hours of data with controls recommended by a certainty-equivalent controller (i.e., optimal controls w.r.t. all available data at each iteration, see Section 2), limited to a safe range. While this data contains a wider range of inputs than Model 2 data, it contains no exploratory actions. 6 -0.25 0.25 0.75 0.0 0.2 0.4 0.6 0.8 1.0 xCAT −xCAT sp (C) -0.012 -0.004 0.004 0.012 0.0 0.2 0.4 0.6 0.8 1.0 xDP −xDP sp (wg) 20.0 20.5 21.0 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 d EWT (C) 0.65 0.7 0.75 0.8 0.85 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 d load(frac. max) Model 1 Model 2 Model 3 Figure 4: Histograms of state variables and disturbances over time and AHUs during steady-state operation of MPC controllers using three different models. Table 2: Average power and water cost (% data) for each controller, restricted to time points and AHUs for which CAT was within 0.25C of xCAT sp and pressure within 0.004 of xDP sp , stratified by values of the disturbances. Entering water Server load Model 1 Model 2 Model 3 temperature (C) (fraction of max) cost (% data) cost (% data) cost (% data) ≤20.5 ≤0.7 84.3 (31%) 94.4 (29.9%) 99.6 (13.7%) > 20.5 ≤0.7 85.8 (17.6 %) 93.8 (14.1 %) 112.7 (36.0 %) ≤20.5 > 0.7 142.4 (21.9 %) 149.4 (20.4 %) 178.2 (8.3 %) > 20.5 > 0.7 144.6 (15.3 %) 148.9(12.8 %) 182 .1 (29.9 %) any any 110.2 (85.8%) 117.9 (77.2%) 140.4 (87.9%) We controlled median CAT and DP at setpoints xCAT sp and xDP sp , using each model for approximately one day. We examine the steady state behavior of the controllers next. Figure 4 shows histograms of states and disturbances during the operation of the three controllers, with data aggregated over both time and sensors. In all three cases, state variables remain close to their targets most of the time, but the controller based on Model 2 (historical data) had the highest steady-state error (e.g., the difference between CAT/DP and their setpoints is close to zero less often with Model 2). The distribution of server loads during the three tests was similar, while the EWT was somewhat higher for Model 3. The average cost of controls (fan power and water usage in the objective) was 115.9, 116.6, and 139.9, respectively; however, these are not directly comparable due to differences in steady state error and disturbances. Stratifying data by state and disturbance values is somewhat complicated. For example, sensor measurements at any location are affected by multiple AHUs with different EWTs. Similarly, each AHU affects measurements at multiple racks with different loads. To simplify analysis, we treat each group of sensors as dependent on its closest AHU, allowing independent consideration of each AHU. A lesser complication is the time lag between control changes and state changes. Since controllers largely operate in steady state, controls do not change often, so we consider time points independently. To compare costs, we first restrict available data to time points and AHUs where temperatures were within 0.25C of xCAT sp , and pressures within 0.004 of xDP sp (i.e., the intersection of histogram peaks in Figure 4, left). This corresponded to 85.8%, 77.2%, and 87.9% of the data for controllers using Models 1, 2, and 3, respectively. We then stratified the data by different ranges of EWT and server load. We evaluated the control cost for each disturbance range. The results are shown in Table 2, and suggest that the controller based on Model 1 (with explicit exploration data) is the most efficient. 5.2 Comparison to local PID controllers The existing local PID controllers differ from ours in that they regulate LAT to a constant offset relative to EWT, rather than controlling CAT directly. To compare the two approaches, we ran our MPC controller with the same LAT-offset setpoints for one day, and compared it to a week of local PID control. As before, we treat measurements at each group of sensors as depending only on the closest AHU, and ignore time lags (assuming reasonable control consistency during steady-state operation). Histograms of states and disturbances during the operation of the two controllers are 7 -0.25 0.25 0.75 0.0 0.2 0.4 0.6 0.8 1.0 (xLAT −xEWT) −x(LAT −EWT) sp (C) -0.012 -0.004 0.004 0.012 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 xDP −xDP sp (wg) 20.0 20.5 21.0 0.0 0.1 0.2 0.3 0.4 0.5 0.6 d EWT (C) 0.65 0.7 0.75 0.8 0.85 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 d load(frac. max) Model 1 Local Figure 5: Histograms of state variables and disturbances over time and AHUs during steady-state operation of the MPC (Model 1) and local PID controllers. Table 3: Average total cost (% data) of each controller, restricted to time points and fancoils for which LAT-EWT and DP were within 0.25C and 0.004wg of their respective setpoints, stratified by values of the disturbances. Entering water Server load Local controllers Model 1 temperature (C) (frac. max) cost (% data) cost (% data) ≤20.5 ≤0.7 95.3 (19.8 %) 106.4 (22.6 %) > 20.5 ≤0.7 107.9 (13.8 %) 104.9 (15.0 %) ≤20.5 > 0.7 170.3 (20.1%) 130.5 (18.8 %) > 20.5 > 0.7 187.8 (20.4 %) 128.7 (18.0 %) any any 142.2 (74.4%) 116.7 (74.1%) shown in Figure 5. Local controllers track the temperature setpoint more closely, but operate at higher DP. Server loads are similar, while average EWT is lower during local controller operation. To compare costs, we restrict data to AHUs and times corresponding to the peaks of histograms in Figure 5 left (about 74% of the data for both controllers). We stratify this data as above and compare the total cost in each stratum in Table 3. While local control was more cost efficient under low EWT and server load, our controller was more efficient under all other conditions and overall. While the quadratic objective is a reasonable approximation, it does not correspond exactly to the true dollar cost of control, which is not quadratic and may change over time. After restricting to temperatures and pressures as in Tables 3 and 2, the average dollar cost (units unspecified) of our LAT and CAT controllers was 94% and 90.7% of the cost of the local controllers. While precise quantification of these savings requires longer-term experiments, our approach of jointly optimizing controls of all AHUs, together with the ability to control process variables at slightly higher values, has the potential to save about 9% of the current server-floor cooling costs. 6 Discussion We have presented an application of model-based reinforcement learning to the task of regulating data center cooling. Specifically, we have demonstrated that a simple linear model identified from only a few hours of exploration suffices for effective regulation of temperatures and airflow on a large-scale server floor. We have also shown that this approach is more cost effective than commonly used local controllers and controllers based on non-exploratory data. One interesting question is whether the controller performance could further be improved by using a higher-capacity model such as a neural network. However, such a model would likely require more than a few hours of exploratory data to identify, and may be more complicated to plan with. Perhaps the most promising direction for model improvement is to learn a mixture of linear models that could approximate dynamics better under different disturbance conditions. In terms of overall data center operational efficiency, further advantages are almost certainly achievable achieved by jointly controlling AHUs and the range of disturbance variables if possible, or by planning AHU control according to known/predicted disturbances values rather than treating them as noise. 8 Acknowledgments The experiments performed for this paper would not have been possible without the help of many people. We would especially like to thank Dave Barker, Charisis Brouzioutis, Branden Davis, Orion Fox, Daniel Fuenffinger, Amanda Gunckle, Brian Kim, Eddie Pettis, Craig Porter, Dustin Reishus, Frank Rusch, Andy Thompson, and Abbi Ward. We also thank Gal Elidan for many valuable discussions. References [1] 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. Software available from tensorflow.org. [2] Yasin Abbasi-Yadkori and Csaba Szepesvári. Regret bounds for the adaptive control of linear quadratic systems. In Computational Learning Theory (COLT), 2011. [3] Yasin Abbasi-Yadkori and Csaba Szepesvári. Bayesian optimal control of smoothly parameterized systems. In Uncertainty in Artificial Intelligence (UAI), pages 1–11, 2015. [4] Marc Abeille and Alessandro Lazaric. Thompson sampling for linear-quadratic control problems. In AISTATS, 2017. [5] K. J. Aström. Optimal control of Markov decision processes with incomplete state estimation. J. Math. Anal. Appl., 10:174–205, 1965. [6] Karl Johan Åström and Björn Wittenmark. On self tuning regulators. Automatica, 9(2):185–199, 1973. [7] Luiz André Barroso, Jimmy Clidaras, and Urs Hölzle. The Datacenter as a Computer: An Introduction to the Design of Warehouse-scale Machines, 2nd Edition. Morgan & Claypool Publishers, 2013. Synthesis Lectures on Computer Architecture 8:3. [8] Sergio Bittanti, Marco C Campi, et al. Adaptive control of linear time invariant systems: the "bet on the best" principle. Communications in Information & Systems, 6(4):299–320, 2006. [9] George EP Box, Gwilym M Jenkins, Gregory C Reinsel, and Greta M Ljung. Time series analysis: forecasting and control. John Wiley & Sons, 2015. [10] Jie Chen and Guoxiang Gu. Control-oriented system identification: an H∞approach, volume 19. WileyInterscience, 2000. [11] Sarah Dean, Horia Mania, Nikolai Matni, Benjamin Recht, and Stephen Tu. On the sample complexity of the linear quadratic regulator. arXiv preprint arXiv:1710.01688, 2017. [12] Jingjuan Dove Feng, Frank Chuang, Francesco Borrelli, and Fred Bauman. Model predictive control of radiant slab systems with evaporative cooling sources. Energy and Buildings, 87:199–210, 2015. [13] Jim Gao. Machine learning applications for data center optimization. Google White Paper, 2014. [14] Moritz Hardt, Tengyu Ma, and Benjamin Recht. Gradient descent learns linear dynamical systems. arXiv preprint arXiv:1609.05191, 2016. [15] Monson H. Hayes. Statistical Digital Signal Processing and Modeling. Wiley, 1996. [16] Arthur J Helmicki, Clas A Jacobson, and Carl N Nett. Control oriented system identification: a worstcase/deterministic approach in H∞. IEEE Transactions on Automatic control, 36(10):1163–1176, 1991. [17] Morteza Ibrahimi, Adel Javanmard, and Benjamin V. Roy. Efficient reinforcement learning for high dimensional linear quadratic systems. In Advances in Neural Information Processing Systems 25, pages 2636–2644. Curran Associates, Inc., 2012. [18] A. Kelman and F. Borrelli. Bilinear model predictive control of a hvac system using sequential quadratic programming. In Proceedings of the 2011 IFAC World Congress, 2011. 9 [19] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. [20] Lennart Ljung, editor. System Identification: Theory for the User (2nd Edition). Prentice Hall, Upper Saddle River, New Jersey, 1999. [21] Lennart Ljung and Torsten Söderström. Theory and practice of recursive identification, volume 5. JSTOR, 1983. [22] Yudong Ma, Francesco Borrelli, Brandon Hencey, Brian Coffey, Sorin Bengea, and Philip Haves. Model predictive control for the operation of building cooling systems. IEEE Transactions on control systems technology, 20(3):796–803, 2012. [23] Yudong Ma, Anthony Kelman, Allan Daly, and Francesco Borrelli. Predictive control for energy efficient buildings with thermal storage: Modeling, stimulation, and experiments. IEEE Control Systems, 32(1):44– 64, 2012. [24] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015. [25] Yi Ouyang, Mukul Gagrani, and Rahul Jain. Learning-based control of unknown linear systems with Thompson sampling. arXiv preprint arXiv:1709.04047, 2017. [26] Judea Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, San Mateo, 1988. [27] Lerrel Pinto, Marcin Andrychowicz, Peter Welinder, Wojciech Zaremba, and Pieter Abbeel. Asymmetric actor critic for image-based robot learning. CoRR, abs/1710.06542, 2017. [28] Arman Shehabi, Sarah Josephine Smith, Dale A. Sartor, Richard E. Brown, Magnus Herrlin, Jonathan G. Koomey, Eric R. Masanet, Nathaniel Horner, Inês Lima Azevedo, and William Lintner. United states data center energy usage report. Technical report, Lawrence Berkeley National Laboratory, 2016. [29] David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of Go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [30] Rongliang Zhou, Cullen Bash, Zhikui Wang, Alan McReynolds, Thomas Christian, and Tahir Cader. Data center cooling efficiency improvement through localized and optimized cooling resources delivery. In ASME 2012 International Mechanical Engineering Congress and Exposition, pages 1789–1796. American Society of Mechanical Engineers, 2012. 10
2018
23
7,397
Causal Inference and Mechanism Clustering of A Mixture of Additive Noise Models Shoubo Hu∗, Zhitang Chen†, Vahid Partovi Nia†, Laiwan Chan∗, Yanhui Geng‡ ∗The Chinese University of Hong Kong; †Huawei Noah’s Ark Lab; ‡Huawei Montréal Research Center ∗{sbhu, lwchan}@cse.cuhk.edu.hk †‡{chenzhitang2, vahid.partovinia, geng.yanhui}@huawei.com Abstract The inference of the causal relationship between a pair of observed variables is a fundamental problem in science, and most existing approaches are based on one single causal model. In practice, however, observations are often collected from multiple sources with heterogeneous causal models due to certain uncontrollable factors, which renders causal analysis results obtained by a single model skeptical. In this paper, we generalize the Additive Noise Model (ANM) to a mixture model, which consists of a finite number of ANMs, and provide the condition of its causal identifiability. To conduct model estimation, we propose Gaussian Process Partially Observable Model (GPPOM), and incorporate independence enforcement into it to learn latent parameter associated with each observation. Causal inference and clustering according to the underlying generating mechanisms of the mixture model are addressed in this work. Experiments on synthetic and real data demonstrate the effectiveness of our proposed approach. 1 Introduction Understanding the data-generating mechanism (g.m.) has been a main theme of causal inference. To infer the causal direction between two random variables (r.v.s) X and Y using passive observations, most existing approaches first model the relation between them using a functional model with certain assumptions [18, 6, 21, 8]. Then a certain asymmetric property (usually termed cause-effect asymmetry), which only holds in the causal direction, is derived to conduct inference. For example, the additive noise model (ANM) [6] represents the effect as a function of the cause with an additive independent noise: Y = f(X)+ϵ. It is shown in [6] that there is no model of the form X = g(Y )+˜ϵ that admits an ANM in the anticausal direction for most combinations (f, p(X), p(ϵ)). Similar to ANM, most causal inference approaches based on functional models, such as LiNGAM [18], PNL [21], and IGCI [9], assume a single causal model for all observations. However, there is no such a guarantee in practice, and it could be very common that the observations are generated by a mixture of causal models due to different data sources or data collection under different conditions, rendering existing single-causal-model based approaches inapplicable in many problems (e.g. Fig. 1). Recently, an approach was proposed for inferring the causal direction of mixtures of ANMs with discrete variables [12]. However, the inference of such mixture models with continuous variables remains a challenging problem and is not yet well studied. Another question regarding mixture models addressed in this paper is how one could reveal causal knowledge in clustering tasks. Specifically, we aim at finding clusters consistent with the causal g.m.s of a mixture model, which is usually vital in the preliminary phase of many research. For example in the analysis of air data (see section 4.2 for detail), discovering knowledge from air data combined from several different regions (i.e. mechanisms in causal perspective) is much more difficult than 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. (a) (b) (c) Figure 1: Example illustrating the failure of ANM on the inference of a mixture of ANMs (a) the distribution of data generated from M1 : Y = X2 + ϵ (red) and M2 : Y = X5 + ϵ (blue), where X ∼U(0, 1) (x-axis) and ϵ ∼U(−0.1, 0.1) ; (b) Conditional p(Y |X = 0.2); (c) Conditional p(Y |X = 0.6). It is obvious that when the data is generated from a mixture of ANMs, the consistency of conditionals is likely to be violated which leads to the failure of ANM. from data of each region separately. Most existing clustering algorithms are weak for this perspective as they typically define similarity between observations in the form of distances in some spaces or manifolds. Most of them neglect the relation among r.v.s within a feature vector (observation), and only use those feature dimensions to calculate an overall distance metric as the clustering criterion. In this paper, we focus on analyzing observations generated by a mixture of ANMs of two r.v.s and try to answer two questions: 1) causal inference: how can we infer the causal direction between the two r.v.s? 2) mechanism clustering: how can we cluster the observations generated from the same g.m. together? To answer these questions, first as the main result of this paper, we show that the causal direction of the mixture of ANMs is identifiable in most cases, and we propose a variant of GP-LVM [10] named Gaussian Process Partially Observable Model (GPPOM) for model estimation, based on which we further develop the algorithms for causal inference and mechanism clustering. The rest of the paper is organized as follows: in section 2, we formalize the model, show its identifiability and elaborate mechanism clustering; in section 3, model estimation method is proposed; we present experiments on synthetic and real world data in section 4 and conclude in section 5. 2 ANM Mixture Model 2.1 Model definition yn fn X θ ϵn β N Figure 2: ANM Mixture Model Each observation is assumed to be generated from an ANM and the entire data set is generated by a finite number of related ANMs. They are called the ANM Mixture Model (ANM-MM) and formally defined as: Definition 1 (ANM Mixture Model). An ANM Mixture Model is a set of causal models of the same causal direction between two continuous r.v.s X and Y . All causal models share the same form given by the following ANM: Y = f(X; θ) + ϵ, (1) where X denotes the cause, Y denotes the effect, f is a nonlinear function parameterized by θ and the noise ϵ ⊥⊥X. The differences between causal models in an ANM-MM stem only from different values of function parameter θ. In ANM-MM, θ is assumed to be drawn from a discrete distribution on a finite set Θ = {θ1, · · · , θC}, i.e. θ ∼pθ(θ) = PC c=1 ac1θc(·), where ac > 0, PC c=1 ac = 1 and 1θc(·) is the indicator function of a single value θc. Obviously in ANM-MM, all observations are generated by a set of g.m.s, which share the same function form (f) but differ in parameter values (θ). This model is inspired by commonly encountered cases where the data-generating process is slightly different in each independent trial due to the influence of certain external factors that one can hardly control. In addition, these factors are usually 2 believed to be independent of the observed variables. The data-generating process of ANM-MM can be represented by a directed graph in Fig. 2. 2.2 Causal inference: identifiability of ANM-MM Let X be the cause and Y be the effect (X →Y ) without loss of generality. As most recently proposed causal inference approaches, following postulate, which was originally proposed in [1], is adopted in the analysis of ANM-MM. Postulate 1 (Independence of input and function). If X →Y , the distribution of X and the function f mapping X to Y are independent since they correspond to independent mechanisms of nature. In a general perspective, postulate 1 essentially claims the independence between the cause (X) and mechanism mapping the cause to effect [9]. In ANM-MM, we interpret the independence between the cause and mechanism in an intuitive way: θ, as the function parameter, captures all variability of mechanisms f so it should be independent of the cause X according to postulate 1. Based on the independence between X and θ, cause-effect asymmetry could be derived to infer the causal direction. Since ANM-MM consists of a set of ANMs, the identifiability result of ANM-MM can be a simple corollary of that in [6] when the number of ANMs (C) is equal and there is a one-to-one correspondence between mechanisms in the forward and backward ANM-MM. In this case the condition of ANM-MM being unidentifiable is to fulfill C ordinary differential equations given in [6] simultaneously which can hardly happen in a generic case. However, C in ANM-MM in both directions may not necessarily be equal and there may also exist many-to-one correspondence between ANMs in both directions. In this case, the identifiability result can not be derived as a simple corollary of [6]. To analyze the identifiability result of ANM-MM, we first derive lemma 1 to find the condition of existence of many-to-one correspondence (which is a generalization of the condition given in [6]), then conclude the identifiability result of ANM-MM (theorem 1) based on the condition in lemma 1. The condition that there exists one backward ANM for a forward ANM-MM is: Lemma 1. Let X →Y and they follow an ANM-MM. If there exists a backward ANM in the anti-causal direction, i.e. X = g(Y ) + ˜ϵ, the cause distribution (pX), the noise distribution (pϵ), the nonlinear function (f) and its parameter distribution (pθ) should jointly fulfill the following ordinary differential equation (ODE) ξ′′′ −G(X, Y ) H(X, Y )ξ′′ = G(X, Y )V (X, Y ) U(X, Y ) −H(X, Y ), (2) where ξ := log pX, and the definitions of G(X, Y ), H(X, Y ), V (X, Y ) and U(X, Y ) are provided in supplementary due to the page limitation. Sketch of proof. Since X and Y follow an ANM-MM, their joint density is factorized in the causal direction by p(X, Y ) = PC c=1 p(Y |X, θc)pX(X)pθ(θc) = pX(X) PC c=1 acpϵ(Y −f(X; θc)). If there exists a backward ANM in the anti-causal direction, i.e. X = g(Y )+˜ϵ, then p(X, Y ) = p˜ϵ(X− g(Y ))pY (Y ) and ∂ ∂X  ∂2π/∂X∂Y ∂2π/∂X2  = 0 holds, where π = log [p˜ϵ(X −g(Y ))pY (Y )], in the backward ANM. Since p(X, Y ) should be the same, by substituting p(X, Y ) = pX(X) PC c=1 acpϵ(Y − f(X; θc)) into ∂ ∂X  ∂2π/∂X∂Y ∂2π/∂X2  = 0, the condition shown in (2) is obtained. The proof of lemma 1 follows the idea of the identifiability of ANM in [6] and is provided in the supplementary. Since the condition that one backward ANM exists for an forward ANM-MM (mixture of ANMs) is more restrictive than that for a single forward ANM, which is the identifiability in [6], lemma 1 indicates that a backward ANM is unlikely to exist in the anticausal direction if 1) X and Y follow an ANM-MM; 2) postulate 1 holds. Based on lemma 1, it is reasonable to hypothesize that a stronger result, which is justified in theorem 1, is valid, i.e. if the g.m. follows an ANM-MM, then it is almost impossible to have a backward ANM-MM in the anticausal direction. Theorem 1. Let X →Y and they follow an ANM-MM. If there exists a backward ANM-MM, X = g(Y ; ω) + ˜ϵ, 3 where ω ∼pω(ω) = P ˜ C ˜c=1 b˜c1ω˜c(·), b˜c > 0, P ˜ C ˜c=1 b˜c = 1 and ˜ϵ ⊥⊥Y , in the anticausal direction, then (pX, pϵ, f, pθ) should fulfill ˜C ordinary differential equations similar to (2), i.e., ξ′′′ −G(˜c)(X, Y ) H(˜c)(X, Y )ξ′′ = G(˜c)(X, Y )V (˜c)(X, Y ) U (˜c)(X, Y ) −H(˜c)(X, Y ), ˜c = 1, 2, · · · , ˜C, (3) where ξ := log pX, G(˜c)(X, Y ), H(˜c)(X, Y ), U (˜c)(X, Y ) and V (˜c)(X, Y ) are defined similarly to those in lemma 1. Proof. Assume that there exists ANM-MM in both directions. Then there exists a non overlapping partition of the entire data D := {(xn, yn)}N n=1 = D1 ∪· · · ∪D ˜ C such that in each data block D˜c, there is an ANM-MM in the causal direction Y = f(X; θ) + ϵ, where θ ∼p(˜c) θ (θ) is a discrete distribution on a finite set Θ(˜c) ⊆Θ, and an ANM in the anti-causal direction X = g(Y ; ω = ω˜c) + ˜ϵ. According to lemma 1, for each data block, to ensure the existence of an ANM-MM in the causal direction and an ANM in the anti-causal direction, (pX, pϵ, f, pθ) should fulfill an ordinary differential equation in the form of (2). Then the existence of backward ANM-MM requires ˜C ordinary differential equations to be fulfilled simultaneously which yields (3). Then the causal direction in ANM-MM can be inferred by investigating the independence between the hypothetical cause and the corresponding function parameter. According to theorem 1, if they are independent in the causal direction, then it is highly likely they are dependent in the anticausal direction. Therefore in practice, the inferred direction is the one that shows more evidence of independence between them. 2.3 Mechanism clustering of ANM-MM In ANM-MM, θ, which represents function parameters, can be directly used to identify different g.m.s since each parameter value corresponds to one mechanism. In other words, observations generated by the same g.m. would have the same θ if the imposed statistical model is identifiable with respect to θ. Denote the parameter associated with each observation (xn, yn) by θn, we suppose a more practical inherent clustering structure behind hidden θn. Formally, there is a grouping indicator of integers z ∈{1, . . . , C}N that assign each θn to one of the C clusters, through the nth element of z, e.g. θn belongs to cluster c if [z]n = c, c ∈{1, . . . , C}. Following ANM-MM, we may assume each θn belong to one of C components and each component follows N(µc, σ2). A likelihood-based clustering scheme suggests minimizing −ℓjointly with respect to all means and z ℓ(M, z) = log N Y n=1 C Y c=1  1 √ 2πσ exp  −1 2σ2 (θn −µc)2 1([z]n=c) , where M = {µc}C c=1 and 1(·) is the indicator function. To simplify further let’s ignore the known σ2 and minimize −ℓusing coordinate descent iteratively ˆ M | z = arg min M C X c=1 X {n|[z]n=c} (θn −µc)2 (4) ˆz | M = arg min z C X c=1 X {n|[z]n=c} (θn −µc)2. (5) The minimizer of (4) is the mean ˆµc = 1 nc P {n|[z]n=c} θn, where nc is the size of the cth cluster nc = PN n=1 1([z]n = c). The minimizer of (5) is group assignment through minimum Euclidean distance. Therefore, iterating between (4) and (5) coincides with applying k-means algorithm on all θn and the goal of finding clusters consistent with the g.m.s for data from ANM-MM can be achieved by firstly estimating parameters associated with each observation and then conducting k-means directly on parameters. 4 3 ANM-MM Estimation by GPPOM We propose Gaussian process partially observable model (GPPOM) and incorporate Hilbert-Schmidt independence criterion (HSIC) [4] enforcement into GPPOM to estimate the model parameter θ. Then we summarize algorithms for causal inference and mechanism clustering of ANM-MM. 3.1 Preliminaries Dual PPCA. Dual PPCA [11] is a latent variable model in which maximum likelihood solution for the latent variables is found by marginalizing out the parameters. Given a set of N centered D-dimensional data Y = [y1, . . . , yN]T , dual PPCA learns the q-dimensional latent representation xn associated with each observation yn. The relation between xn and yn in dual PPCA is yn = Wxn + ϵn, where the matrix W specifies the linear relation between yn and xn and noise ϵn ∼ N(0, β−1I). Then by placing a standard Gaussian prior on each row of W, one obtains the marginal likelihood of all observations and the objective function of dual PPCA is the log-likelihood L = −DN 2 ln(2π)−D 2 ln (|K|)−1 2 tr  K−1YYT  , where K = XXT +β−1I and X = [x1, . . . , xN]T . GP-LVM. GP-LVM [10] generalizes dual PPCA to cases of nonlinear relation between yn and xn by mapping latent representations in X to a feature space, i.e. Φ = [φ(x1), . . . , φ(xN)]T , where φ(·) denotes the canonical feature map. Then K = ΦΦT +β−1I and ΦΦT can be computed using kernel trick. GP-LVM can also be interpreted as a new class of models which consists of D independent Gaussian processes [19] mapping from a latent space to an observed data space [10]. HSIC. HSIC [4], which is based on reproducing kernel Hilbert space (RKHS) theory, is widely used to measure the dependence between r.v.s. Let D := {(xn, yn)}N n=1 be a sample of size N draw independently and identically distributed according to P(X, Y ), HSIC answers the query whether X ⊥⊥Y . Formally, denote by F and G RKHSs with universal kernel k, l on the compact domains X and Y, HSIC is the measure defined as HSIC(P(X, Y ), F, G) := ∥Cxy∥2 HS, which is essentially the squared Hilbert Schmidt norm [4] of the cross-covariance operator Cxy from RKHS G to F [3]. It is proved in [4] that, under conditions specified in [5], HSIC(P(X, Y ), F, G) = 0 if and only if X ⊥⊥Y . In practice, a biased empirical estimator of HSIC based on the sample D is often adopted: HSICb(D) = 1 N 2 tr (KHLH) , (6) where [K]ij = k(xi, xj), [L]ij = l(yi, yj), H = I −1 N ⃗1⃗1T , and ⃗1 is a N × 1 vector of ones. 3.2 Gaussian process partially observable model Partially observable dual PPCA. Dual PPCA is not directly applicable to model ANM-MM since: 1) part of the r.v. that maps to the effect is visible (i.e. X); 2) the relation (i.e. f) is nonlinear; 3) r.v.s that contribute to the effect should be independent (X ⊥⊥θ) in ANM-MM. To tackle 1), a latent r.v. θ is brought in dual PPCA. Denote the observed effect by Y = [y1, . . . , yN]T , observed cause by X = [x1, . . . , xN]T , the matrix collecting function parameters associated with each observation by Θ = [θ1, . . . , θN]T and the r.v. that contribute to the effect by ˜X = [X, θ]. Similar to dual PPCA, the relation between the latent representation and the observation is given by yn = ˜ W˜xn + ϵn, n = 1, . . . , N where ˜xn =  xT n, θT n T , ˜ W is the matrix specifies the relation between yn and ˜xn, ϵn ∼ N(0, β−1I) is the additive noise. Then by placing a standard Gaussian prior on ˜ W, i.e. p( ˜ W) = QD i=1 N( ˜wi,:|0, I), where ˜wi,: is the ith row of the matrix ˜ W, the log-likelihood of the observations is given by L(Θ|X, Y, β) = −DN 2 ln(2π) −D 2 ln  | ˜K|  −1 2 tr  ˜K−1YYT  , (7) where ˜K = ˜X˜XT + β−1I = [X, Θ] [X, Θ]T + β−1I = XXT + ΘΘT + β−1I is the covariance matrix after bringing in θ. 5 Algorithm 1: Causal Inference input :D = {(xn, yn)}N n=1 - the set of observations of two r.v.s; λ - parameter of independence output :The causal direction 1 Standardize observations of each r.v.; 2 Initialize β and kernel parameters; 3 Optimize (8) in both directions, denote the the value of HSIC term by HSICX→Y and HSICY →X, respectively; 4 if HSICX→Y < HSICY →X then 5 The causal direction is X →Y ; 6 else if HSICX→Y > HSICY →X then 7 The causal direction is Y →X; 8 else 9 No decision made. 10 end General nonlinear cases (GPPOM). Similar to the generalization from dual PPCA to GPLVM, the dual PPCA with observable X and latent θ can be easily generalized to nonlinear cases. Denote the feature map by φ(·) and Φ = [φ(˜x1), . . . , φ(˜xN)]T , then the covariance matrix is given by ˜K = ΦΦT + β−1I. The entries of ΦΦT can be computed using kernel trick given a selected kernel k(·, ·). In this paper, we adopt the radial basis function (RBF) kernel, which reads k(xi, xj) = exp  −PDx d=1 γd(xid −xjd)2 , where γd, for d = 1, . . . , Dx, are free parameters and Dx is the dimension of the input. As a result of adopting RBF kernel, the covariance matrix ˜K in (7) can be computed as ˜K = ΦΦT + β−1I = KX ◦Kθ + β−1I, where ◦denotes the Hadamard product, the entries on ith row and jth column of KX and Kθ are given by [KX]ij = k(xi, xj) and [Kθ]ij = k(θi, θj), respectively. After the nonlinear generalization, the relation between Y and ˜X reads Y = f( ˜X) + ϵ = f(X, θ) + ϵ. This variant of GP-LVM with partially observable latent space is named GPPOM in this paper. Like GP-LVM, ˜X is mapped to Y by the same set of Gaussian processes in GPPOM so the differences in the g.m.s is captured by θn, the latent representations associated with each observation. 3.3 Model estimation by independence enforcement Both dual PPCA and GP-LVM finds the latent representations through log-likelihood maximization using scaled conjugate gradient [14]. However, the θ can not be found by directly conducting likelihood maximization since the ANM-MM requires additionally the independence between X and θ. To this end, we include HSIC [4] in the objective. By incorporating HSIC term into the negative log-likelihood of GPPOM, the optimization objective reads arg min Θ,Ω J (Θ) = arg min Θ,Ω [−L(Θ|X, Y, Ω) + λ log HSICb(X, Θ)], (8) where λ is the parameter which controls the importance of the HSIC term and Ωis the set of all hyper parameters including β and all kernel parameters γd, d = 1, . . . , Dx. To find Θ, we resort to the gradient descant methods. The gradient of the objective J with respect to latent points in Θ is given by ∂J ∂[Θ]ij = tr " ∂J ∂Kθ T ∂Kθ ∂[Θ]ij # . (9) The first part on the right hand side of (9), which is the gradient of J with respect to the kernel matrix Kθ, can be computed as ∂J ∂Kθ = −tr  ˜K−1YYT ˜K−1 −D ˜K−1T KX ◦Jij + λ 1 tr (KXHKθH))HKXH, (10) where Jij is the single-entry matrix, 1 at (i, j) and 0 elsewhere and H = I −1 N ⃗1⃗1T . Combining ∂L ∂Kθ with ∂Kθ ∂[Θ]ij , whose entry on the mth row and nth column is given by ∂[KΘ]mn ∂[Θ]ij = ∂k(θm,θn) ∂[Θ]ij , through the chain rule, all latent points in Θ can be optimized. With Θ, one can conduct causal inference and mechanism clustering of ANM-MM. The detailed steps are given in Algorithm 1 and 2. 4 Experiments 6 Figure 3: Accuracy (y-axis) versus sample size (x-axis) on Y = f(X; θc) + ϵ with different mechanisms. (a) f1, (b) f2, (c) f3, (d) f4. Algorithm 2: Mechanism clustering input :D = {(xn, yn)}N n=1 - the set of observations of two r.v.s; λ - parameter of independence; C - Number of clusters output :The cluster labels 1 Standardize observations of each r.v.; 2 Initialize β and kernel parameters; 3 Find Θ by optimizing (8) in causal direction; 4 Apply k-means on θn, n = 1, . . . , N; 5 return the cluster labels. In this section, experimental results on both synthetic and real data are given to show the performance of ANM-MM on causal inference and mechanism clustering tasks. The Python code of ANM-MM is available online at https: //github.com/amber0309/ANM-MM. 4.1 Synthetic data In experiments of causal inference, ANM-MM is compared with ANM [6], PNL [21], IGCI [8], ECP [20] and LiNGAM [18]. The results are evaluated using accuracy, which is the percentage of correct causal direction estimation of 50 independent experiments. Note that ANM-MM was applied using different parameter λ ∈{0.001, 0.01, 0.1, 1, 10} and IGCI was applied using different reference measures and estimators. Their highest accuracy is reported. In experiments of clustering, ANM-MM is compared with well-known k-means [13] (similaritybased) on both raw data (k-means) and its PCA component (PCA-km), Gaussian mixture clustering (GMM) [16] (model-based), spectral clustering (SpeClu) [17] (spectral graph theory-based) and DBSCAN [2] (density-based). Clustering performance is evaluated using average adjusted Rand index [7] (avgARI), which is the mean ARI over 100 experiments. High ARI (∈[−1, 1]) indicates good match between the clustering results and the ground truth. Sample size (N) is 100 in all synthetic clustering experiments. Clustering results are visualized in the supplementary1. Different g.m.s and sample sizes. We examine the performance on different g.m.s (f) and sample sizes (N). The mechanisms adopted are the following elementary functions: 1) f1 = 1 1.5+θcX2 ; 2) f2 = 2 × Xθc−0.25; 3) f3 = exp(−θcX); 4) f4 = tanh(θcX). We tested sample size N = 50, 100 and 200 for each mechanism. Given f and N, the cause X is sampled from a uniform distribution U(0, 1) and then mapped to the effect by Y = f(X; θc) + ϵ, c ∈{1, 2}, where θ1 ∼U(1, 1.1), θ2 ∼U(3, 3.1) and ϵ ∼N(0, 0.052). Each mechanism generates half of the observations. Causal Inference. The results are shown in Fig. 3. ANM-MM and ECP outperforms others based on a single causal model, which is consistent with our anticipation. Compared with ECP, ANM-MM shows slight advantages in 3 out of 4 settings. Clustering. The avgARI values are summarized in (i) of Table 1. ANM-MM significantly outperforms other approaches in all mechanism settings. Different number of g.m.s.2 We examine the performance on different number of g.m.s (C in Definition 1). θ1, θ2 and ϵ are the same as in previous experiments. In the setting of three mechanisms, θ3 ∼U(0.5, 0.6). In the setting of four, θ3 ∼U(0.5, 0.6) and θ4 ∼U(2, 2.1). Again, the numbers of observations from each mechanism are the same. 1The results of PCA-km are not visualized since they are similar to and worse than those of k-means. 2From this part on, g.m. is fixed to be f3. 7 Table 1: avgARI of synthetic clustering experiments avgARI (i) f (ii) C (iii) σ (iv) a1 f1 f2 f3 f4 3 4 0.01 0.1 0.25 0.75 ANM-MM 0.393 0.660 0.777 0.682 0.610 0.447 0.798 0.608 0.604 0.867 k-means 0.014 0.039 0.046 0.046 0.194 0.165 0.049 0.042 0.047 0.013 PCA-km 0.013 0.037 0.044 0.048 0.056 0.041 0.047 0.040 0.052 0.014 GMM 0.015 0.340 0.073 0.208 0.237 0.202 0.191 0.025 0.048 0.381 SpeClu 0.003 0.129 0.295 0.192 0.285 0.175 0.595 0.048 0.044 -0.008 DBSCAN 0.055 0.265 0.342 0.358 0.257 0.106 0.527 0.110 0.521 0.718 (a) (b) (c) Figure 4: Accuracy (y-axis) versus (a) number of mechanisms; (b) noise standard deviation; (c) mixing proportion; on f3 with N = 100. Causal Inference. The results are given in Fig. 4a which shows decreasing trend for all approaches. However, ANM-MM keeps 100% when the number of mechanisms increases from 2 to 3. Clustering. The avgARI values are given in (ii) and (i)f3 of Table 1. The performance of different approaches show different trends which is probably due to the clustering principle they are based on. Although ANM-MM is heavily influenced by C, its performance is still much better than others. Figure 5: Accuracy on real cause-effect pairs. Different noise standard deviations. We examine the performance on different noise standard deviations σ. θ1, θ2 are the same as in the first part of experiments. Three different cases where σ = 0.01, 0.05 and 0.1 are tested. Causal Inference. The results are given in Fig. 4b. The change in σ in this range does not significantly influence the performance of most causal inference approaches. ANM-MM keeps 100% accuracy for all choice of σ. Clustering. The avgARI values are given in (iii) and (i)f3 of Table 1. As our anticipation, the clustering results heavily rely on σ and all approaches show a decreasing trend in avgARI as σ increases. However, ANM-MM is the most robust against large σ. Different mixing proportions. We examine the performance on different mixing proportions (ac in Definition 1). θ1, θ2 and σ are the same as in the first part of experiments. Cases where a1 = 0.25, 0.5 and 0.75 (corresponding a2 = 0.75, 0.5 and 0.25) are tested. Causal Inference. The results on different a1 are given in Fig. 4c. Approaches based on a single causal model are sensitive to the change in a1 whereas ECP and ANM-MM are more robust and outperform others. Clustering. The avgARI values of experiments on different a1 are given in (iv) and (i)f3 of Table 1. The results of comparing approaches are significantly affected by a1 and ANM-MM shows best robustness against the change in a1. 8 (a) Ground truth (b) ANM-MM (c) k-means (d) GMM (e) SpeClu (f) DBSCAN Figure 6: Ground truth and clustering results of different approaches on BAFU air data. 4.2 Real data Causal inference on Tüebingen cause-effect pairs. We evaluate the causal inference performance of ANM-MM on real world benchmark cause-effect pairs3 [15]. Nine out of 41 data sets are excluded in our experiment because either they consists of multivariate or categorical data (pair 47, 52, 53, 54, 55, 70, 71, 101 and 105) or the estimated latent representations are extremely close4 (pair 12 and 17). Fifty independent experiments are repeated for each pair, and the percentage of correct inference of different approaches are recorded. Then average percentage of pairs from the same data set is computed as the accuracy of the corresponding data set. In each independent experiment, different inference approaches are applied on 90 points randomly sampled from raw data without replacement. The results are summarized in Fig. 5 with blue solid line indicating median accuracy and red dashed line indicating mean accuracy. It shows that the performance of ANM-MM is satisfactory, with highest median accuracy of about 82%. IGCI also performs quite well, especially in terms of median, followed by PNL. Clustering on BAFU air data. We evaluate the clustering performance of ANM-MM on real air data obtained online5. This data consists of daily mean values of ozone (µg/m3) and temperature (◦) of 2009 from two distinct locations in Switzerland. In our experiment, we regard the data as generating from two mechanisms (each corresponds to a location). The clustering results are visualized in Fig. 6. The ARI values of ANM-MM is 0.503, whereas k-means, GMM, spectral clustering and DBSCAN could only obtain ARI of -0.001, 0.003, 0.078 and 0.003, respectively. ANM-MM is the only one that could reveal the property related to the location of the data g.m.. 5 Conclusion In this paper, we extend the ANM to a more general model (ANM-MM) in which there are a finite number of ANMs of the same function form and differ only in parameter values. The condition of identifiability of ANM-MM is analyzed. To estimate ANM-MM, we adopt the GP-LVM framework and propose a variant of it called GPPOM to find the optimized latent representations and further conduct causal inference and mechanism clustering. Results on both synthetic and real world data verify the effectiveness of our proposed approach. 3https://webdav.tuebingen.mpg.de/cause-effect/. 4close in the sense that |θi −θj| < 0.001. 5https://www.bafu.admin.ch/bafu/en/home/topics/air.html 9 Acknowledgments This work is partially supported by the Hong Kong Research Grants Council. References [1] Daniusis, P., Janzing, D., Mooij, J., Zscheischler, J., Steudel, B., Zhang, K., and Schölkopf, B. (2012). Inferring deterministic causal relations. arXiv preprint arXiv:1203.3475. [2] Ester, M., Kriegel, H.-P., Sander, J., and Xu, X. (1996). A density-based algorithm for discovering clusters a density-based algorithm for discovering clusters in large spatial databases with noise. In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining, KDD’96, pages 226–231. AAAI Press. [3] Fukumizu, K., Bach, F. R., and Jordan, M. I. (2004). Dimensionality reduction for supervised learning with reproducing kernel hilbert spaces. Journal of Machine Learning Research, 5(Jan):73– 99. [4] Gretton, A., Bousquet, O., Smola, A., and Schölkopf, B. (2005a). Measuring statistical dependence with hilbert-schmidt norms. In International conference on algorithmic learning theory, pages 63–77. Springer. [5] Gretton, A., Smola, A. J., Bousquet, O., Herbrich, R., Belitski, A., Augath, M., Murayama, Y., Pauls, J., Schölkopf, B., and Logothetis, N. K. (2005b). Kernel constrained covariance for dependence measurement. In AISTATS, volume 10, pages 112–119. [6] Hoyer, P. O., Janzing, D., Mooij, J. M., Peters, J., and Schölkopf, B. (2009). Nonlinear causal discovery with additive noise models. In Advances in neural information processing systems, pages 689–696. [7] Hubert, L. and Arabie, P. (1985). Comparing partitions. Journal of classification, 2(1):193–218. [8] Janzing, D., Mooij, J., Zhang, K., Lemeire, J., Zscheischler, J., Daniušis, P., Steudel, B., and Schölkopf, B. (2012). Information-geometric approach to inferring causal directions. Artificial Intelligence, 182:1–31. [9] Janzing, D. and Scholkopf, B. (2010). Causal inference using the algorithmic markov condition. IEEE Transactions on Information Theory, 56(10):5168–5194. [10] Lawrence, N. (2005). Probabilistic non-linear principal component analysis with gaussian process latent variable models. Journal of machine learning research, 6(Nov):1783–1816. [11] Lawrence, N. D. (2004). Gaussian process latent variable models for visualisation of high dimensional data. In Advances in neural information processing systems, pages 329–336. [12] Liu, F. and Chan, L. (2016). Causal discovery on discrete data with extensions to mixture model. ACM Transactions on Intelligent Systems and Technology (TIST), 7(2):21. [13] MacQueen, J. (1967). Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics, pages 281–297, Berkeley, Calif. University of California Press. [14] Møller, M. F. (1993). A scaled conjugate gradient algorithm for fast supervised learning. Neural networks, 6(4):525–533. [15] Mooij, J. M., Peters, J., Janzing, D., Zscheischler, J., and Schölkopf, B. (2016). Distinguishing cause from effect using observational data: methods and benchmarks. The Journal of Machine Learning Research, 17(1):1103–1204. [16] Rasmussen, C. E. (2000). The infinite gaussian mixture model. In Advances in neural information processing systems, pages 554–560. [17] Shi, J. and Malik, J. (2000). Normalized cuts and image segmentation. IEEE Transactions on pattern analysis and machine intelligence, 22(8):888–905. 10 [18] Shimizu, S., Hoyer, P. O., Hyvärinen, A., and Kerminen, A. (2006). A linear non-gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7(Oct):2003–2030. [19] Williams, C. K. (1998). Prediction with gaussian processes: From linear regression to linear prediction and beyond. In Learning in graphical models, pages 599–621. Springer. [20] Zhang, K., Huang, B., Zhang, J., Schölkopf, B., and Glymour, C. (2015). Discovery and visualization of nonstationary causal models. arXiv preprint arXiv:1509.08056. [21] Zhang, K. and Hyvärinen, A. (2009). On the identifiability of the post-nonlinear causal model. In Proceedings of the twenty-fifth conference on uncertainty in artificial intelligence, pages 647–655. AUAI Press. 11
2018
230
7,398
Adversarial Risk and Robustness: General Definitions and Implications for the Uniform Distribution Dimitrios I. Diochnos∗ University of Virginia diochnos@virginia.edu Saeed Mahloujifar∗ University of Virginia saeed@virginia.edu Mohammad Mahmoody† University of Virginia mohammad@virginia.edu Abstract We study adversarial perturbations when the instances are uniformly distributed over {0, 1}n. We study both “inherent” bounds that apply to any problem and any classifier for such a problem as well as bounds that apply to specific problems and specific hypothesis classes. As the current literature contains multiple definitions of adversarial risk and robustness, we start by giving a taxonomy for these definitions based on their direct goals; we identify one of them as the one guaranteeing misclassification by pushing the instances to the error region. We then study some classic algorithms for learning monotone conjunctions and compare their adversarial robustness under different definitions by attacking the hypotheses using instances drawn from the uniform distribution. We observe that sometimes these definitions lead to significantly different bounds. Thus, this study advocates for the use of the error-region definition, even though other definitions, in other contexts with context-dependent assumptions, may coincide with the error-region definition. Using the error-region definition of adversarial perturbations, we then study inherent bounds on risk and robustness of any classifier for any classification problem whose instances are uniformly distributed over {0, 1}n. Using the isoperimetric inequality for the Boolean hypercube, we show that for initial error 0.01, there always exists an adversarial perturbation that changes O(√n) bits of the instances to increase the risk to 0.5, making classifier’s decisions meaningless. Furthermore, by also using the central limit theorem we show that when n →∞, at most c·√n bits of perturbations, for a universal constant c < 1.17, suffice for increasing the risk to 0.5, and the same c√n bits of perturbations on average suffice to increase the risk to 1, hence bounding the robustness by c · √n. 1 Introduction In recent years, modern machine learning tools (e.g., neural networks) have pushed to new heights the classification results on traditional datasets that are used as testbeds for various machine learning methods.1 As a result, the properties of these methods have been put into further scrutiny. In particular, studying the robustness of the trained models in various adversarial contexts has gained special attention, leading to the active area of adversarial machine learning. Within adversarial machine learning, one particular direction of research that has gained attention in recent years deals with the study of the so-called adversarial perturbations of the test instances. This line of work was particularly popularized, in part, by the work of Szegedy et al. [32] within ∗Authors have contributed equally. †Supported by NSF CAREER CCF-1350939 and University of Virginia SEAS Research Innovation Award. 1For example, http://rodrigob.github.io/are_we_there_yet/build/ has a summary of state-of-the-art results. 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. the context of deep learning classifiers, but the same problem can be asked for general classifiers as well. Briefly, when one is given a particular instance x for classification, an adversarial perturbation x′ for that instance is a new instance with minimal changes in the features of x so that the resulting perturbed instance x′ is misclassified by the classifier h. The perturbed instance x′ is commonly referred to as an adversarial example (for the classifier h). Adversarial machine learning has its roots at least as back as in [19, 24, 17]. However, the work of [32] revealed pairs of images that differed slightly so that a human eye could not identify any real differences between the two, and yet, contrary to what one would naturally expect, machine learning classifiers would predict different labels for the classifications of such pairs of instances. It is perhaps this striking resemblance to the human eye of the pairs of images that were provided in [32] that really gave this new push for intense investigations within the context of adversarial perturbations. Thus, a very intense line of work started, aiming to understand and explain the properties of machine learning classifiers on such adversarial perturbations; e.g., [15, 23, 2, 8, 20]. These attacks are also referred to as evasion attacks [25, 4, 15, 8, 36]. There is also work that aims at making the classifiers more robust under such attacks [27, 36], yet newer attacks of Carlini and Wagner [7] broke many proposed defenses. Our general goal. In this work, we study barriers against robust classification of adversarial examples. We are particularly interested in foundational bounds that potentially apply to broad class of problems and distributions. One can study this question from the perspectives of both risk and robustness. In the case of risk, the adversary’s goal is to increase the error probability of the classifier (e.g., to reach risk 0.5) by small perturbations of the instances, and in the case of robustness, we are interested in the average amount of perturbations needed for making the classifier always fail. Studying the uniform distribution. We particularly study adversarial risk and robustness for learning problems where the input distribution is Un which is uniform over the hypercube {0, 1}n. We measure the cost of perturbations using the natural metric of Hamming distance. Namely, the distance between the original and perturbed instances x, x′ ∈{0, 1}n is the number of locations that they are different. This class of distributions already include many learning problems of interest. So, by studying adversarial risk and robustness for such a natural distribution, we can immediately obtain results for a broad class of problems. We believe it is crucial to understand adversarial risk and robustness for natural distributions (e.g., Un uniform over the hypercube) and metrics (e.g., the Hamming distance) to develop a theory of adversarial risk and robustness that can ultimately shed light on the power and limitations of robust classification for practical data sets. Furthermore, natural distributions like Un model a broad class of learning problems directly; e.g., see [5, 28, 18, 30]. The hope is that understanding the limitations of robust learning for these basic natural distributions will ultimately shed light on challenges related to addressing broader problems of interest. Related work. The work of Gilmer et al. [14] studied the above problem for the special case of input distributions that are uniform over unit spheres in dimension n. They showed that for any classification problem with such input distribution, so long as there is an initial constant error probability µ, the robustness under the ℓ2 norm is at most O(√n). Fawzi et al. [11] studied the above question for Gaussian distributions in dimension n and showed that when the input distribution has ℓ2 norm ≈1, then by ≈√n perturbations in ℓ2 norm, we can make the classifier change its prediction (but doing this does not guarantee that the perturbed instance x′ will be misclassified). Schmidt et al. [29] proved limits on robustness of classifying uniform instances by specific classifiers and using a definition based on “corrupted inputs” (see Section 2), while we are mainly interested in bounds that apply to any classifiers and guarantee misclassification of the adversarial inputs. Discussion. Our results, like all other current provable bounds in the literature for adversarial risk and robustness only apply to specific distributions that do not cover the case of image distributions. These results, however, are first steps, and indicate similar phenomena (e.g., relation to isoperimetric inequalities). Thus, as pursued in [14], these works motivate a deeper study of such inequalities for real data sets. Finally, as discussed in [11], such theoretical attacks could potentially imply direct attacks on real data, assuming the existence of smooth generative models for latent vectors with theoretically nice distributions (such as Gaussian or uniform over the hypercube) into natural data. 1.1 Our Contribution and Results As mentioned above, our main goal is to understand inherent barriers against robust classification of adversarial examples, and our focus is on the uniform distribution Un of instances. In order to achieve that goal, we both do a definitions study and prove technical limitation results. 2 General definitions and a taxonomy. As the current literature contains multiple definitions of adversarial risk and robustness, we start by giving a taxonomy for these definitions based on their direct goals. More specifically, suppose x is an original instance that the adversary perturbs into a “close” instance x′. Suppose h(x), h(x′) are the predictions of the hypothesis h(·) and c(x), c(x′) are the true labels of x, x′ defined by the concept function c(·). To call x′ a successful “adversarial example”, a natural definition would compare the predicted label h(x′) with some other “anticipated answer”. However, what h(x′) is exactly compared to is where various definitions of adversarial examples diverge. We observe in Section 2 that the three possible definitions (based on comparing h(x′) with either of h(x), c(x) or c(x′)) lead to three different ways of defining adversarial risk and robustness. We then identify one of them (that compares h(x) with c(x′)) as the one guaranteeing misclassification by pushing the instances to the error region. We also discuss natural conditions under which these definitions coincide. However, these conditions do not hold in general. A comparative study through monotone conjunctions. We next ask: how close/far are these definitions in settings where, e.g., the instances are drawn from the uniform distribution? To answer this question, we make a comparative study of adversarial risk and robustness for a particular case of learning monotone conjunctions under the uniform distribution Un (over {0, 1}n). A monotone conjunction f is a function of the form f = (xi1 ∧· · · ∧xik). This class of functions is perhaps one of the most natural and basic learning problems that are studied in computational learning theory as it encapsulates, in the most basic form, the class of functions that determine which features should be included as relevant for a prediction mechanism. For example, Valiant in [35] used this class of functions under Un to exemplify the framework of evolvability. We attack monotone conjunctions under Un in order to contrast different behavior of definitions of adversarial risk and robustness. In Section 3, we show that previous definitions of robustness that are not based on the error region, lead to bounds that do not equate the bounds provided by the error-region approach. We do so by first deriving theorems that characterize the adversarial risk and robustness of a given hypothesis and a concept function under the uniform distribution. Subsequently, by performing experiments we show that, on average, hypotheses computed by two popular algorithms (FIND-S [22] and SWAPPING ALGORITHM [35]) also exhibit the behavior that is predicted by the theorems. Estimating the (expected value of) the adversarial risk and robustness of hypotheses produced by other classic algorithms under specific distributions, or for other concept classes, is an interesting future work. Inherent bounds for any classification task under the uniform distribution. Finally, after establishing further motivation to use the error-region definition as the default definition for studying adversarial examples in general settings, we turn into studying inherent obstacles against robust classification when the instances are drawn from the uniform distribution. We prove that for any learning problem P with input distribution Un (i.e., uniform over the hypercube) and for any classifier h for P with a constant error µ, the robustness of h to adversarial perturbations (in Hamming distance) is at most O(√n). We also show that by the same amount of O(√n) perturbations in the worst case, one can increase the risk to 0.99. Table 1 lists some numerical examples. Table 1: Each row focuses on the number of tampered bits to achieve its stated goal. The second column shows results using direct calculations for specific dimensions. The third column shows that these results are indeed achieved in the limit, and the last column shows bounds proved for all n. Types of bounds Adversarial goals n = 103, 104, 105 n 7→∞ all n From initial risk 0.01 to 0.99 ≈2.34√n < 2.34√n < 3.04√n From initial risk 0.01 to 0.50 ≈1.17√n < 1.17√n < 1.52√n Robustness for initial risk 0.01 ≈1.17√n < 1.17√n < 1.53√n To prove results above, we apply the isoperimetric inequality of [26, 16] to the error region of the classifier h and the ground truth c. In particular, it was shown in [16, 26] that the subsets of the hypercube with minimum “expansion” (under Hamming distance) are Hamming balls. This fact enables us to prove our bounds on the risk. We then prove the bounds on robustness by proving a general connection between risk and robustness that might obe of independent interest. Using the central limit theorem, we sharpen our bounds for robustness and obtain bounds that closely match the bounds that we also obtain by direct calculations (based on the isoperimetric inequalities and picking Hamming balls as error region) for specific values of dimension n = 103, 104, 105. 3 Full version. All proofs could be found in the full version of the paper2, which also includes results related to the adversarial risk of monotone conjunctions, complementing the picture of Section 3. 2 General Definitions of Risk and Robustness for Adversarial Perturbations Notation. We use calligraphic letters (e.g., X) for sets and capital non-calligraphic letters (e.g., D) for distributions. By x ←D we denote sampling x from D. In a classification problem P = (X, Y, D, C, H), the set X is the set of possible instances, Y is the set of possible labels, D is a set of distributions over X, C is a class of concept functions, and H is a class of hypotheses, where any f ∈C ∪H is a mapping from X to Y. An example is a labeled instance. We did not state the loss function explicitly, as we work with classification problems, however all main three definitions of this section directly extend to arbitrary loss functions. For x ∈X, c ∈C, D ∈D, the risk or error of a hypothesis h ∈H is the expected (0-1) loss of (h, c) with respect to D, namely Risk(h, c, D) = Prx←D[h(x) ̸= c(x)]. We are usually interested in learning problems with a fixed distribution D = {D}, as we are particularly interested in robustness of learning under the uniform distribution Un over {0, 1}n. Note that since we deal with negative results, fixing the distribution only makes our results stronger. As a result, whenever D = {D}, we omit D from the risk notation and simply write Risk(h, c). We usually work with problems P = (X, Y, D, C, H, d) that include a metric d over the instances. For a set S ⊆X we let d(x, S) = inf{d(x, y) | y ∈S}, and by Ballr(x) = {x′ | d(x, x′) ≤r} we denote the ball of radius r centered at x under the metric d. By HD we denote Hamming distance for pairs of instances from {0, 1}n. Finally, we use the term adversarial instance to refer to an adversarially perturbed instance x′ of an originally sampled instance x when the label of the adversarial example is either not known or not considered. Below we present our formal definitions of adversarial risk and robustness. In all of these definitions we will deal with attackers who perturb the initial test instance x into a close adversarial instance x′. We will measure how much an adversary can increase the risk by perturbing a given input x into a close adversarial example x′. When to exactly call x′ a successful adversarial example is where these definitions differ. First we formalize the main definition that we use in this work based on adversary’s ability to push instances to the error region. Definition 2.1 (Error-region risk and robustness). Let P = (X, Y, D, C, H, d) be a classification problem (with metric d defined over instances X). • Risk. For any r ∈R+, h ∈H, c ∈C, the error-region risk under r-perturbation is RiskER r (h, c) = Pr x←D[∃x′ ∈Ballr(x), h(x′) ̸= c(x′)] . For r = 0, RiskER r (h, c) = Risk(h, c) becomes the standard notion of risk. • Robustness. For any h ∈H, x ∈X, c ∈C, the error-region robustness is the expected distance of a sampled instance to the error region, formally defined as follows RobER(h, c) = E x←D [inf{r: ∃x′ ∈Ballr(x), h(x′) ̸= c(x′)}] . h(x) h(x′) c(x) c(x′) Error Region Corrupted Instance Prediction Change Figure 1: The three main definitions based on what h(x′) is compared with. Definition 2.1 requires the adversarial instance x′ to be misclassified, namely, h(x′) ̸= c(x′). So, x′ clearly belongs to the error region of the hypothesis h compared to the ground truth c. This definition is implicit in the work of [14]. In what follows, we compare our main definition above with previously proposed definitions of adversarial risk and robustness found in the literature and discuss when they are (and when they are not) equivalent to Definition 2.1. Figure 1 summarizes the differences between the three main definitions that have appeared in the literature, where we distinguish cases by comparing the classifier’s prediction h(x′) at the new point x′ with either of h(x), c(x), or c(x′), leading to three different definitions. 2See https://arxiv.org/abs/1810.12272. 4 Definitions based on hypothesis’s prediction change (PC risk and robustness). Many works, including the works of [32, 11] use a definition of robustness that compares classifier’s prediction h(x′) with the prediction h(x) on the original instance x. Namely, they require h(x′) ̸= h(x) rather than h(x′) ̸= c(x′) in order to consider x′ an adversarial instance. Here we refer to this definition (that does not depend on the ground truth c) as prediction-change (PC) risk and robustness (denoted as RiskPC r (h) and RobPC(h)). We note that this definition captures the error-region risk and robustness if we assume the initial correctness (i.e., h(x) = c(x)) of classifier’s prediction on all x ←X and “truth proximity”, i.e., that c(x) = c(x′) holds for all x′ that are “close” to x. Both of these assumptions are valid in some natural scenarios. For example, when input instances consist of images that look similar to humans (if used as the ground truth c(·)) and if h is also correct on the original (non-adversarial) test examples, then the two definitions (based on error region or prediction change) coincide. But, these assumptions do not hold in in general. Definitions based on the notion of corrupted instance (CI risk and robustness). The works of [21, 12, 13, 1] study the robustness of learning models in the presence of corrupted inputs. A more recent framework was developed in [20, 29] for modeling risk and robustness that is inspired by robust optimization [3] (with an underlying metric space) and model adversaries that corrupt the the original instance in (exponentially more) ways. When studying adversarial perturbations using corrupted instances, we define adversarial risk by requiring the adversarial instance x′ to satisfy h(x′) ̸= c(x). The term “corrupted instance” is particularly helpful as it emphasizes on the fact that the goal (of the classifier) is to find the true label of the original (uncorrupted) instance x, while we are only given a corrupted version x′. Hence, we refer to this definition as the corrupted instance (CI) risk and robustness and denote them by RiskCI r (h, c) and RobCI(h, c). The advantage of this definition compared to the prediction-change based definitions is that here, we no longer need to assume the initial correctness assumption. Namely, only if the “truth proximity” assumption holds, then we have c(x) = c(x′) which together with the condition h(x′) ̸= c(x) we can conclude that x′ is indeed misclassified. However, if small perturbations can change the ground truth, c(x′) can be different from c(x), in which case, it is no long clear whether x′ is misclassified or not. Stronger definitions of risk and robustness with more restrictions on adversarial instance. The corrupted-input definition requires an adversarial instance x′ to satisfy h(x′) ̸= c(x), and the error-region definition requires h(x′) ̸= c(x′). What if we require both of these conditions to call x′ a true adversarial instance? This is indeed the definition used in the work of Suggala et al. [31], though more formally in their work, they subtract the original risk (without adversarial perturbation) from the adversarial risk. This definition is certainly a stronger guarantee for the adversarial instance. As this definition is a hybrid of the error-region and corrupted-instance definitions, we do not make a direct study of this definition and only focus on the other three definitions described above. How about when the classifier h is 100% correct? We emphasize that when h happens to be the same function as c, (the error region) Definition 2.1 implies h has zero adversarial risk and infinite adversarial robustness RobER(h, c) = ∞. This is expected, as there is no way an adversary can perturb any input x into a misclassified x′. However, both of the definitions of risk and robustness based on prediction change [32] and corrupted instance [21, 20] could compute large risk and small robustness for such h. In fact, in a recent work [33] it is shown that for definitions based on corrupted input, correctness might be provably at odds with robustness in some cases. Therefore, even though all these definitions could perhaps be used to approximate the risk and robustness when we do not have access to the ground truth c′ on the new point x′, in this work we separate the definition of risk and robustness from how to compute/approximate them, so we will use Definition 2.1 by default. 3 A Comparative Study through Monotone Conjunctions In this section, we compare the risk and robustness under the three definitions of Section 2 through a study of monotone conjunctions under the uniform distribution. Namely, we consider adversarial perturbations of truth assignments that are drawn from the uniform distribution Un over {0, 1}n when the concept class contains monotone conjunctions. As we will see, these definitions diverge in this natural case. Below we fix the setup under which all the subsequent results are obtained. Problem Setup 1. Let Cn be the concept class of all monotone conjunctions formed by at least one and at most n Boolean variables. The target concept (ground truth) c that needs to be learned is 5 drawn from Cn. Let the hypothesis class be H = Cn and let h ∈H be the hypothesis obtained by a learning algorithm after processing the training data. With |h| and |c| we denote the size of h and c respectively; that is, number of variables that h and c contain.3 Now let, c = m ^ i=1 xi ∧ u^ k=1 yk and h = m ^ i=1 xi ∧ w ^ ℓ=1 zℓ. (1) We will call the variables that appear both in h and c as mutual, the variables that appear in c but not in h as undiscovered, and the variables that appear in h but not in c as wrong (or redundant). Therefore in (1) we have m mutual variables, u undiscovered and w wrong. We denote the error region of a hypothesis h and the target concept c with E (h, c). That is, E (h, c) = {x ∈{0, 1}n | h(x) ̸= c(x)}. The probability mass of the error region between h and c, denoted by µ, under the uniform distribution Un over {0, 1}n is then, Pr x←Un[x ∈E (h, c)] = µ = (2w + 2u −2) · 2−m−u−w . (2) In this problem setup we are interested in computing the adversarial risk and robustness that attackers can achieve when instances are drawn from the uniform distribution Un over {0, 1}n. Remark 3.1. Note that µ is a variable that depends on the particular h and c. Using the Problem Setup 1, in what follows we compute the adversarial robustness that an arbitrary hypothesis has against an arbitrary target using the error region (ER) definition that we advocate in contexts where the perturbed input is supposed to be misclassified and do the same calculations for adversarial risk and robustness that are based on the definitions of prediction change (PC) and corrupted instance (CI). The important message is that the adversarial robustness of a hypothesis based on the ER definition is Θ (min{|h| , |c|}), whereas the adversarial robustness based on PC and CI is Θ (|h|). In the full version of the paper we also give theorems (that have similar flavor) for calculating the adversarial risk based on the three main definitions (ER, PC, CI). Theorem 3.2. Consider the Problem Setup 1. Then, if h = c we have RobER(h, c) = ∞, while if h ̸= c we have min{|h| , |c|}/16 ≤RobER(h, c) ≤1 + min{|h| , |c|}. Theorem 3.3. Consider the Problem Setup 1. Then, RobPC(h) = |h| /2 + 2−|h|. Theorem 3.4. Consider the Problem Setup 1. Then, |h| /4 < RobCI(h, c) < |h| + 1/2. 3.1 Experiments for the Expected Values of Adversarial Robustness In this part, we complement the theorems that we presented earlier with experiments. This way we are able to examine how some popular algorithms behave under attack, and we explore the extent to which the generated solutions of such algorithms exhibit differences in their (adversarial) robustness on average against various target functions drawn from the class of monotone conjunctions. The first algorithm is the standard Occam algorithm that starts from the full conjunction and eliminates variables from the hypothesis that contradict the positive examples received; this algorithm is known as FIND-S in [22] but has appeared without a name earlier by Valiant in [34] and its roots are at least as old as in [6]. The second algorithm is the SWAPPING ALGORITHM from the framework of evolvability [35]. This algorithm searches for an ε-optimal solution among monotone conjunctions that have at most ⌈lg(3/(2ε))⌉variables in their representation using a local search method where hypotheses in the neighborhood are obtained by swapping in and out some variable(s) from the current hypothesis; we follow the analysis that was used in [10] and is a special case of [9]. In each experiment, we first learn hypotheses by using the algorithms under Un against different target sizes. For both algorithms, during the learning process, we use ε = 0.01 and δ = 0.05 for the learning parameters. We then examine the robustness of the generated hypotheses by drawing examples again from the uniform distribution Un as this is the main theme of this paper. In particular, we test against the 30 target sizes from the set {1, 2, . . . , 24, 25, 30, 50, 75, 99, 100}. For each such target size, we plot the average value, over 500 runs, of the robustness of the learned hypothesis that 3 For example, h1 = x1 ∧x5 ∧x8 is a monotone conjunction of three variables in a space where we have n ≥8 variables and |h1| = 3. 6 we obtain. In each run, we repeat the learning process using a random target of the particular size as well as a fresh training sample and subsequently estimate the robustness of the learned hypothesis by drawing another 10, 000 examples from Un that we violate (depending on the definition). The dimension of the instances is n = 100. Figure 2 presents the values of the three robustness measures for the case of FIND-S. In the full version of the paper we provide more details on the algorithms and more information regarding our experiments. The message is that the adversarial robustness that is based on the definitions of prediction change and corrupted instance is more or less the same, whereas the adversarial robustness based on the error region definition may obtain wildly different values compared to the other two. 65 70 75 80 85 error region 90 95 100 robustness target size |c| 0 5 10 15 20 25 30 35 40 45 50 1 5 10 15 20 25 30 corrupted instance 35 40 45 50 55 60 prediction change Figure 2: Experimental comparison of the different robustness measures. The values for PC and CI almost coincide and they can hardly be distinguished. The value for ER robustness is completely different compared to the other two. Note that ER robustness is ∞when the target size |c| is in {1, . . . , 8} ∪{100} and for this reason only the points between 9 and 99 are plotted. When |c| ≥20, almost always the learned hypothesis is the initialized full conjunction. The reason is that positive examples are very rare and our training set contains none. As a result no variable is eliminated from the initialized hypothesis h (full conjunction). Hence, when |c| ≥20 we see that PC and CI robustness is about max{|h| , |c|}/2 = |h|/2, whereas ER is roughly min{|h| , |c|}/2 = |c|/2. 4 Inherent Bounds on Risk and Robustness for the Uniform Distribution In this section, we state our main theorems about error region adversarial risk and robustness of arbitrary learning problems whose instances are distributed uniformly over the n-dimension hypercube {0, 1}n. The proofs of the theorems below are available in the full version of the paper. We first define a useful notation for the size of the (partial) Hamming balls. Definition 4.1. For every n ∈ N we define the (partial) “Hamming Ball Size” function BSizen : [n] × [0, 1) →[0, 1) as follows BSizen(k, λ) = 2−n · k−1 X i=0 n i  + λ · n k ! . Note that this function is a bijection and we use BSize−1(·) to denote its inverse. When n is clear from the context, we will simply use BSize(·, ·) and BSize−1(·) instead. The following theorem, gives a general lower bound for the adversarial risk of any classification problem for uniform distribution Un over the hypercube {0, 1}n, depending on the original error. Theorem 4.2. Suppose P = ({0, 1}n, Y, Un, C, H, HD) is a classification problem. For any h ∈ H, c ∈C and r ∈N, let µ = Risk(h, c) > 0 be the original risk and (k, λ) = BSize−1 (µ) be a function of the original risk. Then, the error-region adversarial risk under r-perturbation is at least RiskER r (h, c) ≥BSize(k + r, λ). 7 The following corollary determines an asymptotic lower bound for risk based on Theorem 4.2. Corollary 4.3 (Error-region risk for all n). Suppose P = ({0, 1}n, Y, Un, C, H, HD) is a classification problem. For any hypothesis h, c with risk µ ∈(0, 1 2] in predicting a concept function c, we can increase the risk of (h, c) from µ ∈(0, 1 2] to µ′ ∈[ 1 2, 1] by changing at most r = r −n · ln µ 2 + r −n · ln(1 −µ′) 2 bits in the input instances. Namely, by using the above r, we have RiskER r (h, c) ≥µ′. Also, to increase the error to 1 2 we only need to change at most r′ = q −n·ln(µ) 2 bits. Example. Corollary 4.3 implies that for classification tasks over Un, by changing at most 3.04√n number of bits in each example we can increase the error of an hypothesis from 1% to 99%. Furthermore, for increasing the error just to 0.5 we need half of the number of bits, which is 1.52√n. Also, the corollary bellow, gives a lower bound on the limit of adversarial risk when n 7→∞. This lower bound matches the bound we have in our computational experiments. Corollary 4.4 (Error-region risk for large n). Let µ ∈(0, 1] and µ′ ∈(µ, 1] and P = ({0, 1}n, Y, Un, C, H, HD) be a classification problem. Then for any h ∈H, c ∈C such that Risk(h, c) ≥µ we have Riskr(h, c) ≥µ′ for r ≈√n · Φ−1(µ′) −Φ−1(µ) 2 when n 7→∞ where Φ is the CDF of the standard normal distribution. Example. Corollary 4.4 implies that for classification tasks over Un, when n is large enough, we can increase the error from 1% to 99% by changing at most 2.34√n bits, and we can we can increase the error from 1% to 50% by changing at most 1.17√n bits in test instances. The following theorem shows how to upper bound the adversarial robustness using the original risk. Theorem 4.5. Suppose P = ({0, 1}n, Y, Un, C, H, HD) is a classification problem. For any h ∈H and c ∈C, if µ = Risk(h, c) and (k, λ) = BSize−1(µ) depends on the original risk, then the error-region robustness is at most RobER(h, c) ≤ n−k+1 X r=0 (1 −BSize(k + r, λ)) . Following, using Theorem 4.5, we give an asymptotic lower bound for robustness . Corollary 4.6. Suppose P = ({0, 1}n, Y, Un, C, H, HD) is a classification problem. For any hypothesis h with risk µ ∈(0, 1 2], we can make h to give always wrong answers by changing r = p −n · ln µ/2 + µ · p n/2 number of bits on average. Namely, we have RobER(h, c) ≤ r −n · ln µ 2 + µ · rn 2 . And the following Corollary gives a lower bound on the robustness in limit. Corollary 4.7. For any µ ∈(0, 1], classification problem P = ({0, 1}n, Y, Un, C, H, HD), and any h ∈H, c ∈C such that Risk(h, c) ≥µ, we have RobER(h, c) ≤Φ−1(µ) 2 · √n + µ · rπ · n 8 when n 7→∞, where Φ is the CDF of the standard normall distribution. Example. By changing 1.53√n number of bits on average we can increase the error of an hypothesis from 1% to 100%. Also, if n 7→∞, by changing only 1.17√n number of bits on average we can increase the error from 1% to 100%. 8 References [1] Idan Attias, Aryeh Kontorovich, and Yishay Mansour. Improved generalization bounds for robust learning. arXiv preprint arXiv:1810.02180, 2018. [2] Osbert Bastani, Yani Ioannou, Leonidas Lampropoulos, Dimitrios Vytiniotis, Aditya V. Nori, and Antonio Criminisi. Measuring Neural Net Robustness with Constraints. In NIPS, pages 2613–2621, 2016. [3] Aharon Ben-Tal, Laurent El Ghaoui, and Arkadi S. Nemirovski. Robust Optimization. Princeton Series in Applied Mathematics. Princeton University Press, October 2009. [4] Battista Biggio, Giorgio Fumera, and Fabio Roli. Security evaluation of pattern classifiers under attack. IEEE transactions on knowledge and data engineering, 26(4):984–996, 2014. [5] Avrim Blum, Merrick L. Furst, Jeffrey C. Jackson, Michael J. Kearns, Yishay Mansour, and Steven Rudich. Weakly learning DNF and characterizing statistical query learning using Fourier analysis. In STOC, pages 253–262, 1994. [6] Jerome S. Bruner, Jacqueline J. Goodnow, and George A. Austin. A study of thinking. John Wiley & Sons, New York, NY, USA, 1957. [7] Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pages 3–14. ACM, 2017. [8] Nicholas Carlini and David A. Wagner. Towards Evaluating the Robustness of Neural Networks. In 2017 IEEE Symposium on Security and Privacy, SP 2017, San Jose, CA, USA, May 22-26, 2017, pages 39–57, 2017. [9] Dimitrios I. Diochnos. On the Evolution of Monotone Conjunctions: Drilling for Best Approximations. In ALT, pages 98–112, 2016. [10] Dimitrios I. Diochnos and György Turán. On Evolvability: The Swapping Algorithm, Product Distributions, and Covariance. In SAGA, pages 74–88, 2009. [11] Alhussein Fawzi, Hamza Fawzi, and Omar Fawzi. Adversarial vulnerability for any classifier. arXiv preprint arXiv:1802.08686, 2018. [12] Uriel Feige, Yishay Mansour, and Robert Schapire. Learning and inference in the presence of corrupted inputs. In Conference on Learning Theory, pages 637–657, 2015. [13] Uriel Feige, Yishay Mansour, and Robert E Schapire. Robust inference for multiclass classification. In Algorithmic Learning Theory, pages 368–386, 2018. [14] Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018. [15] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. In ICLR, 2015. [16] Lawrence H Harper. Optimal numberings and isoperimetric problems on graphs. Journal of Combinatorial Theory, 1(3):385–393, 1966. [17] Ling Huang, Anthony D. Joseph, Blaine Nelson, Benjamin I. P. Rubinstein, and J. D. Tygar. Adversarial Machine Learning. In Proceedings of the 4th ACM Workshop on Security and Artificial Intelligence, AISec 2011, Chicago, IL, USA, October 21, 2011, pages 43–58, 2011. [18] Jeffrey C. Jackson and Rocco A. Servedio. On Learning Random DNF Formulas Under the Uniform Distribution. Theory of Computing, 2(8):147–172, 2006. [19] Daniel Lowd and Christopher Meek. Adversarial learning. In KDD, pages 641–647, 2005. 9 [20] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083; to appear in International Conference on Learning Representations (ICLR), 2018. [21] Yishay Mansour, Aviad Rubinstein, and Moshe Tennenholtz. Robust probabilistic inference. In Proceedings of the twenty-sixth annual ACM-SIAM symposium on Discrete algorithms, pages 449–460. Society for Industrial and Applied Mathematics, 2015. [22] Thomas M. Mitchell. Machine Learning. McGraw-Hill, Inc., New York, NY, USA, 1 edition, 1997. [23] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. DeepFool: A Simple and Accurate Method to Fool Deep Neural Networks. In CVPR, pages 2574–2582, 2016. [24] Blaine Nelson, Benjamin I. P. Rubinstein, Ling Huang, Anthony D. Joseph, and J. D. Tygar. Classifier Evasion: Models and Open Problems. In PSDM, pages 92–98, 2010. [25] Blaine Nelson, Benjamin IP Rubinstein, Ling Huang, Anthony D Joseph, Steven J Lee, Satish Rao, and JD Tygar. Query strategies for evading convex-inducing classifiers. Journal of Machine Learning Research, 13(May):1293–1332, 2012. [26] R. G. Nigmatullin. Some metric relations in the unit cube (in russian). Diskretny Analiz 9, Novosibirsk, pages 47–58, 1967. [27] Nicolas Papernot, Patrick D. McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a Defense to Adversarial Perturbations Against Deep Neural Networks. In IEEE Symposium on Security and Privacy, SP 2016, San Jose, CA, USA, May 22-26, 2016, pages 582–597, 2016. [28] Yoshifumi Sakai and Akira Maruoka. Learning Monotone Log-Term DNF Formulas under the Uniform Distribution. Theory of Computing Systems, 33(1):17–33, 2000. [29] Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. arXiv preprint arXiv:1804.11285, 2018. [30] Linda Sellie. Exact learning of random DNF over the uniform distribution. In STOC, pages 45–54, 2009. [31] Arun Sai Suggala, Adarsh Prasad, Vaishnavh Nagarajan, and Pradeep Ravikumar. On Adversarial Risk and Training. arXiv preprint arXiv:1806.02924, 2018. [32] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014. [33] Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness May Be at Odds with Accuracy. arXiv preprint arXiv:1805.12152, 2018. [34] Leslie G. Valiant. A Theory of the Learnable. Communications of the ACM, 27(11):1134–1142, 1984. [35] Leslie G. Valiant. Evolvability. Journal of the ACM, 56(1):3:1–3:21, 2009. [36] Weilin Xu, David Evans, and Yanjun Qi. Feature Squeezing: Detecting Adversarial Examples in Deep Neural Networks. arXiv preprint arXiv:1704.01155. To appear in Network and Distributed System Security Symposium (NDSS), 2018. 10
2018
231
7,399
Analysis of Krylov Subspace Solutions of Regularized Nonconvex Quadratic Problems Yair Carmon Department of Electrical Engineering Stanford University yairc@stanford.edu John C. Duchi Departments of Statitstics and Electrical Engineering Stanford University jduchi@stanford.edu Abstract We provide convergence rates for Krylov subspace solutions to the trust-region and cubic-regularized (nonconvex) quadratic problems. Such solutions may be efficiently computed by the Lanczos method and have long been used in practice. We prove error bounds of the form 1/t2 and e−4t/p, where is a condition number for the problem, and t is the Krylov subspace order (number of Lanczos iterations). We also provide lower bounds showing that our analysis is sharp. 1 Introduction Consider the potentially nonconvex quadratic function fA,b(x) := 1 2xT Ax + bT x, where A 2 Rd⇥d and b 2 Rd. We wish to solve regularized minimization problems of the form minimize x fA,b(x) subject to kxk R and minimize x fA,b(x) + ⇢ 3 kxk3 , (1) where R and ⇢≥0 are regularization parameters. These problems arise primarily in the family of trust-region and cubic-regularized Newton methods for general nonlinear optimization problems [11, 29, 18, 9], which optimize a smooth function g by sequentially minimizing local models of the form g(xi + ∆) ⇡g(xi) + rg(xi)T ∆+ 1 2∆T r2g(xi)∆= g(xi) + fr2g(xi),rg(xi)(∆), where xi is the current iterate and ∆2 Rd is the search direction. Such models tend to be unreliable for large k∆k, particularly when r2g(xi) ⌥0. Trust-region and cubic regularization methods address this by constraining and regularizing the direction ∆, respectively. Both classes of methods and their associated subproblems are the subject of substantial ongoing research [19, 21, 5, 1, 25]. In the machine learning community, there is growing interest in using these methods for minimizing (often nonconvex) training losses, handling the large finite-sum structure of learning problems by means of sub-sampling [32, 23, 3, 38, 36]. The problems (1) are challenging to solve in high-dimensional settings, where direct decomposition (or even storage) of the matrix A is infeasible. In some scenarios, however, computing matrix-vector products v 7! Av is feasible. Such is the case when A is the Hessian of a neural network, where d may be in the millions and A is dense, and yet we can compute Hessian-vector products efficiently on batches of training data [31, 33]. In this paper we consider a scalable approach for approximately solving (1), which consists of minimizing the objective in the Krylov subspace of order t, Kt(A, b) := span{b, Ab, . . . , At−1b}. (2) 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montréal, Canada. This requires only t matrix-vector products, and the Lanczos method allows one to efficiently find the solution to problems (1) over Kt(A, b) (see, e.g. [17, 9, Sec. 2]). Krylov subspace methods are familiar in numerous large-scale numerical problems, including conjugate gradient methods, eigenvector problems, or solving linear systems [20, 26, 35, 14]. It is well-known that, with exact arithmetic, the order d subspace Kd(A, b) generically contains the global solutions to (1). However, until recently the literature contained no guarantees on the rate at which the suboptimality of the solution approaches zero as the subspace dimension t grows. This is in contrast to the two predominant Krylov subspace method use-cases—convex quadratic optimization [14, 27, 28] and eigenvector finding [24]—where such rates of convergence have been known for decades. Zhang et al. [39] make substantial progress on this gap, establishing bounds implying a linear rate of convergence for the trust-region variant of problem (1). In this work we complete the picture, proving that the optimality gap of the order t Krylov subspace solution to either of the problems (1) is bounded by both e−4t/pand t−2 log2(kbk/|uT minb|). Here is a condition number for the problem that naturally generalizes the classical condition number of the matrix A, and umin is an eigenvector of A corresponding to its smallest eigenvalue. Using randomization, we may replace |uT minb| with a term proportional to 1/ p d, circumventing the wellknown “hard case” of the problem (1) (see Section 2.5). Our analysis both leverages and unifies the known results for convex quadratic and eigenvector problems, which constitute special cases of (1). Related work Zhang et al. [39] show that the error of certain polynomial approximation problems bounds the suboptimality of Krylov subspace solutions to the trust region-variant of the problems (1), implying convergence at a rate exponential in −t/p. Based on these bounds, the authors propose novel stopping criteria for subproblem solutions in the trust-region optimization method, showing good empirical results. However, the bounds of [39] become weak for large and vacuous in the hard case where = 1. Prior works develop algorithms for solving (1) with convergence guarantees that hold in the hard case. Hazan and Koren [19], Ho-Nguyen and Kılınc˛-Karzan [21], and Agarwal et al. [1] propose algorithms that obtain error roughly t−2 after computing t matrix-vector products. The different algorithms these papers propose all essentially reduce the problems (1) to a sequence of eigenvector and convex quadratic problems to which standard algorithms apply. In previous work [5], we analyze gradient descent—a direct, local method—for the cubic-regularized problem. There, we show a rate of convergence roughly t−1, reflecting the well-known complexity gap between gradient descent (respectively, the power method) and conjugate gradient (respectively, Lanczos) methods [35, 14]. Our development differs from this prior work in the following ways. 1. We analyze a practical approach, implemented in efficient optimization libraries [16, 25], with essentially no tuning parameters. Previous algorithms [19, 21, 1] are convenient for theoretical analysis but less conducive to efficient implementation; each has several parameters that require tuning, and we are unaware of numerical experiments with any of the approaches. 2. We provide both linear (e−4t/p) and sublinear (t−2) convergence guarantees. In contrast, the papers [19, 21, 1] provide only a sublinear rate; Zhang et al. [39] provide only the linear rate. 3. Our analysis applies to both the trust-region and cubic regularization variants in (1), while [19, 21, 39] consider only the trust-region problem, and [39, 5] consider only cubic regularization. 4. We provide lower bounds—for adversarially constructed problem instances—showing our convergence guarantees are tight to within numerical constants. By a resisting oracle argument [27], these bounds apply to any deterministic algorithm that accesses A via matrix-vector products. 5. Our arguments are simple and transparent, and we leverage established results on convex optimization and the eigenvector problem to give short proofs of our main results. Paper organization In Section 2 we state and prove our convergence rate guarantees for the trustregion problem. Then, in Section 3 we quickly transfer those results to the cubic-regularized problem by showing that it always has a smaller optimality gap. Section 4 gives our lower bounds, stated for cubic regularization but immediately applicable to the trust-region problem by the same optimality gap bound. Finally, in Section 5 we illustrate our analysis with some numerical experiments. 2 Notation For a symmetric matrix A 2 Rd⇥d and vector b we let fA,b(x) := 1 2xT Ax + bT x. We let λmin(A) and λmax(A) denote the minimum and maximum eigenvalues of A, and let umin(A), umax(A) denote their corresponding (unit) eigenvectors, dropping the argument A when clear from context. For integer t ≥1 we let Pt := ! c0 + c1x + · · · + ct−1xt−1 | ci 2 R be the polynomials of degree at most t−1, so that the Krylov subspace (2) is Kt(A, b) = {p(A)b | p 2 Pt}. We use k·k to denote Euclidean norm on Rd and `2-operator norm on Rd⇥d. Finally, we denote (z)+ := max{z, 0} and (z)−:= min{z, 0}. 2 The trust-region problem Fixing a symmetric matrix A 2 Rd⇥d, vector b 2 Rd and trust-region radius R > 0, we let str ? 2 argmin x2Rd, kxkR fA,b(x) = 1 2xT Ax + bT x denote a solution (global minimizer) of the trust region problem. Letting λmin, λmax denote the extremal eigenvalues of A, str ? admits the following characterization [11, Ch. 7]: str ? solves problem (1) if and only if there exists λ? such that (A + λ?I)str ? = −b, λ? ≥(−λmin)+, and λ?(R − ##str ? ##) = 0. (3) The optimal Lagrange multiplier λ? always exists and is unique, and if λ? > −λmin the solution str ? is unique and satisfies str ? = −(A + λ?I)−1b. Letting umin denote the eigenvector of A corresponding to λmin, the characterization (3) shows that uT minb 6= 0 implies λ? > −λmin. Now, consider the Krylov subspace solutions, and for t > 0, let str t 2 argmin x2Kt(A,b), kxkR fA,b(x) = 1 2xT Ax + bT x denote a minimizer of the trust-region problem in the Krylov subspace of order t . Gould et al. [17] show how to compute the Krylov subspace solution str t in time dominated by the cost of computing t matrix-vector products using the Lanczos method (see also Section A of the supplement). 2.1 Main result With the notation established above, our main result follows. Theorem 1. For every t > 0, fA,b(str t ) −fA,b(str ? ) 36 ⇥ fA,b(0) −fA,b(str ? ) ⇤ exp ( −4t r λmin + λ? λmax + λ? ) , (4) and fA,b(str t ) −fA,b(str ? ) (λmax −λmin) kstr ? k2 (t −1 2)2 " 4 + I{λmin<0} 8 log2 4 kbk2 (uT minb)2 !# . (5) Theorem 1 characterizes two convergence regimes: linear (4) and sublinear (5). Linear convergence occurs when t & p k, where = λmax+λ? λmin+λ? ≥1 is the condition number for the problem. There, the error decays exponentially and falls beneath ✏in roughly plog 1 ✏Lanczos iteration. Sublinear convergence occurs when t . p k, and there the error decays polynomially and falls beneath ✏in roughly 1 p✏iterations. For worst-case problem instances this characterization is tight to constant factors, as we show in Section 4. The guarantees of Theorem 1 closely resemble the well-known guarantees for the conjugate gradient method [35], including them as the special case R = 1 and λmin ≥0. For convex problems, the radius constraint kxk R always improves the conditioning of the problem, as λmax λmin ≥λmax+λ? λmin+λ? ; the smaller R is, the better conditioned the problem becomes. For non-convex problems, the sublinear rate features an additional logarithmic term that captures the role of the eigenvector umin. The 3 first rate (4) is similar to those of Zhang et al. [39, Thm. 4.11], though with somewhat more explicit dependence on t. In the “hard case,” which corresponds to uT minb = 0 and λmin + λ? = 0 (cf. [11, Ch. 7]), both the bounds in Theorem 1 become vacuous, and indeed str t may not converge to the global minimizer in this case. However, as the bound (5) depends only logarithmically on uT minb, it remains valid even extremely close to the hard case. In Section 2.5 we describe two simple randomization techniques with convergence guarantees that are valid in the hard case as well. 2.2 Proof sketch Our analysis reposes on two elementary observations. First, we note that Krylov subspaces are invariant to shifts by scalar matrices, i.e. Kt(A, b) = Kt(Aλ, b) for any A, b, t where λ 2 R, and Aλ := A + λI. Second, we observe that for every point x and λ 2 R fA,b(x) −fA,b(str ? ) = fAλ,b(x) −fAλ,b(str ? ) + λ 2 ( ##str ? ##2 −kxk2) (6) Our strategy then is to choose λ such that Aλ ⌫0, and then use known results to find yt 2 Kt(Aλ, b) = Kt(A, b) that rapidly reduces the “convex error” term fAλ,b(yt) −fAλ,b(str ? ). We then adjust yt to obtain a feasible point xt such that the “norm error” term λ 2 (kstr ? k2 −kxtk2) is small. To establish linear convergence, we take λ = λ? and adjust the norm of yt by taking xt = (1 −↵)yt for some small ↵that guarantees xt is feasible and that the “norm error” term is small. To establish sublinear convergence we set λ = −λmin and take xt = yt + ↵· zt, where zt is an approximation for umin within Kt(A, b), and ↵is chosen to make kxtk = kstr ? k. This means the “norm error” vanishes, while the “convex error” cannot increase too much, as A−λminzt ⇡A−λminumin = 0. Our approach for proving the sublinear rate of convergence is inspired by Ho-Nguyen and Kılınc˛Karzan [21], who also rely on Nesterov’s method in conjunction with Lanczos-based eigenvector approximation. The analysis in [21] uses an algorithmic reduction, proposing to apply the Lanczos method (with a random vector instead of b) to approximate umin and λmin, then run Nesterov’s method on an approximate version of the “convex error” term, and then use the approximated eigenvector to adjust the norm of the result. We instead argue that all the ingredients for this reduction already exist in the Krylov subspace Kt(A, b), obviating the need for explicit eigenvector estimation or actual application of accelerated gradient descent. 2.3 Building blocks Our proof uses the following classical results. Lemma 1 (Approximate matrix inverse). Let ↵, β satisfy 0 < ↵β, and let = β/↵. For any t ≥1 there exists a polynomial p of degree at most t −1, such that for every M satisfying ↵I ⪯M ⪯βI, kI −Mp(M)k 2e−2t/p. Lemma 2 (Convex trust-region problem). Let t ≥1, M ⌫0, v 2 Rd and r ≥0, and let fM,v(x) = 1 2xT Mx + vT x. There exists xt 2 Kt(M, v) such that kxtk r and fM,v(xt) −min kxkr fM,v(x) 4λmax(M) · r2 (t + 1)2 . Lemma 3 (Finding eigenvectors, [24, Theorem 4.2]). Let M ⌫0 be such that uT Mu = 0 for some unit vector u 2 Rd, and let v 2 Rd. For every t ≥1 there exists zt 2 Kt(M, v) such that kztk = 1 and zT t Mzt  kMk 16(t −1 2)2 log2 −2 + 4 kvk2 (uT v)2 ! . While these lemmas are standard, their explicit forms are useful, and we prove them in Section C.1 in the supplement. Lemmas 1 and 3 are consequences of uniform polynomial approximation results (cf. supplement, Sec. B). To prove Lemma 2 we invoke Tseng’s results on a variant of Nesterov’s accelerated gradient method [37], arguing that its iterates lie in the Krylov subspace. 4 2.4 Proof of Theorem 1 Linear convergence Recalling the notation Aλ? = A+λ?I, let yt = −p(Aλ?)b = p(Aλ?)Aλ?str ? , for the p 2 Pt which Lemma 1 guarantees to satisfy kp(Aλ?)Aλ? −Ik 2e−2t/p (Aλ?). Let xt = (1 −↵)yt, where ↵= kytk −kstr ? k max{kstr? k , kytk}, so that we are guaranteed kxtk kstr ? k for any value of kytk. Moreover |↵| = | kytk −kstr ? k | max{kstr? k , kytk} kyt −str ? k kstr? k = k(p(Aλ?)Aλ? −I)str ? k kstr? k 2e−2t/p (Aλ?), where the last transition used kp(Aλ?)Aλ? −Ik 2e−2t/p (Aλ?). Since b = −Aλ?str ? , we have fAλ?,b(x) = fAλ?,b(str ? ) + 1 2kA1/2 λ? (x −str ? )k2. The equality (6) with λ = λ? and kxtk kstr ? k therefore implies fA,b(xt) −fA,b(str ? ) 1 2 ###A1/2 λ? (xt −str ? ) ### 2 + λ? ##str ? ## ( ##str ? ## −kxtk). (7) When kytk ≥kstr ? k we have kxtk = kstr ? k and the second term vanishes. When kytk < kstr ? k, ##str ? ## −kxtk = ##str ? ## −kytk −kytk kstr? k · ( ##str ? ## −kytk) = ##str ? ## ↵2 4e−4t/p (Aλ?) ##str ? ## . (8) We also have, ###A1/2 λ? (xt −str ? ) ### = ###([1 −↵]p(Aλ?)Aλ? −I) A1/2 λ? str ? ### (1 + |↵|) ###(p(Aλ?)Aλ? −I) A1/2 λ? str ? ### + |↵| ###A1/2 λ? str ? ### 6 ###A1/2 λ? str ? ### e−2t/p (Aλ?), (9) where in the final transition we used our upper bounds on ↵and kp(Aλ?)Aλ? −Ik, as well as |↵| 1. Substituting the bounds (8) and (9) into inequality (7), we have fA,b(xt) −fA,b(str ? )  ⇣ 18str ? T Aλ?str ? + 4λ? ##str ? ##2⌘ e−4t/p (Aλ?), (10) and the final bound follows from recalling that fA,b(0) −fA,b(str ? ) = 1 2str ? T Aλ?str ? + λ? 2 kstr ? k2 and substituting (Aλ?) = (λmax + λ?)/(λmin + λ?). To conclude the proof we note that (1 − ↵)p(Aλ?) = (1 −↵)p(A + λ?I) = ˜p(A) for some ˜p 2 Pt, so that xt 2 Kt(A, b) and kxtk R, and therefore fA,b(str t ) fA,b(xt). Sublinear convergence Let A0 := A −λminI ⌫0 and apply Lemma 2 with M = A0, v = b and r = kstr ? k to obtain yt 2 Kt(A0, b) = Kt(A, b) such that kytk  ##str ? ## and fA0,b(yt) −fA0,b(str ? ) fA0,b(yt) − min kxkkstr?k fA0,b(x) 4 kA0k kstr ? k2 (t + 1)2 . (11) If λmin ≥0, equality (6) with λ = −λmin along with (11) means we are done, recalling that kA0k = λmax −λmin. For λmin < 0, apply Lemma 3 with M = A0 and v = b to obtain zt 2 Kt(A, b) such that kztk = 1 and zT t A0zt  kA0k 16(t −1 2)2 log2 4 kbk2 (uT minb)2 ! . (12) We form the vector xt = yt + ↵· zt 2 Kt(A, b), and choose ↵to satisfy kxtk = ##str ? ## and ↵· zT t (A0yt + b) = ↵· zT t rfA0,b(yt) 0. We may always choose such ↵because kytk kstr ? k and therefore kyt + ↵ztk = kstr ? k has both a non-positive and a non-negative solution in ↵. Moreover because kztk = 1 we have that |↵|  5 2 kstr ? k. The property ↵· zT t rfA0,b(yt) 0 of our construction of ↵along with r2fA0,b = A0, gives us, fA0,b(xt) = fA0,b(yt) + ↵· zT t rfA0,b(yt) + ↵2 2 zT t A0zt fA0,b(yt) + ↵2 2 zT t A0zt. Substituting this bound along with kxtk = kstr ? k and ↵2 4 kstr ? k2 into (6) with λ = −λmin gives fA,b(xt) −fA,b(str ? ) fA0,b(yt) −fA0,b(str ? ) + 2 ##str ? ##2 zT t A0zt. Substituting in the bounds (11) and (12) concludes the proof for the case λmin < 0. 2.5 Randomizing away the hard case Krylov subspace solutions may fail to converge to global solution when both λ? = −λmin and uT minb = 0, the so-called hard case [11, 30]. Yet as with eigenvector methods [24, 14], simple randomization approaches allow us to handle the hard case with high probability, at the modest cost of introducing to the error bounds a logarithmic dependence on d. Here we describe two such approaches. In the first approach, we draw a spherically symmetric random vector v, and consider the joint Krylov subspace K2t(A, {b, v}) := span{b, Ab, . . . , At−1b, v, Av, . . . , At−1v}. The trust-region and cubic-regularized problems (1) can be solved efficiently in K2t(A, {b, v}) using the block Lanczos method [12, 15]; we survey this technique in Section A.1 in the supplement. The analysis in the previous section immediately implies the following convergence guarantee. Corollary 2. Let v be uniformly distributed on the unit sphere in Rd, and ˆstr t 2 argmin x2Kbt/2c(A,{b,v}),kxkR fA,b(x). For any δ > 0, fA,b(ˆstr t ) −fA,b(str ? ) (λmax −λmin)R2 (t −1)2 " 16 + 2 · I{λmin<0} log2 2 p d δ !# (13) with probability at least 1 −δ with respect to the random choice of v. Proof. In the preceding proof of sublinear convergence, apply Lemma 2 on Kbt/2c(A, b) and Lemma 3 on Kbt/2c(A, v); the constructed solution is in Kbt/2c(A, {b, v}). To bound |uT minv|2/kvk2, note that its distribution is Beta( 1 2, d−1 2 ) and therefore |uT minv|2/kvk2 ≥δ2/d with probability greater than 1 −δ (cf. [5, Lemma 4.6]). Corollary 2 implies we can solve the trust-region problem to ✏accuracy in roughly ✏−1/2 log d matrix-vector products, even in the hard case. The main drawback of this randomization approach is that half the matrix-vector products are expended on the random vector; when the problem is well-conditioned or when |uT minb|/kbk is not extremely small, using the standard subspace solution is nearly twice as fast. The second approach follows the proposal [5] to construct a perturbed version of the linear term b, denoted ˜b, and solve the problem instance (A,˜b, R) in the Krylov subspace Kt(A,˜b). Corollary 3. Let v be uniformly distributed on the unit sphere in Rd, let σ > 0 and let ˜b = b + σ · v. Let ˜str t 2 argminx2Kt(A,˜b),kxkR fA,˜b(x) := 1 2xT Ax + ˜bT x. For any δ > 0, fA,b(˜str t ) −fA,b(str ? ) (λmax −λmin)R2 (t −1 2)2 " 4 + I{λmin<0} 2 log2 2k˜bk p d σδ !# + 2σR (14) with probability at least 1 −δ with respect to the random choice of v. 6 See section C.2 in the supplement for a short proof, which consists of arguing that fA,b and fA,˜b deviate by at most σR at any feasible point, and applying a probabilistic lower bound on |uT min˜b|. For any desired accuracy ✏, using Corollary 3 with σ = ✏/(4R) shows we can achieve this accuracy, with constant probability, in a number of Lanczos iterations that scales as ✏−1/2 log(d/✏2). Compared to the first approach, this rate of convergence is asymptotically slightly slower (by a factor of log 1 ✏), and moreover requires us to decide on a desired level of accuracy in advance. However, the second approach avoids the 2x slowdown that the first approach exhibits on easier problem instances. In Section 5 we compare the two approaches empirically. We remark that the linear convergence guarantee (4) continues to hold for both randomization approaches. For the second approach, this is due to the fact that small perturbations to b do not drastically change the condition number, as shown in [5]. However, this also means that we cannot expect a good condition number when perturbing b in the hard case. Nevertheless, we believe it is possible to show that, with randomization, Krylov subspace methods exhibit linear convergence even in the hard case, where the condition number is replaced by the normalized eigen-gap (λmax −λmin)/(λ2 −λmin), with λ2 the smallest eigenvalue of A larger than λmin. 3 The cubic-regularized problem We now consider the cubic-regularized problem minimize x2Rd ˆfA,b,⇢(x) := fA,b(x) + ⇢ 3 kxk3 = 1 2xT Ax + bT x + ⇢ 3 kxk3 . Any global minimizer of ˆfA,b,⇢, denoted scr ? , admits the characterization [9, Theorem 3.1] r ˆfA,b,⇢(scr ? ) = (A + ⇢kscr ? k I) scr ? + b = 0 and ⇢kscr ? k ≥−λmin. (15) Comparing this characterization to its counterpart (3) for the trust-region problem, we see that any instance (A, b, ⇢) of cubic regularization has an equivalent trust-region instance (A, b, R), with R = kscr ? k. Theses instances are equivalent in that they have the same set of global minimizers. Evidently, the equivalent trust-region instance has optimal Lagrange multiplier λ? = ⇢kscr ? k. Moreover, at any trust-region feasible point x (satisfying kxk R = kscr ? k = kstr ? k), the cubic-regularization optimality gap is smaller than its trust-region equivalent, ˆfA,b,⇢(x) −ˆfA,b,⇢(scr ? ) = fA,b(x) −fA,b(str ? ) + ⇢ 3 / kxk3 −kstr ? k30 fA,b(x) −fA,b(str ? ). Letting scr t denote the minimizer of ˆfA,b,⇢in Kt(A, b) and letting str t denote the Krylov subspace solution of the equivalent trust-region problem, we conclude that ˆfA,b,⇢(scr t ) −ˆfA,b,⇢(scr ? ) ˆfA,b,⇢(str t ) −ˆfA,b,⇢(scr ? ) fA,b(str t ) −fA,b(str ? ); (16) cubic regularization Krylov subspace solutions always have a smaller optimality gap than their trustregion equivalents. The guarantees of Theorem 1 therefore apply to ˆfA,b,⇢(scr t )−ˆfA,b,⇢(scr ? ) as well, and we arrive at the following Corollary 4. For every t > 0, ˆfA,b,⇢(scr t ) −ˆfA,b,⇢(scr ? ) 36 h ˆfA,b,⇢(0) −ˆfA,b,⇢(scr ? ) i exp ( −4t s λmin + ⇢kscr ? k λmax + ⇢kscr ? k ) , (17) and ˆfA,b,⇢(scr t ) −ˆfA,b,⇢(scr ? ) (λmax −λmin) kscr ? k2 (t −1 2)2 " 4 + I{λmin<0} 8 log2 4 kbk2 (uT minb)2 !# . (18) Proof. Use the slightly stronger bound (10) derived in the proof of Theorem 1 with the inequality 18str ? T Aλ?str ? + 4λ? kstr ? k2 36[ 1 2scr ? T Ascr ? + 1 6⇢kscr ? k3] = 36[ ˆfA,b,⇢(0) −ˆfA,b,⇢(scr ? )]. 7 Here too it is possible to randomly perturb b and obtain a guarantee for cubic regularization that applies in the hard case. In [5] we carry out such analysis for gradient descent, and show that perturbations to b with norm σ can increase kscr ? k2 by at most 2σ/⇢[5, Lemma 4.6]. Thus the cubic-regularization equivalent of Corollary 3 amounts to replacing R2 with kscr ? k2 + 2σ/⇢in (14). We note briefly—without giving a full analysis—that Corollary 4 shows that the practically successful Adaptive Regularization using Cubics (ARC) method [9] can find ✏-stationary points in roughly ✏−7/4 Hessian-vector product operations (with proper randomization and subproblem stopping criteria). Researchers have given such guarantees for a number of algorithms that are mainly theoretical [1, 8], as well as variants of accelerated gradient descent [6, 22], which while more practical still require careful parameter tuning. In contrast, ARC requires very little tuning and it is encouraging that it may also exhibit the enhanced Hessian-vector product complexity ✏−7/4, which is at least near-optimal [7]. 4 Lower bounds We now show that the guarantees in Theorem 1 and Corollary 4 are tight up to numerical constants for adversarially constructed problems. We state the result for the cubic-regularization problem; corresponding lower bounds for the trust-region problem are immediate from the optimality gap relation (16).1 To state the result, we require a bit more notation. Let L map cubic-regularization problem instances of the form (A, b, ⇢) to the quadruple (λmin, λmax, λ?, ∆) = L(A, b, ⇢) such that λmin, λmax are the extremal eigenvalues of A and the solution scr ? = argminx ˆfA,b,⇢(x) satisfies ⇢kscr ? k = λ?, and ˆfA,b,⇢(0) −ˆfA,b,⇢(scr ? ) = ∆. Similarly let L0 map an instance (A, b, ⇢) to the quadruple (λmin, λmax, ⌧, R) where now kscr ? k = R and kbk /|uT minb| = ⌧, with umin an eigenvector of A corresponding to eigenvalue λmin. With this notation in hand, we state our lower bounds. (See supplemental section D for a proof.) Theorem 5. Let d, t 2 N with t < d and λmin, λmax, λ?, ∆be such that λmin λmax, λ? > (−λmin)+, and ∆> 0. There exists (A, b, ⇢) such that L(A, b, ⇢) = (λmin, λmax, λ?, ∆) and for all s 2 Kt(A, b), ˆfA,b,⇢(s) −ˆfA,b,⇢(scr ? ) > 1 K h ˆfA,b,⇢(0) −ˆfA,b,⇢(scr ? ) i exp ⇢ − 4t p−1 5 , (19) where K = 1 + λ? 3(λ?+λmin) and = λ?+λmax λ?+λmin . Alternatively, for any ⌧≥1 and R > 0, there exists (A, b, ⇢) such that L0(A, b, ⇢) = (λmin, λmax, ⌧, R) and for s 2 Kt(A, b), ˆfA,b,⇢(s)−ˆfA,b,⇢(scr ? ) > min ( (λmax)−−λmin, λmax −λmin 16(t −1 2)2 log2 kbk2 (uT minb)2 !) kscr ? k2 32 , (20) and ˆfA,b,⇢(s) −ˆfA,b,⇢(scr ? ) > (λmax −λmin) kscr ? k2 16(t + 1 2)2 . (21) The lower bounds (19) matches the linear convergence guarantee (17) to within a numerical constant, as we may choose λmax, λmin and λ? so that is arbitrary and K < 2. Similarly, lower bounds (20) and (21) match the sublinear convergence rate (18) for λmin < 0 and λmin ≥0 respectively. Our proof flows naturally from minimax characterizations of uniform polynomial approximations (Lemmas 4 and 5 in the supplement), which also play a crucial role in proving our upper bounds. One consequence of the lower bound (19) is the existence of extremely badly conditioned instances, say with = (100d)2 and K = 3/2, such that in the first d−1 iterations it is impossible to decrease the initial error by more than a factor of 2 (the initial error may be chosen arbitrarily large as well). However, since these instances have finite condition number we have scr ? 2 Kd(A, b), and so the error supposedly drops to 0 at the dth iteration. This seeming discontinuity stems from the fact that 1To obtain the correct prefactor in the trust-region equivalent of lower bound (19) we may use the fact that ˆfA,b,⇢(0) −ˆfA,b,⇢(scr ? ) = 1 2bT A−1 λ? b + ⇢ 6 kscr ? k3 ≥1 3( 1 2bT A−1 λ? b + λ? 2 R2) = 1 3(fA,b(0) −fA,b(str ?)). 8 (a) (b) Figure 1: Optimality gap of Krylov subspace solutions on random cubic-regularization problems, versus subspace dimension t. (a) Columns show ensembles with different condition numbers , and rows differ by scaling of t. Thin lines indicate results for individual instances, and bold lines indicate ensemble median and maximum suboptimality. (b) Each line represents median suboptimality, and shaded regions represent inter-quartile range. Different lines correspond to different randomization settings. in this case scr ? depends on the Lanczos basis of Kd(A, b) through a very badly conditioned linear system and cannot be recovered with finite-precision arithmetic. Indeed, running Krylov subspace methods for d iterations with inexact arithmetic often results in solutions that are very far from exact, while guarantees of the form (17) are more robust to roundoff errors [4, 13, 35]. While we state the lower bounds in Theorem 5 for points in the Krylov subspace Kt(A, b), a classical “resisting oracle” construction due to Nemirovski and Yudin [27, Chapter 7.2] (see also [26, §10.2.3]) shows that (for d > 2t) these lower bounds hold also for any deterministic method that accesses A only through matrix-vector products, and computes a single matrix-vector product per iteration. The randomization we employ in Corollaries 2 and 3 breaks the lower bound (20) when λmin < 0 and kbk /|uT minb| is very large, so there is some substantial power from randomization in this case. However, Simchowitz [34] recently showed that randomization cannot break the lower bounds for convex quadratics (λmin ≥0 and ⇢= 0). 5 Numerical experiments To see whether our analysis applies to non-worst case problem instances, we generate 5,000 random cubic-regularization problems with d = 106 and controlled condition number = (λmax + ⇢kscr ? k)/(λmin + ⇢kscr ? k) (see Section E in the supplement for more details). We repeat the experiment three times with different values of and summarize the results in Figure 1a. As seen in the figure, about 20 Lanczos iterations suffice to solve even the worst-conditioned instances to about 10% accuracy, and 100 iterations give accuracy better than 1%. Moreover, for t ' p, the approximation error decays exponentially with precisely the rate 4/ppredicted by our analysis, for almost all the generated problems. For t ⌧p, the error decays approximately as t−2. We conclude that the rates characterized by Theorem 1 are relevant beyond the worst case. We conduct an additional experiment to test the effect of randomization for “hard case” instances, where = 1. We generate such problem instances (see details in Section E), and compare the joint subspace randomization scheme (Corollary 2) to the perturbation scheme (Corollary 3) with different perturbation magnitudes σ; the results are shown in Figure 1b. For any fixed target accuracy, some choices of σ yield faster convergence than the joint subspace scheme. However, for any fixed σ optimization eventually hits a noise floor due to the perturbation, while the joint subspace scheme continues to improve. Choosing σ requires striking a balance: if too large the noise floor is high and might even be worse than no perturbation at all; if too small, escaping the unperturbed error level will take too long, and the method might falsely declare convergence. A practical heuristic for safely choosing σ is an interesting topic for future research. 9 Acknowledgments We thank the anonymous reviewers for several helpful questions and suggestions. Both authors were supported by NSF-CAREER Award 1553086 and the Sloan Foundation. YC was partially supported by the Stanford Graduate Fellowship. References [1] N. Agarwal, Z. Allen-Zhu, B. Bullins, E. Hazan, and T. Ma. Finding approximate local minima faster than gradient descent. In Proceedings of the Forty-Ninth Annual ACM Symposium on the Theory of Computing, 2017. [2] Z. Allen-Zhu and L. Orecchia. Linear coupling: An ultimate unification of gradient and mirror descent. In Proceedings of the 8th Innovations in Theoretical Computer Science, ITCS ’17, 2017. [3] J. Blanchet, C. Cartis, M. Menickelly, and K. Scheinberg. Convergence rate analysis of a stochastic trust region method for nonconvex optimization. arXiv:1609.07428 [math.OC], 2016. [4] A. S. Cameron Musco, Christopher Musco. Stability of the Lanczos method for matrix function approximation. arXiv:1708.07788 [cs.DS], 2017. [5] Y. Carmon and J. C. Duchi. Gradient descent efficiently finds the cubic-regularized non-convex Newton step. arXiv:1612.00547 [math.OC], 2016. [6] Y. Carmon, J. C. Duchi, O. Hinder, and A. Sidford. Convex until proven guilty: dimensionfree acceleration of gradient descent on non-convex functions. In Proceedings of the 34th International Conference on Machine Learning, 2017. [7] Y. Carmon, J. C. Duchi, O. Hinder, and A. Sidford. Lower bounds for finding stationary points II: First order methods. arXiv:1711.00841 [math.OC], 2017. [8] Y. Carmon, J. C. Duchi, O. Hinder, and A. Sidford. Accelerated methods for non-convex optimization. SIAM Journal on Optimization, 28(2):1751–1772, 2018. URL https://arXiv. org/abs/1611.00756. [9] C. Cartis, N. I. M. Gould, and P. L. Toint. Adaptive cubic regularisation methods for unconstrained optimization. Part I: motivation, convergence and numerical results. Mathematical Programming, Series A, 127:245–295, 2011. [10] E. S. Coakley and V. Rokhlin. A fast divide-and-conquer algorithm for computing the spectra of real symmetric tridiagonal matrices. Applied and Computational Harmonic Analysis, 34(3): 379–414, 2013. [11] A. R. Conn, N. I. M. Gould, and P. L. Toint. Trust Region Methods. MPS-SIAM Series on Optimization. SIAM, 2000. [12] J. Cullum and W. E. Donath. A block Lanczos algorithm for computing the q algebraically largest eigenvalues and a corresponding eigenspace of large, sparse, real symmetric matrices. In Decision and Control including the 13th Symposium on Adaptive Processes, 1974 IEEE Conference on, volume 13, pages 505–509. IEEE, 1974. [13] V. Druskin and L. Knizhnerman. Error bounds in the simple Lanczos procedure for computing functions of symmetric matrices and eigenvalues. U.S.S.R. Computational Mathematics and Mathematical Physics, 31(7):970–983, 1991. [14] G. Golub and C. V. Loan. Matrix computations. John Hopkins University Press, 1989. [15] G. H. Golub and R. Underwood. The block Lanczos method for computing eigenvalues. In Mathematical software, pages 361–377. Elsevier, 1977. [16] N. I. Gould, D. Orban, and P. L. Toint. GALAHAD, a library of thread-safe Fortran 90 packages for large-scale nonlinear optimization. ACM Transactions on Mathematical Software (TOMS), 29(4):353–372, 2003. 10 [17] N. I. M. Gould, S. Lucidi, M. Roma, and P. L. Toint. Solving the trust-region subproblem using the Lanczos method. SIAM Journal on Optimization, 9(2):504–525, 1999. [18] A. Griewank. The modification of Newton’s method for unconstrained optimization by bounding cubic terms. Technical report, Technical report NA/12, 1981. [19] E. Hazan and T. Koren. A linear-time algorithm for trust region problems. Mathematical Programming, Series A, 158(1):363–381, 2016. [20] M. Hestenes and E. Stiefel. Methods of conjugate gradients for solving linear systems. Journal of Research of the National Bureau of Standards, 49(6), 1952. [21] N. Ho-Nguyen and F. Kılınc˛-Karzan. A second-order cone based approach for solving the trust-region subproblem and its variants. arXiv:1603.03366 [math.OC], 2016. [22] C. Jin, P. Netrapalli, and M. I. Jordan. Accelerated gradient descent escapes saddle points faster than gradient descent. arXiv:1711.10456 [cs.LG], 2017. [23] J. M. Kohler and A. Lucchi. Sub-sampled cubic regularization for non-convex optimization. In Proceedings of the 34th International Conference on Machine Learning, 2017. [24] J. Kuczynski and H. Wozniakowski. Estimating the largest eigenvalue by the power and Lanczos algorithms with a random start. SIAM Journal on Matrix Analysis and Applications, 13(4): 1094–1122, 1992. [25] F. Lenders, C. Kirches, and A. Potschka. trlib: A vector-free implementation of the GLTR method for iterative solution of the trust region problem. Optimization Methods and Software, 33(3):420–449, 2018. [26] A. Nemirovski. Efficient methods in convex programming. Technion: The Israel Institute of Technology, 1994. [27] A. Nemirovski and D. Yudin. Problem Complexity and Method Efficiency in Optimization. Wiley, 1983. [28] Y. Nesterov. Introductory Lectures on Convex Optimization. Kluwer Academic Publishers, 2004. [29] Y. Nesterov and B. Polyak. Cubic regularization of Newton method and its global performance. Mathematical Programming, Series A, 108:177–205, 2006. [30] J. Nocedal and S. J. Wright. Numerical Optimization. Springer, 2006. [31] B. A. Pearlmutter. Fast exact multiplication by the Hessian. Neural computation, 6(1):147– 160, 1994. [32] J. Regier, M. I. Jordan, and J. McAuliffe. Fast black-box variational inference through stochastic trust-region optimization. In Advances in Neural Information Processing Systems 31, 2017. [33] N. N. Schraudolph. Fast curvature matrix-vector products for second-order gradient descent. Neural computation, 14(7):1723–1738, 2002. [34] M. Simchowitz. On the randomized complexity of minimizing a convex quadratic function. arXiv:1807.09386 [cs.LG], 2018. [35] L. N. Trefethen and D. Bau III. Numerical Linear Algebra. SIAM, 1997. [36] N. Tripuraneni, M. Stern, C. Jin, J. Regier, and M. I. Jordan. Stochastic cubic regularization for fast nonconvex optimization. arXiv:1711.02838 [cs.LG], 2017. [37] P. Tseng. On accelerated proximal gradient methods for convex-concave optimization. 2008. URL http://www.mit.edu/~dimitrib/PTseng/papers/apgm.pdf. [38] Z. Yao, P. Xu, F. Roosta-Khorasani, and M. W. Mahoney. Inexact non-convex newton-type methods. arXiv:1802.06925 [math.OC], 2018. [39] L.-H. Zhang, C. Shen, and R.-C. Li. On the generalized Lanczos trust-region method. SIAM Journal on Optimization, 27(3):2110–2142, 2017. 11
2018
232