Year: 2020

Abstract:
Studying the sensitivity of weight perturbation in neural networks and its impacts on model performance, including generalization and robustness, is an active research topic due to its implications on a wide range of machine learning tasks such as model compression, generalization gap assessment, and adversarial attacks. In this paper, we provide the first formal analysis for feed-forward neural networks with non-negative monotone activation functions against norm-bounded weight perturbations, in terms of the robustness in pairwise class margin functions and the Rademacher complexity for generalization. We further design a new theory-driven loss function for training generalizable and robust neural networks against weight perturbations. Empirical experiments are conducted to validate our theoretical analysis. Our results offer fundamental insights for characterizing the generalization and robustness of neural networks against weight perturbations.

heading: 1 INTRODUCTION
text: Neural network is currently the state-of-the-art machine learning model in a variety of tasks, including computer vision, natural language processing, and game-playing, to name a few. In particular, feed-forward neural networks consists of layers of trainable model weights and activation functions with the premise of learning informative data representations and the complex mapping between data samples and the associated labels. Albeit attaining superior performance, the need for studying the sensitivity of neural networks to weight perturbations is also intensifying owing to several practical motivations. For instance, in model compression, the robustness to weight quantification is crucial for reducing memory storage while retaining model performance (Hubara et al., 2017; Weng et al., 2020). The notion of weight perturbation sensitivity is also used as a metric to evaluate the generalization gap at local minima (Keskar et al., 2017; Neyshabur et al., 2017). In adversarial robustness and security, weight sensitivity can be leveraged as a vulnerability for fault injection and causing erroneous prediction (Liu et al., 2017; Zhao et al., 2019). However, while weight sensitivity plays an important role in many machine learning tasks and problem setups, theoretical characterization of its impacts on generalization and robustness of neural networks remains elusive.
This paper bridges this gap by developing a novel theoretical framework for understanding the generalization gap (through Rademacher complexity) and the robustness (through classification margin) of neural networks against norm-bounded weight perturbations. Specifically, we consider the multiclass classification problem setup and multi-layer feed-forward neural networks with non-negative monotonic activation functions. Our analysis offers fundamental insights into how weight perturbation affects the generalization gap and the pairwise class margin. To the best of our knowledge, this study is the first work that provides a comprehensive theoretical characterization of the interplay between weight perturbation, robustness in classification margin, and generalization gap. Moreover, based on our analysis, we propose a theory-driven loss function for training generalizable and robust neural networks against norm-bounded weight perturbations. We validate its effectiveness via empirical experiments. We summarize our main contributions as follows.
• We study the robustness (worst-case bound) of the pairwise class margin function against weight perturbations in neural networks, including the analysis of single-layer (Theorem 1), all-layer (Theorem 2), and selected-layer (Theorem 3) weight perturbations.
• We characterize the generalization behavior of robust surrogate loss for neural networks under weight perturbations (Section 3.4) through Rademacher complexity (Theorem 4).
• We propose a theory-driven loss design for training generalizable and robust neural networks (Section 3.5). The empirical results in Section 4 validate our theoretical analysis and demonstrate the effectiveness of improving generalization and robustness against weight perturbations.

heading: 2 RELATED WORKS
text: In model compression, the robustness to weight quantization is critical to reducing memory size and accesses for low-precision inference and training (Hubara et al., 2017). Weng et al. (2020) showed that incorporating weight perturbation sensitivity into training can better retain model performance (standard accuracy) after quantization. For studying the generalization of neural networks, Keskar et al. (2017) proposed a metric called sharpness (or weight sensitivity) by perturbing the learned model weights around the local minima of the loss landscape for generalization assessment while An (1996) introduced weight noise into the training process and concluded that random noise training improves the overall generalization. Neyshabur et al. (2017) made a connection between sharpness and PAC-Bayes theory and found that some combination of sharpness and norms on the model weights may capture the generalization behavior of neural networks. Additionally, Bartlett et al. (2017) discovered normalized margin measure to be useful towards quantifying generalization property and a bound was therefore constructed to give an quantitative description on the generalization gap. Moreover, Golowich et al. (2019) incorporated additional assumptions to offer tighter and size-independent bounds from the setting of (Neyshabur et al., 2015) and (Bartlett et al., 2017) respectively. Despite development of various generalization bounds, empirical observations in (Nagarajan & Kolter, 2019) showed that once the size of the training dataset grows, generalization bounds proposed in (Neyshabur et al., 2017) and (Bartlett et al., 2017) will enlarge thus become vacuous. Discussions on the relation between (Nagarajan & Kolter, 2019) and our works can be found at Appendix E, where we show that in our studied setting the associated generalization bounds are non-vacuous. On the other hand, Barron & Klusowski (2018) and Theisen et al. (2019) applied several techniques in tandem with a probabilistic method named path sampling to construct a representing set of given neural networks for approximating and studying the generalization property. Another approach considered by Petzka et al. (2020) consists of segmenting the neural networks into two functions, predictor and feature selection respectively where two measures (representativeness and feature robustness) concerning these aforementioned functions were later combined to offer a meaningful generalization bound. However, these works only focused on the generalization behavior of the local minima and did not consider the generalization and robustness under weight perturbations. Weng et al. (2020) proposed a certification method for weight perturbation retaining consistent model prediction. While the certification bound can be used to train robust models with interval bound propagation (Gowal et al., 2019), it requires additional optimization subroutine and computation costs when comparing to our approach. Moreover, the convoluted nature of certification bound complicates the analysis when studying generalization, which is one of our main objectives. In adversarial robustness, fault-injection attacks are known to inject errors to model weights at the inference phase and causing erroneous model prediction (Liu et al., 2017; Zhao et al., 2019), which can be realized at the hardware level by changing or flipping the logic values of the corresponding bits and thus modifying the model parameters saved in memory (Barenghi et al., 2012; Van Der Veen et al., 2016). Zhao et al. (2020) proposed to use the mode connectivity of the model parameters in the loss landscape for mitigating such weight-perturbation-based adversarial attacks.
Although, to the best of our knowledge, theoretical characterization of generalization and robustness for neural networks against weight perturbations remains elusive, recent works have studied these properties under another scenario – the input perturbations. Both empirical and theoretical evidence have been given to the existence of a fundamental trade-off between generalization and robustness against norm-bounded input perturbations (Xu & Mannor, 2012; Su et al., 2018; Zhang et al., 2019; Tsipras et al., 2019). The adversarial training proposed in (Madry et al., 2018) is a popular training strategy for training robust models against input perturbations, where a min-max optimization principle is used to minimize the worst-case input perturbations of a data batch during model parameter updates. For adversarial training with input perturbations, Wang et al. (2019) proved its convergence and Yin et al. (2019) derived bounds on its Rademacher complexity for generalization. Different from the case of input perturbation, we note that min-max optimization on neural network training subject to weight perturbation is not straightforward, as the minimization and maximization steps are both taken on the model parameters. In this paper, we disentangle the min-max formulation for
weight perturbation by developing bounds for the inner maximization step and provide quantifiable metrics for training generalization and robust neural networks against weight perturbations.

heading: 3 MAIN RESULTS
text: We provide an overview of the presentation flow for our main results as follows. First, we introduce the mathematical notations and preliminary information in Section 3.1. In Section 3.2, we establish our weight perturbation analysis on a simplified case of single-layer perturbation. We then use the single-layer analysis as a building block and extend the results to the multi-layer perturbation setting in Section 3.3. In Section 3.4, we define the framework of robust training with surrogate loss and study the generalization property using Rademacher complexity. Finally, we propose a theory-driven loss toward training robust and generalizable neural networks in Section 3.5.

heading: 3.1 NOTATION AND PRELIMINARIES
text: Notation We start by introducing the mathematical notations used in this paper. We define the set [L] := {1, 2, ..., L}. For any two non-empty sets A, B, FA7→B denotes the set of all functions from A to B. We mark the indicator function of an event E as 1(E), which is 1 if E holds and 0 otherwise. We use sgn(·) to denote element-wise sign function that outputs 1 when input is nonnegative and -1 otherwise. Boldface lowercase letters are used to denote vectors (e.g., x), and the i-th element is denoted as [x]i. Matrices are presented as boldface uppercase letters, say W. Given a matrix W ∈ Rk×d , we write its i-th row, j-th column and (i, j) element as Wi,:, W:,j , and Wi,j respectively. Moreover, we write its transpose matrix as (W)T . The matrix (p, q) norm is defined as ‖W‖p,q := ∥∥∥[‖W:,1‖p , ‖W:,2‖p , ..., ‖W:,d‖p]∥∥∥ q
for any p, q ≥ 1. For convenience, we have ‖W‖p = ‖W‖p,p and write the spectral norm and Frobenius norm as ‖W‖σ and ‖W‖F respectively. We mark one matrix norm commonly used in this paper – the matrix (1,∞) norm. With a matrix W, we express its matrix (1,∞) norm as ‖W‖1,∞, which is defined as ‖W‖1,∞ = maxj ‖W:,j‖1 and ∥∥WT∥∥ 1,∞ = maxi ‖Wi,:‖1. We use IB ∞ W ( ) to express an element-wise `∞ norm ball of matrix W within radius , i.e., IB∞W ( ) = {Ŵ| |Ŵi,j −Wi,j | ≤ ,∀i ∈ [k], j ∈ [d]}.
Preliminaries In order to formally explain our theoretical results, we introduce the considered learning problem, neural network model and complexity definition. LetX andY be the feature space and label space, respectively. We place the assumption that all data are drawn from an unknown distribution D over X × Y and each data point is generated under i.i.d condition. In this paper, we specifically consider the feature space X as a subset of d-dimensional Euclidean space, i.e., X ⊆ Rd. We denote the symbol F ⊆ FX 7→Y to be the hypothesis class which we use to make predictions. Furthermore, we consider a loss function ` : X × Y −→ [0, 1] and compose it with the hypothesis class to make a function family written as `F := {(x, y) −→ `(f(x), y)| f ∈ F}. The optimal solution of this learning problem is a function f∗ ∈ F such that it minimizes the population risk R(f) = E(x,y)∼D[`(f(x), y)]. However, since the underlying data distribution is generally unknown, one typically aims at reducing the empirical risk evaluated by a set of training data {(xi, yi)}ni=1, which can be expressed as Rn(f) = 1n ∑n i=1 `(f(xi), yi). The generalization error is the gap between population and empirical risk, which could serve as an indicator of model’s performance under unseen data from identical distribution D. To study the generalization error, one would explore the learning capacity of a certain hypothesis class. In this paper, we adopt the notion of Rademacher complexity as a measure of learning capacity, which is widely used in statistical machine learning literature (Mohri et al., 2018). The empirical Rademacher complexity of a function class F given a set of samples S = {(xi, yi)}ni=1 is
RS(`F ) = Eν [sup f∈F
1
n n∑ i=1 νi`(f(xi), yi)] (1)
where {νi}ni=1 is a set of i.i.d Rademacher random variables with P{νi = −1} = P{νi = +1} = 12 . The empirical Rademacher complexity measures on average how well a function class F correlates with random noises on dataset S. Thus, a richer or more complex family could better correlate with random noise on average. With Rademacher complexity as a toolkit, one can develop the following relationship between generalization error and complexity measure. Specifically, it is shown in
(Mohri et al., 2018) that given a set of training samples S and assume that the range of loss function `(f(x), y) is [0, 1]. Then for any δ ∈ (0, 1), with at least probability 1− δ we have ∀f ∈ F
R(f) ≤ Rn(f) + 2RS(`F ) + 3
√ log 2
δ
2n (2)
Note that when the Rademacher complexity is small, it is then viable to learn the hypothesis class F by minimizing the empirical risk and thus effectively reducing the generalization gap.
Finally, we define the structure of neural networks and introduce a few related quantities. The problem studied in this paper is a multi-class classification task with the number of classes being K. Consider an input vector x ∈ X ⊆ Rd, an L-layer neural network is defined as
fW (x) = WL(...ρ(W1x)...) ∈ FX 7→R (3)
with W being the set containing all weight matrices, i.e., W := {Wi| ∀i ∈ [L]}, and the notation ρ(·) is used to express any non-negative monotone activation function and we further assume that ρ(·) is 1-Lipschitz, which includes popular activation functions such as ReLU applied element-wise on a vector. Moreover, the i-th component of neural networks’ output is written as f iW (x) = [fW (x)]i and a pairwise margin between i-th and j-th class, denoted as f ijW (x) := f j W (x) − f j W (x), is said to be the difference between two classes in output of the neural network. Lastly, we use the notion of zk and ẑk to represent the output vector of the k-th layer (k ∈ [L − 1]) under natural and weight perturbed settings respectively, which are zk = ρ(Wk(...ρ(W1x)...)) and ẑk = ρ(Ŵ k (...ρ(Ŵ 1 x)...)), where Ŵ
i ∈ IB∞Wi( i) denotes the
perturbed weight matrix bounded by its element-wise `∞-norm with radius i for some i ∈ [k].

heading: 3.2 BUILDING BLOCK: SINGLE-LAYER WEIGHT PERTURBATION
text: We study the sensitivity of neural network to weight perturbations through the pairwise margin bound f ijW (x). Specifically, when i and j corresponds to the top-1 and the second-top class prediction of x, respectively, the margin can be used as an indicator of robust prediction under weight perturbation to W . For ease of understanding, we first consider a simple example with a three-layer neural network and explain the bound through the error propagation incurred by weight perturbation.
We define the neural network as fW (x) = W3ρ(W2ρ(Ŵ 1 x)) with Wi being the weight matrix of the i-th layer and assume that one could only perturb any element in the first weight matrix within an `∞ norm ball of radius , i.e., Ŵ 1 ∈ IB∞W1( ). We also define an error vector as ei, which stands for the entry-wise error after propagating through the i-th layer. Since no perturbations happened prior to the first layer, we would directly take input vector x and derive an upper bound on the entry-wise error e1. While every element in the first weight matrix is allowed to change its magnitude by at most , the maximum error for any entry by matrix-vector multiplication becomes
[e1]i := |Ŵ 1i,:x−Wi,:x| ≤ ∑ j |Ŵ 1i,j −W 1i,j ||[x]j | ≤ ∑ j |[x]j | = ‖x‖1 . (4)
Since the following layer weight is not subject to perturbation, we simply take the magnitude of each element in the subsequent weight matrix to calculate the next error vector. In this case, we have the next layer’s error e2 with W2 as [e2]i = ∑ j |W 2i,j | [e1]j = ‖x‖1 ∑ j |W 2i,j |. Eventually, with error propagation over layers, we arrive at the final layer and are able to assess the maximum change of any entry in output value. By recalling the pairwise class margin f ijW (x), we would like to inspect the relative change in error between any two classes. Specifically, we derive an upper bound on the pairwise margin between any two classes α and β. In the above example, the difference in entry-wise maximum error can be deduced in the following manner:
[e3]α − [e3]β = ∑ k (|W 3α,k| − |W 3β,k|)[e2]k (i) ≤ ∑ k (|W 3α,k −W 3β,k|) ‖x‖1 ∑ l |W 2k,l| (5)
(ii) ≤ ‖x‖1maxk ∥∥W 2k,:∥∥1∑
k
(|W 3α,k −W 3β,k|) = ‖x‖1 ∥∥∥(W2)T∥∥∥
1,∞ ∥∥W 3α,: −W 3β,:∥∥1 , (6)
where inequality (i) comes from triangle inequality and inequality (ii) results from taking the row in W2 with maximum `1 norm. It is worth noting that there exist possible scenarios for the above inequalities to hold and therefore achieving the worst-case error. Specifically, using the example in Section 3.2, as we trace down the associated inequality bound in (i), we see that the first inequality can be achieved when the final weight layer possesses all positive weights and that the row associated with label α is greater than label β in all individual entries. Furthermore, as long as the second weight matrix W2 has equal `1 norm throughout all rows, we can then tighten the bound to give the worst-case error in (ii). Nevertheless, we could see from the above example that the difference of maximum error between entries in output would be propagating at the rate of weight matrices’ (1,∞) norm. By utilizing this essential concept, we introduce the first theorem of our results, which provides an upper bound on the pairwise margin under single-layer weight perturbation.
Theorem 1 (N -th layer weight perturbation (N 6= L)) Let fW (x) = WL(...ρ(W1x)...) denote an L-layer neural network and let f
Ŵ (x) = WL(..Ŵ
N ...ρ(W1x)...) with Ŵ N ∈ IB∞WN ( ), N 6= L, denote the corresponding network subject to N -th layer perturbation. For any set of perturbed and unperturbed pairwise margin f ij
Ŵ (x) and f ijW (x), we have
f ij Ŵ (x) ≤ f ijW (x) + ∥∥WLi,: −WLj,:∥∥1 ∥∥zN−1∥∥1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞
where zk = ρ(Wk(...ρ(W1x)...)).
Proof : See Appendix A.1
Since the final layer does not have any activation function, the margin bound on the margin difference when only perturbing the final layer can be simply derived, which is given in the following lemma.
Lemma 1 (Final-layer weight perturbation) Consider the case N = L in Theorem 1, we have f ij Ŵ (x) ≤ f ijW (x) + 2 ∥∥zL−1∥∥ 1 , where zL−1 is the output of the (L− 1)-th layer.
Proof : See Appendix A.1.

heading: 3.3 GENERAL SETTING: MULTI-LAYER WEIGHT PERTURBATION
text: With the developed single-layer analysis in Section 3.2 as a building block, we now extend our analysis to the general setting of multi-layer weight perturbation, which is further divided into two cases: (i) the case of perturbing all L layers; and (ii) the case of perturbing I out of L layers.

heading: 3.3.1 PERTURBING ALL LAYERS
text: Once equipped with the concept of error propagation over subsequent layers, we consider the scenario where every layer in a neural network is subject to weight perturbation. We denote the model under this circumstance as the all-perturbed setting. The following theorem states an upper bound on the pairwise margin between the natural (unperturbed) and all-perturbed settings.
Theorem 2 (all-layer perturbation) Let fW (x) = WL(...ρ(W1x)...) denote an L-layer (natural) neural network and let f
Ŵ (x) = Ŵ
L (..Ŵ N ...ρ(Ŵ 1 x)...) with Ŵ m ∈ IB∞Wm( i), ∀m ∈ [L], denote its perturbed version. For any set of pairwise margin f ij
Ŵ (x) and f ijW (x), we have
f ij Ŵ (x) ≤ f ijW (x) + ∥∥WLi,: −WLj,:∥∥1{ 1 ‖x‖1 ΠL−2l=1 ∥∥∥(WL−l)T∥∥∥1,∞︸ ︷︷ ︸
Input Layer Error
+
L−3∑ k=1 ( ΠL−1m=k+2 ∥∥∥(Wm)T∥∥∥ 1,∞ ) k+1 ∥∥∥zk∗∥∥∥ 1︸ ︷︷ ︸
Error from layer 1 to L-2
+ L−1 ∥∥∥zL−2∗∥∥∥ 1︸ ︷︷ ︸
Error of layer L-1
} + 2 L ∥∥∥zL−1∗∥∥∥ 1︸ ︷︷ ︸
Error of layer L
where zk ∗ = ρ(Wk ∗ ...ρ(W1 ∗ x) with Wm ∗ defined as
{ Wm ∗ i,j = W m i,j + m, ∀i, j and ∀m ∈ [L] \ {1}
W 1 ∗ i,j = W 1 i,j + sgn([x]j) 1, ∀i, j
Proof : See Appendix A.2.2.
Here, we provide some intuition on deriving the upper bound of the margin in the all-perturbed setting. The scheme behind this all-perturbed scenario can be viewed as an inductive layer-wise error propagation. Specifically, we can choose any perturbed layer as the commencement point of propagation, then fix any other weight matrices’ values and further calculate the propagation of error from that layer using the concept in Section 3.2. In such manner, after iterating through all these weight matrices subject to weight perturbation, one could obtain the final change in output value and therefore establish the pairwise margin bound. A close inspection of the bound shows that the propagation of error causes the first term since the input layer and the rest of the terms are errors propagating since the i-th layer in the neural network, where i ∈ [L].

heading: 3.3.2 PERTURBING MULTIPLE LAYERS
text: The all-perturbed setting is a special case of perturbing layers from an index set I when I = [L]. We extend our analysis to the general multi-layer weight perturbation setting with I ⊆ [L], which includes the single-layer setting (I = {N}) and all-perturbed setting (I = [L]) as special cases.
Theorem 3 (multiple-layer perturbation) Let an L-Layer neural network be written as fW (x) = WL(...ρ(W1x)...). Given an index set I ⊆ [L], we define the perturbed neural network as
fŴ (x) = W̃ L (...W̃N ...ρ(W̃1x)...) with { W̃i = Wi, ∀i ∈ [L] \ I W̃i = Ŵ i , Ŵ
i ∈ IB∞Wi( i), ∀i ∈ I
for any pairwise margin between f ij Ŵ (x) and f ijW (x) we have
f ij Ŵ (x) ≤ f ijW (x) + ∥∥WLi,: −WLj,:∥∥1{∑`∈I\{L,L−1} ` ∥∥∥z`−1∗∥∥∥1 (ΠL−1j=`+1 ∥∥(Wj)T∥∥1,∞ )+ 1(L− 1 ∈
I) L−1 ∥∥∥zL−2∗∥∥∥ 1 } + 1(L ∈ I)2 L ∥∥∥zL−1∗∥∥∥ 1 := f ijW (x) + η ij W (x|I)
where zk ∗ = ρ(Wk ∗ ...ρ(W1 ∗ x)
with Wm ∗ defined as  Wm ∗ i,j = W m i,j + m, ∀i, j ∀m ∈ [L] ∩ I \ {1} Wmi,j , ∀i, j ∀m ∈ [L] \ (I ∪ {1}) W 1 ∗ i,j = { W 1i,j + sgn([x]j) 1, ∀i, j if 1 ∈ I
W 1i,j , ∀i, j otherwise
and z0 ∗ = x
Proof : See Appendix A.2.3.

heading: 3.4 SURROGATE LOSS AND GENERALIZATION BOUND

heading: 3.4.1 CONSTRUCTION OF ROBUST SURROGATE LOSS ON PAIRWISE MARGIN
text: We aim to construct a surrogate loss function based on a standard loss function and study its behavior against weight perturbations. Specifically, given a perturbation radius and the original loss function `(fW(x), y), robust training aims to minimize the following objective function:
˜̀(fW (x), y) = max∀m∈[L],Ŵm∈IB∞Wm ( )`(fŴ (x), y) (7)
which we call it as the robustness (worst-case) loss. Even for a single data point (x, y), it is hard to assess the exact robustness loss since it requires the maximization of a non-concave function over a norm ball. To make the problem of robust training against weight perturbations more computationally tractable, we aim to design a surrogate loss as an upper bound on the worst-case loss.
We focus on the construction of surrogate loss by means of pairwise margin bound in Section 3.3. We first define mathematically two popular loss functions in the classification problem, ramp loss and cross entropy, and derive their surrogate versions. Define the margin function M(fW (x), y) as
M(fW (x), y) = min y′ 6=y [fW (x)]y − [fW (x)]y′ = [fW (x)]y −max y′ 6=y [fW (x)]y′ (8)
The ramp loss for a given data point (x, y) and neural network fW (·) is written as `ramp(fW (x), y) = φγ(M(fW (x), y)), where the function φγ : R 7→ [0, 1] is defined as φγ(t) = 1 if t ≤ 0, φγ(t) = 0 if t ≥ γ, and φγ(t) = 1 − tγ if t ∈ [0, γ]. Since the ramp loss is a piece-wise linear function, its surrogate loss can be directly obtained with the pairwise margin bound in Section 3.3. The cross entropy is written as CE(f̃W (x), y) = − ln([f̃W (x)]y), where f̃W (x) represents a neural network with its output passing through a softmax layer. That is, [f̃W (x)]i = exp
[fW (x)]i∑ k∈[K] exp [fW (x)]k .
For ease of demonstration, we will be using ramp loss and its pairwise margin under single-layer perturbation in the following lemma. The surrogate loss analysis for cross entropy and robust surrogate loss for multiple-layer perturbation is given in Appendix B.
Lemma 2 (robust surrogate ramp loss) Let N ∈ [L] denote the perturbed layer index and let
ˆ̀(fW (x), y) := φγ { M(fW (x), y)︸ ︷︷ ︸
margin
−2 max k∈[K]
∥∥∥WLk,:∥∥∥
1 ΠN−1m=1 ‖W m‖1,∞Π L−N−1 k=1 ∥∥∥(WL−k)T∥∥∥ 1,∞ ‖x‖1︸ ︷︷ ︸
worst-case error
}
Then we have upper and lower bounds of ˆ̀ in terms of 0-1 losses expressed as
maxŴN∈IB∞ WN
( ) 1{y 6= arg maxy′∈[K][fŴ (x)]y′ } ≤ ˆ̀(fW (x), y) ≤ 1{M(fW (x), y)− 2 maxk∈[K] ∥∥WLk,:∥∥1 ΠN−1m=1 ‖Wm‖1,∞ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ‖x‖1 ≤ γ}.
Proof : Please see Appendix B.1
One could observe in the formula that the margin function M(fW (x), y) serves as an accuracy objective similar to the standard training process while the latter term could be conceived as the worst-case error caused by weight perturbation that should be suppressed. Therefore, by training under such an objective, we can simulate the scenario of robust training. Another intuition on the surrogate loss function is that the surrogate loss also implies the difficulty of training robust and generalizable models against large weight perturbations. Since error caused by perturbations would be surging rapidly through layers, only small perturbations can be applied in training and practice, permitting the worst-case error term to be smaller than the margin term. However, one follow-up question that naturally arises is whether or not the generalization gap will be widened when training with the robust surrogate loss. The following section investigates the generalization property while conducting robust training and provides some theoretical insights to training toward a generalizable and robust model under weight perturbation.

heading: 3.4.2 GENERALIZATION GAP FOR ROBUST SURROGATE LOSS
text: We consider the robust surrogate loss established in Lemma 2 and study its generalization bound via Rademacher complexity in Theorem 4, where S = {(xi, yi)}ni=1 denotes the set of i.i.d training samples, X := [x1, x2, . . . , xn] ∈ Rd×n denotes the matrix composed of training data samples, and dmax = max{d, d1, . . . , dL} denotes the maximum dimension among all weight matrices.
Theorem 4 (generalization gap for robust surrogate loss) With Lemma 2, consider the neural network hypothesis class F = {fW (x)|W = (W1,W2, ...,WL), ∥∥Wh∥∥ σ ≤ sh, ∥∥(Wh)T∥∥ 2,1 ≤ bh, h ∈ [L]}. For any γ > 0, with probability at least 1− δ, we have for all fW (·) ∈ F
P(x,y)∼D { ∃ŴN ∈ IB∞WN ( ) s.t. y 6= arg maxy′∈[K][fŴ(x)]y′ } ≤ 1 n ∑n i=1 1 ( [fW (xi)]yi ≤ γ +
maxy′ 6=yi [fW (xi)]y′ + 2 maxk∈[K] ∥∥WLk,:∥∥1 ΠN−1m=1 ‖Wm‖1,∞ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ‖xi‖1)+
1 γ
( 4
n3/2 + 60 log(n) log(2dmax) n ‖X‖F ( ΠLh=1sh )(∑L j=1 ( bj sj )2/3)3/2 +
2 supf∈F Π N−1 m=1 ‖Wm‖1,∞Π L−N−1 k=0 ∥∥(WL−k)T∥∥ 1,∞ n ‖X‖1,2︸ ︷︷ ︸
complexity term caused by robust training
) + 3 √ log 2
δ 2n
Proof : Please see Appendix C.1
As highlighted in the bracket term of Theorem 4, if the product of multiple weight norm bounds is not well confined, the model will suffer from a notable generalization gap. Consequently, our analysis suggests a solution to reduce the generalization gap by imposing norm penalty functions on all weight matrices for training generalizable neural networks subject to weight perturbations.

heading: 3.5 THEORY-DRIVEN LOSS TOWARD ROBUSTNESS AND GENERALIZATION
text: With our theoretical insights, we now propose a robust and generalizable loss function. Standard neural network classifier training uses a classification loss `cls(fW (x), y) that aims to widen the pairwise margin so as to raise accuracy, but won’t necessarily be able to curb the error in output once weight perturbation is imposed. To address this issue, we propose to train under a mixed and regularized objective given a data sample (x, y), which would, in turn, balance the tradeoff between standard accuracy, robustness, and generalization. The designed loss takes the form:
`∗(fW (x), y) = `cls(fW (x), y)︸ ︷︷ ︸ standard loss +λ · max y′ 6=y {ηy ′y W (x|I)}︸ ︷︷ ︸ robustness loss from Thm. 3
+µ · L∑
m=1
( ∥∥∥(Wm)T∥∥∥ 1,∞ + ‖Wm‖1,∞ )
︸ ︷︷ ︸ generalization gap regularization from Thm. 4
(9)
The first term in the proposed loss function originates from standard classification problem for taskspecific accuracy, while the second term results from the maximum error on pairwise margin (the term ηy
′y W (x|I) defined in Theorem 3) induced by weight perturbation. Finally, we contribute the last
term to the theoretical findings in Theorem 4, where imposing norm constraints on weight matrices could benefit generalization and prevent the generalization gap from widening.

heading: 4 NUMERICAL VALIDATION
text: We validate our theoretical results and the designed loss function in (9) through two sets of experiments: empirical generalization gap with matrix norm regularization and robust accuracy against adversarial weight perturbations.
Experiment setup We used the MNIST dataset comprised of gray-scale images of hand-written digits with ten categories. We trained neural network models as in (3) with four dense layers (number of neurons are 128-64-32-10) and the ReLU activation function without the bias term. We used the loss function `∗ in (9) with all-layer perturbation bound (i.e., I = [L]), identical weight perturbation radius (or train), cross entropy as the standard classification loss `cls, and a batch size of 32 with 20 epochs. Stochastic gradient descent with momentum is used for training, with the learning rate set to be 0.01. For the generalization experiment, we follow the same setting as in (Yin et al., 2019), which uses 1000 data samples to train the neural network with 100 epochs. All experiments were conducted using an Intel Xeon E5-2620v4 CPU, 125 GB RAM, and an NVIDIA TITAN Xp GPU with 12 GB RAM. For reproducibility, our codes are given in the supplementary material.
Empirical generalization gap Figure 1 (a) shows the empirical generalization gap (training accuracy - test accuracy) with respect to the matrix norm regularization coefficient µ defined in (9). As indicated in Theorem 4, increasing µ effectively suppresses the Rademacher complexity and thus reduces the generalization gaps, which are consistently observed on neural networks trained with different weight perturbation level .
Robustness against adversarial weight perturbation To evaluate the robustness against weight perturbations, we modified the projected gradient descent (PGD) attack originally designed for input perturbation (Madry et al., 2018), which we call as weight PGD attack. Starting from a trained neural network weight W , the perturbed weight W̃ is crafted by iterative gradient ascent using the signed gradient of the standard loss denoted as sgn(∇W `cls(fW̃ (x), y)), followed by an element-wise clipping centered at W . The attack iteration with the step size α is expressed as
W̃ (0) = W , W̃ (t+1) = ClipW , { W̃ (t) + α sgn(∇W `cls(fW̃ (t)(x), y)) } (10)
We trained neural networks with different combinations of the coefficients λ and µ in (9) using train = 0.01. Figure 1 (b) shows the test accuracy under different weight perturbation level (i.e., the robust accuracy) with 200 attack steps. The standard model (λ = µ = 0) is fragile to weight PGD attack. On the other hand, neural networks trained only with the robustness loss (λ > 0 and µ = 0) or the generalization gap regularization (λ = 0 and µ > 0) can improve the robust accuracy due to improved generalization and classification margin. Moreover, joint training using the proposed loss with proper coefficients can further boost model performance (e.g., (λ, µ) = (0.0125, 0.01)), as seen by the significantly improved area under curve (AUC) score of robust accuracy over all tested values. The AUC of the best model is about 2× larger than that of the standard model. Similar results can be concluded for the attack with 100 steps (see Appendix D). In Appendix D.3, we conduct additional experiments on the coefficients λ and µ and discuss their tradeoffs. We also report the run-time analysis in Appendix F. Training with our loss function has a comparable perepoch run time when comparing to standard training.

heading: 5 CONCLUSION
text: In this paper, we developed a formal analysis of the robustness of the pairwise class margin for neural networks against weight perturbations. We also characterized its generalization gap through Rademacher complexity. A theory-driven loss function was proposed, and the empirical results showed significantly improved performance in generalization and robustness. Our analysis offers theoretical insights and training loss design principles for studying the generalization and robustness of neural networks subject to weight perturbations.

heading: A MARGIN BOUND

heading: A.1 SINGLE-LAYER BOUND
text: We shall first prove when N 6= L and follow similar reasoning to prove the case when N = L. Consider the difference between set of pairwise margin f ij
Ŵ (x)− f ijW (x), we have
f ij Ŵ (x)− f ijW (x)
= {WLi,: −WLj,:}(ẑ L−1 − zL−1) (11)
(a) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥∥ρ(WL−1ẑL−2)− ρ(WL−1zL−2)∥∥∥∞ (12)
(b) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥∥WL−1(ẑL−2 − zL−2)∥∥∥∞ (13)
(c) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥(WL−1)T∥∥1,∞ ∥∥∥(ẑL−2 − zL−2)∥∥∥∞ (14)
(d) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥(WL−1)T∥∥1,∞ ...∥∥(WN+1)T∥∥1,∞ ∥∥∥(ŴN −WN )zN−1∥∥∥∞ (15)
(e) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥zN−1∥∥1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ , (16)
where inequality (a) results from applying Hölder inequality, and inequality (b) comes from the contractive property (1-Lipschitz) of activation function ρ(·). Inequality (c) and (d) come from triangle inequality applied element-wise on vector WL−1(ẑL−2 − zL−2) combined with induction while inequality (e) simply comes from the fact that every element in matrix Ŵ N −WN has at most
in magnitude.
With similar reasoning, we proof the scenario when N = L as following
f ij Ŵ (x)− f ijW (x)
= {WLi,: −WLj,:}zL−1 − {ŴLi,: − ŴLj,:}zL−1 (17) (i) ≤ 2 1T zL−1 (18) = 2 ∥∥zL−1∥∥ 1 , (19)
where inequality (i) comes from problem definition (within element-wise `∞ norm ball) and since the activation function ρ(·) is non-negative, we could transform the inner product to its `1 norm.

heading: A.2 MULTI-LAYER SCENARIO

heading: A.2.1 KEY PREREQUISITE
text: Before going through the proof for all-perturbed bound, we shall be introducing a maximization problem and search for its solution. Recall that we have defined in Section 3.1 the notion of output vector under weight perturbation setting, we now consider maximizing its `1 norm over a given perturbed matrix set Ŵ and give the following solution. Using the notation in Section 3.1, we have ẑk as the output vector under perturbation setting and write the optimal vector that achieve its maximum `1 norm as zk
∗ . We then obtain the following solution∥∥zk∗∥∥
1 = max Ŵ ∥∥∥ẑk∥∥∥ 1 ,
where zk ∗ = ρ(Wk ∗ ...ρ(W1 ∗ x) with
{ Wm ∗
i,j = W m i,j + m, ∀i, j ∀m ∈ {2, ..., L}
W1 ∗
i,j = W 1 i,j + sgn([x]j) 1, ∀i, j
The reasoning behind uses the non-negative property of activation function, for any element in a matrix W, the choice to maximize it’s `1 norm matrix-vector product is to go in the direction identical to the sign of the vector’s element-wise value since the activation function is applied after the first layer, we would then obtain the solution above.

heading: A.2.2 ALL-PERTURBED BOUND
text: In the following proof for Theorem 2, we apply similar steps in Appendix A.1 and consider the difference between set of pairwise margin under natural and weight perturbation setting, recall in Theorem 2 we defined that fW (x) = WL(..WN ...ρ(W1x)...) and fŴ (x) = Ŵ L (..Ŵ N ...ρ(Ŵ 1 x)...) Thus for any set of pairwise margin f ij Ŵ (x) and f ijW (x), we have
f ij Ŵ (x)− f ijW (x)
= {ŴLi,: − ŴLj,:}ẑ L−1 − {WLi,: −WLj,:}zL−1 (20)
(a) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥∥ρ(ŴL−1 ẑL−2)− ρ(WL−1zL−2)∥∥∥∞ + 2 L1T ẑL−1 (21)
(b) ≤ ∥∥WLi,: −WLj,:∥∥1 {∥∥∥WL−1(ẑL−2 − zL−2)∥∥∥∞ + ∥∥∥(ŴL−1 −WL−1)ẑL−2∥∥∥∞ }+ 2 L ∥∥∥ẑL−1∥∥∥1 (22) (c)
≤ ∥∥WLi,: −WLj,:∥∥1 {∥∥(WL−1)T∥∥1,∞ ∥∥∥ρ(ŴL−2 ẑL−3)− ρ(WL−2zL−3)∥∥∥∞ + L−1 ∥∥∥ẑL−2∥∥∥1 }
+ 2 L ∥∥∥ẑL−1∥∥∥ 1
(23)
(d) ≤ ∥∥WLi,: −WLj,:∥∥1{ 1 ‖x‖1 ΠL−2l=1 ∥∥(WL−l)T∥∥1,∞ + L−3∑
j=1
( ΠL−1k=j+2 ∥∥(Wk)T∥∥ 1,∞ ) j+1 ∥∥∥ẑj∥∥∥ 1
+ L−1 ∥∥∥ẑL−2∥∥∥ 1 } + 2 L ∥∥∥ẑL−1∥∥∥ 1
(24)
(e) ≤ ∥∥WLi,: −WLj,:∥∥1{ 1 ‖x‖1 ΠL−2l=1 ∥∥(WL−l)T∥∥1,∞ + L−3∑
j=1
( ΠL−1k=j+2 ∥∥(Wk)T∥∥ 1,∞ ) j+1 ∥∥∥zj∗∥∥∥ 1
+ L−1 ∥∥∥zL−2∗∥∥∥ 1 } + 2 L ∥∥∥zL−1∗∥∥∥ 1
(25)
In the above proof, inequality (a) comes from the problem definition (perturbation of final layer within L) and inequality (b) results from the contractive property of ρ(·) (1-Lipschitz) combined with the use of triangle inequality. Inequality (c) was achieved through triangle inequality applied on elements of WL−1(ẑL−2 − zL−2) and using the fact that Ŵ L−1 −WL−1 has every element less
than or equal to L−1 in magnitude. By the process of induction and maximizing the `1 norm of perturbed output under weight perturbation ẑk, we arrive at inequality (d) and (e).

heading: A.2.3 MULTI-LAYER BOUND
text: We now proceed to utilize similar reasoning to establish the multi-layer bound when weight perturbation is imposed according to an index set I
f ij Ŵ (x)− f ijW (x)
= {W̃Li,: − W̃Lj,:}ẑ L−1 − {WLi,: −WLj,:}zL−1 (26) ≤ ∥∥WLi,: −WLj,:∥∥1 ∥∥∥ρ(W̃L−1 ẑL−2)− ρ(WL−1zL−2)∥∥∥∞ + 1(L ∈ I)2 L1T ẑL−1 (27)
≤ ∥∥WLi,: −WLj,:∥∥1 {∥∥∥WL−1(ẑL−2 − zL−2)∥∥∥∞ + ∥∥∥(W̃L−1 −WL−1)ẑL−2∥∥∥∞ }
+ 1(L ∈ I)2 L ∥∥∥ẑL−1∥∥∥
1 (28) ≤ ∥∥WLi,: −WLj,:∥∥1 {∥∥(WL−1)T∥∥1,∞ ∥∥∥ρ(W̃L−2 ẑL−3)− ρ(WL−2zL−3)∥∥∥∞
+ 1(L− 1 ∈ I) L−1 ∥∥∥ẑL−2∥∥∥
1
} + 1(L ∈ I)2 L ∥∥∥ẑL−1∥∥∥ 1
(29) ≤ ∥∥WLi,: −WLj,:∥∥1{1(1 ∈ I) 1 ‖x‖1 ΠL−2l=1 ∥∥(WL−l)T∥∥1,∞ + 1(L− 1 ∈ I) L−1 ∥∥∥ẑL−2∥∥∥1
+ L−3∑ j=1 1(j + 1 ∈ I) ( ΠL−1k=j+2 ∥∥(Wk)T∥∥ 1,∞ ) j+1 ∥∥∥ẑj∥∥∥ 1 } + 1(L ∈ I)2 L ∥∥∥ẑL−1∥∥∥ 1
(30)
≤ ∥∥WLi,: −WLj,:∥∥1{ ∑
`∈I\{L,L−1}
( ΠL−1k=`+1 ∥∥(Wk)T∥∥ 1,∞ ) ` ∥∥∥z`−1∗∥∥∥ 1
+ 1(L− 1 ∈ I) L−1 ∥∥∥zL−2∗∥∥∥
1
} + 1(L ∈ I)2 L ∥∥∥zL−1∗∥∥∥ 1
(31)
The proof for multi-layer bound follows same reasoning from the all-perturbed setting except indicator function was added to check whether a certain layer m is in the index set I and at last we rewrite the expression using the members of set I .

heading: B SURROGATE LOSS

heading: B.1 CASE ON RAMP LOSS
text: We now provide a proof for Lemma 2. Recall the definition of ramp function in Section 3.4.1, we have that ramp loss for a given data point (x, y) and neural network fW (·) is written as `ramp(fW (x), y) = φγ(M(fW (x), y)), where the function φγ : R 7→ [0, 1] is defined as
φγ(t) =  1 if t ≤ 0 0 if t ≥ γ 1− tγ if t ∈ [0, γ]
(32)
Then for any (x, y), using ReLU as activation function, we have
max Ŵ 1(y 6= arg max y′ [f Ŵ (x)]y′)
(a) ≤ φγ(min Ŵ M(f Ŵ (x), y)) (33)
(b) ≤ φγ(min y′ 6=y min Ŵ [f Ŵ (x)]y − [fŴ (x)]y′) (34)
(c) ≤ φγ (
min y′ 6=y [fW (x)]y − [fW (x)]y′ −max y′ 6=y ∥∥WLy′,: −WLy,:∥∥1 ∥∥zN−1∥∥1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ )
(35) (d) ≤ φγ (
min y′ 6=y [fW (x)]y − [fW (x)]y′ − 2 max k∈[K] ∥∥WLk,:∥∥1 ∥∥zN−1∥∥1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ )
(36) (e) ≤ φγ ( M(fW (x), y)− 2 max k∈[K] ∥∥WLk,:∥∥1 ∥∥zN−1∥∥1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ) (37)
(f) ≤ φγ ( M(fW (x), y)− 2 max k∈[K] ∥∥WLk,:∥∥1 ‖x‖1 ΠN−1m=1 ‖Wm‖1,∞ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ )
(38)
:= ˆ̀(fW (x), y) (39) (g) ≤ 1 ( M(fW (x), y)− 2 max k∈[K] ∥∥WLk,:∥∥1 ‖x‖1 ΠN−1m=1 ‖Wm‖1,∞ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ≤ γ),
(40)
where inequality (a) is due to the property of ramp loss while inequality (b) is by the definition of margin and inequality (c) comes from applying Theorem 1. Inequality (d) results from using triangle inequality and taking its maximum, inequality (e) is by the definition of margin and inequality (f) comes from the fact that with ReLU we have ‖ρ(Ax)‖1 ≤ ‖Ax‖1. Lastly, inequality (g) is a direct consequence from property of ramp loss.

heading: B.1.1 RAMP LOSS ON MULTIPLE LAYER BOUND
text: We now follow a similar course and prove robust ramp loss using the multi-layer bound in Theorem 3. We consider the robust loss form proposed in Section 3.4.1 and have that,
max Ŵ `ramp(fŴ (x), y)
(a) ≤ φγ(min Ŵ M(f Ŵ (x), y)) (41)
(b) ≤ φγ (
min y′ 6=y [fW (x)]y − [fW (x)]y′ −max y′ 6=y
ηy ′y W (x|I) )
(42)
(c) ≤ φγ ( M(fW (x), y)−max
y′ 6=y ηy ′y
W (x|I) ) := ˆ̀(fW (x), y) (43)

heading: B.2 CROSS ENTROPY
text: We further consider the case of cross entropy and prove an upper bound for it. We denote the loss function as CE(·), and during training, hard label was applied. Recall the definition of f̃W (x) in
Section 3.4.1, we have the difference of loss function between natural and perturbation settings as,
CE(f̃ Ŵ
(x), y)− CE(f̃W (x), y)
= −y ln [f̃ Ŵ (x)]y
[f̃W (x)]y (44)
= ln [f̃W (x)]y [f̃
Ŵ (x)]y
(45)
= ln ( e[fW (x)]y−[fŴ (x)]y
∑ k∈[K] e [f Ŵ
(x)]k∑ k∈[K] e [fW (x)]k } (46)
(a) ≤ ln (
max y′ 6=y
e[fW (x)]y−[fŴ (x)]y · e[fŴ (x)]y′−[fW (x)]y′ )
(47)
(b) ≤ ln ( e maxy′ 6=y f y′y Ŵ (x)−fy ′y W (x) )
(48) (c) = max
y′ 6=y ηy ′y W (x|I), (49)
where inequality (a) comes from taking the maximum in the set of all ratios { e [f Ŵ (x)]k
e[fW (x)]k
} and in-
equality (b) comes from monotonicity of exponential function. Finally, the last expression (c) can be referred to Theorem 3. Thus with the above proof, we could establish the following robust surrogate loss for cross entropy, denoted as ĈE(fW (x), y) :
ĈE(fW (x), y) = CE(fW (x), y) + maxy′ 6=y ηy ′y W (x|I)

heading: C GENERALIZATION BOUND ON RADEMACHER COMPLEXITY

heading: C.1 PROOF ON SINGLE LAYER BOUND
text: To show the Rademacher complexity and generalization gap on single layer robust surrogate loss, we first introduce a result proven in (Bartlett et al., 2017) and another classical result in statistical learning theory and proceed to give a proof on Theorem 4. Given a set S = {(xi, yi)}ni=1 of i.i.d training samples, denote X := [x1, x2, . . . , xn] ∈ Rd×n as the matrix composed of training data and let dmax = max{d, d1, . . . , dL} as the maximum dimension among all weight matrices.
Lemma 3 (Mohri et al. (2018)) Assume that the range of loss function `(·) is [0,1]. Then, for any δ ∈ (0, 1), with probability as least 1− δ, we have for all f ∈ F
R(f) ≤ Rn(f) + 2R(`F ) + 3 √ log 2δ 2n ,
where R(f) and Rn(f) stand for population risk and empirical risk, respectively.
Lemma 4 (Bartlett et al. (2017)) Consider the neural network hypothesis class,
F = {fW (x) |W = (W1,W2, ...,WL), ∥∥Wh∥∥
σ ≤ sh, ∥∥(Wh)T∥∥ 2,1 ≤ bh h ∈ [L]}
We have an upper bound on the Rademacher complexity,
R(F) ≤ 4 n3/2 + 26 log(n) log(2dmax)n ‖X‖F ( ΠLh=1sh )(∑L j=1 ( bj sj )2/3)3/2 We now study the Rademacher Complexity of the function class
ˆ̀F = {(x, y) 7→ ˆ̀(fW (x), y)| f ∈ F},
where ˆ̀(·) is denoted in Lemma 2 and let MF = {(x, y) 7→M(fW (x), y)| f ∈ F}. Then we could obtain,
R(ˆ̀F ) ≤ 1
γ
( R(MF ) + 2
n Eν [sup
f∈F n∑ i=1 νi max k∈[K] ∥∥WLk,:∥∥1 ΠN−1m=1 ‖Wm‖1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ‖xi‖1]), (50)
where the inequality was achieved by using the Ledoux-Talagrand contraction inequality and the convexity of the supreme operation. Consider the second term, we have that
2 n Eν [sup
f∈F n∑ i=1 νi max k∈[K] ∥∥WLk,:∥∥1 ΠN−1m=1 ‖Wm‖1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ ‖xi‖1] (51) (a) ≤ 2 n ( sup f∈F max k∈[K] ∥∥WLk,:∥∥1 ΠN−1m=1 ‖Wm‖1 ΠL−N−1k=1 ∥∥(WL−k)T∥∥1,∞ )Eν [| n∑ i=1 νi ‖xi‖1 |] (52)
(b) ≤ 2 n ( sup f∈F ΠN−1m=1 ‖W m‖1 Π L−N−1 k=0 ∥∥(WL−k)T∥∥ 1,∞ ) ‖X‖1,2 , (53)
where inequality (a) is achieved by separating all neural network related parameters and inequality (b) is a result of applying Khintchine’s inequality.
Thus, combined with Lemma 4, we have that
R(ˆ̀F ) ≤ 1
γ ( 4 n3/2 + 60 log(n) log(2dmax) n ‖X‖F ( ΠLh=1sh )( L∑ j=1 ( bj sj )2/3)3/2 + 2
n ( sup f∈F ΠN−1m=1 ‖W m‖1 Π L−N−1 k=0 ∥∥(WL−k)T∥∥ 1,∞ ) ‖X‖1,2 (54)
Once we have calculated an upper bound for R(ˆ̀F ), then Theorem 4 is a direct consequence of Lemma 2 and 3.

heading: C.2 EXTENSION TO MULTIPLE LAYER BOUND
text: In this section, we consider the robust surrogate loss under multi-layer bound and study its Rademacher complexity, We first give the expression of the robust surrogate loss then give an result on generalization bound.
Lemma 5 Define the robust loss function ˆ̀(fW (x), y) as ˆ̀(fW (x), y) = φγ ( M(fW (x), y)
− 2 max k∈[K] ∥∥WLk,:∥∥1{ ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) ‖x‖1
+ 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖x‖1 } − 1(L ∈ I)2 L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖x‖1 ) (55)
We would have that
max Ŵ 1(y 6= arg max y′ [f Ŵ (x)]y′) ≤ ˆ̀(fW (x), y) ≤ 1 ( M(fW (x), y)− 2 max
k∈[K] ∥∥WLk,:∥∥1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) ‖x‖1
+ 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖x‖1 } − 1(L ∈ I)2 L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖x‖1 ≤ γ ) Using the above loss, we could further establish an upper bound on robust surrogate loss and provide statements on generalization bound. Given the following function class
ˆ̀F = {(x, y) 7→ ˆ̀(fW (x), y)|f ∈ F}
We have that,
R(ˆ̀F ) ≤ 1
γ
( R(MF ) + 2
n Eν [ sup f∈F n∑ i=1 νi max k∈[K] ∥∥WLk,:∥∥1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ×
( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) ‖xi‖1 + 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖xi‖1 }] + 2
n Eν [ sup f∈F n∑ i=1 νi1(L ∈ I) L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖xi‖1 ]) (56)
which the second term can be bounded as, 2
n Eν [ sup f∈F n∑ i=1 νi max k∈[K] ∥∥WLk,:∥∥1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ×
( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) ‖xi‖1 + 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖xi‖1 }] (57)
≤ 2 n sup f∈F max k∈[K] {∥∥WLk,:∥∥1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) + 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )}} Eν [| n∑ i=1 νi ‖xi‖1 |] (58)
≤ 2 n sup f∈F max k∈[K] {∥∥WLk,:∥∥1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥(Wj)T∥∥ 1,∞ ) + 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )}} ‖X‖1,2 (59)
while the last term can as well be bounded as, 2
n Eν [ sup f∈F n∑ i=1 νi1(L ∈ I) L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖xi‖1 ] (60)
≤ 2 supf∈F 1(L ∈ I) L
( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) n Eν [| n∑ i=1 νi ‖xi‖1 |] (61)
≤ 21(L ∈ I) L supf∈F
( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) n
‖X‖1,2 (62) With all of the upper bounds above and Lemma 4, 5, we have the following theorem,
Theorem 5 (generalization gap for robust surrogate loss) With Lemma 5, consider the neural network hypothesis class F = {fW (x)|W = (W1,W2, ...,WL), ∥∥Wh∥∥ σ ≤ sh, ∥∥(Wh)T∥∥ 2,1 ≤ bh, h ∈ [L]}. For any γ > 0, with probability at least 1− δ, we have for all fW (·) ∈ F
P(x,y)∼D { ∃Ŵ s.t. y 6= arg max
y ′∈[K]
[fŴ (x)]y′ } ≤ 1 n n∑ i=1 1 ( [fW (xi)]yi ≤ γ + max y ′ 6=yi [fW (xi)]y′ + 2 max k∈[K] ∥∥∥WLk,:∥∥∥ 1
× { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥∥(Wj)T∥∥∥ 1,∞ ) + 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )} ‖xi‖1
+ 21(L ∈ I) L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ ) ‖xi‖1 ) + 1 γ ( 4 n3/2 + 60 log(n) log(2dmax) n ‖X‖F
+ 2
n sup f∈F max k∈[K] {∥∥∥WLk,:∥∥∥ 1 { ∑ `∈I\{L,L−1} ` ( Πl−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )( ΠL−1j=`+1 ∥∥∥(Wj)T∥∥∥ 1,∞ )
+ 1(L− 1 ∈ I) L−1 ( ΠL−2i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )} + 21(L ∈ I) L ( ΠL−1i=1 ∥∥∥Wi∗∥∥∥ 1,∞ )} ‖X‖1,2 ) + 3 √ log 2 δ
2n (63)

heading: D ADDITIONAL EXPERIMENTS

heading: D.1 SUPPLEMENT OF FIGURE 1 (A)
text: For completeness, Figure 2 adds the curve of = 0 (the standard generalization setting) in Figure 1 (a). The generalization gap is obviously lower than others when = 0, but its trend with respect to regularization is similar to the setting when 6= 0.

heading: D.2 WEIGHT PGD ATTACK (100 STEPS) ON MNIST
text: Figure 3 shows the accuracy and AUC score of different models against weight PGD attack with 100 iterations.
D.3 MORE DETAILS ON THE TRADE-OFF BETWEEN λ AND µ
Figure 4 shows the trade-off with a fine grid search between coefficients λ and µ, we present test accuracy under weight PGD attack using perturbation radius of ( = 0.01 and 0.02) with different combinations of λ (from 0.01 to 0.015) and µ (from 0 to 0.05). We find that there is indeed a sweet spot with proper values of λ and µ leading to significantly better robust accuracy. When both λ and µ are too large or too small, the robustness of the model will decrease.

heading: D.4 ALTERNATIVE ROBUST LOSS FUNCTION
text: In addition to the proposed loss function in equation (9), one can consider an alternative generalization gap regularization term derived from Theorem 4, which is ∑L m=1(log (||(W
m)>||1,∞) + log (||Wm||1,∞)). We compare its performance following the same experiment setting as in Figure 1 (b) with finetuned coefficients λ and µ. It can be observed that this alternative loss function also yields robust models with comparable (sometimes slightly better) performance to those in Figure 1 (b), verifying the effectiveness in using theory-driven insights to reduce the generalization gap against weight perturbation.

heading: E ON THE VACUITY OF GENERALIZATION BOUND
text: In (Nagarajan & Kolter, 2019), empirical observations were made to point out the fact that when given increase in the size of the training data, the error bound proposed in (Bartlett et al., 2017) grows rapidly, loosing the ability to describe generalization gap and thus becomes vacuous. However, we note that under our settings with models trained using the loss function in Section 3.5, the bound would not grow in a polynomial rate and instead shows a decreasing trend. We conducted experiments and presented results under the same setting as (Nagarajan & Kolter, 2019) in Figure 6. Here we verify two existing generalization bounds from different literature, one from (Bartlett et al., 2017) while another one from (Barron & Klusowski, 2018) in which the former one is composed mainly of product of weight matrices’ norm and the latter is comprised of the norm of matrices’ product. Empirical results in Figure 6(a) show that under the standard settings the main components of generalization bound in (Bartlett et al., 2017) and Barron & Klusowski (2018) both grows rapidly with respect to the increase in size of the training dataset, as confirmed in (Nagarajan & Kolter, 2019). Another empirical finding in the last column of Figure 6(a) shows that the multiplicative difference between bounds in (Bartlett et al., 2017) and (Barron & Klusowski, 2018) exhibit a constant rate, demonstrating the vacuity of both bounds. However, when measuring the same component under our setting in Figure 6(b), new results showed decreasing bounds as the size of the training dataset increases, concluding the non-vacuity of the associated generalization bounds in our settings.
As an ablation study, Figure 7 shows the performance of the robust model with (λ = 0.01, µ = 0). That is, training a neural network without the generalization regularization term in equation (9). Unlike the standard model, it is observed that the generalization bounds still show decreasing trend with the test error. This is due to the fact that the robustness term in equation (9), which is induced from our analysis of the worst-case error propagation from weight perturbation, also plays a role in regularizing the network weights, and therefore making the resulting generalization bound nonvacuous.

heading: F RUN TIME ANALYSIS
text: Table 1 reports the per-epoch run time of the models trained with the standard model (λ = 0, µ = 0) and the robust model (λ = 0.01, µ = 0.1) using equation (9). We train both models with 20 epochs and use the same hyperparameters, including setting the SGD optimizer with learning rate as 0.01, and setting the batch size as 32. The cost of training both models are comparable.

Review summaries:
The paper investigates the effects of weight perturbations on the output margin for multiclass classifcation problems. The paper shows that robustness to weight perturbations can be bounded using the (1,\infty)-norm of the weight matrices. The paper then suggests that a low (1,\infty)-norm of the weight matrices leads to better generalization. Moreover, the robustness against weight perturbation implied by low (1,\infty)-norms of weight matrices should increase the robustness against adversarial perturbations. To support these claims, the paper presents a generalization bound using the (1,\infty)-norm of weight matrices as well as an empirical evaluation using a novel surrogate loss function that, when used in training, is empirically shown to reduce the generalization gap and increase the robustness against adversarial perturbations.

The paper discusses learning neural network models under weight parameter perturbations. In particular the paper motivates the use of a new loss function (equation 9) based on the analysis of neural network robustness (Section 3.2, 3.3) and generalization properties (Section 3.4) to perturbations of the weight parameters. Section 4 has experiments supporting the theory that the loss function in equation 9 is robust and has good generalization properties to weight perturbations.

In this work, the authors theoretically analyze the robustness against weight perturbations in neural networks. Upper bounds of the pairwise class margin for single-layer, all-layer, and selected-layer perturbation are established. Based on the analysis, the authors propose novel robust surrogate loss functions for 0-1 loss and cross-entropy.  Furthermore,  the authors analyze the Rademacher complexity of the perturbated network with the proposed loss, which leads to generalization bounds based on (Mohri et al. (2018)) and (Bartlett et al. (2017)).