Title: Sharpness-diversity tradeoff: improving flat ensembles with SharpBalance
Venue: NeurIPS 2024
Accepted: yes
Keywords: Diversity

loss landscape

deep ensemble
Abstract: Recent studies on deep ensembles have identified the sharpness of the local minima of individual learners and the diversity of the ensemble members as key factors in improving test-time performance. Building on this, our study investigates the interplay between sharpness and diversity within deep ensembles, illustrating their crucial role in robust generalization to both in-distribution (ID) and out-of-distribution (OOD) data. We discover a trade-off between sharpness and diversity: minimizing the sharpness in the loss landscape tends to diminish the diversity of individual members within the ensemble, adversely affecting the ensemble's improvement. The trade-off is justified through our rigorous theoretical analysis and verified empirically through extensive experiments. To address the issue of reduced diversity, we introduce SharpBalance, a novel training approach that balances sharpness and diversity within ensembles. Theoretically, we show that our training strategy achieves a better sharpness-diversity trade-off. Empirically, we conducted comprehensive evaluations in various data sets (CIFAR-10, CIFAR-100, TinyImageNet) and showed that SharpBalance not only effectively improves the sharpness-diversity trade-off but also significantly improves ensemble performance in ID and OOD scenarios.

Sharpness-diversity tradeoff: improving flat ensembles with SharpBalance

Abstract

Recent studies on deep ensembles have identified the sharpness of the local minima of individual learners and the diversity of the ensemble members as key factors in improving test-time performance. Building on this, our study investigates the interplay between sharpness and diversity within deep ensembles, illustrating their crucial role in robust generalization to both in-distribution (ID) and out-of-distribution (OOD) data. We discover a trade-off between sharpness and diversity: minimizing the sharpness in the loss landscape tends to diminish the diversity of individual members within the ensemble, adversely affecting the ensemble's improvement. The trade-off is justified through our theoretical analysis and verified empirically through extensive experiments. To address the issue of reduced diversity, we introduce SharpBalance , a novel training approach that balances sharpness and diversity within ensembles. Theoretically, we show that our training strategy achieves a better sharpness-diversity trade-off. Empirically, we conducted comprehensive evaluations in various data sets (CIFAR-10, CIFAR-100, TinyImageNet) and showed that SharpBalance not only effectively improves the sharpness-diversity trade-off, but also significantly improves ensemble performance in ID and OOD scenarios. Our code has been made open-source. †

1 Introduction

There has been interest in understanding the properties of neural networks (NNs) and their implications for robust generalization to both in-distribution (ID) and out-of-distribution (OOD) data [Hendrycks and Dietterich, 2019a]. Two properties of particular importance, sharpness (or flatness) [Granziol, 2020, Andriushchenko et al., 2023, Yang et al., 2021, Dinh et al., 2017, Yao et al., 2020] and diversity [Laviolette et al., 2017, Fort et al., 2019, Yao et al., 2020, Dietterich, 2000, Ortega et al., 2022, Theisen et al., 2023], have been shown to have a significant influence on performance. In the context of deep ensembles [Ovadia et al., 2019, Lakshminarayanan et al., 2017, Fort et al., 2019, Mehrtash et al., 2020, Ganaie et al., 2022], diversity (which measures the variance in output between independently-trained models) is shown to be critical in enhancing ensemble accuracy. Sharpness, on the other hand, quantifies the curvature of local minima and is believed to be empirically correlated with an individual model's generalization ability.

SharpBalance

Sharpness-aware Minimization

High diversity

Low sharpness

Low diversity

Low sharpness

SharpBalance (ours)

Sharpness-Diversity

Trade-off

High diversity

High sharpness

Ordinary

deep ensemble

one NN in a three-member ensemble

SAM

(a) Overview

0.5

0.6

0.7

0.8

Sharpness (upper bound)

0.00

0.02

0.04

0.06

0.08

Diversity

SAM (theory)

SharpBalance (theory)

(b) Theoretical results

0.2

0.4

0.6

Sharpness

2

4

6

Diversity

75.5

76.5

77.5

Ensemble OOD Acc

(c) Empirical results

Recent research on loss landscapes [Yang et al., 2021] highlights that a single structural property of the loss landscape is insufficient to fully capture a model's generalizability, and it underscores the importance of a joint analysis of sharpness and diversity. Despite significant efforts in studying sharpness and diversity individually, a gap persists in understanding their relationship, particularly in the context of ensemble learning. Our work seeks to bridge this gap by investigating ensemble learning through the lens of loss landscapes, with a specific focus on the interplay between sharpness and diversity.

Sharpness-diversity trade-off. Our examination of loss landscape structure for ensembling revealed a 'trade-off' between the diversity of individual NNs and the sharpness of the local minima to which they converge. This trade-off introduces a potential limitation to the achievable performance of the deep ensemble: the test accuracy of individual NN can be improved as the sharpness is reduced, but it simultaneously reduces diversity, thereby compromising the ensembling improvement (evidence in Section 4.2 and 4.4). This trade-off is visually summarized in the lower transition branch in Figure 1a. We also developed theories (in Section 3) to verify the trade-off. The theoretical results characterizing this phenomenon are visualized in Figure 1b, and the experimental observation is presented in Figure 1c. In Section 4.2, we also verified the existence of the trade-off by varying the experimental setting to include different datasets and different levels of overparameterization (e.g., changing model width).

SharpBalance mitigates the trade-off and improves ensembling performance. To address the challenge presented by the sharpness-diversity tradeoff, we propose a novel ensemble training method called SharpBalance . This method aims to simultaneously reduce the sharpness of individual NNs and prevent diversity reduction among them, as demonstrated in the upper transition branch of Figure 1a. This method is designed based on our theoretical results, which suggest that training different ensemble members using a loss function that aims to reduce sharpness on different subsets of the training data can improve the trade-off between sharpness and diversity. Our theoretical results are summarized in Figure 1b. Aligned with theoretical insights, our SharpBalance method lets each ensemble member minimize the sharpness objective exclusively on a subset of training data, termed the sharpness-aware set . The sharpness-aware set of each ensemble member is diversified by an adaptive strategy based on data-dependent sharpness measures. As shown in Figure 1c, we verify

that SharpBalance improves the sharpness-diversity tradeoff in training the ResNet18 ensemble on CIFAR10. We conducted experiments on three classification datasets to show that SharpBalance boosts ensembling performance in ID and OOD data.

Our contributions are summarized as follows:

Comprehensive identification of the sharpness-diversity trade-off: This work provides a thorough examination of the phenomenon sharpness-diversity trade-off where reducing the sharpness of individual models can decrease diversity between models within an ensemble. We demonstrate this effect through extensive experiments across various settings,using different sharpness and diversity measures, as well as different model capacities. Our findings show that this trade-off can negatively affect the ensemble improvements.

Novel theory: We prove the existence of the trade-off under a novel theoretical framework based on rigorous analysis of sharpness-aware training objectives [Foret et al., 2021, Behdin and Mazumder, 2023]. Our analysis borrows tools from analyzing Wishart moments [Bishop et al., 2018], and characterizes the exact dynamics of training, bias-variance tradeoff, and the upper and lower bounds of sharpness. Notably, our novel theoretical analysis generalizes existing analysis to ensemble members trained with different data, which is the key to analyzing our own training method SharpBalance .

Effective approach: To mitigate the sharpness-diversity trade-off, we introduce SharpBalance , an ensemble training approach. Our theoretical framework demonstrates that SharpBalance provably achieves improvements on the sharpness-diversity trade-off by reducing sharpness while mitigating the decrease in diversity. Empirically, we confirm this improvement and demonstrate that SharpBalance enhances overall ensemble performance, outperforming baseline methods in CIFAR-10, CIFAR-100 [Krizhevsky, 2009], TinyImageNet [Le and Yang, 2015], and their corrupted versions to assess OOD performance.

We provide a more detailed discussion on related work in Appendix B.

2 Background

Preliminaries. We use a NN denoted as f θ : R d in → R d out , where θ ∈ R p denotes the trainable parameters. The training dataset comprises n data-label pairs D = { ( x 1 , y 1 ) , . . . , ( x n , y n ) } . The training loss of NN f θ over a dataset D can be defined as L D ( θ ) = 1 n ∑ n i =1 ℓ ( f θ ( x i ) , y i ) . Here ℓ ( · ) is a loss function, which, for instance, can be the cross entropy loss or ℓ 2 loss. We construct a deep ensemble consisting of m distinct NNs f θ 1 , . . . , f θ m . For classification tasks, the ensemble's output is derived by averaging the predicted logits of these individual networks. We use flat ensemble to mean the deep ensemble in which each ensemble member is trained using a sharpness-aware optimization method [Foret et al., 2021], differentiating it from other ensemble approaches.

Diversity metrics. Distinct measures of diversity have been proposed in the literature [Laviolette et al., 2017, Fort et al., 2019, Dietterich, 2000, Baek et al., 2022, Ortega et al., 2022, Theisen et al., 2023], and they are primarily calculated using the predictions made by individual models. Ortega et al. [2022] define diversity D ( θ ) to be the variance of model outputs averaged over the data-generating distribution, which we adopt in the theoretical analysis:

In our experiments, diversity is measured using variance defined above, as well as two other widely used metrics in ensemble learning, namely Disagreement Error Ratio (DER) [Theisen et al., 2023] defined in equation (2), and KL divergence [Kullback and Leibler, 1951] defined in equation (11) in the appendices. We show in Section 4.2 that our main claim generalizes to these three metrics in characterizing the diversity between members within an ensemble. Specifically, denote P as the distribution of model weights θ after training. Then, the DER is defined as

where Dis( f θ , f θ ′ ) is the prediction disagreement [Masegosa, 2020, Mukhoti et al., 2021, Jiang et al., 2022] between two classifier f θ , f θ ′ , and E ( f θ ) is the prediction error.

Sharpness Metric. In accordance with the definition proposed by Foret et al. [2021], we characterize the first-order sharpness of a model as the worst-case perturbation within a radius of ρ 0 . Mathematically, the sharpness κ of a model θ is expressed as follows:

Empirically, we measure the sharpness of the NN via the adaptive worst-case sharpness [Kwon et al., 2021, Andriushchenko et al., 2023]. The adaptive worst-case sharpness captures how much the loss can increase within the perturbation radius ρ 0 of θ :

where θ = [ θ 1 , . . . , θ l ] , and T θ = diag ( | θ 1 | , . . . , | θ l | ) . T -1 θ is a normalization operator to make sharpness 'scale-free', that is, such that scaling operations on θ that do not alter NN predictions will not impact the sharpness measure.

Ensembling. We characterize the effectiveness of ensembling by the metric called ensemble improvement rate (EIR) [Theisen et al., 2023], which is defined as the ensembling improvement over the average performance of single models. Let E ens denote the test error of an ensemble; the EIR is then defined as follows:

Sharpness Aware Minimization ( SAM ). SAM [Foret et al., 2021] has been shown to be an effective method for improving the generalization of NNs by reducing the sharpness of local minima. It essentially functions by penalizing the maximum loss within a specified radius ρ of the current parameter θ . The training objective of SAM is to minimize the following loss function:

where λ is the hyperparameter of a standard ℓ 2 regularization term.

3 Theoretical Analysis of Sharpness-diversity Trade-off

This section theoretically analyzes the sharpness-diversity trade-off. The diversity among individual models is quantified using equation (1). The first theorem establishes the existence of a trade-off between sharpness and diversity. The second theorem demonstrates that training models with only a subset of data samples leads to a more favorable trade-off between these two metrics.

Sharpness and Diversity of SAM . Assume the training data matrix A ∈ R n tr × d in and test data matrix T ∈ R n te × d in are random with entries drawn from Gaussian N (0 , 1 d in I ) . Suppose the model weight at the 0-th time step, θ 0 , is initialized randomly such that E [ θ 0 ] = 0 and E [ θ 0 θ T 0 ] = σ 2 I and updated with a quadratic optimization objective through SAM . The learned weight matrix after k time steps is denoted as θ k . Let θ ∗ be the teacher model (i.e., ground-truth model) such that A θ ∗ = y ( A ) and T θ ∗ = y ( T ) , where y ( D ) is the label vector for data matrix D . Given a perturbation radius ρ 0 , the sharpness of a model after k iteration under the random matrix assumption is defined as

which is the expected fluctuation of the model output after perturbation over the data distribution. For simplicity, we denote κ ( θ SAM k ; ρ 0 ) = κ SAM k for the rest of the paper. We derive an explicit formulation of diversity and upper and lower bounds of sharpness for models optimized with SAM in Theorem 1. Detailed proof can be found in Appendix C.1.

Theorem 1 (Diversity and Sharpness of SAM ) . Let θ 0 be initialized randomly such that E [ θ 0 ] = 0 and E [ θ 0 θ T 0 ] = σ 2 I . Suppose θ SAM k is the model weight after k iterations of training with SAM on A ∈ R n tr × d in and evaluated on T ∈ R n te × d in . Let η be the step size, ρ be the perturbation radius in SAM and ρ 0 be the radius for measuring sharpness κ SAM k . Then

where

To provide a clearer understanding of the relationship between sharpness and diversity, Figure 2 presents a trade-off curve between these two metrics. The estimated sharpness and diversity are displayed on the x and y axes, respectively. Each point in the plot corresponds to a model trained using SAM with a different ρ value, showcasing the outcome of varying perturbation radius. In these experiments, we evaluated the sharpness and diversity of the models empirically and compared them to the estimates obtained using Theorem 1. The soundness of Theorem 1 and tightness of the derived bounds are further supported by empirical evidence, as depicted in Figure 2. Further verification results supporting our theoretical analysis are provided in Appendix C.3

Training with Data Subsets. Assume A is partitioned into S horizontal submatrices, such that A = [ A T 1 , A T 2 , . . . , A T S ] T . We show in Theorem 2 a similar analysis of the sharpness and diversity of ensembles for which each model is trained with a submatrix. Under this setting, we first selected a subset of data A s uniformly at random and then train the model with the selected subset with SAM .

Theorem 2 (Diversity and Sharpness when Models are Trained on Subsets) . Suppose the training data matrix A is partitioned into S horizontal submatrices. Let θ 0 be initialized randomly such that E [ θ 0 ] = 0 and E [ θ 0 θ T 0 ] = σ 2 I . Let θ SharpBal k be the model weight trained with SAM for k iterations on the submatrix A s ∈ R n tr S × d in , selected uniformly at random, and evaluated on test data T ∈ R n te × d in . Let η be the step size, ρ be the perturbation radius in SAM , ρ 0 be the radius for measuring sharpness κ SAM k , and r = n tr Sd in . Then

and

where

The proof of Theorem 2 is provided in Appendix C.2. Similar experimental validations are conducted to verify Theorem 2, with results also presented in Appendix C. The main insight from Theorem 2 is

Lower bound of sharpness (x-axis)

Upper bound of sharpness (x-axis)

10000

Simulated

p=0.5

Diversity

LowerBound onSharpness

p=2.5e-1

10

?

D

UpperBound onSharpness

0

p=0.1

?

1

10

100

Sharpness

that training models on a randomly selected data subset offers a better trade-off between sharpness and diversity compared to training on the complete dataset. This idea is further illustrated in Figure 1b, where we compare the sharpness upper bound and diversity of models trained on the full dataset (labeled as SAM ) and those trained on subsets (labeled as SharpBalance ). The results demonstrate that SharpBalance achieves a more favorable trade-off. For a given level of sharpness, deep ensembles with models trained on subsets of the data exhibit higher diversity compared to those trained on the entire dataset. This indicates that minimizing sharpness on randomly sampled data subsets for each model within the ensemble promotes the diversity among the models, thereby enhancing the sharpness-diversity trade-off.

4 Experiments

In this section, we describe our experiments. In particular, following Section 4.1 where we describe our experimental setup, in Section 4.2, we provide an empirical evaluation across various datasets to explore the trade-off between sharpness and diversity. We also examine how this trade-off changes with different levels of overparameterization. Then, in Section 4.3 and 4.4, we elaborate the SharpBalance algorithm and compare its performance with baseline methods.

4.1 Experimental setup

Here, we describe the experiment setup for Section 4.2. Each ensemble member is trained individually using SAM with a consistent perturbation radius ρ , as defined in equation (5). We adjust ρ across different ensembles to achieve varying levels of minimized sharpness. Sharpness for each NN was measured using the adaptive worst-case sharpness metric, defined in equation (3). The sharpness measurement was done on the training set, using 100 batches of size 5. The diversity between NNs is measured using DER defined in equation (2). The diversity between ensemble members is tested on OOD data. We evaluated this trade-off using a variety of image classification datasets, including CIFAR-10, CIFAR-100 [Krizhevsky, 2009], TinyImageNet [Le and Yang, 2015], and their corrupted versions [Hendrycks and Dietterich, 2019b]. For the setup of Section 4.4, we used the same datasets and architecture. The hyperparameters of the baseline methods has been carefully tuned. The hyperparameters for conducting the experiments are detailed in Appendix D.

0.2

0.4

0.6

Sharpness

2

4

6

Diversity (Variance)

0.03

0.04

0.05

Ensemble Improvement Rate

0.2

0.4

0.6

Sharpness

0.4

0.6

Diversity (DER)

0.03

0.04

0.05

Ensemble Improvement Rate

0.2

0.4

0.6

Sharpness

0.2

0.4

Diversity (KL)

0.03

0.04

0.05

Ensemble Improvement Rate

(a) Measuring diversity via Variance

(c) Measuring diversity via KL

4.2 Empirical validation of Sharpness-diversity trade-off

We provide empirical observation to validate and explore the sharpness-diversity trade-off. Figure 3 presents the validation of observing the trade-off phenomenon on training ResNet18 ensembles on CIFAR10 applying three different metrics to measure the diversity. The results demonstrate that this trade-off phenomenon generalizes to the three diversity metrics defined in Section 2. Figure 4 presents the validation on three different datasets. In the following empirical study, DER will be the primary metric for measuring diversity of models.

(a) CIFAR-10

(b) CIFAR-100

(c) TinyImageNet

Ensemble Improvement Rate

EnsembleImprovement Rate

Ensemble Improvement Rate

0.03

0.04

0.05

0.04

0.05

0.035

0.040

0.045

0.8

0.9

Diversity

Diversity

0.7

0.8

O

Ensembleimprovement

0.4

diversity decreases.

decreasewhile

0.6

Ensembleimprovement

diversity decreases

decreasewhile

0.7

Ensemble improvement

diversity decreases

decreasewhile

0.2

0.4

0.6

0.5

1.0

2.0

2.5

3.0

Sharpness

Sharpness

Sharpness

Individual OOD Acc

Individual OOD Acc

Individual OOD Acc

74.75

75.00

75.25

75.50

0.8

48.0

48.5

49.0

49.5

0.9

0.27

0.28

Diversity

Diversity

0.7

0.8

Individual performance

0.6

Individualperformance

Individualperformance

0.4

sharpness decreases

increasewhile

sharpness decreases

increase while

0.7

sharpness decreases

increase while

0.2

0.4

0.6

0.5

1.0

2.0

2.5

3.0

Sharpness

Sharpness

Sharpness

Experimental results obtained with the other two metrics are available in Appendix E. The three sets of results first verify that minimizing individual member's sharpness indeed reduces diversity. This is confirmed by the consistent trends of markers moving from upper right to lower left. Second, the first row of Figure 4 shows that an ensemble with decreased diversity (lower in y -axis) shows a lower ensemble improvement rate (from red to blue), highlighting the negative impact of this trade-off. Lastly, the second row shows when the sharpness of the individual model is reduced (lower in x -axis), the individual model's OOD accuracy is improved (from blue to red), demonstrating the benefits of minimizing sharpness. We verify the robustness of the phenomenon by measuring the sharpness and diversity using different metrics in Appendix E.

Figure 5 illustrates the trade-off curves as the overparameterization level of the model is adjusted by changing width or sparsity (introduced using model pruning). This visualization confirms that the trade-off is a consistent phenomenon across models of different sizes, and the ensemble provides less improvement (blue color) at the lower left end of each trade-off curve. It also highlights that models with smaller or sparser configurations show a more significant trade-off effect, as evidenced by the steeper slopes and higher coefficient values of the linear fitting curves. As sparse ensembles are now being used to demonstrate the benefits of ensembling for efficient models [Liu et al., 2022, Diffenderfer et al., 2021, Whitaker and Whitley, 2022, Kobayashi et al., 2022, Zimmer et al., 2024], addressing the conflict between sharpness and diversity becomes particularly crucial.

4.3 Our SharpBalance method

Here, we describe the design and implementation of our main method, SharpBalance . Figure 6 provides an overview. Our approach is motivated by the theoretical analysis in Section 3, which suggests that having each ensemble member minimize sharpness on diverse subsets of the data can lead to a better trade-off between sharpness and diversity. SharpBalance aims to achieve the optimal balance by applying SAM to a carefully selected subset of the data, while performing standard optimization on the remaining samples. More specifically, for each ensemble member NN f θ i , our method divides the entire training dataset D into two distinct subsets: sharpness-aware set D i SAM and normal set D i Normal . The model is trained to optimize the sharpness reduction objective on D i SAM ,

0.1

0.2

0.4

0.8

1.6

3.2

Sharpness

0.4

0.5

0.6

0.7

0.8

Diversity

=0.58

=0.54

=0.33

=0.28

Width=16

Width=64

Width=8

0.03

0.04

0.05

0.06

0.07

Ensemble Improvement Rate

(a) Varying model width

0.2

0.4

0.8

1.6

3.2

Sharpness

0.4

0.5

0.6

0.7

0.8

Diversity

=0.50

=0.47

=0.43

=0.33

Sparsity=0

Sparsity=0.95

Sparsity=0.8

Sparsity=0.99

0.03

0.04

0.05

0.06

0.07

Ensemble Improvement Rate

(b) Varying model sparsity

while it optimizes the normal training objective on D i Normal . These training objectives are denoted as L SAM D i SAM ( θ i ) and L D i Normal ( θ i ) , respectively. The D i SAM is selected by an adaptive strategy from the whole dataset D : it is composed of the union of samples that are deemed 'sharp' by all other members of the ensemble except the i -th. Specifically, for each model, we pick the subset of data samples with the topk %highest 'per-data-sample sharpness.' Then, we take the union of all such subsets expect the i -th for creating the subset D i SAM . This partition of data samples can be efficiently computed in parallel as there is no sequential dependency on the training of the ensemble members. However, SharpBalance can be easily adapted for sequential training if memory constraints permit training only one model at a time.

per-data-sample sharpness

Ensemble

sharpness reduction objective

normal objective

Dataset

Top-

Top-

optimization

Union of Top-

Per-data-sample sharpness. This metric is designed to efficiently assess the sharpness of a model for individual data samples. For each data point ( x j , y j ) , sharpness is quantified using the Fisher Information Matrix (FIM), which is expressed as ∇ θ ℓ ( f θ ( x j ) , y j ) ∇ θ ℓ ( f θ ( x j ) , y j ) T . Following a well-established approach [Bottou et al., 2018], we approximate the trace of the FIM by computing the squared ℓ 2 norm of the gradient: ∥∇ θ ℓ ( f θ ( x j ) , y j ) ∥ 2 2 . Other common sharpness metrics, such as worst-case sharpness, trace of the Hessian, or Hessian eigenvalues, are computationally slightly more expensive to approximate [Yao et al., 2020, 2021], but are expected to lead to similar results.

4.4 Empirical evaluation of SharpBalance

Deep Ensemble

SAM

SharpBalance

74

75

76

77

78

Test Accuracy

74.19

75.45

76.12

+1.64

+0.87

+1.20

75.83

76.32

77.32

(a) CIFAR10-C

Deep Ensemble

SAM

SharpBalance

48

49

50

51

52

Test Accuracy

47.66

49.41

50.43

+3.01

+1.88

+2.03

50.67

51.29

52.46

(b) CIFAR100-C

Deep Ensemble

SAM

SharpBalance

26

28

30

32

Test Accuracy

26.30

28.37

29.27

+3.34

+2.45

+2.71

29.64

30.82

31.98

(c) TinyImageNet-C

Deep Ensemble

SAM

SharpBalance

95.0

95.5

96.0

96.5

Test Accuracy

94.74

95.66

95.73

+0.84

+0.40

+0.45

95.58

96.06

96.18

(d) CIFAR10

Deep Ensemble

SAM

SharpBalance

77

78

79

80

Test Accuracy

76.77

77.81

78.06

+2.51

+1.69

+1.78

79.28

79.50

79.84

(e) CIFAR100

Deep Ensemble

SAM

SharpBalance

66

68

70

72

Test Accuracy

65.75

68.26

68.36

+3.85

+2.43

+2.47

69.60

70.69

70.83

(f) TinyImageNet

We evaluate SharpBalance by benchmarking it against both a standard Deep Ensemble, trained using SGD, and a Deep Ensemble enhanced with SAM . The results are presented in Figure 7 for CIFAR-10, CIFAR-100, and TinyImageNet. The comparison between the middle and left bars shows that SAM enhances individual model performance by reducing sharpness. However, this reduction in sharpness also diminishes the overall ensemble effectiveness by lowering diversity, exemplifying the sharpness-diversity trade-off discussed in Section 4.2. Further comparison between the right and middle bars shows that SharpBalance maintains or improves individual performance while improving ensemble effectiveness.

We also evaluate SharpBalance on different ensemble sizes. As shown in Figure 8, SharpBalance demonstrates more pronounced empirical improvements as the number of ensemble models increases. The accuracy difference between SharpBalance and the baseline methods becomes more significant, especially on corrupted data. Specifically, SharpBalance outperforms the baselines by up to 1.30% when ensembling 5 models on CIFAR100-C dataset.

To further evaluate SharpBalance , we provide corroborating results in Appendix F, which includes:

We evaluate SharpBalance on different severity of the corruption on CIFAR10-C, CIFAR100-C and Tiny-ImageNet-C. SharpBalance increasingly outperforms the baselines as the severity of the corruption increases. We also evaluate the proposed method using uncertainty metrics such as negative log-likelihood and expected calibration error.

We further evaluate SharpBalance on other model architectures and tasks, such as WideResNet, ViT, and ALBERT [Lan et al., 2020] on language tasks.

We compare our method of measuring sharpness with another method of measuring the curvature of the loss around a data point [Garg and Roy, 2023] and show the strong correlation between these two methods.

We further compare SharpBalance with ensemble baseline EoA [Arpit et al., 2022], an improved version of SAM (for which individual models in an ensemble are trained with different ρ values) and GSAM [Zhuang et al., 2022]. Results show that SharpBalance can significantly outperform the baselines.

CIFAR10

CIFAR100

CIFAR10-C

CIFAR100-C

CIFAR10

CIFAR100

CIFAR10-C

CIFAR100-C

Deep ensemble + SAM

SharpBalance

96.50

78

96.25-

80

77

52

76

79

75

50

23456

23456

2345(

6

2345

6

Number of models

Number of models

Number of models

0.02

0.03

0.06

R

0.006

EIR

EIR

0.02

0.004

0.01

2

345

6

2

3

45

6

2

3

45

6

2

3

4

5

6

Number of models

Number ofmodels

Number of models

Number of models

We demonstrate that, compared to training a deep ensemble with SAM , our method adds only minimal computational cost. The extra time complexity is dominated by the computation of Fisher trace for evaluating per-sample sharpness, which empirically increases the training time by 1%.

5 Conclusion

Our theoretical and empirical analyses demonstrate the existence of a sharpness-diversity trade-off when sharpness-minimization training methods are applied to deep ensembles. This leads to two main insights that are relevant for improving model performance. First, reducing the sharpness in individual models proves to be beneficial in enhancing the performance of the ensemble as a whole. Second, the accompanying reduction in diversity suggests that popular ensembling methods have limitations, and also highlights the potential for more sophisticated designs that promote diversity among models with lower sharpness. These results are particularly timely, given recent theoretical work on characterizing ensemble improvement [Theisen et al., 2023]. In response to these findings, we have proposed SharpBalance , which 'diagnoses' the training data by evaluating the sharpness of each sample and then fine-tunes the training of individual models to focus on a diverse subset of the sharpest training data samples. This targeted approach helps maintain diversity among models while also reducing their individual sharpness. Extensive evaluations indicate that SharpBalance not only improves the sharpness-diversity trade-off but also delivers superior OOD performance for both dense and sparse models across various datasets and architectures when compared to other ensembling approaches.

Limitations. One limitation of the study is that our theoretical analysis in Section 3 relies on the assumption that the data matrices A , T follow a Gaussian distribution and assumed the optimization objective to be quadratic, which may not always hold in practice. Despite the potentially strong assumptions, our empirical findings in Section 4 show that the conclusions remain robust in real-world datasets with various model architectures. This suggests the insights discovered in our study are applicable to a wider range of real-world scenarios, beyond just those strictly adhering to the Gaussian assumption. Nevertheless, future research could explore how such assumptions can be relaxed and extend the theoretical analysis to a weaker condition.

Acknowledgements. Michael W. Mahoney would like to acknowledge the UC Berkeley CLTC, ARO, IARPA (contract W911NF20C0035), NSF, and ONR for providing partial support of this work. Kurt Keutzer would like to acknowledge support from Berkeley Deep Drive. Yaoqing Yang would like to acknowledge support from DOE under Award Number DE-SC0025584, DARPA under Agreement

number HR00112490441, and Dartmouth College. Our conclusions do not necessarily reflect the position or the policy of our sponsors, and no official endorsement should be inferred.

References

Maksym Andriushchenko, Francesco Croce, Maximilian Mueller, Matthias Hein, and Nicolas Flammarion. A modern look at the relationship between sharpness and generalization. In International Conference on Machine Learning , 2023.

Devansh Arpit, Huan Wang, Yingbo Zhou, and Caiming Xiong. Ensemble of averages: Improving model selection and boosting performance in domain generalization. Advances in Neural Information Processing Systems , 2022.

Christina Baek, Yiding Jiang, Aditi Raghunathan, and J Zico Kolter. Agreement-on-the-line: Predicting the performance of neural networks under distribution shift. Advances in Neural Information Processing Systems , 35:19274-19289, 2022.

Kayhan Behdin and Rahul Mazumder. On statistical properties of sharpness-aware minimization: Provable guarantees. arXiv preprint arXiv:2302.11836 , 2023.

Adrian N Bishop, Pierre Del Moral, Angèle Niclas, et al. An introduction to wishart matrix moments. Foundations and Trends® in Machine Learning , 11(2):97-218, 2018.

Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. SIAM review , 60(2):223-311, 2018.

Leo Breiman. Random forests. Machine learning , 45(1):5-32, 2001.

Anh Bui, Vy Vo, Tung Pham, Dinh Phung, and Trung Le. Diversity-aware agnostic ensemble of sharpness minimizers. arXiv preprint arXiv:2403.13204 , 2024.

Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. Advances in Neural Information Processing Systems , 34:22405-22418, 2021.

Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining , pages 785-794, 2016.

Thomas G Dietterich. Ensemble methods in machine learning. In International workshop on multiple classifier systems , pages 1-15. Springer, 2000.

James Diffenderfer, Brian Bartoldson, Shreya Chaganti, Jize Zhang, and Bhavya Kailkhura. A winning hand: Compressing deep networks can improve out-of-distribution robustness. Advances in neural information processing systems , 34:664-676, 2021.

Laurent Dinh, Razvan Pascanu, Samy Bengio, and Yoshua Bengio. Sharp minima can generalize for deep nets. In International Conference on Machine Learning , pages 1019-1028. PMLR, 2017.

Jiawei Du, Hanshu Yan, Jiashi Feng, Joey Tianyi Zhou, Liangli Zhen, Rick Siow Mong Goh, and Vincent Tan. Efficient sharpness-aware minimization for improved training of neural networks. In International Conference on Learning Representations , 2024.

Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. In International Conference on Learning Representations , 2021.

Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv:1912.02757 , 2019.

Yoav Freund. Boosting a weak learning algorithm by majority. Information and computation , 121(2): 256-285, 1995.

Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences , 55(1):119-139, 1997.

Mudasir A Ganaie, Minghui Hu, AK Malik, M Tanveer, and PN Suganthan. Ensemble deep learning: A review. Engineering Applications of Artificial Intelligence , 115:105151, 2022.

Xiang Gao, Meera Sitharam, and Adrian E. Roitberg. Bounds on the jensen gap, and implications for mean-concentrated distributions. The Australian Journal of Mathematical Analysis and Applications , 2019.

Isha Garg and Kaushik Roy. Samples with low loss curvature improve data efficiency. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition , pages 20290-20300, 2023.

Diego Granziol. Flatness is a false friend. arXiv preprint arXiv:2006.09091 , 2020.

Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition , pages 770-778, 2016.

Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations , 2019a.

Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations , 2019b.

Geoffrey E. Hinton and Drew van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In Proceedings of the Sixth Annual Conference on Computational Learning Theory , 1993.

Sepp Hochreiter and Jürgen Schmidhuber. Flat Minima. Neural Computation , 9(1):1-42, 1997.

Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. In 34th Conference on Uncertainty in Artificial Intelligence 2018, UAI 2018 , pages 876-885. Association For Uncertainty in Artificial Intelligence (AUAI), 2018.

Weisen Jiang, Hansi Yang, Yu Zhang, and James Kwok. An adaptive policy to employ sharpnessaware minimization. In International Conference on Learning Representations , 2023.

Yiding Jiang, Vaishnavh Nagarajan, Christina Baek, and J Zico Kolter. Assessing generalization of SGD via disagreement. In International Conference on Learning Representations , 2022.

Jean Kaddour, Linqing Liu, Ricardo Silva, and Matt J Kusner. When do flat minima optimizers work? Advances in Neural Information Processing Systems , 35:16577-16595, 2022.

Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. In International Conference on Learning Representations , 2016.

Sosuke Kobayashi, Shun Kiyono, Jun Suzuki, and Kentaro Inui. Diverse lottery tickets boost ensemble from a single pretrained model. In Proceedings of BigScience Episode #5 - Workshop on Challenges & Perspectives in Creating Large Language Models , 2022.

Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.

Kullback and R. A. Leibler. On Information and Sufficiency. The Annals of Mathematical Statistics , 22(1):79 - 86, 1951. doi: 10.1214/aoms/1177729694.

Jungmin Kwon, Jeongseop Kim, Hyunseo Park, and In Kwon Choi. Asam: Adaptive sharpness-aware minimization for scale-invariant learning of deep neural networks. In International Conference on Machine Learning , pages 5905-5914. PMLR, 2021.

Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems , 30, 2017.

Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. Albert: A lite bert for self-supervised learning of language representations. In International Conference on Learning Representations , 2020.

François Laviolette, Emilie Morvant, Liva Ralaivola, and Jean-Francis Roy. Risk upper bounds for general ensemble methods with an application to multiclass classification. Neurocomputing , 219: 15-25, 2017.

Ya Le and Xuan S. Yang. Tiny imagenet visual recognition challenge. 2015.

Yoonho Lee, Huaxiu Yao, and Chelsea Finn. Diversify and disambiguate: Learning from underspecified data. In ICML 2022: Workshop on Spurious Correlations, Invariance and Stability , 2022.

Shiwei Liu, Tianlong Chen, Zahra Atashgahi, Xiaohan Chen, Ghada Sokar, Elena Mocanu, Mykola Pechenizkiy, Zhangyang Wang, and Decebal Constantin Mocanu. Deep ensembling with no overhead for either training or testing: The all-round blessings of dynamic sparsity. In International Conference on Learning Representations , 2022.

Andres Masegosa. Learning under model misspecification: Applications to variational and ensemble methods. Advances in Neural Information Processing Systems , 33:5479-5491, 2020.

Alireza Mehrtash, Purang Abolmaesumi, Polina Golland, Tina Kapur, Demian Wassermann, and William Wells. Pep: Parameter ensembling by perturbation. Advances in neural information processing systems , 33:8895-8906, 2020.

Jishnu Mukhoti, Andreas Kirsch, Joost van Amersfoort, Philip HS Torr, and Yarin Gal. Deterministic neural networks with appropriate inductive biases capture epistemic and aleatoric uncertainty. arXiv preprint arXiv:2102.11582 , 2021.

Behnam Neyshabur, Srinadh Bhojanapalli, and Nathan Srebro. A PAC-bayesian approach to spectrally-normalized margin bounds for neural networks. In International Conference on Learning Representations , 2018.

Luis A Ortega, Rafael Cabañas, and Andres Masegosa. Diversity and generalization in neural network ensembles. In International Conference on Artificial Intelligence and Statistics , pages 11720-11743. PMLR, 2022.

Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. Advances in neural information processing systems , 32, 2019.

Tianyu Pang, Kun Xu, Chao Du, Ning Chen, and Jun Zhu. Improving adversarial robustness via promoting ensemble diversity. In International Conference on Machine Learning , pages 4970-4979. PMLR, 2019.

Jack Parker-Holder, Luke Metz, Cinjon Resnick, Hengyuan Hu, Adam Lerer, Alistair Letcher, Alexander Peysakhovich, Aldo Pacchiano, and Jakob Foerster. Ridge rider: Finding diverse solutions by following eigenvectors of the hessian. Advances in Neural Information Processing Systems , 33:753-765, 2020.

Alexandre Rame, Matthieu Kirchmeyer, Thibaud Rahier, Alain Rakotomamonjy, Patrick Gallinari, and Matthieu Cord. Diverse weight averaging for out-of-distribution generalization. Advances in Neural Information Processing Systems , 35:10821-10836, 2022.

Ryan Theisen, Hyunsuk Kim, Yaoqing Yang, Liam Hodgkinson, and Michael W Mahoney. When are ensembles really effective? Advances in neural information processing systems , 2023.

Giorgio Valentini and Thomas G Dietterich. Low bias bagged support vector machines. In Proceedings of the 20th International Conference on Machine Learning (ICML-03) , pages 752-759, 2003.

Roman Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science . Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, 2018.

Tim Whitaker and Darrell Whitley. Prune and tune ensembles: low-cost ensemble learning with sparse independent subnetworks. In Proceedings of the AAAI Conference on Artificial Intelligence , volume 36, pages 8638-8646, 2022.

Yaoqing Yang, Liam Hodgkinson, Ryan Theisen, Joe Zou, Joseph E Gonzalez, Kannan Ramchandran, and Michael W Mahoney. Taxonomizing local versus global structure in neural network loss landscapes. Advances in Neural Information Processing Systems , 34:18722-18733, 2021.

Zhewei Yao, Amir Gholami, Qi Lei, Kurt Keutzer, and Michael W Mahoney. Hessian-based analysis of large batch training and robustness to adversaries. Advances in Neural Information Processing Systems , 31, 2018.

Zhewei Yao, Amir Gholami, Kurt Keutzer, and Michael W Mahoney. Pyhessian: Neural networks through the lens of the hessian. In 2020 IEEE international conference on big data (Big data) , pages 581-590. IEEE, 2020.

Zhewei Yao, Amir Gholami, Sheng Shen, Mustafa Mustafa, Kurt Keutzer, and Michael Mahoney. Adahessian: An adaptive second order optimizer for machine learning. In proceedings of the AAAI conference on artificial intelligence , volume 35, pages 10665-10673, 2021.

Juntang Zhuang, Boqing Gong, Liangzhe Yuan, Yin Cui, Hartwig Adam, Nicha C Dvornek, James s Duncan, Ting Liu, et al. Surrogate gap minimization improves sharpness-aware training. In International Conference on Learning Representations , 2022.

Max Zimmer, Christoph Spiegel, and Sebastian Pokutta. Sparse model soups: A recipe for improved pruning via model averaging. In International Conference on Learning Representations , 2024.

Appendix

A Impact Statement

This paper uncovers a trade-off between sharpness and diversity in deep ensembles and introduces a novel training strategy to achieve an optimal balance between these two crucial metrics. While the proposed method could potentially be misused for malicious purposes, we believe that the study itself does not pose any direct negative societal impact. More importantly, this research advances the field of ensemble learning and contribute to the development of more reliable deep ensemble models. These advancements consequently result in enhanced robustness when dealing with OOD data and enable the quantification of uncertainty, thereby strengthening the reliability and applicability of deep learning systems in real-world scenarios.

B Related work

Ensembling . Diversity is one of the major factors that contribute to the success of the ensembling method. Popular ensemble techniques have been developed for tree-type individual learners, which are known to have a high variance. This is evident such as in [Breiman, 2001, Chen and Guestrin, 2016, Freund, 1995, Freund and Schapire, 1997]. In contrast, more stable algorithms, such as support vector machines (SVM) type learners, are less commonly used for ensembles, unless they are tuned to a low-bias, high-variance regime, as explored in [Valentini and Dietterich, 2003]. When it comes to diversity and ensembling, NNs are known to exhibit properties different than traditional models, e.g., as described in recent theoretical and empirical work on loss landscapes and emsemble improvement [Theisen et al., 2023, Yang et al., 2021]. Therefore, ensembling techniques that work well for traditional models (e.g., tree-type models) often underperform the simple yet efficient deep ensembles method [Fort et al., 2019, Ortega et al., 2022] that uses the independent initialization and optimization. Previous literature has explored various new methods to learn diverse NNs [Lee et al., 2022, Rame et al., 2022, Pang et al., 2019, Parker-Holder et al., 2020]. Our work is different from previous work in that we study flat ensembles obtained from sharpness-aware training methods, especially focusing on diversifying flat ensembles by reducing the overlap between sharpness-aware data subsets. While our work demonstrates significant improvements in OOD generalization, it is known that (in some cases, see also Theisen et al. [2023]) deep ensembling is a simple, yet effective method to improve OOD performance [Diffenderfer et al., 2021]. Therefore, we compare the OOD performance of SharpBalance to deep ensembles.

Sharpness and generalization . A large body of work has studied the relationship between the sharpness (or flatness) of minima and the generalizability of models [Hochreiter and Schmidhuber, 1997, Hinton and van Camp, 1993, Keskar et al., 2016, Neyshabur et al., 2018, Yang et al., 2021, Kaddour et al., 2022, Yao et al., 2021, 2020]. Works such as those by [Hochreiter and Schmidhuber, 1997] and [Hinton and van Camp, 1993] use Bayesian learning and minimum description length to explain why we should train models to flat minima. [Keskar et al., 2016] introduces a sharpness-based metric, demonstrating how large-batch training can skew NNs towards sharp local minima, adversely affecting generalization. In addition, [Neyshabur et al., 2018] uses a PAC-Bayesian framework to prove bounds on generalization, which can be interpreted as the relationship between sharpness and test accuracy. Furthermore, [Cha et al., 2021] presents a theoretical exploration of the link between the sharpness of minima and OOD generalization.

Motivated by the good generalization property of flat minima, variants of sharpness-guided optimization techniques have been proposed [Yao et al., 2018, 2021, Du et al., 2024, Jiang et al., 2023], including sharpness-aware minimization [Foret et al., 2021]. The DiWA method [Rame et al., 2022] observed that SAM can decrease the diversity of models in the context of weight averaging (WA) [Izmailov et al., 2018]. However, WA imposes constraints on different models, requiring them to share the same initialization and stay close to each other in the parameter space. In contrast, our work focuses on deep ensembles that do not pose additional constraints on the training trajectories of individual ensemble members. Previous work by [Behdin and Mazumder, 2023] provided a theoretical characterization of important statistical properties for kernel regression models and single-layer ReLU networks, optimized using SAM on noisy datasets. Our theoretical analysis borrows ideas from [Behdin and Mazumder, 2023] and extends the analysis using random matrix theory. DASH was proposed in [Bui et al., 2024] to minimize the generalization loss by adding KL divergence constraint

on the output logits of ensemble members. The authors believe that the decrease in diversity is a result of models being initialized closely and updated with the same direction. In contrast, SharpBalance observed that the sharpness-diversity trade-off is ubiquitous across various settings and provides a rigorous theoretical quantification that characterizes the interplay of the two metrics. Compare to DASH, SharpBalance provably achieves improved performance and is simple, effective, and computationally cheap to implement.

C Proof of Theorems in Section 3

Recall that SAM updates the model weights, ignoring the normalization constant and regularization, through the following recursive rule

We first show an unrolling of the iterative optimization on a quadratic objective.

Theorem 3 (Unrolling SAM ) . Let θ ∗ be the teacher model. Let θ 0 be randomly initialized and updated with SAM to solve a quadratic objective L A ( θ ) = 1 2 ( θ -θ ∗ ) T A T A ( θ -θ ∗ ) . Then,

where B = I -η A T A -ηρ ( A T A ) 2 .

Proof. The gradient of the objective f is given by ∇ f ( θ ) = A T A ( θ -θ ∗ ) . Therefore,

With SAM update,

where the last equation is obtained by recursively unrolling the weight by previous updates.

Theorem 3 offers a valuable tool to analyze the statistical behavior of the models optimized by SAM . However, one more ingredient is required to arrive at the interesting conclusions claimed in Section 3, the random matrix theory. Recall that the data matrix A ∈ R n tr × d in is random with entries drawn from Gaussian N (0 , I /d in ) . As a result, entries in A T A follows the Wishart distribution and according to Corollary 3.3 in Bishop et al. [2018], for k ≥ 1 ,

where N k,i = 1 i ( k -1 i -1 )( k i -1 ) is the Narayana number. With the help of this Corollary, we now prove a proposition on the expectation of B k .

Proposition 1 (Expectation of Wishart Moments) . Let i, j be non-negative integers, then

where

Let m = k 2 +2 k 3 + j and taking the expectation with equation (6) gives

If j = 0 , then there is a case when k 2 = k 3 = 0 , and the expectation of ( A T A ) 0 simply becomes I . Therefore,

C.1 Proof of Theorem 1

In this subsection, we show a proof for Theorem 1.

Proof. Apply Singular Value Decomposition (SVD) to obtain A = V Σ U T and A T A = U Σ 2 U T . Let D = Σ 2 . By Theorem 3,

As a result, E θ 0 [ θ SAM k ] = θ ∗ -( I -η A T A -ηρ ( A T A ) 2 ) k θ ∗ = θ ∗ -B k θ ∗ . By definition,

Since E T [ T T T ] = n te d in I and E [ θ 0 θ T 0 ] = σ 2 I . Hence,

Recall that given a perturbation radius ρ 0 , the sharpness is defined as

We first compute

Similarly,

Let λ min be the least eigenvalue of A T A . By subtracting equation (7) with equation (8), we have

The smallest singular value λ min of a random n × d in matrix A can be bounded by the following inequality on the smallest singular value σ min ( A ) by Vershynin [2018], assuming n tr ≥ d in, then almost surely

Therefore, E A [ λ min ] ≥ E A [ σ min ( A )] 2 ≥ (√ n tr d in -1 ) 2 . Now we show a lower bound on E A [ ρ 0 ∥ B k A T A θ ∗ ∥ 2 ] . By Gao et al. [2019], the Jensen gap ( E [ Z ]) 1 / 2 -E [( Z ) 1 / 2 ] is upper bounded by Var ( Z ) 2 when Z is non-negative and E [ Z ] = 1 . Notice that

By normalizing Z and applying the Jensen gap upperbound, we have

As a result,

The derivation of the upper bound follows from a similar proof, ignoring the Jensen gap.

C.2 Proof of Theorem 2

Below we show a proof of Theorem 2.

Proof. We apply SVD to A s to obtain A s = V s Σ s U T s and A T s A = U s Σ 2 s U T s . Let D s = Σ 2 s and B s = I -η A T s A s -ηρ ( A T s A s ) 2 . By Theorem 3 and a similar derivation in the proof of Theorem 1,

Applying Proposition 1, we have where

Then,

The last equality is the result of applying E A [ B i s ] = ϕ ′ ( i, 0) with different combinations of B s , B s ′ , counting multiplicity. Similarly,

Therefore,

When the model is trained on the submatrix, the sharpness of model θ SharpBal k is defined as

From a similar analysis of the proof for Theorem 1,

and with r = n tr Sd in ,

The last equality is the result of applying E A [ B i s ( A T s A s ) j ] = ϕ ′ ( i, j ) with different combinations of B s , B s ′ , A T j A j , and A T l A l , counting multiplicity and the fact that E A [( A T s A s ) 2 ] = r (1 + r ) I . In conclusion, where

The claims in Theorem 2 is further supported by the experimental validations with results presented in Figure 9.

(a) Varying perturbation radius

ρ

(b) Varying number of training iterations k

Upper bound of sharpness (x-axis)

Upper bound of sharpness (x-axis)

Simulated

0.10

Simulated

p=1.0

100

Diversity

Diversity

0.06

1

UpperBound onSharpness

0.04

Upper Bound on Sharpness

p=0.4

k=15

0.03

1.0

10.0

0.4

0.5

0.6

0.7

0.8

0.9

Sharpness

Sharpness

C.3 Empirical Verification of Theorem 1 and 2

To demonstrate the robustness and tightness of the bounds presented in Theorem 1, we provide verification results across a range of parameter configurations. Interestingly, the observed model behaviors closely align with the upper bound derived in Theorem 1, highlighting the effectiveness of our theoretical analysis in capturing the underlying dynamics of the ensemble. Figure 10 illustrates these results, with each sub-figure corresponding to a specific combination of k and η with ρ from range 0 . 5 to 0 . 3 . In these experiment, we generated 50 random data matrices A of size 3000 × 150 and test data T of size 1000 × 150 . For each random dataset, we initialized 50 random model weights θ 0 and collected the expected statistics of interest after training. To measure the sharpness κ SAM k , we employed projected gradient ascent to find the optimal perturbation, using a step size of 0 . 01 and a maximum of 50 steps. Similar experiments are performed to verify the derivations in Theorem 2 with results presented in Figure 11, with the number of partitions S = 10 .

D Hyperparamter setting

D.1 Datasets

We first evaluate on image classification datasets CIFAR-10 and CIFAR-100. The corresponding OOD robustness is evaluated on CIFAR-10C and CIFAR-100C [Hendrycks and Dietterich, 2019b]. The experiments are carried out on ResNet18 [He et al., 2016]. We use a batch size of 128, a momentum of 0.9, and a weight decay of 0.0005 for model training. TinyImageNet is an image classification dataset consisting of 100K images for training and 10K images for in-distribution testing. We evaluate ensemble's OOD robustness on TinyImageNetC [Hendrycks and Dietterich, 2019b].

D.2 Hyperparamter setting for empirical sharpness-diversity trade-off

Here, we provide the hyperparameter for the experiments in Section 4.2. When using adaptive worst-case sharpness for sharpness measurement, the size of neighborhood γ defined in equation (3) needed to be specified, we use a γ of 0.5 for all the results in Figure 1 and Figure 5. Additionally, when training NNs in the ensemble, we change the perturbation radius ρ of SAM so that we can study the trade-off. The range of ρ for the results in Figure 1 is { 0 . 01 , 0 . 02 , 0 . 03 , 0 . 04 , 0 . 05 , 0 . 1 , 0 . 2 , 0 . 3 } , the range of ρ for the results in Figure 5 is { 0 . 01 , 0 . 015 , 0 . 02 , 0 . 025 , 0 . 03 , 0 . 05 , 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 } .

(a)

k

= 2

, η

= 0

.

1

(b)

k

= 2

, η

= 0

.

05

(c)

k

= 2

, η

= 0

.

01

(d)

k

= 4

, η

= 0

.

1

(e)

k

= 4

, η

= 0

.

05

(f)

k

= 4

, η

= 0

.

01

(g)

k

= 8

, η

= 0

.

1

(h)

k

= 8

, η

= 0

.

05

(i)

k

= 8

, η

= 0

.

01

Simulated

6×10+--

Lower bound of sharpness (x-axis)

3×103

Upper bound of sharpness (x-axis)

4×10*

2×103

10°%

Diversity

Diversity

2 ×10

103

6x 102

104

3×10²

4×10²

6×10²

4×10²

6×10

了

102

10

10°

2×10° 3×104×10°

Sharpness

Sharpness

Sharpness

Simulated

Lower bound of sharpness (x-axis)

10----

Upper bound of sharpness (x-axis)

10²/

8

Diversity

Diversity

108

Diversity

10′

1010

10”

10%

10$

10°

104

10'

Sharpness

Sharpness

Sharpness

Simulated

Lower bound of sharpness (x-axis)

10

1019

Upper bound of sharpness (x-axis)

Diversity

1023

Diversity

1018

Diversity

10

1022

1017

103

1021

1016

D

1010

10!1

1012

108

109

1010

10'

102

103

Sharpness

Sharpness

Sharpness

D.3 Hyperparamter setting for SharpBalance

Hyperparameter setting on CIFAR10/100 . For experiments on CIFAR10/100, we train an NN from scratch with basic data augmentations, including random cropping, padding by four pixels, and random horizontal flipping. We use a batch size of 128, a momentum of 0.9, and a weight decay of 0.0005. For deep ensemble, we train each model for 200 epochs.

In addition, we use 10% of the training set as the validation set for selecting ρ and k based on the ensemble's performance. We make a grid search for ρ over { 0 . 01 , 0 . 02 , 0 . 05 , 0 . 1 , 0 . 2 , 0 . 5 } . For SharpBalance , we use the same ρ as SAM and search k over { 0 . 2 , 0 . 3 , 0 . 4 , 0 . 5 , 0 . 6 } . T d is another hyperparameter introduced by SharpBalance , we use a T d of 10 for all experiments on CIFAR10, a T d of 100 and 150 respectively when training dense and sparse models on CIFAR100. See Table 1 for the optimal ρ and k after grid search.

Hyperparameter setting on TinyImageNet . For experiments on TinyImageNet, we adopt basic data augmentations, including random cropping, padding by four pixels, and random horizontal flipping. We train each model for 200 epochs. We use a batch size of 128, a momentum of 0.9, a weight decay of 5e-4, a T d of 100, an initial learning rate of 0.1, and decay it with a factor of 10 at Epoch 100 and 150. We search ρ and k in the same range as what we do on CIFAR10/100. See Table 1 for the optimal ρ and k after grid search.

(a)

k

= 4

, η

= 0

.

5

(b)

k

= 4

, η

= 0

.

3

(c)

k

= 4

, η

= 0

.

1

(d)

k

= 8

, η

= 0

.

5

(e)

k

= 8

, η

= 0

.

3

(f)

k

= 8

, η

= 0

.

1

(g)

k

= 12

, η

= 0

.

5

(h)

k

= 12

, η

= 0

.

3

(i)

k

= 12

, η

= 0

.

1

Simulated

Upper bound of sharpness (x-axis)

10'

--------

Diversity

10°

-

104

10²

10-

102

103

10

10²

10°

Sharpness

Sharpness

Sharpness

Simulated

Upper bound of sharpness (x-axis)

10'6

：.....

1012]

103

Diversity

1014

Diversity

Diversity

10°

10'

1012

10°

10'0

10-

10

10°

10′

108

103

10

10'

10°

10'

10²

Sharpness

Sharpness

Sharpness

Simulated

Upper bound of sharpness (x-axis)

1022

102s

10%

Diversity

Diversity

1018

Diversity

1021

10°

1014

10'7

1010

10°%

108

1010

10'2

105

10?

109

1011

10°

10²

104

Sharpness

Sharpness

Sharpness

E Ablation studies on loss landscape metrics

In this section, we show that the sharpness-diversity trade-off generalizes to different measurements of sharpness and diversity. The results are presented in Figure 12.

0.3

0.4

0.5

0.6

0.7

Adaptive

worst-case sharpness

0.60

0.65

0.70

0.75

DER

: 0.17

50.5

51.0

51.5

Ensemble OOD Accuracy

(a) Diff sharpness (CIFAR-100)

0.3

0.4

0.5

0.6

0.7

Adaptive average case sharpness

0.60

0.65

0.70

0.75

DER

: 0.23

50.5

51.0

51.5

Ensemble OOD Accuracy

(b) Diff sharpness (CIFAR-100)

0.4

0.5

0.6

0.8

1.0

Adaptive worst case sharpness

0.5

0.6

0.7

0.8

KL

: 0.52

50.5

51.0

51.5

Ensemble OOD Accuracy

(c) Diff diversity (CIFAR-100)

1.0

1.2

1.4

1.6

1.8

Adaptive

worst-case sharpness

0.7

0.8

0.9

DER

: 0.22

30.0

30.5

31.0

Ensemble OOD Accuracy

(d) Diff sharpness (TIN)

3.0

3.5

4.0

4.5

Adaptive average case sharpness

0.7

0.8

0.9

DER

: 0.32

30.0

30.5

31.0

Ensemble OOD Accuracy

(e) Diff sharpness (TIN)

2.0

2.5

3.0

Adaptive worst case sharpness

0.7

0.8

0.9

1.1

1.3

KL

: 0.98

30.0

30.5

31.0

Ensemble OOD Accuracy

(f) Diff diversity (TIN)

Sharpness metric. In the main paper, we use adaptive worst-case sharpness defined in equation (3), the parameter neighborhood is bounded by ℓ 2 norm. In this section, we consider two more sharpness metrics [Kwon et al., 2021, Andriushchenko et al., 2023]: adaptive worst-case sharpness with the parameter neighborhood bounded by ℓ ∞ norm (referred to as adaptive ℓ ∞ worst-case sharpness); and adaptive average case sharpness bounded by ℓ 2 norm (termed average case sharpness). The adaptive ℓ ∞ worst-case sharpness is defined as:

The average case sharpness is defined as:

where ρ 0 is the neighborhood size of current parameter θ . T θ is a normalization operator that ensures the sharpness measure is invariant with respect to the re-scaling operation of the parameter. The results, illustrated in Figures 12, corroborate our observation of a trade-off between sharpness and diversity.

Diversity metric . We consider Kullback-Leibler (KL) Divergence [Kullback and Leibler, 1951] as an alternative diversity metric, which is also widely used in previous literature to gauge the diversity of two ensemble members [Fort et al., 2019, Liu et al., 2022]. Specifically, the KL-divergence between the outputs of two ensemble members given a data sample ( x , y ) is defined as:

We measure the KL divergence on each data sample in the test data and then average the measured KL divergence. The results for KL-divergence are shown in Figure 12, which demonstrate the trade-off remains consistent for different diversity metrics.

F More results

F.1 Evaluation on different corruption severity

SharpBalance 's main advantage lies in OOD scenarios. As shown in Table 2-4, SharpBalance consistently outperforms the baselines on different levels of corruption.

F.2 Evaluation on different model architectures

We extend the evaluations on more architectures such as WideResNet (WRN), ViT, and ALBERT. Here we describe the experimental setup. For vision tasks with WRN, we trained the ensemble members from scratch on CIFAR-10 and CIFAR-100. For vision tasks with transformers, we constructed the three-member ensemble by fine-tuning the pre-trained ViT-T/16 model on the CIFAR100 dataset, evaluated on in-distribution and CIFAR100-C test sets. For language tasks, we constructed the three-member ensemble by fine-tuning the pre-trained ALBERT-Base model on Microsoft Research Paraphrase Corpus (MRPC) dataset and evaluated the performance on its validation set. The hyperparameter search and setup are the same as in Appendix D.3.

These results in Figure 13 and Table 5 confirm that SharpBalance consistently boosts both ID and OOD performance across the models and datasets studied.

Deep Ensemble

SAM

SharpBalance

73

74

75

76

77

Test Accuracy

73.03

74.56

75.37

+2.03

+1.02

+1.24

75.06

75.58

76.61

(a) CIFAR10-C

Deep Ensemble

SAM

SharpBalance

46

47

49

50

51

52

Test Accuracy

46.15

48.42

48.65

+2.64

+3.26

50.15

51.06

51.91

(b) CIFAR100-C

Deep Ensemble

SAM

SharpBalance

94.5

95.0

95.5

96.0

Test Accuracy

94.41

95.36

95.41

+0.90

+0.29

+0.41

95.31

95.65

95.82

(c) CIFAR10

Deep Ensemble

SAM

SharpBalance

76

78

80

Test Accuracy

75.15

77.38

77.39

+3.73

+2.46

+2.62

78.88

79.84

80.01

(d) CIFAR100

F.3 Sharpness-aware set: hard vs easy examples

SharpBalance aims to achieve the optimal balance by applying SAM to a carefully selected subset of the data while performing standard optimization on the remaining samples. In our work, sharpness is determined by the curvature of the loss around the model's weights, whereas [Garg and Roy, 2023] determines it based on the curvature of the loss around a data point. In Figure 14, we rank 1000 samples using both metrics and found a strong correlation between these two.

0

2

4

6

loss curvature around input data

0

1000

2000

3000

4000

5000

sharpness(fisher trace)

Rank correlation:0.82

F.4 Comparison with more baselines

We compare SharpBalance with stronger ensemble method EoA [Arpit et al., 2022] and stronger SAMmethods. We carefully tuned the hyperparameters for EoA. EoA fine-tuned a pre-trained model; and in our paper, all models are trained from scratch. We compare SharpBalance with another SAM baseline: SAM + , where three individual models are trained with different ρ values, e.g., 0.05, 0.1, and 0.2, respectively. From Table 6, SharpBalance outperforms these two baselines both in-distribution and OOD generalization.

In Table 7, we combine GSAM [Zhuang et al., 2022] with Deep Ensemble as a new baseline method 'Deep Ensemble + GSAM', and incorporate the GSAM into our method SharpBalance. The results show that the new baseline with GSAM outperforms the original baseline in ID and OOD performance but still underperforms SharpBalance (w/ SAM). Furthermore, we enhance SharpBalance by replacing the SAM with GSAM, which leads to better ID performance.

2

4

6

Number of models

2.1

2.2

2.3

ECE

(a) Expected Calibration Error (ECE)

2

4

6

Number of models

0.08

0.10

0.12

NLL

(b) Negative Log Likelihood (NLL)

F.5 Evaluation on uncertainty metrics

In Figure 15, we present the results of uncertainty metrics, i.e., negative log-likelihood and expected calibration error. These uncertainty metrics exhibit trends similar to the accuracy metrics: "Deep Ensemble + SAM" outperforms "Deep Ensemble", and our method outperforms both baselines. The experiments were conducted using ResNet-18 on CIFAR100, with metrics reported on corrupted datasets. Additionally, we observe that both metrics improve as the number of ensemble members increases for all three methods.

G Experiments Compute Resources

All codes are implemented in PyTorch, and the experiments are conducted on 3 Nvidia Quadro RTX 6000 GPUs for training an ensemble of 3 models. Compared to SAM , our method adds a minimal computational cost. The extra time comes from using Fisher trace to compute the per-sample sharpness. Therefore, computing the per-sample sharpness requires one single forward pass and one backward pass. We report the additional training cost in Table 8. SharpBalance only increases the training time by 1%: 0 . 83 (84 . 48 -0 . 83) × 100% ≈ 1% .

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: Main claims made in the abstract and introduction accurately reflect the scope and contribution of the paper, supported by our theoretical and experimental results.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: The limitations of the work are discussed in Section 5.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: Proofs of all theoretical results are provided in Appendix C and the assumptions are clearly stated in the theorems.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: The paper fully discloses all relevant information including detailed description of the algorithms, datasets, experimental set up in Section 4 and hyperparameters in Appendix D to reproduce the main experimental results claimed in the paper.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: The implementation can be found through the anonymous github repository and the zip file uploaded as the supplementary materials.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: The experimental settings with hyperparameters are provided in both Section 4 and Appendix D.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: The results are accompanied by error bars, for the experiments in Section 4.4 that support the main claims of the paper.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: The information on the computer resources for experiments can be found in Appendix G.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [Yes]

Justification: The impact statement of the study can be found in Appendix A.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: The paper poses no such risks.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: The original papers that produced the code or dataset are appropriately cited in this work.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: The paper does not release new assets.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects. Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: The paper does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
comments: SUMMARY:
This paper presents introduces a training approach for ensemble learning called SharpBalance to balance sharpness and diversity within ensembles. This paper shows theoretically that SharpBalance achieves a better sharpness-diversity trade-off.

STRENGTHS:
1. Ensemble learning is an important research direction.
2. Understanding of sharpness and diversity within deep ensembles is important for the study of generalization to both in-distribution and out-of-distribution data.
3. The paper is technically sound.

WEAKNESSES:
1. Since SharpBalance focuses "on a diverse subset of the sharpest training data samples", it may not apply in small datasets where available data is already sparse.
2. Empirical improvement over existing methods is marginal.

QUESTIONS:
1. Why does SharpBalance seem more effective on corrupted data?
2. Do models in an ensemble converge on the same local minima?

LIMITATIONS:
Limitations are adequately addressed.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2024-06-21

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper investigates the sharpness and diversity within deep ensembles. Specifically, it identifies the trade-off phenomenon between sharpness and diversity with both theoretical and empirical evidence. Additionally, it proposes a method called SharpBalance, which trains individuals using selective 'sharp' subsets. Conducted experiments have demonstrated the effectiveness of the proposed SharpBalance when applied to deep ensembles.\n\nSTRENGTHS:\nThere are several strengths in this paper:\n\n- The exploration of sharpness and diversity in deep ensembles is both interesting and novel.\n\n- Sufficient theoretical and empirical evidence has been provided for validation.\n\n- The proposed method is simple, effective, and accompanied by code for verification.\n\nWEAKNESSES:\nHowever, I still have the following concerns:\n\n - The evaluation seems a bit weak. The authors should consider comparing with more ensemble baselines.\n\n - What is the scale of $D_{SAM}^i$ and how does it change during training? Providing some details on this would help in understanding the proposed method.\n\n - Refer to Line 166: How do the authors train individuals with the full datasets? Are these individuals trained with different initializations?\n\n - (Optional) As described, the model's generalization is not merely correlated with sharpness, which aligns with some recent advanced SAM variants. Thus, integrating these advanced variants [1][2] with SharpBal would be more beneficial for studying the trade-off between sharpness and diversity.\n\nReferences:\n\n[1] Random Sharpness-Aware Minimization. In NeurIPS 2022.\n\n[2] Gradient Norm Aware Minimization Seeks First-Order Flatness and Improves Generalization. In CVPR 2023.\n\nQUESTIONS:\nPlease refer to the **Weaknesses**.\n\nLIMITATIONS:\nThe authors have provided **Limitations** section.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-08"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper proposes SharpBalance, that is a method aiming to investigate the relationship between sharpness and diversity for deep ensembles.\n\nSTRENGTHS:\n- SharpBalance looks quite effective for the out-of-distribution setting. The goal of balancing sharpness and diversity within ensembles is an important idea.  \n- Great theoretical analysis\n\nWEAKNESSES:\n- The authors are aware of the paper called “Diversity-Aware Agnostic Ensemble of Sharpness Minimizers” [1], the idea is quite like the proposed paper, they aim to investigate the relations between sharpness and diversity on ensemble learning. I suggest the authors to discuss the main differences between both.    \n\n[1] Anh Bui, Vy Vo, Tung Pham, Dinh Phung and Trung Le, Diversity-Aware Agnostic Ensemble of Sharpness Minimizers, arXiv:2403.13204. \n\n- Regarding the baselines the authors only compare SharpBalance with SAM. Nevertheless, newer, and stronger baselines like GSAM [2] and OBF [3] should also be benchmarked since they are the current state-of-the-art. \n\n[2] Zhuang, J., Gong, B., Yuan, L., Cui, Y., Adam, H., Dvornek, N., Tatikonda, S., Duncan, J., and Liu, T. Surrogate gap minimization improves sharpness-aware training. arXiv preprint arXiv:2203.08065, 2022. \n\n[3] Vani, A; Tung, F; Oliveira G; Sharifi H. Forget Sharpness: Perturbed Forgetting of Model Biases Within SAM Dynamics, International Conference on Machine Learning (ICML) 2024.  \n\n- Another point to improve are the datasets. I strongly suggest the authors to benchmark with at least a couple large scale datasets. Options are ImageNet-V1 [4] for training and ImageNet-Real [5] and ImageNet-V2 [6] for testing, ImageNet-R [7] for out-of-distribution robustness benchmark and ImageNet-Sketch [8].  \n\n[4] Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. ImageNet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. IEEE, 2009 \n\n[5] Beyer, L., He ́naff, O. J., Kolesnikov, A., Zhai, X., and Oord, A. v. d. Are we done with imagenet? arXiv preprint arXiv:2006.07159, 2020. \n\n[6] Recht, B., Roelofs, R., Schmidt, L., and Shankar, V. Do imagenet classifiers generalize to imagenet? In Interna- tional conference on \nmachine learning, pp. 5389–5400. PMLR, 2019. \n\n[7] Hendrycks, D., Basart, S., Mu, N., Kadavath, S., Wang, F., Dorundo, E., Desai, R., Zhu, T., Parajuli, S., Guo, M., et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8340–8349, 2021. \n\n[8] Wang, H., Ge, S., Lipton, Z., and Xing, E. P. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems, pp. 10506–10518, 2019.\n\nQUESTIONS:\n- Regarding the new discovery contribution. As I previously stated on the weakness section were the authors aware of the paper “Diversity-Aware Agnostic Ensemble of Sharpness Minimizers. Could the authors present the main differences between this method and SharpBalance.\n\nLIMITATIONS:\n- The proposed method is not a significant improvement for ID scenarios as the authors claim. I would tone that down over the whole text. Maybe clearly state that SharpBalance is indeed superior to OOD scenarios and competitive on ID settings.  \n\n- I would not claim the phenomenon called sharpness-diversity trade-off is a discovery, paper [1] is addressing the same phenomena and it was publicly available on arxiv before submission and on openreview since the beginning of the year.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-08"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nEnsemble methods and sharpness-aware optimization techniques are well-known strategies for improving generalization. This work identifies a trade-off between sharpness and diversity, observing that reducing sharpness can diminish diversity and harm ensemble performance. Through theoretical and empirical analysis of this sharpness-diversity trade-off, the authors present SharpBalance, an algorithm for training ensembles with sharpness-aware solutions without sacrificing diversity. Evaluation results on CIFAR-10/100, TinyImageNet, and their corrupted variants confirm the effectiveness of SharpBalance.\n\nSTRENGTHS:\n- Ensemble methods and sharpness-aware optimization techniques are both prominent approaches for improving generalization. The aim of this work, which combines these two approaches, is well-motivated.\n- While the theoretical analysis uses the variance metric to indicate diversity, the experimental results show consistent trends across different diversity metrics. It suggests that the proposed analysis is widely applicable to the general concept of diversity.\n- Extensive empirical results effectively validate the theoretical analysis. The summary plots of the results are generally highly readable.\n\nWEAKNESSES:\n- The evaluation results are centered exclusively on classification accuracy; since ensembling usually highlights both predictive accuracy and uncertainty, relying solely on accuracy to assess overall performance is insufficient. \n- Specifically, for the corrupted CIFAR benchmark, uncertainty metrics like negative log-likelihood or expected calibration error are more important than test accuracy, but these aspects are not currently considered.\n- It seems that all experiments were conducted exclusively with residual networks. It is essential to verify if the proposed analysis and algorithm are applicable to other architecture families as well.\n\nQUESTIONS:\n- It appears that the current emphasis is on logit-ensemble (lines 82-83). Does the same rationale apply when ensembling categorical probabilities (i.e., probability-ensemble)?\n- In the proposed SharpBalance algorithm, it seems that the training data and objective for the i-th member are defined using other members (such as members i+1, i+2, as illustrated in the figure). Does this imply that in practice, each member is trained sequentially?\n\nLIMITATIONS:\nSection 5 addressed the limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 2, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-13"}