A Unified Algebraic Perspective on Lipschitz Neural Networks
Important research efforts have focused on the design and training of neural
networks with a controlled Lipschitz constant. The goal is to increase and
sometimes guarantee the robustness against adversarial attacks. Recent
promising techniques draw inspirations from different backgrounds to design
1-Lipschitz neural networks, just to name a few: convex potential layers derive
from the discretization of continuous dynamical systems,
Almost-Orthogonal-Layer proposes a tailored method for matrix rescaling.
However, it is today important to consider the recent and promising
contributions in the field under a common theoretical lens to better design new
and improved layers. This paper introduces a novel algebraic perspective
unifying various types of 1-Lipschitz neural networks, including the ones
previously mentioned, along with methods based on orthogonality and spectral
methods. Interestingly, we show that many existing techniques can be derived
and generalized via finding analytical solutions of a common semidefinite
programming (SDP) condition. We also prove that AOL biases the scaled weight to
the ones which are close to the set of orthogonal matrices in a certain
mathematical manner. Moreover, our algebraic condition, combined with the
Gershgorin circle theorem, readily leads to new and diverse parameterizations
for 1-Lipschitz network layers. Our approach, called SDP-based Lipschitz Layers
(SLL), allows us to design non-trivial yet efficient generalization of convex
potential layers. Finally, the comprehensive set of experiments on image
classification shows that SLLs outperform previous approaches on certified
robust accuracy. Code is available at
https://github.com/araujoalexandre/Lipschitz-SLL-Networks.
Alexandre Araujo, Aaron Havens, Blaise Delattre, Alexandre Allauzen, Bin Hu
# A Unified Algebraic Perspective on Lipschitz Neural Networks

###### Abstract

Important research efforts have focused on the design and training of neural networks with a controlled Lipschitz constant. The goal is to increase and sometimes guarantee the robustness against adversarial attacks. Recent promising techniques draw inspirations from different backgrounds to design 1-Lipschitz neural networks, just to name a few: convex potential layers derive from the discretization of continuous dynamical systems, Almost-Orthogonal-Layer proposes a tailored method for matrix rescaling. However, it is today important to consider the recent and promising contributions in the field under a common theoretical lens to better design new and improved layers. This paper introduces a novel algebraic perspective unifying various types of 1-Lipschitz neural networks, including the ones previously mentioned, along with methods based on orthogonality and spectral methods. Interestingly, we show that many existing techniques can be derived and generalized via finding analytical solutions of a common semidefinite programming (SDP) condition. We also prove that AOL biases the scaled weight to the ones which are close to the set of orthogonal matrices in a certain mathematical manner. Moreover, our algebraic condition, combined with the Gershgorin circle theorem, readily leads to new and diverse parameterizations for 1-Lipschitz network layers. Our approach, called SDP-based Lipschitz Layers (SLL), allows us to design non-trivial yet efficient generalization of convex potential layers. Finally, the comprehensive set of experiments on image classification shows that SLLs outperform previous approaches on certified robust accuracy. Code is available at github.com/araujoalexandre/Lipschitz-SLL-Networks.

+
Footnote †: Equal contribution.

## 1 Introduction

The robustness of deep neural networks is nowadays a great challenge to establish confidence in their decisions for real-life applications. Addressing this challenge requires guarantees on the stability of the prediction, with respect to adversarial attacks. In this context, the Lipschitz constant of neural networks is a key property at the core of many recent advances. Along with the margin of the classifier, this property allows us to certify the robustness against worst-case adversarial perturbations. This certification is based on a sphere of stability within which the decision remains the same for any perturbation inside the sphere (Tsuzuku et al., 2018).

The design of 1-Lipschitz layers provides a successful approach to enforce this property for the whole neural network. For this purpose, many different techniques have been devised such as spectral normalization (Miyato et al., 2018; Farnia et al., 2019), orthogonal parameterization (Trockman et al., 2021; Li et al., 2019; Singla et al., 2021; Yu et al., 2022; Xu et al., 2022), Convex Potential Layers (CPL) (Meunier et al., 2022), and Almost-Orthogonal-Layers (AOL) (Prach et al., 2022). While all these techniques share the same goal, their motivations, and
derivations can greatly differ, delivering different solutions. Nevertheless, their raw experimental comparison fails to really gain insight into their peculiar performance, soundness, and in the end their possible complementarity. Therefore a question acts as a barrier for an in-depth analysis and future development:

_Are there common principles underlying the developments of 1-Lipschitz Layers?_

In this paper, we propose a novel perspective to answer this question based on a unified Semidefinite Programming (SDP) approach. We introduce a common algebraic condition underlying various types of methods like spectral normalization, orthogonality-based methods, AOL, and CPL. Our key insight is that this condition can be formulated as a unifying and simple SDP problem, and that the development of 1-Lipschitz architectures systematically arise by finding "analytical solutions" of this SDP. Our main contributions are summarized as follows.

* We provide a unifying algebraic perspective for 1-Lipschitz network layers by showing that existing techniques such as spectral normalization, orthogonal parameterization, AOL, and CPL can all be recast as a solution of the same simple SDP condition (Theorem 1 and related discussions). Consequently, any new analytical solutions of our proposed SDP condition will immediately lead to new 1-Lipschitz network structures.
* Built upon the above algebraic viewpoint, we give a rigorous mathematical interpretation for AOL explaining how this method promotes "almost orthogonality" in training (Theorem 2).
* Based on our SDPs, a new family of 1-Lipschitz network structures termed as SDP-based Lipschitz layers (SLL) has been developed. Specifically, we apply the Gershgorin circle theorem to obtain some new SDP solutions, leading to non-trivial extensions of CPL (Theorem 3). We derive new SDP conditions to characterize SLL in a very general form (Theorem 4).
* Finally, we show, by a comprehensive set of experiments, that our new SDP-based Lipschitz layers outperform previous approaches on certified robust accuracy.

Our work is inspired by Fazlyab et al. (2019) that develops SDP conditions for numerical estimation of Lipschitz constants of given neural networks. A main difference is that we focus on "analytical SDP solutions" which can be used to characterize 1-Lipschitz network structures.

## 2 Related Work

In recent years, certified methods have been central to the development of trustworthy machine learning and especially for deep learning. _Randomized Smoothing_(Cohen et al., 2019; Salman et al., 2019) is one of the first defenses to offer provable robustness guarantees. The method simply extends a given classifier by the smart introduction of random noise to enhance the robustness of the classifier. Although this method offers an interesting level of certified robustness, it suffers from important downsides such as the high computational cost of inference and some impossibility results from information-theory perspective (Yang et al., 2020; Kumar et al., 2020).

Another approach to certify the robustness of a classifier is to control its Lipschitz constant (Hein et al., 2017; Tsuzuku et al., 2018). The main idea is to derive a certified radius in the feature space by upper bounding the margin of the classifier. See Proposition 1 of Tsuzuku et al. (2018) for more details. This radius, along with the Lipschitz constant of the network can certify the robustness. In order to reduce the Lipschitz constant and have a non-trivial certified accuracy, Tsuzuku et al. (2018) and Leino et al. (2021) both upper bound the margin via computing a bound on the global Lipschitz constant, however, these bounds have proved to be loose. Instead of upper bounding the global Lipschitz constant, Huang et al. (2021) leverages _local_ information to get tighter bound on the Lipschitz constant. On the other hand, other works, instead of upper bounding the local or global Lipschitz, devised neural networks architecture that are provably 1-Lipschitz. One of the first approaches in this direction consists of normalizing each layer with its spectral norm (Miyato et al., 2018; Farnia et al., 2019). Each layer is, by construction, 1-Lipschitz. Later, a body of research replaces the normalized weight matrix by an orthogonal matrix. It improves upon the spectral normalization method by adding the gradient preservation (Li et al., 2019; Trockman et al., 2021; Singla et al., 2021; Yu et al., 2022; Xu et al., 2022). These methods constrain the parameters by orthogonality during training. Specifically, the Cayley transform can be used to constrain the weights (Trockman et al., 2021) and, in a similar fashion, SOC (Singla et al., 2021)
parameterizes their layers with the exponential of a skew symmetric matrix making it orthogonal. To reduce cost, Trockman et al. (2021), Yu et al. (2022), and Xu et al. (2022) orthogonalize their convolutional kernel in the Fourier domain.

More recently, a work by Meunier et al. (2022) has studied Lipschitz networks from a dynamical system perspective. Starting from the continuous view of a residual network, they showed that the parameterization with the Cayley transform (Trockman et al., 2021) and SOC (Singla et al., 2021) correspond respectively to two specific discretization schemes of the continuous flow. Furthermore, a new layer is derived from convex potential flows to ensure the 1-Lipschitz property1:

Footnote 1: We reverse the transposition from the original layer to have a consistent notation in the rest of the article.

\[z=x-\frac{2}{\|W\|_{2}^{2}}W\sigma(W^{\top}x+b), \tag{1}\]

where \(\|W\|_{2}\) is the spectral norm of the weight matrix \(W\) and \(\sigma\) is the ReLU activation function. In general, the training of orthogonal layers can be expensive. The Cayley approach involves a matrix inversion, and the implementation of SOC requires either an SVD or an iterative Taylor expansion. The CPL approach can be more efficient, although the computation of \(\|W\|_{2}\) is still needed.

A recent work, _Almost-Orthogonal-layer_ (AOL) (Prach et al., 2022) came up with a middle ground: a new normalization which makes the layer 1-Lipschitz by favoring orthogonality. The fully-connected AOL layer is defined as \(z=WDx+b\) where \(D\) is a diagonal matrix given by2:

Footnote 2: For simplicity, we assume all the columns of \(W\) have at least one non-zero entry. Then (2) is well defined.

\[D=\mathrm{diag}\left(\sum_{j}|W^{\top}W|_{ij}\right)^{-\frac{1}{2}} \tag{2}\]

They demonstrated that this layer is 1-Lipschitz and they empirically show that, after training, the Jacobian of the layer (with respect to \(x\)) is almost orthogonal, hence facilitating the training.

Another source of inspiration is the application of convex programs for robustness certification of neural networks (Wong et al., 2018; Raghunathan et al., 2018; Fazlyab et al., 2019; Revay et al., 2020; Fazlyab et al., 2020; Wang et al., 2022). The most relevant work is Fazlyab et al. (2019), which leverages the quadratic constraint approach from control theory (Megretski et al., 1997) to formulate SDPs for estimating the global Lipschitz constant of neural networks numerically. It is possible to solve such SDPs numerically for training relatively small Lipschitz networks (Pauli et al., 2021). However, due to the restrictions of existing SDP solvers, scalability has been one issue when deploying such approaches to deep learning problems with large data sets. Our focus is on the design of Lipschitz network structures, and we avoid the scalability issue via solving SDPs analytically.

## 3 Background

Notation.The \(n\times n\) identity matrix and the \(n\times n\) zero matrix are denoted as \(I_{n}\) and \(0_{n}\), respectively. The subscripts will be omitted when the dimension is clear from the context. When a matrix \(P\) is negative semidefinite (definite), we will use the notation \(P\preceq(\prec)0\). When a matrix \(P\) is positive semidefinite (definite), we will use the notation \(P\succeq(\succ)0\). Let \(e_{i}\) denote the vector whose \(i\)-entry is \(1\) and all other entries are \(0\). Given a collection of scalars \(\{a_{i}\}_{i=1}^{n}\), we use the notation \(\mathrm{diag}(a_{i})\) to denote the \(n\times n\) diagonal matrix whose \((i,i)\)-th entry is \(a_{i}\). For a matrix \(A\), the following notations \(A^{\mathsf{T}}\), \(\|A\|_{2}\), \(\mathrm{tr}(A)\), \(\sigma_{\min}(A)\), \(\|A\|_{F}\), and \(\rho(A)\) stand for its transpose, largest singular value, trace, smallest singular value, Frobenius norm, and spectral radius, respectively.

Lipschitz functions.A function \(f:\mathbb{R}^{n}\to\mathbb{R}^{m}\) is \(L\)-Lipschitz with respect to the \(\ell_{2}\) norm iff it satisfies \(\|f(x)-f(y)\|\leq L\|x-y\|\) for all \(x,y\in\mathbb{R}^{n}\), where \(\|\cdot\|\) stands for the \(\ell_{2}\) norm. An important fact is that the robustness of a neural network can be certified based on its Lipschitz constant (Tsuzuku et al., 2018). In this paper, we are interested in the case where \(L=1\). Specifically, we consider the training of 1-Lipschitz neural networks. If each layer of a neural network is 1-Lipschitz, then the entire neural network is also 1-Lipschitz. The Lipschitz constant also satisfies the triangle inequality, and hence convex combination will preserve the 1-Lipschitz property.
Matrix cones: Positive semidefiniteness and diagonal dominance.Let \(\mathbf{S}^{n}\) denote the set of all \(n\times n\) real symmetric matrices. Let \(\mathbf{S}^{n}_{+}\subset\mathbf{S}^{n}\) be the set of all \(n\times n\) symmetric positive semidefinite matrices. It is well known that \(\mathbf{S}^{n}_{+}\) is a closed-pointed convex cone in \(\mathbf{S}^{n}\). With the trace inner product, \(\mathbf{S}^{n}_{+}\) is also self-dual. Consider two symmetric matrices \(A\) and \(B\) such that \(A\succeq B\in\mathbf{S}^{n}\), then we have \(A-B\in\mathbf{S}^{n}_{+}\), and \(\operatorname{tr}(A-B)\) provides a distance measure between \(A\) and \(B\). In addition, we have \(\|A-B\|_{F}\leq\operatorname{tr}(A-B)\). Finally, the set of all \(n\times n\) real symmetric diagonally dominant matrices with non-negative diagonal entries is represented by \(\mathbf{D}^{n}\). It is known that \(\mathbf{D}^{n}\) forms a closed, pointed, full cone (Barker et al., 1975). Based on the Gershgorin circle theorem (Horn et al., 2012), we know \(\mathbf{D}^{n}\subset\mathbf{S}^{n}_{+}\). It is also known that \(\mathbf{D}^{n}\) is smaller than \(\mathbf{S}^{n}_{+}\)(Barker et al., 1975). For any \(A\in\mathbf{D}^{n}\), we have \(A_{ii}\geq\sum_{j:j\neq i}|A_{ij}|\). It is important to require \(A_{ii}\geq 0\), and the set of real symmetric diagonally dominant matrices is not a cone by itself.

## 4 An Algebraic Unification of 1-Lipschitz Layers

In this section, we present a unified algebraic perspective for various 1-Lipschitz layers (Spectral Normalization, Orthogonalization, AOL, and CPL) via developing a common SDP condition characterizing the Lipschitz property. Built upon our algebraic viewpoint, we also present a new mathematical interpretation explaining how AOL promotes orthogonality in training.

### The unifying Algebraic Condition

First, we present an algebraic condition which can be used to unify the developments of existing techniques such as SN, AOL, and CPL. Our main theorem is formalized below.

**Theorem 1**.: _For any weight matrix \(W\in\mathbb{R}^{m\times n}\), if there exists a nonsingular diagonal matrix \(T\) such that \(W^{\mathsf{T}}W-T\preceq 0\), then the two following statements hold true._

1. _The mapping_ \(g(x)=WT^{-\frac{1}{2}}x+b\) _is_ \(1\)_-Lipschitz,_
2. _The mapping_ \(h(x)=x-2WT^{-1}\sigma(W^{\mathsf{T}}x+b)\) _is_ \(1\)_-Lipschitz if_ \(\sigma\) _is ReLU,_ \(\tanh\) _or sigmoid._

The proof of the above theorem and some related control-theoretic interpretations are provided in the appendix. This theorem allows us to design different 1-Lipschitz layers just with various choices of \(T\), in two important cases: for a linear transformation with Statement 1, as well as for a residual and non-linear block with Statement 2. Moreover, for any given weight matrix \(W\), the condition \(W^{\mathsf{T}}W\preceq T\) is linear in \(T\), and hence can be viewed as an SDP condition with decision variable \(T\). To emphasize the significance of this theorem, we propose to derive existing methods used for designing 1-Lipschitz layers by choosing specific \(T\) for the SDP condition \(W^{\mathsf{T}}W\preceq T\). The 1-Lipschitz property is then automatically obtained.

* Spectral Normalization (SN) corresponds to an almost trivial choice if we notice that \(W^{\mathsf{T}}W\preceq\|W^{\mathsf{T}}W\|_{2}I\preceq\|W\|_{2}^{2}I\). Hence with \(T=\|W\|_{2}^{2}I\), we build the SN layer \(g(x)=WT^{-\frac{1}{2}}x+b=\frac{1}{\|W\|_{2}}Wx+b\).
* The Orthogonality-based parameterization is obtained by setting \(T=I\) and enforcing the equality \(W^{\mathsf{T}}W=T=I\). Then obviously \(g(x)=Wx+b\) is 1-Lipschitz.
* AOL formula can be derived by letting \(T=\operatorname{diag}(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij})\). With this choice, we have \(T-W^{\mathsf{T}}W\in\mathbf{D}^{n}\subset\mathbf{S}^{n}_{+}\), hence \(W^{\mathsf{T}}W\preceq T\). Then Statement 1 in Theorem 1 implies that the AOL layer, written as \(g(x)=WT^{-\frac{1}{2}}x+b\), is 1-Lipschitz.3 Footnote 3: For ease of exposition, our main paper always assumes that all the columns of \(W\) have at least one non-zero entry such that (2) is well defined. To drop this assumption, we can use a variant of Theorem 1 which replaces the SDP condition with a bilinear matrix inequality condition. We will discuss this point in the appendix.
* CPL follows the same SN choice \(T=\|W\|_{2}^{2}I\), but with Statement 2 of Theorem 1. Hence we derive a different function \(h(x)=x-\frac{1}{\|W\|_{2}^{2}}W\sigma(W^{\mathsf{T}}x+b)\) which is also 1-Lipschitz.

The above discussion illustrates the benefit of expressing all these methods within the same theoretical framework, offering us a new tool to characterize the similarity between different meth
ods. For instance, SN and CPL share the same choice of \(T=\|W\|_{2}^{2}I\). The difference between them is which statement is used. Hence CPL can be viewed as the "residual version" of SN. Clearly, the residual network structure allows CPL to address the gradient vanishing issue more efficiently than SN. With the same approach, we can readily infer from our unified algebraic condition what are the "residual" counterparts for orthogonality-based parameterization and AOL. For orthogonality-based parameterization, if we enforce \(W^{\mathsf{T}}W=T=I\) via methods such as SOC and ECO, then the function \(h(x)=x-2W\sigma(W^{\mathsf{T}}x+b)\) is 1-Lipschitz (by Statement 2 in Theorem 1). Finally, if we choose \(T=\operatorname{diag}\left(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij}\right)\), then the function \(h(x)=x-2W\operatorname{diag}\left(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij}\right)^ {-1}\sigma(W^{\mathsf{T}}x+b)\) is also 1-Lipschitz. Therefore it is straightforward to create new classes of 1-Lipschitz network structures from existing ones.

Another important consequence of Theorem 1 is about new layer development. Any new nonsingular diagonal solution \(T\) for the SDP condition \(W^{\mathsf{T}}W-T\preceq 0\) immediately leads to new 1-Lipschitz network structures in the form of \(g(x)=WT^{-\frac{1}{2}}x+b\) or \(h(x)=x-2WT^{-1}\sigma(W^{\mathsf{T}}x+b)\). Therefore, the developments of 1-Lipschitz network structures can be reformulated as finding analytical solutions of the matrix inequality \(W^{\mathsf{T}}W\preceq T\) with nonsingular diagonal \(T\). As a matter of fact, the Gershgorin circle theorem can help to improve the existing choices of \(T\) in a systematic way. In Section 5, we will discuss such new choices of \(T\) and related applications to improve CPL. At this point, it is worth noticing that to develop deep Lipschitz networks, it is important to have analytical formulas of \(T\). The analytical formula of \(T\) will enable a fast computation of \(WT^{-\frac{1}{2}}\) or \(WT^{-1}\).

Theorem 1 is powerful in building a connection between 1-Lipschitz network layers and the algebraic condition \(W^{\mathsf{T}}W\preceq T\). Next, we will look closer at this algebraic condition and provide a new mathematical interpretation explaining how AOL generates "almost orthogonal" weights.

**Remark 1**.: _The proof of Statement 2 in Theorem 1 relies on (Fazlyab et al., 2019, Lemma 1), which requires the activation function \(\sigma\) to be slope-restricted on \([0,1]\). Therefore, Statement 2 cannot be applied to the case with \(\sigma\) being the GroupSort activation function (Anil et al., 2019). In contrast, Statement 1 can be used to build neural networks with any activation functions which are 1-Lipschitz._

### A New Mathematical Interpretation for AOL

In Prach et al. (2022), it is observed that AOL can learn "almost orthogonal" weights and hence overcome the gradient vanishing issue. As a matter of fact, the choice of \(T\) used in AOL is optimal in a specific mathematical sense as formalized with the next theorem.

**Theorem 2**.: _Given any \(W\in\mathbb{R}^{m\times n}\) which does not have zero columns, define the set \(\mathbf{T}=\left\{T:T\text{ is nonsingular diagonal, and }T-W^{\mathsf{T}}W\in\mathbf{D}^{n}\right\}\). Then the choice of \(T\) for the AOL method actually satisfies_

\[T=\operatorname{diag}(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij})=\operatorname*{ arg\,min}_{T\in\mathbf{T}}\operatorname{tr}(I-T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{- \frac{1}{2}})=\operatorname*{arg\,min}_{T\in\mathbf{T}}\lVert T^{-\frac{1}{2} }W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}.\]

We defer the proof for the above result to the appendix. Here we provide some interpretations for the above result. Obviously, the quantity \(\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\) provides a measure for the distance between the scaled weight matrix \(WT^{-\frac{1}{2}}\) and the set of \(n\times n\) orthogonal matrices. If \(\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}=0\), then the scaled weight \(WT^{-\frac{1}{2}}\) is orthogonal. If \(\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\) is small, it means that \(WT^{-\frac{1}{2}}\) is "almost orthogonal" and close to the set of orthogonal matrices. Since we require \(W^{\mathsf{T}}W-T\preceq 0\), we know that \(I-T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}\) is a positive semidefinite matrix, and its trace provides an alternative metric quantifying the distance between \(WT^{-\frac{1}{2}}\) and the set of orthogonal matrices. Importantly, we have the following inequality:

\[\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\leq \operatorname{tr}(I-T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}).\]

If \(\operatorname{tr}(I-T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}})\) is small, then \(\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\) is also small, and \(WT^{-\frac{1}{2}}\) is close to the set of orthogonal matrices. Therefore, one interpretation for Theorem 2 is that among all the nonsingular diagonal scaling matrices \(T\) satisfying \(T-W^{\mathsf{T}}W\in\mathbf{D}^{n}\), the choice of \(T\) used in AOL makes the scaled weight matrix \(WT^{-\frac{1}{2}}\) the closest to the set of orthogonal matrices. This provides a new mathematical explanation of how AOL can generate "almost orthogonal" weights.
One potential issue for AOL is that \(\mathbf{D}^{n}\) is typically much smaller than \(\mathbf{S}^{n}_{+}\), and the condition \(T-W^{\mathsf{T}}W\in\mathbf{D}^{n}\) may be too conservative compared to the original condition \(T-W^{\mathsf{T}}W\in\mathbf{S}^{n}_{+}\) in Theorem 1. If we denote the set \(\hat{\mathbf{T}}=\left\{T:T\text{ is nonsingular diagonal, and }T-W^{\mathsf{T}}W\in\mathbf{S}^{n}_{+}\right\}\), then we have \(\arg\min_{T\in\hat{\mathbf{T}}}\operatorname{tr}(I-T^{-\frac{1}{2}}W^{\mathsf{ T}}WT^{-\frac{1}{2}})\leq\arg\min_{T\in\mathbf{T}}\operatorname{tr}(I-T^{- \frac{1}{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}})\), and \(\arg\min_{T\in\hat{\mathbf{T}}}\lVert T^{-\frac{1}{2}}W^{\mathsf{T}}WT^{- \frac{1}{2}}-I\rVert_{F}\leq\arg\min_{T\in\hat{\mathbf{T}}}\lVert T^{-\frac{1 }{2}}W^{\mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\). This leads to interesting alternative choices of \(T\) which can further promote orthogonality:

\[T=\operatorname*{arg\,min}_{T\in\hat{\mathbf{T}}}\lVert T^{-\frac{1}{2}}W^{ \mathsf{T}}WT^{-\frac{1}{2}}-I\rVert_{F}\quad\text{or}\quad T=\operatorname*{ arg\,min}_{T\in\hat{\mathbf{T}}}\operatorname{tr}(I-T^{-\frac{1}{2}}W^{ \mathsf{T}}WT^{-\frac{1}{2}}) \tag{3}\]

Although (3) may be solved as convex programs on small toy examples, it is not practical to use such choice of \(T\) for large-scale problems. It is our hope that our theoretical discussion above will inspire more future research on developing new practical choices of \(T\) for promoting orthogonality.

## 5 Extensions of CPL: The Power of Gershgorin circle theorem

In this section, we extend the original CPL layer (5) to a new family of 1-Lipschitz network structures via providing new analytical solutions to our condition \(W^{\mathsf{T}}W\preceq T\). We term this general family of layers as SDP-based Lipschitz layers (SLL), since the condition \(W^{\mathsf{T}}W\preceq T\) can be viewed as an SDP for the decision variable \(T\). First of all, we extend the existing CPL (Eq. (1)) via applying more general choices of \(T\) with Theorem 1. From the discussion after Theorem 1, we already know that we can use the choice of \(T=\operatorname{diag}(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij})\) to replace the original choice \(T=\lVert W\rVert_{2}^{2}I\). In this section, we will strengthen CPL via an even more general choice of \(T\), which is based on a special version of Gershgorin circle theorem. Specifically, we will apply (Horn et al., 2012, Corollary 6.1.6) to show the following result.

**Theorem 3**.: _Let \(W\) be the weight matrix. Suppose \(T\) is a nonsingular diagonal matrix. If there exists some diagonal matrix \(Q\) with all positive diagonal entries such that \((T-QW^{\mathsf{T}}WQ^{-1})\) is a real diagonally dominant matrix with diagonal entries being all positive, then \(T\succeq W^{\mathsf{T}}W\), and the function \(h(x)=x-2WT^{-1}\sigma(W^{\mathsf{T}}x+b)\) is 1-Lipschitz for \(\sigma\) being ReLU, \(\tanh\) or sigmoid._

We defer the proof of this result to the appendix. If we choose \(Q=I\), the above theorem just recovers the choice of \(T\) used in AOL, i.e. \(T=\operatorname{diag}(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij})\). However, it is expected that the use of more general \(Q\) will allow us to train a less conservative 1-Lipschitz neural network due to the increasing expressivity brought by these extra variables. We will present numerical results to demonstrate this. We also emphasize that \((T-QW^{\mathsf{T}}WQ^{-1})\) is typically not a symmetric matrix and hence is not in \(\mathbf{D}^{n}\) even when it only has non-negative eigenvalues. However, this does not affect our proof on the positive-semidefiniteness of \((T-W^{\mathsf{T}}W)\).

Application of Theorem 3.We can parameterize \(Q^{-1}=\operatorname{diag}(q_{i})\) with \(q_{i}>0\). Then the \((i,j)\)-th entry of \(QW^{\mathsf{T}}WQ^{-1}\) is equal to \((W^{\mathsf{T}}W)_{ij}q_{j}/q_{i}\). Hence we can just set the diagonal entry of \(T\) as

\[T_{ii}=\sum_{j=1}^{n}|(W^{\mathsf{T}}W)_{ij}q_{j}/q_{i}|=\sum_{j=1}^{n}|W^{ \mathsf{T}}W|_{ij}\frac{q_{j}}{q_{i}}. \tag{4}\]

This leads to our new choice of \(T=\operatorname{diag}(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij}q_{j}/q_{i})\). Notice that the layer function \(h(x)=x-2WT^{-1}\sigma(W^{\mathsf{T}}x+b)\) has a residual network structure. Hence it is expected that vanishing gradient will not be an issue. Therefore, we can simultaneously optimize the training loss over \(W\) and \(\{q_{i}\}\). We will present a numerical study to demonstrate that such a training approach will allow us to generate competitive results on training certifiably robust classifiers.

SDP conditions for more general network structures.It is also worth mentioning that the SDP condition in Theorem 1 can be generalized to address the following more general structure:

\[h(x)=Hx+G\sigma(W^{\mathsf{T}}x+b), \tag{5}\]

where \(H\) and \(G\) will be determined by the weight \(W\) in some manner, and the matrix dimensions are assumed to be compatible. If we choose \(H=I\) and \(G=-2WT^{-1}\), then (5) reduces to the residual network structure considered in Theorem 1. There are many other choices of \((H,G)\) which can also ensure (5) to be 1-Lipschitz. Our last theoretical result is a new SDP condition which generalizes Theorem 1 and provides a more comprehensive characterization of such choices of \((H,\bar{G})\).
**Theorem 4**.: _Let \(n\) be the neuron number. For any non-negative scalars \(\{\lambda_{i}\}_{i=1}^{n}\), define_

\[\Lambda=\operatorname{diag}(\lambda_{1},\lambda_{2},\ldots,\lambda_{n}). \tag{6}\]

_Suppose the activation function \(\sigma\) is ReLU or \(\tanh\) or sigmoid. If there exist non-negative scalars \(\{\lambda_{i}\}_{i=1}^{n}\) such that the following matrix inequality holds_

\[\begin{bmatrix}I-H^{\mathsf{T}}H&-H^{\mathsf{T}}G-W\Lambda\\ -G^{\mathsf{T}}H-\Lambda W^{\mathsf{T}}&2\Lambda-G^{\mathsf{T}}G\end{bmatrix}\succeq 0 \tag{7}\]

_then the network layer (5) is \(1\)-Lipschitz, i.e., \(\|h(x)-h(y)\|\leq\|x-y\|\) for all \((x,y)\)._

The above theorem can be proved via modifying the argument used in Fazlyab et al. (2019, Theorem 1)4 and we defer the detailed proof to the appendix. On one hand, if we choose \(H=0\), then our condition (7) reduces to a variant of Theorem 1 in Fazlyab et al. (2019).5 On the other hand, for residual network structure with \(H=I\), we can choose \(T=2\Lambda^{-1}\) and \(G=-W\Lambda=-2WT^{-1}\) to reduce (7) to our original algebraic condition \(T\succeq W^{\mathsf{T}}W\). Therefore, Theorem 4 provides a connection between the SDP condition in Fazlyab et al. (2019) and our proposed simple algebraic condition in Theorem 1. It is possible to obtain new 1-Lipschitz network layers via providing new analytical solutions to (7). It is our hope that our proposed SDP condition (7) can lead to many more 1-Lipschitz network structures in the future.

Footnote 4: As commented in Pauli et al. (2021), such a modification works as long as \(\Lambda\) is diagonal.

## 6 Experiments

In this section, we present a comprehensive set of experiments with 1-Lipschitz neural networks based on our proposed _SDP-based Lipschitz Layer_. More specifically, we build 1-Lipschitz neural networks based on the following layer:

\[h(x)=x-2W\operatorname{diag}\left(\sum_{j=1}^{n}|W^{\mathsf{T}}W|_{ij}q_{j}/q_ {i}\right)^{-1}\sigma(W^{\mathsf{T}}x+b), \tag{8}\]

where \(W\) is a parameter matrix being either dense or a convolution, \(\{q_{i}\}\) forms a diagonal scaling matrix as described by Theorem 3, and \(\sigma(\cdot)\) is the ReLU nonlinearity function. We use the same architectures proposed by Meunier et al. (2022) with _small_, _medium_, _large_ and _xlarge_ sizes. The architecture consists of several Conv-SLL and Linear-SLL. For CIFAR-100, we use the Last Layer Normalization proposed by Singla et al. (2022b) which improves the certified accuracy when the number of classes becomes large. Note that the layer presented in Equation (8) can be easily implemented with convolutions following the same scaling as in Prach et al. (2022). Our experiments focus on the impact of the Lipschitz layer structures on certified robustness. This complements a recent study on other aspects (e.g. projection pooling) of robust networks (Singla et al., 2022a).

\begin{table}
\begin{tabular}{l r r r r r r r} \hline \hline \multirow{2}{*}{**Models**} & \multirow{2}{*}{**Natural**} & \multicolumn{3}{c}{**Provable Accuracy (\(\varepsilon\))**} & \multicolumn{2}{c}{**Number of**} & \multicolumn{1}{c}{**Time by**} \\ \cline{3-8}  & & \multicolumn{1}{c}{**Accuracy**} & \multicolumn{1}{c}{\(\frac{36}{255}\)} & \multicolumn{1}{c}{\(\frac{72}{255}\)} & \multicolumn{1}{c}{\(\frac{108}{255}\)} & \multicolumn{1}{c}{\(1\)} & **Parameters** & **Epoch (s)** \\ \hline
**GloRo**(Leino et al., 2021) & 77.0 & 58.4 & - & - & - & 8M & 6 \\
**Local-Lip-B**(Huang et al., 2021b) & 77.4 & 60.7 & 39.0 & 20.4 & - & 2.3M & 8 \\
**Cayley Large**(Trockman et al., 2021) & 74.6 & 61.4 & 46.4 & 32.1 & - & 21M & 30 \\
**SOC 20**(Singla et al., 2021) & 78.0 & 62.7 & 46.0 & 30.3 & - & 27M & 52 \\
**SOC + 20**(Singla et al., 2022b) & 76.3 & 62.6 & 48.7 & 36.0 & - & 27M & 52 \\
**CPL XL**(Meunier et al., 2022) & 78.5 & 64.4 & 48.0 & 33.0 & - & 236M & 163 \\
**AOL Large**(Pach et al., 2022) & 71.6 & 64.0 & 56.4 & 49.0 & 23.7 & 136M & 64 \\ \hline
**SLL Small** & 71.2 & 62.6 & 53.8 & 45.3 & 20.4 & 41M & 20 \\
**SLL Medium** & 72.2 & 64.3 & 56.0 & 48.3 & 23.9 & 78M & 35 \\
**SLL Large** & 72.7 & 65.0 & 57.3 & 49.7 & 25.4 & 118M & 55 \\
**SLL X-Large** & 73.3 & 65.8 & 58.4 & 51.3 & 27.3 & 236M & 105 \\ \hline \hline \end{tabular}
\end{table}
Table 1: This table presents the natural, provable accuracy as well as the number of parameters and training time of several concurrent work and our SLL networks on CIFAR10 dataset. All results for SLL networks are the result of the average of 3 trainings.
**Details on the architectures & Hyper-parameters.** Table 3 describes the detail of our Small, Medium, Large and X-Large architectures. We trained our networks with a batch size of 256 over 1000 epochs with the data augmentation used by. We use an Adam optimizer (Kingma et al., 2014) with \(0.01\) learning rate and parameters \(\beta_{1}\) and \(\beta_{2}\) equal to \(0.5\) and \(0.9\) respectively and no weight decay. We use a piecewise triangular learning rate scheduler to decay the learning rate during training. We use the CrossEntropy loss as in Prach et al. (2022) with a temperature of \(0.25\) and an offset value \(\frac{3}{2}\sqrt{2}\).

**Results in terms of Natural and Certified Accuracy on CIFAR10/100.** First, we evaluate our networks (SLL) on CIFAR10 and CIAFR100 and compute the results against recent 1-Lipschitz neural network structures: Cayley, SOC, SOC+, CPL and AOL. We also compare SLL with two other Lipschitz training approaches (Leino et al., 2021; Huang et al., 2021b), which do not guarantee prescribed global Lipschitz bounds during the training stage. Table 1 presents the natural and certified accuracy with different radius of certification on CIFAR10. For a fair comparison, parameter number and training time per epoch for each method are also added to Table 1. Results on CIFAR100 are included in Table 2. We can see that our approach outperforms existing 1-Lipschitz architectures including AOL and CPL on certified accuracy for all values of \(\varepsilon\). We also observe that SLL-based 1-Lipschitz neural networks offer a good trade-off among previous approaches with respect to natural and certified accuracy. A detailed comparison is given below.

**Advantages of SLL over Cayley/SOC.** In general, it is difficult to compare the expressive power of non-residual and residual networks. Hence we do not claim that with the same model size, SLL is more representative than Cayley or SOC which are not residual networks in the first place. However, we believe that the current choice of \(T\) in SLL is very easy to calculate and hence leads to a scalable approach that allows us to train very large models with a reasonable amount of time. For illustrative purposes, consider the comparison between SLL and Cayley in Table 1. We can see that SLL Small has more parameters than Cayley Large (41M vs. 21M) while being faster to train. Indeed, the Cayley approach involves computing an expensive orthogonal projection (with a matrix inverse), while SOC requires to the computation of several convolutions at training and inference (from 6 to 12) to compute the exponential of a convolution up to a desired precision. Hence the training time per epoch for Cayley Large and SOC is actually longer than SLL Small. While being faster to train SLL Small still outperforms Cayley Large and SOC for all three values of \(\varepsilon\). In general, we think it is fair to claim that our approach is more scalable than previous approaches based on orthogonal layers, and allows the use of larger networks which leads to improvements in certified robustness.

\begin{table}
\begin{tabular}{l l c c c c c} \hline \hline \multirow{2}{*}{**Datasets**} & \multirow{2}{*}{**Models**} & \multirow{2}{*}{**Natural**} & \multicolumn{4}{c}{**Provable Accuracy (\(\varepsilon\))**} \\ \cline{3-6}  & & & \(\frac{36}{25}\) & \(\frac{72}{25}\) & \(\frac{108}{25}\) & \(1\) \\ \hline \multirow{8}{*}{CIFAR100} & **Cayley Large** (Trockman et al., 2021) & 43.3 & 29.2 & 18.8 & 11.0 & - \\  & **SOC 20** (Singla et al., 2021) & 48.3 & 34.4 & 22.7 & 14.2 & - \\  & **SOC+ 20** (Singla et al., 2022b) & 47.8 & 34.8 & 23.7 & 15.8 & - \\  & **CPL XL** (Meunier et al., 2022) & 47.8 & 33.4 & 20.9 & 12.6 & - \\  & **AOL Large** (Prach et al., 2022) & 43.7 & 33.7 & 26.3 & 20.7 & 7.8 \\
Advantages of SLL over AOL/CPL.With careful tuning of the offset value, SLL outperforms AOL for all values of \(\varepsilon\). We experiment with several offset values: \(\sqrt{2}\), \(\frac{3}{2}\sqrt{2}\) and \(2\sqrt{2}\). The detailed results for all these different offset values are deferred to Table 6 in the appendix. In general, the offset value offers a trade-off between natural accuracy and robustness, thus, by choosing the offset value properly, SLL Large already achieves better results than AOL Large (notice that the training time per epoch for these two is roughly the same). SLL X-Large has even more improvements. We can also see that SLL Large outperforms CPL XL for all values of \(\varepsilon\) while being faster to train. For larger value of \(\varepsilon\), the gain of SLL over CPL is remarkable (over 10%).

Results on TinyImageNet.We have also implemented SLL on TinyImageNet (see Table 2). Previously, other 1-Lipschitz network structures including SOC, Cayley, AOL, and CPL have not been tested on TinyImageNet, and the state-of-the-art approach on TinyImageNet is the local Lipschitz bound approach (Huang et al., 2021). We can see that SLL significantly outperforms this local Lipschitz approach for larger values of \(\varepsilon\) (while generating similar results for the small \(\varepsilon\) case). Notice that the local Lipschitz approach (Huang et al., 2021) is quite different from other 1-Lipschitz network methods in the sense that it has no guarantees on the Lipschitz constant of the resultant network and hence does not generate 1-Lipschitz networks in the first place. Furthermore, given that this approach does not guarantee a Lipschitz bound during training, a lot more computation needs to be performed during inference, making the certification process very time consuming. Table 4 describes the inference time on TinyImageNet for this local Lipschitz approach and SLL X-large.

Results on Empirical Robustness.We also provide results of our approach on empirical robustness against an ensemble of diverse parameter-free attacks (_i.e._, _AutoAttacks_) developed by Croce et al. (2020). Table 5 reports the empirical robustness accuracy for different levels of perturbations. Although _AutoAttacks_ is a strong empirical attack consisting of an ensemble of several known attacks: APGDCE, APGDLR, FAB (Croce et al., 2020) and Square (Andriushchenko et al., 2020). We can observe that the measure robustness is high and well above the certified radius. Indeed, on CIFAR10, we observe a robustness "gain" of up to 4.5%, 9.6%, 14.1% and 21.7% for respectively, 36, 72, 108 and 255 \(\varepsilon\)-perturbations.

## 7 Conclusion

In this paper, we present a unifying framework for designing Lipschitz layers. Based on a novel algebraic perspective, we identify a common SDP condition underlying the developments of spectral normalization, orthogonality-based methods, AOL, and CPL. Furthermore, we have shown that AOL and CPL can be re-derived and generalized using our theoretical framework. From this analysis, we introduce a family of SDP-based Lipschitz layers (SLL) that outperforms previous work. In the future, it will be interesting to investigate more expressive structures of \(T\) and extending our contributions to address multi-layer neural networks.

\begin{table}
\begin{tabular}{l c} \hline \hline
**Models** & **Inference Time** \\ \hline
**Local-Lip-B** & 41 min \\
**SLL X-Large** & 8 sec \\ \hline \hline \end{tabular}
\end{table}
Table 4: Inference time for Local-Lip-B and SLL X-Large on the full TinyImageNet validation with 4 GPUs.

\begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline \multirow{2}{*}{**Models**} & \multicolumn{3}{c}{**CIFAR10 \(-\)_AutoAttack_ (\(\varepsilon\))} & \multicolumn{3}{c}{**CIFAR100 \(-\)_AutoAttack_ (\(\varepsilon\))} \\ \cline{2-9}  & \(\frac{36}{255}\) & \(\frac{72}{255}\) & \(\frac{108}{255}\) & \(1\) & \(\frac{36}{255}\) & \(\frac{72}{255}\) & \(\frac{108}{255}\) & \(1\) \\ \hline
**SLL Small** & 68.1 & 62.5 & 56.8 & 35.0 & 40.7 & 35.2 & 30.4 & 17.0 \\
**SLL Medium** & 69.1 & 63.8 & 58.4 & 37.0 & 41.5 & 36.4 & 31.5 & 17.9 \\
**SLL Large** & 69.8 & 64.5 & 59.1 & 37.9 & 42.1 & 37.1 & 32.6 & 18.7 \\
**SLL X-Large** & 70.3 & 65.4 & 60.2 & 39.4 & 42.7 & 37.8 & 33.2 & 19.5 \\ \hline \hline \end{tabular}
\end{table}
Table 5: The table describes the empirical robustness of our SLL-based classifiers on CIFAR10 ans CIFAR100 datasets. The empirical robustness is measured with _AutoAttacks_. All results are the average of 3 models.
#### Acknowledgments

This work was performed using HPC resources from GENCI-IDRIS (Grant 2021-AD011013259) and funded by the French National Research Agency (ANR SPEED-20-CE23-0025). A. Havens and B. Hu are generously supported by the NSF award CAREER-2048168.
