Annealed correlation and quenched noise sensitivity in biased deep neural networks
Johan Jonasson
Abstract
In [1], fully connected deep neural networks with layers of width n, i.i.d. standard Gaussian weights, sign activations and no bias terms were shown to be annealed and quenched noise sensitive with respect to any joint probability distribution Q(n) on the input ω and its perturbation η satisfying a mild positive-correlation condition and Q(n)(η∈{ω,−ω})→0. Here we add independent Gaussian biases of the natural order and show that quenched noise sensitivity is retained over a broad range of depths, indeed under the slightly weaker assumption that Q(n)(ω=η)→0. Thus, subject to the positive-correlation condition, quenched noise sensitivity holds under the minimal requirement that the perturbed input is asymptotically unlikely to coincide with the original input. At the same time, the annealed covariance remains bounded away from zero and is entirely accounted for by fluctuations in the network-dependent output means.
1 Introduction
This paper addresses a question left open in [1]. The driving force there was to investigate how sensitive binary deep neural net (DNN) classifiers are to input noise, i.e. if small changes in a typical input make the classifier change its mind. It is a well-known observation that neural nets used in practice are typically sensitive to such perturbations. For example a DNN that distinguishes cars from aeroplanes can be very certain that an image that clearly is of a car is in fact a car, but after well-chosen perturbations indistinguishable to the human eye, the DNN suddenly believes that the image is an aeroplane.
*Chalmers University of Technology and University of Gothenburg, S-412 96 Gothenburg, Sweden, jonasson@chalmers.se
†Research partly supported by WASP (Wallenberg Autonomous Systems and Software Program)
The simplest model studied in [1], and, with some modifications, also the model considered here, is a fully connected network in which every hidden layer has width n and the depth is Tn. Asymptotics when n grows to infinity will be in focus. The network weights Θt,i,j are assumed to be i.i.d. standard Gaussian. Unlike in [1], each node will also have a bias term that is Gaussian with mean 0. The given weights constitute a typical initialization before training with data starts. The input will always be a binary string and the output activation will always be the sign function. In practice this activation is seldom used because it makes training hard, but could be argued to be the most natural one if such considerations were not needed.
To make the setup precise, let Θ={Θ1,…,ΘTn} be i.i.d. random n×n matrices, where in each Θt, the elements Θt(i,j) are i.i.d. standard Gaussian. Let B=(b1,…,bTn) be independent Gaussian n-vectors with mean 0 and covariance cnnI, where cn is assumed to satisfy 1/n≤cn≤cˉ<∞. Let ω=ω0∈{−1,1}n be the input. Then for t=1,…,Tn, let
ωt=sign(Θtωt−1+bt),
where the sign operator is taken pointwise. Finally, writing Φ=(Θ,B,θ,b), let the output of the DNN be
fΦ(n,Tn)(ω)=sign(θ⊤ωTn+b),
where θ∼N(0,In) and b∼N(0,cnn). (i.e. fn,Tn is constructed by feeding the penultimate vector ωTn into another independent neuron of the same kind as all the other neurons before it). We always assume that n is odd. Denote the law of fΦ(n,Tn) by Pf(n).
In [1], it was shown that for cn=0, the sequence {fΦ(n,Tn)} is noise sensitive in a very strong sense: It is annealed noise sensitive with respect to any joint distribution Q(n)=Pω,η(n) on the input ω and its perturbation η for which these are whp not identical or antipodal: Q(n)(η∈{ω,−ω})→0, i.e. for such Q(n),
n→∞limCov(f,(ω,η))∼Pf(n)×Q(n)(f(ω),f(η))=0.
If Q(n) also satisfies the positive-correlation condition
Cov(ω,η)∼Q(n)(h(ω),h(η))≥0
for all Boolean functions h, then this entails that {fΦ(n,Tn)} is also quenched noise sensitive with respect to Q(n): for any δ>0, there exists N<∞ such that whenever n≥N,
Pf(n)(CovQ(n)(f(ω),f(η))>δ)<δ.
(This quenched noise-sensitivity result was in fact not explicitly stated in [1], but is immediate from what was done there.) The positive-correlation condition on Q(n) holds very generally, for example if Q(n) is symmetric and the (automatically reversible) Markov kernel K given by
K(x,y)=Q(n)(η=y∣ω=x)
has only nonnegative eigenvalues, which immediately gives CovQ(n)(h(ω),h(η))≥0. A particular class of such distributions is given by taking (ω,η) as consecutive states of any lazy reversible Markov chain on {−1,1}n at stationarity. Another such class is given by taking states two steps apart for any reversible stationary Markov chain on {−1,1}n.
In other words, [1] established noise sensitivity for cn=0 for a very broad class of input and perturbation distributions. As we shall now see, when adding bias vectors to the model as above, quenched noise sensitivity remains for Tn in a window [Kn,eρn] for Kn/loglogn→∞ and some ρ>0. Indeed it does so in an even stronger form: We retain the positive-correlation assumption on Q(n), but, in the biased setting considered below, replace the non-antipodal condition by the weaker assumption Q(n)(ω=η)→0 as n→∞. The exclusion of antipodal input pairs is no longer required because the bias destroys the absorbing antipodal state.
We write Pω(n) and Pη(n) for the two marginals of Q(n). Before stating the main result, we need the following.
Lemma 1.1 Consider
gc(x)=π2arcsin1+cx,0≤c≤cˉ,0≤x≤1.
Then gc has a unique fixed point vc in (0,1), for which π2(1+c)4≤vc≤1/2, and for any sufficiently small ϵ, there exists α>0 such that gc(x)≥x+α on [ϵ,vc−ϵ] and gc(x)≤x−α on [vc+ϵ,1−ϵ] uniformly over c∈[0,cˉ].
Theorem 1.2 Let Q(n) and Φ=(Θ,B,θ,b) be as above, and let gc be as in Lemma 1.1. Assume that Kn/loglogn→∞. Then there exists ρ>0 such that whenever
Kn≤Tn≤eρn,
and Pf(n) is the resulting law of fΦ(n,Tn), the following conclusions hold.
(i) Quenched noise sensitivity: We have
CovQ(n)(f(ω),f(η))Pf(n)0
as n→∞, in particular {fΦ(n,Tn)} is quenched noise sensitive with respect to Q(n).
(ii) Annealed correlation: If cn=c>0, then, with vc being the unique fixed point of gc,
for gc as in Lemma 1.1, where (Θt)i, denotes the ith row of Θt.
Proof of Lemma 1.1: It is obvious that gc is nonnegative, increasing, and of order x as x→0. Also,
1−gc(1−x)≥gc(x)∨π2arctanc,
where the first inequality follows from gc(x)+gc(1−x)≤1. Moreover,
gc′′(x)=−2π(x(1+c−x))3/21+c−2x,
which shows that hc(x):=gc(x)−x is concave on [0,a] and convex on [a,1], where a=1∧(1+c)/2. Let
0<ϵ<min{π2(1+cˉ)2,41}.
Then
−hc(1−ϵ)≥hc(ϵ)≥π21+cϵ−ϵ≥π21+cˉϵ−ϵ>0.
We claim that hc has a unique zero vc∈(0,1), which satisfies vc∈[ϵ,1−ϵ], hc>0 on (0,vc), and hc<0 on (vc,1). That vc∈[ϵ,1−ϵ] follows from the inequalities displayed. To see the other two conclusions, use that hc(a)≥0 or hc(a)<0. If the former holds, then concavity and hc(ϵ)>0 prove that hc has no zero on [ϵ,a), and convexity and hc(1−ϵ)<0 prove that there is a unique zero in [a,1−ϵ]. If the latter holds, concavity and hc(ϵ)>0 prove a unique zero in [ϵ,a], and convexity and hc(1−ϵ)<0 prove the absence of a zero in [a,1−ϵ].
Knowing that vc is unique and using that arcsinu≥u and gc(1/2)≤g0(1/2)=1/2, it is now easy to show that π2(1+c)4≤vc≤1/2. This also means, by the choice of ϵ, that the two intervals [ϵ,vc−ϵ] and [vc+ϵ,1−ϵ] are nonempty. Since vc is the unique solution of Ψ(x)=c for a continuous strictly decreasing function Ψ, vc is continuous in c. Hence the sets
A−={(c,x):0≤c≤cˉ,ϵ≤x≤vc−ϵ}
and
A+={(c,x):0≤c≤cˉ,vc+ϵ≤x≤1−ϵ}
are compact. Moreover, hc(x)>0 on A− and hc(x)<0 on A+. Hence
α:=min{A−minhc(x),A+min(−hc(x))}>0,
and gc(x)≥x+α on [ϵ,vc−ϵ] and gc(x)≤x−α on [vc+ϵ,1−ϵ] uniformly over c∈[0,cˉ].
Proof of Theorem 1.2: Let ω=ω0 and η=η0 be two inputs into the DNN fΦ(n,Tn) defined above. Let Wt be the set of coordinates where ωt and ηt differ, and let Dt=∣Wt∣/n. Conditionally on Dt−1=x, the disagreement indicators in layer t are i.i.d. Bernoulli with parameter gcn(x), so that in particular Wt is invariant under permutations and nDt∣Dt−1=x∼Bin(n,gcn(x)).
On [1/n,ϵ], a lower bound gcn(x)≥2Cx applies uniformly. By standard Chernoff bounds, there then exists ρ>0 such that for x∈[1/n,ϵ],
Pf(n)(Dt+1≤Cx∣Dt=x)≤e−3ρn.
Hence, for n large and 0<D0<ϵ, Dt exceeds ϵ within O(loglogn) steps with probability at least 1−e−2ρn, by a union bound over layers. By identical arguments, if D0>1−ϵ, then Dt goes below 1−ϵ within time O(loglogn) with probability at least 1−e−2ρn.
Using further Chernoff bounds, union bounds over layers, and Lemma 1.1, it follows that for t0(n)/loglogn→∞ and t1(n)=eρn and sufficiently small φ>0,
By Markov's inequality, it follows for any δ>0, by taking φ>0 sufficiently small and n sufficiently large,
Pf(n)(CovQ(n)(f(ω),f(η))>δ)<δ.
This proves (i), and in combination with the previous lower bound on the second term, it also proves (ii).
References
[1] J. Jonasson, J. E. Steif and O. Zetterqvist, Noise sensitivity and stability of deep neural networks for binary classification, Stochastic Processes and their Applications 165 (2023), 130-167.