Random deep neural networks are biased towards simple functions
Giacomo De Palma Bobak Toussi Kiani Seth Lloyd


Finger-GAN:
Generating
Realistic
Fingerprint Images
Using
Connectivity
Imposed
GAN
    Shervin Minaee^*, AmirAli Abdolrashidi^†  

^*New York University

 ^†University of California, Riverside
 


    

=================================================================================================================




We prove that the binary classifiers of bit strings generated by random wide deep neural networks with ReLU activation function are biased towards simple functions.
The simplicity is captured by the following two properties.
For any given input bit string, the average Hamming distance of the closest input bit string with a different classification is at least √(n/(2πln n)), where n is the length of the string.
Moreover, if the bits of the initial string are flipped randomly, the average number of flips required to change the classification grows linearly with n.
These results are confirmed by numerical experiments on deep neural networks with two hidden layers, and settle the conjecture stating that random deep neural networks are biased towards simple functions.
This conjecture was proposed and numerically explored in [Valle Pérez et al., ICLR 2019] to explain the unreasonably good generalization properties of deep learning algorithms.
The probability distribution of the functions generated by random deep neural networks is a good choice for the prior probability distribution in the PAC-Bayesian generalization bounds.
Our results constitute a fundamental step forward in the characterization of this distribution, therefore contributing to the understanding of the generalization properties of deep learning algorithms.




§ INTRODUCTION

The field of deep learning provides a broad family of algorithms to fit an unknown target function via a deep neural network and is having an enormous success in the fields of computer vision, machine learning and artificial intelligence <cit.>.
The input of a deep learning algorithm is a training set, which is a set of inputs of the target function together with the corresponding outputs.
The goal of the learning algorithm is to determine the parameters of the deep neural network that best reproduces the training set.

Deep learning algorithms generalize well when trained on real-world data <cit.>: the deep neural networks that they generate usually reproduce the target function even for inputs that are not part of the training set and do not suffer from over-fitting even if the number of parameters of the network is larger than the number of elements of the training set <cit.>.
A thorough theoretical understanding of this unreasonable effectiveness is still lacking.
The bounds to the generalization error of learning algorithms are proven in the probably approximately correct (PAC) learning framework <cit.>.
Most of these bounds depend on complexity measures such as the Vapnik-Chervonenkis dimension <cit.> or the Rademacher complexity <cit.> which are based on the worst-case analysis and are not sufficient to explain the observed effectiveness since they become void when the number of parameters is larger than the number of training samples <cit.>.
A complementary approach is provided by the PAC-Bayesian generalization bounds <cit.>, which apply to nondeterministic learning algorithms.
These bounds depend on the Kullback-Leibler divergence <cit.> between the probability distribution of the function generated by the learning algorithm given the training set and an arbitrary prior probability distribution that is not allowed to depend on the training set: the smaller the divergence, the better the generalization properties of the algorithm.
Making the right choice for the prior distribution is fundamental to obtain a nontrivial generalization bound.

A good choice for the prior distribution is the probability distribution of the functions generated by deep neural networks with randomly initialized weights <cit.>.
Understanding this distribution is therefore necessary to understand the generalization properties of deep learning algorithms.
PAC-Bayesian generalization bounds with this prior distribution led to the proposal that the unreasonable effectiveness of deep learning algorithms arises from the fact that the functions generated by a random deep neural network are biased towards simple functions <cit.>.
Since real-world functions are usually simple <cit.>, among all the functions that are compatible with a training set made of real-world data, the simple ones are more likely to be close to the target function.
The conjectured bias towards simple functions has been numerically explored in <cit.>, which considered binary classifications of bit strings and showed that binary classifiers with a small Lempel-Ziv complexity <cit.> are more likely to be generated by a random deep neural network than binary classifiers with a large Lempel-Ziv complexity.
However, a rigorous proof of this bias is still lacking.



 §.§ Our contribution

We prove that random deep neural networks are biased towards simple functions,
in the sense that a typical function generated is insensitive to large changes
in the input.
We consider random deep neural networks with Rectified Linear Unit (ReLU) activation function and weights and biases drawn from independent Gaussian probability distributions, and we employ such networks to implement binary classifiers of bit strings.
Our main results are the following:


  * We prove that for n≫1, where n is the length of the string, for any given input bit string the average Hamming distance of the closest bit string with a different classification is at least √(n/(2πln n)) (<ref>),
where the Hamming distance between two bit strings is the number of different bits.

  * We prove that, if the bits of the initial string are randomly flipped, the average number of bit flips required to change the classification grows linearly with n (<ref>).
From a heuristic argument, we find that the average required number of bit flips is at least n/4 (<ref>), and simulations on deep neural networks with two hidden layers indicate a scaling of approximately n/3.

By contrast, for a random binary classifier drawn from the uniform distribution over all the possible binary classifiers of strings of n≫1 bits, the average Hamming distance of the closest bit string with a different classification is one, and the average number of random bit flips required to change the classification is two.
Therefore, our result identifies a fundamental qualitative difference between a typical binary classifier generated by a random deep neural network and a uniformly random binary classifier.

The result proves that the binary classifiers generated by random deep neural networks are simple and identifies the classifiers that are likely to be generated as the ones with the property that a large number of bits need to be flipped in order to change the classification.
While all the classifiers with this property have a low Kolmogorov complexity[The Kolmogorov complexity of a function is the length of the shortest program that implements the function on a Turing machine  <cit.>.
], the converse is not true.
For example, the parity function has a small Kolmogorov complexity, but it is sufficient to flip just one bit of the input to change the classification, hence our result implies that it occurs with a probability exponentially small in n.  Similarly, our results explain why
<cit.> found that the look-up tables for the functions generated by random deep networks are typically highly compressible using the LZW algorithm <cit.>, which identifies statistical regularities, but not all functions with highly compressible look-up tables are likely to be generated.

The proofs of Theorems <ref> and <ref> are based on the approximation of random deep neural networks as Gaussian processes, which becomes exact in the limit of infinite width <cit.>.
The crucial property of random deep neural networks captured by this approximation is that the outputs generated by inputs whose Hamming distance grows sub-linearly with n become perfectly correlated in the limit n→∞.
These strong correlations are the reason why a large number of input bits need to be flipped in order to change the classification.
The proof of <ref> also exploits the theory of stochastic processes, and in particular the Kolmogorov continuity theorem <cit.>.
We stress that for activation functions other than the ReLU, the scaling with n of both the Hamming distance of the closest bit string with a different classification and the number of random bit flips necessary to change the classification remain the same.
However, the prefactor can change and can be exponentially small in the number of hidden layers.


We validate all the theoretical results with numerical experiments on deep neural networks with ReLU activation function and two hidden layers.
The experiments confirm the scalings Θ(√(n/ln n)) and Θ(n) for the Hamming distance of the closest string with a different classification and for the average random flips required to change the classification, respectively.
The theoretical pre-factor 1/√(2π) for the closest string with a different classification is confirmed within an extremely small error of 1.5%.
The heuristic argument that pre-factor for the random flips is greater than 1/4 is confirmed by numerics which indicate that the pre-factor is approximately 0.33.
Moreover, we explore the Hamming distance to the closest bit string with a different classification on deep neural networks trained on the MNIST database <cit.> of hand-written digits.
The experiments show that the scaling Θ(√(n/ln n)) survives after the training of the network and that the distance of a training or test picture from the closest classification boundary is strongly correlated with its classification accuracy, i.e., the correctly classified pictures are further from the boundary than the incorrectly classified ones.





 §.§ Further related works

The properties of deep neural networks with randomly initialized weights have been the subject of intensive studies <cit.>.
The relation between generalization and simplicity for Boolean function was explored in <cit.>, where the authors provide numerical evidence that the generalization error is correlated with a complexity measure that they define.
Ref. <cit.> explores the generalization properties of deep neural networks trained on partially random data, and finds that the generalization error correlates with the amount of randomness in the data.
Based on this result, Ref. <cit.> proposed that the stochastic gradient descent employed to train the network is more likely to find the simpler functions that match the training set rather than the more complex ones.
However, further studies <cit.> suggested that stochastic gradient descent is not sufficient to justify the observed  generalization.
The idea of a bias towards simple patterns has been applied to learning theory through the concepts of minimum description length <cit.>, Blumer algorithms <cit.> and universal induction <cit.>.
Ref. <cit.> proved that the generalization error grows with the Kolmogorov complexity of the target function if the learning algorithm returns the function that has the lowest Kolmogorov complexity among all the functions compatible with the training set.
The relation between generalization and complexity has been further investigated in <cit.>.
The complexity of the functions generated by a deep neural networks has also been studied from the perspective of the number of linear regions <cit.> and of the curvature of the classification boundaries <cit.>.   We note that
the results proved here — viz., that the functions generated by random deep networks are insensitive to large changes in their inputs — implies that such functions should be simple with respect to all the measures of complexity above,
but the converse is not true: not all simple functions are likely to be generated by random deep networks.








§ SETUP AND GAUSSIAN PROCESS APPROXIMATION

We consider a feed-forward deep neural network with L hidden layers, activation function τ, input in ℝ^n and output in ℝ.
The most common choice for τ is the ReLU activation function τ(x)=max(0,x).
We stress that Theorems <ref> and <ref> do not rely on this assumption and hold for any activation function.
For any x∈ℝ^n and l=2,…,L+1, the network is recursively defined by

    ϕ^(1)(x) = W^(1)x + b^(1) ,    ϕ^(l)(x) = W^(l) τ(ϕ^(l-1)(x)) + b^(l) ,

where ϕ^(l)(x), b^(l)∈ℝ^n_l, W^(l) is an n_l× n_l-1 real matrix, n_0=n and n_L+1=1.
We put for simplicity ϕ=ϕ^(L+1), and we define ψ(x) = sign(ϕ(x)) for any x∈ℝ^n.
The function ψ is a binary classifier on the set of the strings of n bits identified with the set {-1,1}^n⊂ℝ^n, where the classification of the string x∈{-1,1}^n is ψ(x)∈{-1,1}.
We choose this representation of the bit strings since any x∈{-1,1}^n has x^2=n, and the covariance of the Gaussian process approximating the deep neural network has a significantly simpler expression if all the inputs have the same norm.
Moreover, having the inputs lying on a sphere is a common assumption in the machine learning literature <cit.>.


We draw each entry of each W^(l) and of each b^(l) from independent Gaussian distributions with zero mean and variances σ_w^2/n_l-1 and σ_b^2, respectively.
We employ the Gaussian process approximation of <cit.>, which consists in assuming that for any l and any x, y∈ℝ^n, the joint probability distribution of ϕ^(l)(x) and ϕ^(l)(y) is Gaussian, and ϕ_i^(l)(x) is independent from ϕ_j^(l)(y) for any i≠ j.
This approximation is exact for l=1 and holds for any l in the limit n_1, …, n_L→∞ <cit.>.
Indeed, ϕ^(l)_i(x) is the sum of b^(l)_i, which has a Gaussian distribution, with the n_l-1 terms {W^(l)_ij τ(ϕ^(l-1)_j(x))}_j=1^n_l-1 which are iid from the inductive hypothesis.
Therefore if n_l-1≫1, from the central limit theorem ϕ^(l)_i(x) has a Gaussian distribution.
We notice that for finite width, the outputs of the intermediate layers have a sub-Weibull distribution <cit.>.
Our experiments in <ref> show agreement with the Gaussian approximation starting from n≳100.


In the Gaussian process approximation, for any x, y with x^2=y^2=n, the joint probability distribution of ϕ(x) and ϕ(y) is Gaussian with zero mean and covariance that depends on x, y and n only through x· y/n:

    𝔼(ϕ(x))=0 ,    𝔼(ϕ(x) ϕ(y)) = Q F(x· yn) ,    x^2=y^2=n .

Analogously, ϕ(x) is a Gaussian process with zero average and covariance given by the kernel K(x,y) = Q F(x· yn).
Here Q>0 is a suitable constant and F:[-1,1]→ℝ is a suitable function that depend on τ, L, σ_w and σ_b, but not on n, x nor y.
We have introduced the constant Q because it will be useful to have F satisfy F(1)=1.
We provide the expression of Q and F in terms of τ, L, σ_w and σ_b in <ref>, where we also prove that for the ReLU activation function t≤ F(t) ≤ 1.

The correlations between outputs of the network generated by close inputs are captured by the behavior of F(t) for t→1.
If F(t) stays close to 1 as t departs from 1, then the outputs generated by close inputs are almost perfectly correlated and have the same classification with probability close to one.
On the contrary, if F(t) drops quickly, the correlations decay and there is a nonzero probability that close inputs have different classifications.
In <ref> we prove that for the ReLU activation function we have 0<F'(1)≤1 and for t→ 1,

    F(t) = 1 - F'(1)(1-t) + O((1-t)^3/2) ,

implying strong short-distance correlations.



§ THEORETICAL RESULTS



 §.§ Closest bit string with a different classification

Our first main result is the following <ref>, which states that for n≫1, for any given input bit string of a random deep neural network as in <ref> the average Hamming distance of the closest input bit string with a different classification is √(n/(2π F'(1)ln n)).
The proof is in <ref>.

For any n∈ℕ, let ϕ:{-1,1}^n→ℝ be the output of a random deep neural network as in <ref>.
Let a>0 and let h_n = ⌊ a√(n/ln n)⌋, where ⌊ t⌋ denotes the integer part of t≥0.
Let us fix x∈{-1,1}^n and z>0, and let N_n(a,z) be the average number of input bit strings y∈{-1,1}^n with Hamming distance h_n from x and with a different classification from x, conditioned on ϕ(x) = √(Q) z:

    N_n(a,z) = 𝔼(#{y∈{-1,1}^n:h(x,y)=h_n ,ϕ(y)<0}|ϕ(x) = √(Q) z.) .

Here h(x,y) is the Hamming distance between x and y and we recall that Q=𝔼(ϕ(x)^2).
Then, for n→∞

    ln N_n(a,z) = a/2√(nln n)(1 - z^2/4F'(1)a^2 + lnln n/a^2/ln n + O(1√(nln n))) .

In particular,

    lim_n→∞N_n(a,z) = 0   for   a<z/2√(F'(1)) ,    lim_n→∞N_n(a,z) = ∞  for   a≥z/2√(F'(1)) .


<ref> tells us that, if n≫1, for any input bit string x∈{-1,1}^n, with very high probability all the input bit strings y∈{-1,1}^n with Hamming distance from x lower than

    h^*_n(x) = |ϕ(x)|/2√(Q F'(1))√(n/ln n)

have the same classification as x, i.e., ϕ(y) has the same sign as ϕ(x).
Moreover, the number of input bit strings y with Hamming distance from x higher than h_n^*(x) and with a different classification than x is exponentially large in n.
Therefore, with very high probability the Hamming distance from x of the closest bit string with a different classification is approximately h_n^*(x).
Since 𝔼(|ϕ(x)|) = √(2Q/π), the average Hamming distance of the closest string with a different classification is

    𝔼(h_n^*(x)) = √(n/2π F'(1)ln n)≥√(n/2πln n) ,

where the last inequality holds for the ReLU activation function and follows since in this case F'(1)≤1.

While <ref> holds for any activation function, the property F'(1)≤1 may not hold for activation functions different from the ReLU.
For example, in the case of tanh there are values of σ_w and σ_b such that F'(1) grows exponentially with L <cit.>.
In this case, the Hamming distance of the closest string with a different classification still scales as √(n/ln n), but the prefactor can be exponentially small in L.
Therefore with the tanh activation function, for finite values of L and n, F'(1) may become comparable with
√(n/ln n) and significantly affect the Hamming distance.





 §.§ Random bit flips

Let us now consider the problem of the average number of bits that are needed to flip in order to change the classification of a given bit string.
We consider a random sequence of input bit strings {x^(0), …, x^(n)}⊂{-1,1}^n, where at the i-th step x^(i) is generated flipping a random bit of x^(i-1) that has not been already flipped in the previous steps.
Any sequence as above is geodesic, i.e., h(x^(i), x^(j)) = |i-j| for any i, j=0, …, n.
The following <ref> states that the average Hamming distance from x^(0) of the closest string of the sequence with a different classification is proportional to n.
The proof is in <ref>.

For any n∈ℕ, let ϕ:{-1,1}^n→ℝ be the output of a random deep neural network as in <ref>, and let {x^(0), …, x^(n)}⊂{-1,1}^n be a geodesic sequence of bit strings.
Let h_n be the expected value of the minimum number of steps required to reach a bit string with a different classification from x^(0):

    h_n = 𝔼(min{min{1≤ i ≤ n:ϕ(x^(0))ϕ(x^(i))<0}, n}).

Then, there exists a constant t_0>0 which depends only on F such that h_n ≥ n t_0 for any n∈ℕ.


Since the entry of the kernel (<ref>) associated to two inputs lying on the sphere is a function of their squared Euclidean distance, which coincides with the Hamming distance in the case of bit strings, Theorems <ref> and <ref> may be generalized to continuous inputs on the sphere by replacing the Hamming distance with the squared Euclidean distance.




 §.§ Heuristic argument

For a better understanding of Theorems <ref> and <ref>, we provide a simple heuristic argument to their validity.
The crucial observation is that, if one bit of the input is flipped, the change in ϕ is Θ(1/√(n)).
Indeed, let x, y∈{-1,1}^n with h(x,y)=1.
From (<ref>), ϕ(y)-ϕ(x) is a Gaussian random variable with zero average and variance

    𝔼((ϕ(y)-ϕ(x))^2) = 2Q(1-F(1-2n))≃ 4QF'(1)/n .


For any i, at the i-th step of the sequence of bit strings of <ref>, ϕ changes by the Gaussian random variable ϕ(x^(i)) - ϕ(x^(i+1)), which from (<ref>) has zero mean and variance 4Q F'(1)/n.
Assuming that the changes are independent, after h steps ϕ changes by a Gaussian random variable with zero mean and variance 4h Q F'(1)/n.
Recalling that 𝔼(ϕ(x^(0))^2)=Q and that F'(1)≤ 1 for the ReLU activation function, approximately h≈ n/(4F'(1)) ≥ n/4
steps are needed in order to flip the sign of ϕ and hence the classification.

Let us now consider the problem of the closest bit string with a different classification from a given bit string x.
For any bit string y at Hamming distance one from x, ϕ(y)-ϕ(x) is a Gaussian random variable with zero mean and variance 4Q F'(1)/n.
We assume that these random variables are independent, and recall that the minimum among n iid normal Gaussian random variables scales as √(2ln n) <cit.>.
There are n bit strings y at Hamming distance one from x, therefore the minimum over these y of ϕ(y)-ϕ(x) is approximately -√(8Q F'(1)ln n/n).
This is the maximum amount by which we can decrease ϕ flipping one bit of the input.
Iterating the procedure, the maximum amount by which we can decrease ϕ flipping h bits is h√(8Q F'(1)ln n/n).
Since 𝔼(ϕ(x^(0))^2)=Q, the minimum number of bit flips required to flip the sign of ϕ is approximately h≈√(n/(8F'(1)ln n))≥√(n/(8ln n)), where the last inequality holds for the ReLU activation function.
The pre-factor 1/√(8)≃ 0.354 obtained with the heuristic proof above is very close to the exact pre-factor 1/√(2π)≃ 0.399 obtained with the formal proof in (<ref>).







§ EXPERIMENTS



 §.§ Closest bit string with a different classification

To confirm experimentally the findings of <ref>, Hamming distances to the closest bit string with a different classification were calculated for randomly generated neural networks with parameters sampled from normal distributions (see <ref>). This distance was calculated using a greedy search algorithm (<ref>).
In this algorithm, the search for a differently classified bit string progressed in steps, where in each step, the most significant bit was flipped. This bit corresponded to the one that produced the largest change towards zero in the value of the output neuron when flipped. To ensure that this algorithm accurately calculated Hamming distances, we compared the results of the greedy search algorithm to those from an exact search which exhaustively searched all bit strings at specified Hamming distances for smaller networks where this exact search method was computationally feasible. Comparisons between the two algorithms in <ref> show that outcomes from the greedy search algorithm were consistent with those from the exact search algorithm.
The results from the greedy search method confirm the √(n/ln n) scaling of the average Hamming distance starting from n≳100.
The value of the pre-factor 1/√(2 π) is also confirmed with the high precision of 1.5%.
<ref> empirically validates the linear relationship between the value of the output neuron |ϕ(x)| and the Hamming distance to bit strings with different classification h^*_n(x) expressed by (<ref>). This linear relationship was consistent with all neural networks empirically tested in our analysis. Intuitively, |ϕ(x)| is an indication of the confidence in classification. The linear relationship shown here implies that as the value of |ϕ(x)| grows, the confidence of the classification of an input strengthens, increasing the distance from that input to boundaries of different classifications.




 §.§ Random bit flips

<ref> confirms the findings of <ref>, namely that the expected number of random bit flips required to reach a bit string with a different classification scales linearly with the number of input neurons.
The pre-factor found by simulation is 0.33, slightly above the lower bound of 0.25 estimated from the heuristic argument.
Our results show that, though the Hamming distance to the nearest classification boundary scales on average at a rate of √(n/ln n), the distance to a random boundary scales linearly and more rapidly.

















 §.§ Analysis of MNIST data

Our theoretical results hold for random, untrained deep neural networks. It is an interesting question whether trained deep neural networks exhibit similar properties for the Hamming distances to classification boundaries. Clearly some trained networks will not: a network that has been trained to return as output the final bit of the input string has Hamming distance one to the nearest classification boundary. For networks that are trained to classify noisy data, however, we expect the trained networks to exhibit relatively large Hamming distances to the nearest classification boundary. Moreover, if a `typical' network can perform the noisy classification task, then we expect training to guide the weights to a nearby typical network that does the job, for the simple reason that networks that exhibit Θ(√(n/ln n)) distance to the nearest boundary and an average distance of Θ(n) to a boundary under random bit flips have much higher prior probabilities than atypical networks.

To determine if our results hold for models trained on real-world data, we trained 2-layer fully-connected neural networks to categorize whether hand-drawn digits taken from the MNIST database <cit.> are even or odd.
Images of hand drawn digits were converted from their 2-dimensional format (28 by 28 pixels) into a 1-dimensional vector of 784 binary inputs. The starting 8 bit pixel values were converted to binary format by determining whether the pixel value was above or below a threshold of 25. Networks were trained to determine whether the hand-drawn digit was odd or even. All networks followed the design described in <ref>. 400 Networks were trained for 20 epochs using the Adam optimizer <cit.>; average test set accuracy of 98.8% was achieved.

For these trained networks, Hamming distances to the nearest bit string with a different classification were calculated using the greedy search method outlined in <ref>. These Hamming distances were evaluated for three types of bit strings: bit strings taken from the training set, bit strings taken from the test set, and randomly sampled bit strings where each bit has equal probability of 0 and 1.  For the randomly sampled bit strings, the average minimum Hamming distance to a differently classified bit string is very close to the expected theoretical value of √(n/(2πln n)) (<ref>).
By contrast, for bit strings taken from the test and training set, the minimum Hamming distances to a classification boundary were on average much higher than that for random bits, as should be expected: training increases the distance from the data points to the boundary of their respective classification regions and makes the network more robust to errors when classifying real-world data compared with classifying random bit strings.

Furthermore, even for trained networks, a linear relationship is still observed between the absolute value of the output neuron (prior to normalization by a sigmoid activation) and the average Hamming distance to the nearest differently classified bit string (<ref>). Here, the slope of the linear relationship is larger for test and training set data, consistent with the expectation that training should extend the Hamming distance to classification boundaries for patterns of data found in the training set.





Finally, we have explored the correlation between the distance of a training or test picture from the closest classification boundary with its classification accuracy.
<ref> shows that the incorrectly classified pictures tend to be significantly closer to the classification boundary than the correctly classified ones: the average distances are 1.42 and 10.61, respectively, for the training set, and 2.30 and 10.47, respectively, for the test set.
Therefore, our results show that the distance to the closest classification boundary is empirically correlated with the classification accuracy and with the generalization properties of the deep neural network.







 §.§ Experimental apparatus and structure of neural networks

Weights for all neural networks are initialized according to a normal distribution with zero mean and variance equal to 2/n_in, where n_in is the number of input units in the weight tensor. No bias term is included in the neural networks.
All networks consist of two fully connected hidden layers, each with n neurons (equal to number of input neurons) and activation function set to the commonly used Rectified Linear Unit (ReLU). All networks contain a single output neuron with no activation function.
In the notation of <ref>, this choice corresponds to σ_w^2=2, σ_b^2=0, n_0=n_1=n_2=n and n_3=1, and implies F'(1)=1.
Simulations were run using the python package Keras with a backend of TensorFlow <cit.>.






§ CONCLUSIONS

We have proved that the binary classifiers of strings of n≫1 bits generated by wide random deep neural networks with ReLU activation function are simple.
The simplicity is captured by the following two properties.
First, for any given input bit string the average Hamming distance of the closest input bit string with a different classification is at least √(n/(2πln n)).
Second, if the bits of the original string are randomly flipped, the average number of bit flips needed to change the classification is at least n/4.
For activation functions other than the ReLU both scalings remain the same, but the prefactor can change and can be exponentially small in the number of hidden layers.


The striking consequence of our result is that the binary classifiers of strings of n≫1 bits generated by a random deep neural network lie with very high probability in a subset which is an exponentially small fraction of all the possible binary classifiers.
Indeed, for a uniformly random binary classifier, the average Hamming distance of the closest input bit string with a different classification is one, and the average number of bit flips required to change the classification is two.
Our result constitutes a fundamental step forward in the characterization of the probability distribution of the functions generated by random deep neural networks, which is employed as prior distribution in the PAC-Bayesian generalization bounds.
Therefore, our result can contribute to the understanding of the generalization properties of deep learning algorithms.

Our analysis of the MNIST data suggests that, for certain types of problems, the property that many bits need to be flipped in order to change the classification survives after training the network.
Both our theoretical results and our experiments are completely consistent to the empirical findings in the context of adversarial perturbations <cit.>, where the existence of inputs that are close to a correctly classified input but have the wrong classification is explored.
As expected, our results show that as the size of the input grows, the average number of bits needed to be flipped to change the classification increases in absolute terms but decreases as a percentage of the total number of bits.
An extension of our theoretical results to trained deep neural networks would provide a fundamental robustness result of deep neural networks with respect to adversarial perturbations, and will be the subject of future work.

Moreover, our experiments on MNIST show that the distance of a picture to the closest classification boundary is correlated with its classification accuracy and thus with the generalization properties of deep neural networks, and confirm that exploring the properties of this distance is a promising route towards proving the unreasonably good generalization properties of deep neural networks.



Finally, the simplicity bias proven in this paper might shed new light on the unexpected empirical property of deep learning algorithms that the optimization over the network parameters does not suffer from bad local minima, despite the huge number of parameters and the non-convexity of the function to be optimized <cit.>.



§ SETUP AND GAUSSIAN PROCESS APPROXIMATION

We consider a feed-forward deep neural network with L hidden layers, activation function τ, input in ℝ^n and output in ℝ.
The network is recursively defined by (<ref>) of <ref>.

We draw each entry of each W^(l) and of each b^(l) from independent Gaussian distributions with zero mean and variances σ_w^2/n_l-1 and σ_b^2, respectively.
This implies for any x, y∈ℝ^n

    𝔼(ϕ^(l)(x)) = 0 ,  𝔼(ϕ^(l)_i(x) ϕ^(l)_j(y)) = δ_ij G_l(x,y) .


We determine the covariance function G_l in the Gaussian process approximation of <cit.>, which consists in assuming that for any l and any x, y∈ℝ^n, the joint probability distribution of ϕ^(l)(x) and ϕ^(l)(y) is Gaussian.

We start with the diagonal elements G_l(x,x), which depend on x and n only through x^2/n <cit.>.
Since any x∈{-1,1}^n has x^2=n, we put by simplicity for any x∈ℝ^n with x^2=n

    G_l(x,x) = Q_l .

The constants Q_l can be computed from the recursive relation <cit.>

    Q_1 = σ_w^2 + σ_b^2 ,     Q_l = σ_w^2∫_-∞^∞τ(√(Q_l-1) z)^2 e^-z^2/2 dz/√(2π) + σ_b^2 .

We now consider the off-diagonal elements of G_l.
For x^2=y^2=n, the correlation coefficients

    C_l(x,y) = G_l(x,y)/Q_l

depend on x, y and n only through the combination x· y/n <cit.>.
We can therefore put

    C_l(x,y) = F_l(x· y/n),  x^2=y^2=n .

The functions F_l:[-1,1]→ℝ satisfy by definition F_l(1)=1 and can be computed from the recursive relation <cit.>

    F_1(t)    = σ_w^2 t + σ_b^2/σ_w^2 + σ_b^2 ,
    
    Q_lF_l(t)    = σ_w^2∫_ℝ^2τ(√(Q_l-1) z)τ(√(Q_l-1)(F_l-1(t)z+√(1-F_l-1(t)^2) w)) e^-z^2+w^2/2 dz dw/2π
       = + σ_b^2 .

Defining F = F_L+1 and Q=Q_L+1, the covariance of the function ϕ generated by the deep neural network is of the form given by (<ref>).

For the ReLU activation function, (<ref>) simplifies to <cit.>

    F_l(t) = Q_l-1 σ_w^2 Ψ(F_l-1(t)) + 2σ_b^2/Q_l-1 σ_w^2 + 2σ_b^2 ,

where

    Ψ(t) = √(1-t^2) + (π - arccos t)t/π .

The function Ψ satisfies for t→ 1

    Ψ(t) = t + O((1-t)^3/2) .


For the ReLU activation function, t≤ F(t) ≤ 1 for any -1≤ t≤1.

We prove by induction that t≤ F_l(t)≤1.
From (<ref>), the claim is true for l=1.
Let us assume the claim for l-1.
We have

    Ψ'(t) = 1-arccos t/π≥0 ,

hence Ψ is increasing.
We also have Ψ'(t)≤1 and Ψ(1)=1, hence Ψ(t)≥ t.
Finally, we have from (<ref>) and from the inductive hypothesis

    F_l(t) ≥Ψ(F_l-1(t)) ≥Ψ(t) ≥ t ,

and the claim for l follows.




For the ReLU activation function,

    F(t) = 1 - F'(1)(1-t) + O((1-t)^3/2)

for t→1, where F'(1) is determined by the recursive relation

    F_1'(1) = σ_w^2/σ_w^2 + σ_b^2 ,   F_l'(1) = Q_l-1 σ_w^2/Q_l-1 σ_w^2 + 2σ_b^2 F_l-1'(1) ,     F'(1)=F_L+1'(1)

and satisfies 0<F'(1)≤1.

The recursive relation (<ref>) follows taking the derivative of (<ref>) in t=1.
Eq. (<ref>) implies 0<F_l'(1)≤ 1 for any l, hence 0<F'(1)≤1.

The claim in (<ref>) follows if we prove by induction that

    F_l(t) = 1 - F_l'(1)(1-t) + O((1-t)^3/2)

for any l.
The claim is true for l=1.
Let us assume by induction (<ref>) for l-1.
We have from (<ref>)

    Ψ(F_l-1(t)) = 1 - F_l-1'(1)(1-t) + O((1-t)^3/2) ,

and the claim (<ref>) for l follows from (<ref>) and (<ref>).








§ PROOF OF <REF>

Let x, y∈{-1,1}^n with h(x,y)=h_n.
From (<ref>) we get 𝔼(ϕ(x) ϕ(y)) = Q F(1-2h_n/n), then

    𝔼(ϕ(y)| ϕ(x)=√(Q) z.)    = F(1-2h_nn)√(Q) z ,
    Var(ϕ(y)|ϕ(x)=√(Q) z.)    = (1-F(1-2h_nn)^2)Q ,

so that

    P_n(a,z)    = ℙ(ϕ(y)<0| ϕ(x)=√(Q) z.)= Φ(-F(1-2h_n/n)z/√(1-F(1-2h_n/n)^2))
       = Φ(-z/2√(n/F'(1) h_n)(1+O(√(h_nn)))) ,

where

    Φ(t) = ∫_-∞^t e^-s^2/2 ds/√(2π)

and we have used (<ref>).
Using that lnΦ(-t) = -t^2/2 - 1/2ln(2π t^2) + O(1/t^2) for t→∞ we get

    ln P_n(a,z) = -n z^2/8F'(1)h_n + O(√(nh_n)) = -z^2√(nln n)/8F'(1)a + O(√(nln n)) .

We have

    N_n(a,z) = nh_nP_n(a,z) .

Using that ln k! = (k+1/2)ln k - k + O(1) for k→∞ we get

    lnnh_n = h_n(lnn/h_n + 1) - 1/2ln h_n + O(1) = a/2√(nln n) + a/2√(n/ln n)lnln n/a^2 + O(ln n) ,

and the claim follows.



§ PROOF OF <REF>

Let φ:[0,1]→ℝ be a random function with a Gaussian probability distribution such that for any s, t∈[0,1]

    𝔼(φ(t)) = 0 ,  𝔼(φ(s) φ(t)) = F(1-2|s-t|) .

From (<ref>), for any s, t∈[0,1], φ(s)-φ(t) is a Gaussian random variable with zero average and variance

    𝔼((φ(s)-φ(t))^2) = 2-2F(1-2|s-t|) .

Recalling that F(1)=1, there exists ϵ>0 such that for any 0≤ u≤2ϵ we have 1-F(1-u)≤ (F'(1)+1)u.
Hence, if |s-t|≤ϵ we have

    𝔼((φ(s)-φ(t))^4) = 12(1-F(1-2|s-t|))^2 ≤ 48(F'(1)+1)^2|s-t|^2 .

Then, the Kolmogorov continuity theorem <cit.> implies that with probability one the function φ is continuous.
Let t(φ) be the minimum 0≤ t≤ 1 such that φ(t)=0:

    t(φ) = min{inf{0≤ t≤ 1:φ(t)=0}, 1} .

Since with probability one φ is continuous and φ(0)≠0, we have φ(t)≠0 in a neighborhood of 0, hence t(φ)>0 with probability one.
Therefore, the expectation value of t(φ) is strictly positive: t_0 = 𝔼(t(φ)) > 0.

From (<ref>), for any i, j=0, …, n we have 𝔼(ϕ(x^(i))) = 0 and

    𝔼(ϕ(x^(i)) ϕ(x^(j))) = Q F(1 - 2|i-j|n) .

Comparing with (<ref>) we get that {ϕ(x^(i))}_i=0^n have the same probability distribution as {√(Q) φ(i/n)}_i=0^n.
From the definition of t(φ), for any 1≤ i < n t(φ), φ(i/n) has the same sign as φ(0).
Therefore, h_n ≥ n t_0, and the claim follows.







§ EXPERIMENTS ON RANDOM DEEP NEURAL NETWORKS

<ref> shows Hamming distances of random bit strings to the nearest differently classified bit string measured using a heuristic greedy search algorithm and an exact search algorithm. Resulting breakdowns for the two algorithms are consistent across all network input sizes tested. For each algorithm and network input size, Hamming distances to nearest differently classified bit strings from a random bit string were evaluated 1000 times with each evaluation performed on a randomly created neural network.







§ ACKNOWLEDGEMENTS

GdP thanks the Research Laboratory of Electronics of the Massachusetts Institute of Technology for the kind hospitality in Cambridge, and Dario Trevisan for useful discussions.

GdP acknowledges financial support from the European Research Council (ERC Grant
Agreements Nos. 337603 and 321029), the Danish Council for Independent Research (Sapere
Aude), VILLUM FONDEN via the QMATH Centre of Excellence (Grant No. 10059) and AFOSR and ARO under the Blue Sky program.
SL and BTK were supported by IARPA, NSF, BMW under the MIT Energy Initiative, and ARO under the Blue Sky program.



unsrt

