Explorations on high dimensional landscapes

Levent Sagun, V. Ugur Guney, Gerard Ben Arous, Yann LeCun

Introduction

Many problems of practical interest can be rephrased as forms of an optimization problem in which one needs to locate a point in a given domain that has some optimal energy or cost value. Given a dynamics on such a surface the question of where it will stop on the landscape on which it is moving is a challenging one, especially if the terrain is rugged. ComplexEven though we use ‘complex’ to refer to systems that has exponentially many critical points, we would like to point out that to the best of our knowledge there is no agreed upon definition of what complex a system is across disciplines. systems can be described by functions that are highly non-convex, that lives on high dimensional spaces and they have exponentially many critical points.

One such problem arises in the context of learning: Given a set of input-output pairs, one seeks to find a function whose values roughly match the ones in the set and which also performs well on new inputs. That is, it learns the task described by the set it began with. To this end, a loss function is formed which is optimized over the parameters of the desired function. Performance of this loss minimization is tested against another set of input-output pairs.

The second problem we consider comes from statistical physics: In magnetic materials, the spins are aligned according to interactions with their neighbors. Over time equilibrium is reached when particles settle down to a configuration that has a reasonably low energy, if not the lowest possible. Stability of this state is tested against small fluctuations.

Some machine learning problems, such as deep networks, hint at similarity with spin systems of statistical mechanics. Finding connections between the two became an attractive research area. For a nice survey of theoretical results between Hopfield networks and Boltzmann machines, see Agliari et al. (2014), and Barra et al. (2012). In a slightly different approach Dauphin et al. (2014) and Choromanska et al. (2014) exhibit that stochastic gradient descent might end up in critical points other than local minima.

The energy landscapes of spin glasses are of interest in themselves. One of the main questions concerns the number of critical points of a given index at a given level. For a detailed analysis of this in spherical spin glasses, see Auffinger et al. (2013), Auffinger & Ben Arous (2013) and Auffinger & Chen (2014). The first of this sequence of papers will be used in this present paper in the corresponding experimental section. It establishes the existence of an energy level, which we named floorThroughout this paper the energy levels that an algorithm can not pass in a reasonable amount of time will be referred to as floor. For example in the spin glass context of the following section it corresponds to the smallest energy of the highest value of the function Θ(u)\Theta(u) in equation 1, which is −E∞-E_{\infty}., in which bulk of the low index critical points lie in the absence of an external field. It is proved that this level contains exponentially many local minima. For an algorithm to pass this level the search time should be exponentially long. Yet the floor lies just above the ground state, therefore from an optimization point of view it does not matter whether the algorithm reaches to the global minimum or local minimum at the floor. For a similar analysis in a slightly more general context using random matrices, see Fyodorov (2013), and Fyodorov & Le Doussal (2013). For a review of random matrices and extreme value statistics, see Dean & Majumdar (2008). The added external field as a tunable parameter allows changing the topology of the landscape. Inspired by this work, Mehta et al. (a) gives a detailed experimental analysis of the case in which there are polynomially many critical points, and Mehta et al. (b) counts critical points for third order interactions in which there are exponentially many critical points.

In this work, we focus on the case that has exponentially many critical points. In such high dimensional non-convex surfaces, a moving object is likely to get stuck in a local minimum point or a plateau of flat areas that is close to degenerate. A reasonable algorithm should have enough noise to make the particle jump out of those critical points that have high energy. However, if the landscape has exponentially many critical points that lie around the same energy level, then jumping out of this well will lead to another point of similar energy, clearly not resulting in any improvement. The existence of such a floor will increase the search time for points that have lower energy values regardless of the method of choice. Alternatively, one can attempt to change the system so that floor is at a different, more favorable value, namely closer to the global minimum. One will of course be curious about the performance of such a point in the learning context, or its stability in the spin glass context.

1) Where does the particle end up and how good is that point for the task at hand?

2) What do various descent algorithms do differently?

We perform experiments in spin glasses and in deep networks to address those questions above. The differences in the graph connectivities of spins and weights indicate that the two systems are not mathematically analogous. Rather we propose that they are special cases of a more general phenomenon which is not yet discovered. The authors hope to extract further knowledge from such complex systems that will shed light to a thorough theoretical understanding in the future.

Setting for experiments and previous theoretical work

The simplest model of a magnetic material is the one in which atoms have spins with two states: +1 for spin up, or -1 for spin down. Considering pairwise interactions (in other words 2-body interactions) between neighbors gives the total energy of the system: −∑ijwiwj-\sum_{ij}w_{i}w_{j} where ww represents spin sign of the particle located at position ii. Mean field assumption ignores the lattice geometry of particles and assumes all interactions have equal strength. Introducing a weak external field leads all particles to favor alignment, which incidentally corresponds to the minimum energy configuration which will be achieved at the point where all of the particles have spin up (or down for that matter). This is a rather simple landscape whose global minimum is easy to achieve. This assumes no frustration, that is, all particles favor alignment. This model is known as the Currie-Weiss model. If we have an alloy in which some particle pairs favor alignment and some favor dis-alignment, the picture changes drastically. This introduces a whole new set of constraints which may not be simultaneously attained, leading to glassy states. One way to model this is to introduce random interaction coefficients between particles: ∑ijxijwiwj\sum_{ij}x_{ij}w_{i}w_{j} this model, which has a rather complex energy landscape, is known as the Sherrington-Kirkpatrick model. See Agliari et al. (2014) and Sherrington (2014) for a survey on spin glasses and their connection to complex systems.

Auffinger et al. (2013) considers a more general version that involves any combinations of interactions not only 2 or 3. The main reason we consider triplets is because it is the smallest system that has exponentially many critical points. Before moving any further we would like to remark on why there are only polynomially many critical points in the binary interaction case. For ∑wi2=N\sum w^{2}_{i}=N and xij∼x_{ij}\sim Gaussian(0,1) the Hamiltonian of the system is given by

which is a quadratic form where Mij=xij+xji2M_{ij}=\frac{x_{ij}+x_{ji}}{2} is a random N×NN\times N Gaussian Orthogonal Ensemble matrix. This system has 2N2N critical points at eigenvectors and their corresponding energy values are eigenvalues scaled by NN.

Once the random coefficients are chosen, the landscape that will be explored is fixed. Note that as a continuous function on a compact set HNH_{N} attains its minimum and maximum. Also, since the landscape is symmetric through origin, its local or global maximum points have similar energy values with the opposite sign. We only focus on its minimum.

Let NN,k(u)\mathcal{N}_{N,k}(u) denote the total number of index-kk critical points of HNH_{N} that lies below the level NuNu. In other words NN,k(u)\mathcal{N}_{N,k}(u) is the random variable that counts critical points in the set {w:HN(w)≤Nu}\{w:H_{N}(w)\leq Nu\}. Auffinger et al. (2013) finds asymptotic expected value of this quantity in logarithmic scale:

In other words Θ(u)\Theta(u) is a measure of the cumulative number of critical points from the ground state to the level NuNu. An exact analytic description of the function Θ(u)\Theta(u) can be found in Auffinger et al. (2013). Figure 1 shows that analytic expression for k=0k=0, local minima, and k=1k=1, saddles of index 1. It shows, as expected, that Θ\Theta in equation (2) is non-decreasing as it counts the number of critical points cumulatively. Θ\Theta becomes positiveNote that in the binary interaction case described above, the exponent in (2) never crosses beyond zero otherwise it would imply exponentially many critical points. So that the binary interaction case, or the two-body case is an example of a simple system., and keeps increasing until it becomes constant at a value denoted as −E∞-E_{\infty}, which is the lowest uu for which Θ\Theta is at its maximum value. Hence the number of critical points of low index do not increase at high energy values.

where −E0-E_{0} is the zero of Θ\Theta function. In words, the global minimum of the Hamiltonian on the sphere is bounded from below by −NE0-NE_{0}. This lower bound gives a measure on how far a given point is away from the ground state. For our experiments the energy at the ground state and floor is calculated to be −N1.657-N1.657 and −N1.633-N1.633, respectively. For practical purposes the floor level is close to the ground state. At the level of −N1.633-N1.633 (the vertical line in Figure 1) the landscape is expected to exponentially many points that are local minimum or saddles of low index, and the exponent is at its maximum. Therefore probability of finding a local minimum that lies below the floor level is exponentially small. This leads us to conjecture that this floor is the first place to get stuck when using a descent method which is confirmed in our simulations. Diving deeper would require a long search time. Therefore trying to find points that has lower energy levels is not necessary and even realizable.

2 Setting for MNIST

For an integer PP consider i.i.d. training sample, xpx^{p} for p=1,...,Pp=1,...,P, of the measure μ\mu and define the empirical training loss:

where LL is the loss per sample which can be the mean square loss, the hinge loss or cross-entropy. Also by the law of large numbers:

The limit holds pointwise so that the sampled loss approximates well the true loss as the number of samples increases. Moreover, by the central limit theorem the following holds pointwise:

So that the fluctuations of this approximation is pointwise Gaussian. In real life problems true loss is not accessible, instead we have LTrain(w)\mathcal{L}_{\text{Train}}(w) which approximates d(w)d(w). From the above convergence properties we expect both the test and training loss to converge with good accuracy to the true loss. Therefore we expect LTrain(w)∼LTest(w)\mathcal{L}_{\text{Train}}(w)\sim\mathcal{L}_{\text{Test}}(w) as well if there is enough data for both functions. A natural question is how close are they to each other? If we sample points from the floor of training surface, do they necessarily correspond to the floor of the test surface? How does the smaller scale fluctuations effect learning? We address these questions in the rest of the paper.

Simulations and experiments

Our simulations in the first part below show existence of a critical dimension before which the landscape is hectic and does not really show any sign of a well-defined value that algorithms converge. This implies that in low dimensions the surface is not trivial, and that there are traps at high energy levels and those traps are located at somewhat arbitrary values as seen in figure 2. On the other hand high dimensional picture is drastically different. The landscape is trivial in the following sense: Starting from a random point, and following the gradient descent algorithm almost always leads to a very narrow band of values. Moreover in the second part we show that this descent is irrespective of which algorithm is being used.

Simulations of the spin glass model shows a clear qualitative difference between low dimensional and high dimensional surfaces. Namely, low dimensional surfaces do not exhibit a well defined floor however high dimensional surfaces does. Another important feature is that the floor level is very close to the global minimum, therefore floor level is enough for practical purposes of optimization, even when we set aside the problem of reaching global minimum.

The gradient descent algorithm is used on spin glass landscape. Procedure starts with fixing random couplings. Given the dimension NN, sample N3N^{3} many i.i.d. standard normal random variables:

Pick a random element ww of the sphere SN−1(N)S^{N-1}(\sqrt{N}) as a starting point for each trial.

IteratateNote here the constraint that the gradient is tangential to the sphere. wt+1=wt−γt∇wH(wt)w^{t+1}=w^{t}-\gamma_{t}\nabla_{w}H(w^{t}), and normalize, Nwt+1∣∣wt+1∣∣←wt+1\sqrt{N}\frac{w^{t+1}}{||w^{t+1}||}\leftarrow w^{t+1}.

Stop when the gradient size is below the order of 10−510^{-5}.

For each NN the experiment is repeated 5000 times. And the stopping criteria is the norm of the gradient vector. The theoretical results of the previous section holds true asymptotically. At this point, to the best of the knowledge of authors, there is no proof of how fast the energy of critical points concentrate around the limiting floor value. We hope this simulation will lead to a prediction in this direction. Nevertheless it is observed that the points found with this procedure lies within a narrow band of values that is just above the asymptotic floor level that is given in the previous section.

1.2 Tri-partite spin glass: a toy model for multilayer Restricted Boltzmann Machines

The graph structure of a fully connected spin glass above is highly coupled, in this section we modify the function so the terms of the polynomial have a layered structure. This is achieved by simulating the uncoupled version of the above spin glass model in a way that mimics the layered structure of a multilayer Restricted Boltzmann Machine. From an optimization point of view a similar consideration can be found in Frieze & Kannan (2008).

1.3 Teacher-student network: case of a known ground state at zero

In this section we design a system for which we know where its global minimum lies. The idea for this experiment is inspired by the teacher-student network comparisons of Saad et al. (1996) and West et al. (1997). It goes as follows: Split the MNIST training set into two parts. Using only the first half of the training data, train a network of two hidden layers, 784-500-300-10, with ReLU’s at first two layers and soft-max at the last output layer. The teacher makes 211 mistakes in the test set of size 10,000. Use cross entropy loss and train the system with SGD. This gives the teacher network. Using the teacher network create new labels on the second half of the training set by replacing actual tags with the probabilities assigned by the outputs of the teacher network.

If size of the student network is at least as big as the teacher network, it is guaranteed that zero cost value points exist. Moreover there are exponentially many of them: an exact copy of the network can be found, and appealing to the symmetries of the network one can permute all the weight connections without changing the cost. All student networks are trained with SGD, and it does not reach zero cost. The algorithm either gets stuck at a critical point or extremely slows down at a very flat area in the surface whose value is away from zero. We conjecture that this level is the floor for the student training surface. Also notice the different behavior of low dimensional networks that have bad critical points at which the floor is not well defined, which is again in contrast with the high dimensional networks.

Data that students are trained on are not exact, they are partial in the sense that many labels are vague. For some characters, the teacher does not know the answer for sure. Figure 6 captures this vague response of the teacher which is learned by the student. But this ambiguity does not stop the teacher from teaching; instead, the teacher passes information with the ambiguity, which is some information by itself (this reminds us the Dark Knowledge at Hinton et al. ).

Recall that the teacher did not see the second half of the data during its training, but used it to teach its students. We look at its students to see how well they learned the things the teacher taught. It turns out, perhaps not surprisingly, that the ambiguity propagates. Many mistakes that the teacher makes in the second half of the data are also made by its students. There are cases that a student might judge more correctly. See Figure 6 for an example digit 0 that the teacher mistakenly thought was 6. Luckily, as an honest teacher, it did not train its student as if it were a firm 6. With the help of this extra information, the student was able to classify correctly the digit by a tiny margin.

2 Floor by gradient descent vs. stochastic gradient descent

This section compares the two algorithms in terms of where they reach on their training surface.

A spin glass field is created by a sum of smaller such fields:

Here xijkp∼ Gaussian(0,1P)x^{p}_{ijk}\sim\text{ Gaussian}(0,\frac{1}{P}) so that the resulting field of the sum is distributed as the one in equation 1. Then at the pthp^{th} step, the point on the sphere is updated in the negative direction of the gradient of the pthp^{th} summand. This procedure is then the stochastic gradient descent with a minibatch of size 1. It is important to note that all summands are independent from each other, unlike the MNIST case. SGD still goes to the floor. The tiny difference in the values of SGD comes from the fact that the SGD slows down very fast and stops at the walls of a well. Once SGD slows down, one could restart GD from that point and reach the bottom of that well.

2.2 MNIST

This experiment compares GD with SGD over full MNIST in a two layer network. One property that is attributed to SGD is that due to its noisy nature it is capable of escaping local minima at higher cost values. This would imply that GD would get stuck before SGD slows down. However it does not seem like this is the case at all. Within the same stepsize SGD and GD perfoms very similar on the training surface. Table 2 shows mean cost values and the difference in test errors.

Conclusion

High dimensional systems are typically considered as systems that come with their curses, however they also exhibit lots of symmetries which can be a blessing as observed in the first part of the simulations. One goal of the paper is to trigger theoretical research on non-convex surfaces on high dimensional domains. It is crucial to repeat here that we do not suggest a direct equivalency between spin glasses and deep networks; rather, we hint at a more general phenomenon that governs the two different cases. Finding similar properties in a variety of other problems might help us identify and quantify the properties of such complex systems. We hope further investigation in other optimization problems will lead to supporting conclusion that is in line with this research.

We thank David Belius for valuable discussions, Taylan Cemgil and Atilla Yılmaz for valuable feedback, and reviewers for valuable suggestions. We thank the developers of Torch7 (Collobert et al. (2011)) which we used for the spin glass simulations and Theano (Bastien et al. (2012) and Bergstra et al. (2010)) which we used for MNIST experiments. We also gratefully acknowledge the support of NVIDIA Corporation with the donation of the Tesla K40 GPU used for part of this research.

References