Year: 2021

Abstract:
Deep learning has achieved many breakthroughs in modern classification tasks. Numerous architectures have been proposed for different data structures but when it comes to the loss function, the cross-entropy loss is the predominant choice. Recently, several alternative losses have seen revived interests for deep classifiers. In particular, empirical evidence seems to promote square loss but a theoretical justification is still lacking. In this work, we contribute to the theoretical understanding of square loss in classification by systematically investigating how it performs for overparametrized neural networks in the neural tangent kernel (NTK) regime. Interesting properties regarding the generalization error, robustness, and calibration error are revealed. We consider two cases, according to whether classes are separable or not. In the general non-separable case, fast convergence rate is established for both misclassification rate and calibration error. When classes are separable, the misclassification rate improves to be exponentially fast. Further, the resulting margin is proven to be lower bounded away from zero, providing theoretical guarantees for robustness. We expect our findings to hold beyond the NTK regime and translate to practical settings. To this end, we conduct extensive empirical studies on practical neural networks, demonstrating the effectiveness of square loss in both synthetic low-dimensional data and real image data. Comparing to crossentropy, square loss has comparable generalization error but noticeable advantages in robustness and model calibration.

heading: 1 INTRODUCTION
text: The pursuit of better classifiers has fueled the progress of machine learning and deep learning research. The abundance of benchmark image datasets, e.g., MNIST, CIFAR, ImageNet, etc., provides test fields for all kinds of new classification models, especially those based on deep neural networks (DNN). With the introduction of CNN, ResNets, and transformers, DNN classifiers are constantly improving and catching up to the human-level performance. In contrast to the active innovations in model architecture, the training objective remains largely stagnant, with cross-entropy loss being the default choice. Despite its popularity, cross-entropy has been shown to be problematic in some applications. Among others, Yu et al. (2020) argued that features learned from cross-entropy lack interpretability and proposed a new loss aiming for maximum coding rate reduction. Pang et al. (2019) linked the use of cross-entropy to adversarial vulnerability and proposed a new classification loss based on latent space matching. Guo et al. (2017) discovered that the confidence of most DNN classifiers trained with cross-entropy is not well-calibrated.
Recently, several alternative losses have seen revived interests for deep classifiers. In particular, many existing works have presented empirical evidence promoting the use of square loss over crossentropy. Hui & Belkin (2020) conducted large-scale experiments comparing the two and found that square loss tends to perform better in natural language processing related tasks while cross-entropy usually yields slightly better accuracy in image classification. Similar comparisons are also made in Demirkaya et al. (2020). Kornblith et al. (2020) compared a variety of loss functions and output layer regularization strategies on the accuracy and out-of-distribution robustness, and found that square loss has greater class separation and better out-of-distribution robustness.
In comparison to the empirical investigation, theoretical understanding of square loss in training deep learning classifiers is still lacking. Through our lens, square loss has its uniqueness among
classic classification losses, and we argue that it has great potentials for modern classification tasks. Below we list our motivations and reasons why.
Explicit feature modeling Deep learning’s success can be largely attributed to its superior ability as feature extractors. For classification, the ideal features should be separated between classes and concentrated within classes. However, when optimizing cross-entropy loss, it’s not clear what the learned features should look like (Yu et al., 2020). In comparison, square loss uses the label codings (one-hot, simplex etc.) as features, which can be modeled explicitly to control class separations.
Model Calibration An ideal classifier should not only give the correct class prediction, but also with the correct confidence. Calibration error measures the closeness of the predicted confidence to the underlying conditional probability ⌘. Using square loss in classification can be essentially viewed as regression where it treats discrete labels as continuous code vectors. It can be shown that the optimal classifier under square loss is 2⌘ 1, linear with the ground truth. This distinguishing property allows it to easily recover ⌘. In comparison, the optimal classifiers under the hinge loss and cross-entropy are sign(2⌘ 1) and log( ⌘1 ⌘ ), respectively. Therefore, hinge loss doesn’t provide reliable information on the prediction confidence, and cross-entropy can be problematic when ⌘ is close to 0 or 1 (Zhang, 2004). Hence, in terms of model calibration, square loss is a natural choice.
Connections to popular approaches Mixup (Zhang et al., 2017) is a popular data augmentation technique where augmented data are constructed via convex combinations of inputs and their labels. Like in square loss, mixup treats labels as continuous and is shown to improve the generalization of DNN classifiers. In knowledge distillation (Hinton et al., 2015), where a student classifier is trying to learn from a trained teacher, Menon et al. (2021) proved that the “optimal” teacher with the ground truth conditional probabilities provides the lowest variance in student learning. Since classifiers trained using square loss is a natural consistent estimator of ⌘, one can argue that it is a better teacher. In supervised contrastive learning (Khosla et al., 2020), the optimal features are the same as those from square loss with simplex label coding (Graf et al., 2021) (details in Section 4).
Despite its lack of popularity in practice, square loss has many advantages that can be easily overlooked. In this work, we systematically investigate from a statistical estimation perspective, the properties of deep learning classifiers trained using square loss. The neural networks in our analysis are required to be sufficiently overparametrized in the neural tangent kernel (NTK) regime. Even though this restricts the implication of our results, it is a necessary first step towards a deeper understanding. In summary, our main contributions are:
• Generalization error bound: We consider two cases, according to whether classes are separable or not. In the general non-separable case, we adopt the classical binary classification setting with smooth conditional probability. Fast rate of convergence is established for overparametrized neural network classifiers with Tsybakov’s noise condition. If two classes are separable with positive margins, we show that overparametrized neural network classifiers can provably reach zero misclassification error with probability exponentially tending to one. To the best of our knowledge, this is the first such result for separable but not linear separable classes. Furthermore, we bridge these two cases and offer a unified view by considering auxiliary random noise injection.
• Robustness (margin property): When two classes are separable, the decision boundary is not unique and large-margin classifiers are preferred. In the separable case, we further show that the decision boundary of overparametrized neural network classifiers trained by square loss cannot be too close to the data support and the resulting margin is lower bounded away from zero, providing theoretical guarantees for robustness.
• Calibration error: We show that classifiers trained using square loss are inherently well-calibrated, i.e., the trained classifier provides consistent estimation of the ground-truth conditional probability in L1 norm. Such property doesn’t hold for cross-entropy.
• Empirical evaluation: We corroborate our theoretical findings with empirical experiments in both synthetic low-dimensional data and real image data. Comparing to cross-entropy, square loss has comparable generalization error but noticeable advantages in robustness and model calibration.
This work contributes towards the theoretical understanding of deep classifiers, from an estimation point of view, which has been a classic topic in statistics literature. Among others, Mammen & Tsybakov (1999) established the optimal convergence rate for 0-1 loss excess risk when the decision boundary is smooth. Zhang (2004); Bartlett et al. (2006) extended the analysis to various surrogate
losses. Audibert & Tsybakov (2007); Kohler & Krzyzak (2007) studied the convergence rates for plug-in classifiers from local averaging estimators. Steinwart et al. (2007) investigated the convergence rate for support vector machine using Gaussian kernels. We build on and extend classic results to neural networks in the NTK regime. Comparing to existing works on deep learning classification, e.g., Kim et al. (2018) derived fast convergence rates of ReLU DNN classifiers that minimize the empirical hinge loss, our results incorporate the training algorithm and apply to trained classifiers.
We require the neural network to be overparametrized, which has been extensively studied recently, under the umbrella term NTK. Most such results are in the regression setting with a handful of exceptions. Ji & Telgarsky (2019) showed that only polylogarithmic width is sufficient for gradient descent to overfit the training data using logistic loss. Hu et al. (2020) proved generalization error bound for regularized NTK in classification. Cao & Gu (2019; 2020) provided optimization and generalization guarantees for overparametrized network trained with cross-entropy. In comparison, our results are sharper in the sense that we take the ground truth data assumptions into consideration. This allows a faster convergence rate, especially when the classes are separable, where the exponential convergence rate is attainable. The NTK framework greatly reduces the technical difficulty for our theoretical analysis. However, our results are mainly due to properties of the square loss itself and we expect them to hold for a wide range of classifiers.
There are other works investigating the use of square loss for training (deep) classifiers. Han et al. (2021) uncovered that the “neural collapse” phenomenon also occurs under square loss where the last-layer features eventually collapse to their simplex-style class-means. Muthukumar et al. (2020) compared classification and regression tasks in the overparameterized linear model with Gaussian features, illustrating different roles and properties of loss functions used at the training and testing phases. Poggio & Liao (2019) made interesting observations on effects of popular regularization techniques such as batch normalization and weight decay on the gradient flow dynamics under square loss. These findings support our theoretical results’ implication, which further strengthens our beliefs that the essence comes from the square loss and our analysis can go beyond NTK regime.
The rest of this paper is arranged as follows. Section 2 presents some preliminaries. Main theoretical results are in Section 3. The simplex label coding is discussed in Section 4 followed by numerical studies in Section 5 and conclusions in Section 6. Technical proofs and details of the numerical studies can be found in the Appendix.

heading: 2 PRELIMINARIES
text: Notation For a function f : ⌦ ! R, let kfk1 = supx2⌦ |f(x)| and kfkp = ( R ⌦ |f(x)|
pdx)1/p. For a vector x, kxkp denotes its p-norm, for 1  p  1. Lp and lp are used to distinguish function norms and vector norms. For two positive sequences {an}n2N and {bn}n2N, we write an . bn if there exists a constant C > 0 such that an  Cbn for all sufficiently large n. We write an ⇣ bn if an . bn and bn . an. Let [N ] = {1, . . . , N} for N 2 N, I be the indicator function, and Id be the d⇥ d identity matrix. N(µ,⌃) represents Gaussian distribution with mean µ and covariance ⌃. Classification problem settings Let P be an underlying probability measure on ⌦ ⇥ Y , where ⌦ ⇢ Rd is compact and Y = {1, 1}. Let (X,Y ) be a random variable with respect to P . Suppose we have observations {(xi, yi)}ni=1 ⇢ (⌦ ⇥ Y )n i.i.d. sampled according to P . The classification task is to predict the unobserved label y given a new input x 2 ⌦. Let ⌘ defined on ⌦ denote the conditional probability, i.e., ⌘(x) = P(y = 1|x). Let PX be the marginal distribution of P on X . The key quantity of interest is the misclassification error, i.e., 0-1 loss. In the population level, the 0-1 loss can be written as
L(f) = E(X,Y )⇠P I{sign(f(X)) 6= Y } =EX⇠PX [(1 ⌘(X))I{f(X) 0}+ ⌘(X)I{f(X) < 0}], (2.1)
where the expectation is taken with respect to the probability measure P . Clearly, an optimal classifier with the minimal 0-1 loss is 2⌘ 1. According to whether labels are deterministic, there are two scenarios of interest. If ⌘ only takes values from {0, 1}, i.e., labels are deterministic, we call this case the separable case1. Let ⌦1 =
1In the separable case we consider, the classes are not limited to linearly separable but can be arbitrarily complicated.
{x|⌘(x) = 1}, ⌦2 = {x|⌘(x) = 0} and ⌦ = ⌦1 [ ⌦2. If the probability measure of {x|⌘(x) 2 (0, 1)} is non-zero, i.e., the labels contain randomness, we call this case the non-separable case. In the separable case, we further assume that there exists a positive margin, i.e., dist(⌦1,⌦2) 2 > 0, where is a constant, and dist(⌦1,⌦2) = infx2⌦1,x02⌦2 kx x0k2. In the non-separable case, to quantify the difficulty of classification, we adopt the well-established Tsybakov’s noise condition (Audibert & Tsybakov, 2007), which measures how large the “difficult region” is where ⌘(x) ⇡ 1/2. Definition 2.1 (Tsybakov’s noise condition). Let  2 [0,1]. We say P has Tsybakov noise exponent  if there exists a constant C, T > 0 such that for all 0 < t < T , PX(|2⌘(X) 1| < t)  C ·t.
A large value of  implies the difficult region to be small. It is expected that a larger  leads to a faster convergence rate of a neural network classifier. This intuition is verified for the overparametrized neural network classifier trained by square loss and `2 regularization. See Section 3 for more details.
Neural network setup We mainly focus on the one-hidden-layer ReLU neural network family F with m nodes in the hidden layer, denoted by
fW ,a(x) = 1p m
mX
r=1
ar (W > r x),
where x 2 ⌦, W = (W1, · · · ,Wm) 2 Rd⇥m is the weight matrix in the hidden layer, a = (a1, · · · , am)> 2 Rm is the weight vector in the output layer, (z) = max{0, z} is the rectified linear unit (ReLU). The initial values of the weights are independently generated from
Wr(0) ⇠ N(0, ⇠2Im), ar ⇠ unif{ 1, 1}, 8r 2 [m]. Based on the observations {(xi, yi)}ni=1, the goal of training a neural network is to find a solution to
min W
nX
i=1
l(fW ,a(xi), yi) + µR(W ,a), (2.2)
where l is the loss function, R is the regularization, and µ 0 is the regularization parameter. Note in Equation 2.2 that we only consider training the weights W . This is because a · (z) = sign(a) · (|a|z), which allows us to reparametrize the network to have all ai’s to be either 1 or 1. In this work, we consider square loss associated with `2 regularization, i.e., l(fW ,a(xi), yi) = (fW ,a(xi) yi)2 and R(W ,a) = kW k22. A popular way to train the neural network is via gradient based methods. It has been shown that the training process of DNNs can be characterized by the neural tangent kernel (NTK) (Jacot et al., 2018). As is usually assumed in the NTK literature (Arora et al., 2019; Hu et al., 2020; Bietti & Mairal, 2019; Hu et al., 2021), we consider data on the unit sphere Sd 1, i.e., kxik2 = 1, 8i 2 [n], and the neural network is highly overparametrized (m n) and trained by gradient descent (GD). For details about NTK and GD in one-hidden-layer ReLU neural networks, we refer to Appendix A. In the rest of this work, we use fW (k),a to denote the GD-trained neural network classifier under square loss associated with `2 regularization, where k is the iteration number satisfying Assumption D.1 and W (k) is the weight matrix after k-th iteration.

heading: 3 THEORETICAL RESULTS
text: In this section, we present our main theoretical results. Throughout the analysis, we assume that the overparametrized neural network fW ,a and the training process via GD satisfy Assumption D.1 (see Appendix D), which essentially requires the neural network to be sufficiently overparametrized (with a finite width), and imposes conditions on the learning rate and iteration number. Our theoretical results consist of three parts: generalization error, robustness, and calibration error.

heading: 3.1 GENERALIZATION ERROR BOUND
text: In classification, the generalization error is typically referred to as the misclassification error, which can be quantified by L(f) defined in Equation 2.1. In the non-separable case, the excess risk, defined by L(f) L⇤, is used to evaluate the quality of a classifier f , where L⇤ = L(2⌘ 1), which minimizes the 0-1 loss. The following theorem states that the overparametrized neural network with GD and `2 regularization can achieve a small excess risk in the non-separable case.
Theorem 3.1 (Excess risk in the non-separable case). Suppose Assumptions D.1, D.2, and D.4 hold. Assume the conditional probability ⌘(x) satisfies Tsybakov’s noise condition with component . Let µ ⇣ n d 1 2d 1 . Then
L(fW (k),a) = L ⇤ +OP(n d(+1)(2d 1)(+2) ). (3.1)
From Theorem 3.1, we can see that as  becomes larger, the convergence rate becomes faster, which is intuitively true. Generalization error bounds in this setting is scarce. To the best of the authors’ knowledge, Hu et al. (2020) is the closest work (the labels are randomly flipped), where the bound is in the order of OP(1/ p n). Our bound is faster, especially with larger . It is known that the optimal convergence rate under Assumptions D.2 and D.4 is OP(n d(+1)
d+4d 2 ) (Audibert & Tsybakov, 2007). The differences between Equation 3.1 and the optimal convergence rate is that there is an extra (d 1) in the denominator of the convergence rate in Equation 3.1 (since n d(+1) (2d 1)(+2) = n d(+1) (d 1)+d+4d 2 ). If the conditional probability ⌘ has a bounded Lipschitz constant, then Kohler & Krzyzak (2007) showed that the convergence rate based on the plug-in kernel estimate is OP(n +1 +3+d ), which is slower than the rate in Equation 3.1 if d is large.
Now we turn to the separable case. Since ⌘ only takes value from {0, 1} in the separable case, ⌘ is bounded away from 1/2. Therefore, one can trivially take  ! 1 in Equation 3.1 and obtain the convergence rate OP(n d/(2d 1)). However, this rate can be significantly improved in the separable case, as stated in the following theorem. Theorem 3.2 (Generalization error in the separable case). Suppose Assumptions D.1, D.3, and D.5 hold. Let µ = o(1). There exist positive constants C1, C2 such that the misclassification rate is 0% with probability at least 1 C1 exp( C2n), and can be arbitrarily small2 by enlarging the neural network’s width.
Note that in Theorem 3.2, the regularization parameter can take any rate that converges to zero. In particular, µ can be zero, and the corresponding classifier overfits the training data. Theorem 3.2 states that the convergence rate in the separable case is exponential, if a sufficiently wide neural network is applied. This is because the observed labels are not corrupted by noise, i.e., P(y = 1|x) is either one or zero. Therefore, it is easier to classify separable data, which is intuitively true.

heading: 3.2 ROBUSTNESS AND CALIBRATION ERROR
text: If two classes are separable with positive margin, the decision boundary is not unique. Practitioners often prefer the decision boundary with large margins, which are robust against possible perturbation on input points (Elsayed et al., 2018; Ding et al., 2018). The following theorem states that the square loss trained margin can be lower bounded by a positive constant. Recall that in the separable case, ⌦ = ⌦1 [ ⌦2, where ⌦1 = {x|⌘(x) = 1} and ⌦2 = {x|⌘(x) = 0}. Theorem 3.3 (Robustness in the separable case). Suppose the assumptions of Theorem 3.2 are satisfied. Let µ = o(1). Then there exist positive constants C,C1, C2 such that for all n,
min x2DT ,x02⌦1[⌦2
kx x0k2 C,
and the misclassification rate is 0% with probability at least 1 C1 exp( C2n), where DT is the decision boundary, and is as in Theorem 3.2. Remark 1. Note that kx x0k1 p dkx x0k2, thus Theorem 3.3 also indicates l1 robustness.
In the non-separable case, ⌘(x) varies within (0,1) and practitioners may not only want a classifier with a small excess risk, but also want to recover the underlying conditional probability ⌘. Therefore, square loss is naturally preferred since it treats the classification problem as a regression problem. The following theorem states that, one can recover the conditional probability ⌘ by using an overparametrized neural network with `2 regularization and GD training. Theorem 3.4 (Calibration error). Suppose the conditions in Theorem 3.1, Assumption D.3 and D.4 are fulfilled. Let µ ⇣ n d 1 2d 1 . Then
k(fW (k),a + 1)/2 ⌘kL1 = OP(n 1
4d 2 ). (3.2) 2The term only depends on the width of the neural network. A smaller requires a wider neural network.
If = 0, then the number of nodes in the hidden layer is infinity.
Theorem 3.4 states that the underlying conditional probability in the non-separable case can be recovered by (fW (k),a + 1)/2. The form (fW (k),a + 1)/2 is to account for the { 1, 1} label coding. Under {0,1} coding, the estimator would be fW (k),a itself. The L1 consistency doesn’t hold for cross-entropy trained neural networks, due to the form of the optimal solution log( ⌘1 ⌘ ). With limited capacity, the network’s confidence prediction is bounded away from 0 and 1 (Zhang, 2004). In practice, we want to control the complexity of the neural network thus it is usually the case that kfW (k),ak1 < C for some constant C. Hence, it cannot accurately estimate ⌘(x) when ⌘(x) > e C
1+eC or ⌘(x) < 1 1+eC , which makes the calibration error under the cross-entropy loss always bounded away from zero. However, square loss does not have such a problem.
Notice that the calibration error bound in Theorem 3.4 does not depend on the Tsybakov’s noise condition, and is slower than the excess risk. This is because, a small calibration error is much stronger than a small excess risk, since the former requires the conditional probability estimation to be uniformly accurate, not just matching the sign of ⌘(x) 1/2. To be more specific, a good estimated b⌘ can always result in a low risk plug-in classifier bf(x) = 2b⌘(x) 1, but not vice versa.
Remark 2 (Technical challenge). Despite the similar forms of regression and classification using square loss, most of the regression analysis techniques cannot be directly applied to the classification problem, even if the supports of two classes are non-separable. Moreover, it is clear that classification problems in the separable case are completely different with regression problems.
Remark 3 (Extension on NTK). Although our analysis only concerns overparametrized onehidden-layer ReLU neural networks, it can potentially apply to other types of neural networks in the NTK regime. Recently, it has been shown that overparametrized multi-layer networks correspond to the Laplace kernel (Geifman et al., 2020; Chen & Xu, 2020). As long as the trained neural networks can approximate the classifier induced by the NTK, our results can be naturally extended.

heading: 3.3 TRANSITION FROM SEPARABLE TO NON-SEPARABLE
text: The general non-separable case and the special separable case can be connected via Gaussian noise injection. In practice, data augmentation is an effective way to improve robustness and the simplest way is Gaussian noise injection (He et al., 2019). In this section, we only consider it as an auxiliary tool for theoretical analysis purpose and not for actual robust training. Injecting Gaussian noise amounts to convoluting a Gaussian distribution N(0, 2Id) to the marginal distribution PX , which enlarges both ⌦1 and ⌦2 to Rd and a unique decision boundary D can be induced. Correspondingly, the “noisy” conditional probability, denoted as e⌘ , is also smoothed to be continuous on Rd. As ! 0, ke⌘ ⌘k1 ! 0 on ⌦1 and ⌦2 and the limiting e⌘0 is a piecewise constant function with discontinuity at the induced decision boundary.
Lemma 3.5 (Tsybakov’s noise condition under Gaussian noises). Let the margin be 2 > 0, the noise be N(0, 2Id). Then there exist some constants T,C > 0 such that for any 0 < t < T ,
PX(|2e⌘ (X) 1| < t)  C 2 exp
✓
2
2 2
◆ · t.
Theorem 3.6 (Exponential convergence rate). Suppose the classes are separable with margin 2 > 0. No matter how complicated ⌦1[⌦2 are, the excess risk of the over parameterized neural network classifier satisfying Assumptions D.1 and D.4 has the rate OP(e n /7).
The proof of Theorem 3.6 involves taking the auxiliary noise to zero, e.g., v = vn ⇣ 1/ p n. The exponential convergence rate is a direct outcome of Lemma 3.5 and Theorem 3.1. Note that our exponential convergence rate is much faster than existing ones under the similar separable setting (Ji & Telgarsky, 2019; Cao & Gu, 2019; 2020), which are all polynomial with n, e.g., OP(1/ p n).
Remark 4. Theorems 3.4 and 3.6 share the same gist that the over parameterized neural network classifiers can have exponential convergence rate when data are separable with positive margin, while the result of Theorem 3.6 is weaker than that of Theorem 3.4, but with milder conditions. Nevertheless, Theorem 3.6 bridges the non-separable case and separable case.

heading: 4 MULTICLASS CLASSIFICATION
text: In binary classification, the labels are usually encoded as 1 and 1. When there are K > 2 classes, the default label coding is one-hot. However, it is empirically observed that this vanilla square loss struggles when the number of classes are large, for which scaling tricks have been proposed (Hui & Belkin, 2020; Demirkaya et al., 2020). Another popular coding scheme is the simplex coding (Mroueh et al., 2012), which takes maximally separated K points on the sphere as label features. When K = 2, this reduces to the typical 1, 1 coding. Many advantages of the simplex coding have been discussed, including its relationship with cross-entropy loss and supervised contrastive learning (Papyan et al., 2020; Han et al., 2021; Graf et al., 2021; Fang et al., 2021).
In this work, we adopt the simplex coding. More discussion and empirical comparison about the coding choices can be found in Appendix G.2. Given the label coding, one can easily generalize the theoretical development in Section 3 by employing the following objective function
min W
KX
j=1
nX
i=1
(fj,W ,a(xi) yi,j)2 + µkW k22,
where fW ,a : ⌦ 7! RK , and yi = (yi,1, ..., yi,K)> is the label of i-th observation. The following proposition states a relationship between the simplex coding scheme and the conditional probability. Proposition 4.1 (Conditional probability). Let f⇤ : ⌦ ! RK minimize the mean square error EX(f⇤(X) vy)2, where vy is the simplex coding vector of label y. Then we have
⌘k(x) := P (y = k|x) = (K 1)f⇤(x)>vk + 1 /K. (4.1)
Unlike the softmax function when using cross entropy, the estimated conditional probability using square loss is not guaranteed to be within 0 and 1. This will cause issues for adversarial attacks, which will be discussed in detail in Appendix G.2.

heading: 5 NUMERICAL STUDIES
text: Although our theoretical results are for overparametrized neural network in the NTK regime, we expect our conclusions to generalize to practical network architectures. The focus of this section is not on improving the state-of-the-art performance for deep classifiers, but to illustrate the difference between cross-entropy and square loss. We provide experiment results on both synthetic and real data, to support our theoretical findings and illustrate the practical benefits of square loss in training overparametrized DNN classifiers. Compared with cross-entropy, the square loss has comparable generalization performance, but with stronger robustness and smaller calibration error.

heading: 5.1 SYNTHETIC DATA
text: We consider the square loss based and cross-entropy based overparametrized neural networks (ONN) with `2 regularization, denoted as SL-ONN + `2 and CE-ONN + `2, respectively. The chosen ONNs are two-hidden-layer ReLU neural networks with 500 neurons for each layer, and the parameter µ is selected via a validation set. More implementation details are in Appendix G.1.
Separable case We consider two separated classes with spiral curve like supports. We also present the performance of the cross-entropy based ONN without `2 regularization (CE-ONN). Figure 1 shows one instance of the test misclassification rate and decision boundaries attained by SL-ONN + `2 (Left), CE-ONN + `2 (Center), and CE-ONN (Right). From this example and other examples in Appendix G.1, it can be seen that SL-ONN + `2 has a smaller test misclassification rate and a much smoother decision boundary. In particular, in the red region, where the training data are sparse, SL-ONN + `2 fits the correct data distribution best. Non-separable case We consider the conditional probability ⌘(x) = sin( p 2⇡||x||2),x 2 [ 1, 1]2, and the calibration performance of SL-ONN + `2 and CE-ONN + `2, where the classifiers are denoted by bfl2 and bfce, respectively. The results are presented in Figure G.8 in the Appendix.
The error bar plot of the test calibration error shows that bfl2 has the smaller mean and standard deviation than bfce. It suggests that square loss generally outperforms cross entropy in calibration. The histogram and kernel density estimation of the test calibration errors for one case show that the pointwise calibration errors on the test points of bfl2 are more concentrated around zero than those of bfce. Moreover, despite a comparable misclassification rate with bfce, bfl2 has a smaller calibration error. Figure G.8 demonstrates that SL-ONN + `2 recovers ⌘ much better than CE-ONN + `2.

heading: 5.2 REAL DATA
text: To make a fair comparison, we adopt popular architectures, ResNet (He et al., 2016) and Wide ResNet (Zagoruyko & Komodakis, 2016) and evaluate them on the CIFAR image classification datasets, with only the training loss function changed, from cross-entropy (CE) to square loss with simplex coding (SL). Further, we don’t employ any large scale hyper-parameter tuning and all the parameters are kept as default except for the learning rate (lr) and batch size (bs), where we are choosing from the better of (lr=0.01, bs=32) and (lr=0.1, bs=128). Each experiment setting is replicated 5 times and we report the average performance followed by its standard deviation in the parenthesis. (lr=0.01, bs=32) works better for the most cases except for square loss trained WRN-16-10 on CIFAR-100. More experiment details and additional results can be found in Appendix G.2.
Generalization In both CIFAR-10 and CIFAR-100, the performance of cross-entropy and square loss with simplex coding are quite comparable, as observed in Hui & Belkin (2020). Cross-entropy tends to perform slightly better for ResNet, especially on CIFAR-100 with an advantage of less than 1%. There is a more significant gap with Wide ResNet where square loss outperforms cross-entropy by more than 1% on both CIFAR-10 and CIFAR-100. The details can be found in Table 1.
Adversarial robustness Normally trained deep classifiers are found to be adversarially vulnerable and adversarial attacks provide a powerful tool to evaluate classification robustness. For our experiment, we consider the black-box Gaussian noise attack, the classic white-box PGD attack (Madry et al., 2017) and the state-of-the-art AutoAttack (Croce & Hein, 2020), with attack strength level 2/255, 4/255, 8/255 in l1 norm. AutoAttack contains both white-box and black-box attacks and offers a more comprehensive evaluation of adversarial robustness. The Gaussian noises results are
presented in Table G.3 in the Appendix. At different noise levels, square loss consistently outperforms cross-entropy, especially for WRN-16-10, with around 2-4% accuracy improvement. More details can be found in Appendix G.2. The PGD and AutoAttack results are reported in Table 1. Even though classifiers trained with square loss is far away from adversarially robust, it consistently gives significantly higher adversarial accuracy. The same margin can be carried over to standard adversarial training as well. Table 2 lists results from standard PGD adversarial training with CE and SL. By substituting cross-entropy loss to square loss, the robust accuracy increased around 3% while maintaining higher clean accuracy.
One thing to notice is that when constructing white-box attacks, square loss will not work well since it doesn’t directly reflect the classification accuracy. More specifically, for a correctly classified image (x, y), maximizing the square loss may result in linear scaling of the classifier f(x), which doesn’t change the predicted class (see Appendix G.2 for more discussion). To this end, we consider a special attack for classifiers trained by square loss by maximizing the cosine similarity between f(x) and vy . We call this angle attack and also utilize it for the PGD adversarial training paired with square loss in Table 2. In our experiments, this special attack rarely outperforms the standard PGD with cross-entropy and the reported PGD accuracy are from the latter settings. This property of square loss may be an advantage in defending adversarial attacks.
Model calibration The predicted class probabilities for square loss can be obtained from Equation 4.1. Expected calibration error (ECE) measures the absolute difference between predicted confidence and the actual accuracy. Deep classifiers are usually found to be over-confident (Vaicenavicius et al., 2019). Using ResNet as an example, we report the typical reliability diagram in Figure 2. On CIFAR-10 with ResNet-18, the average ECE for cross-entropy is 0.028 (0.002) while that for square loss is 0.0097 (0.001). On CIFAR-100 with ResNet-50, the average ECE for cross-entropy is 0.094 (0.005) while that for square loss is 0.068 (0.005). Square loss results are much more calibrated with significantly smaller ECE.

heading: 6 CONCLUSIONS
text: Classification problems are ubiquitous in deep learning. As a fundamental problem, any progress in classification can potentially benefit numerous relevant tasks. Despite its lack of popularity in practice, square loss has many advantages that can be easily overlooked. Through both theoretical analysis and empirical studies, we identify several ideal properties of using square loss in training neural network classifiers, including provable fast convergence rates, strong robustness, and small calibration error. We encourage readers to try square loss in your own application scenarios.
Ethnics Statement We acknowledge the ICLR Code of Ethics. This submission is mostly theoretical and the authors could not think of any potential violations of them in this submission.
Reproducibility Statement For our theoretical results, explanations of assumptions can be found in Appendix D and a complete proof of the claims can be found in the Appendix E and Appendix F. Our experiment details can be found in Appendix G, with both data and training descriptions.

Review summaries:
This paper studies square loss theoretically in the NTK regime. In this particular regime, authors find indications that square loss might lead to (adversarially) robust models and good calibration. Authors then run experiments outside of the NTK regime, on CIFAR-10 and CIFAR-100, to compare the robustness and calibration performance of square loss with cross-entropy.   

This paper provides a theoretical analysis of the squared loss for classification where cross-entropy loss is often the standard choice in both theory and practice. The authors show under some assumption of the data and the NTK regime, GD on squared loss enjoys fast convergence, strong robustness and good calibration. They also provide empirical results. 

The paper studies wide neural networks trained with the square loss in the neural tangent kernel regime from a theoretical perspective. In particular, it provides generalization error bounds, robustness and calibration results and makes a connection to supervised contrastive learning. Furthermore, an empirical comparison between cross entropy and square loss is provided.