Title: Resilient Constrained Learning
Venue: NeurIPS 2023
Accepted: yes
Keywords: Constrained Learning

Relaxation

Lagrangian duality

Primal-Dual

Machine Learning

Federated Learning

Invariance
Abstract: When deploying machine learning solutions, they must satisfy multiple requirements beyond accuracy, such as fairness, robustness, or safety. These requirements are imposed during training either implicitly, using penalties, or explicitly, using constrained optimization methods based on Lagrangian duality. Either way, specifying requirements is hindered by the presence of compromises and limited prior knowledge about the data. Furthermore, their impact on performance can often only be evaluated by actually solving the learning problem. This paper presents a constrained learning approach that adapts the requirements while simultaneously solving the learning task. To do so, it relaxes the learning constraints in a way that contemplates how much they affect the task at hand by balancing the performance gains obtained from the relaxation against a user-defined cost of that relaxation. We call this approach resilient constrained learning after the term used to describe ecological systems that adapt to disruptions by modifying their operation. We show conditions under which this balance can be achieved and introduce a practical algorithm to compute it, for which we derive approximation and generalization guarantees. We showcase the advantages of this resilient learning method in image classification tasks involving multiple potential invariances and in federated learning under distribution shift.

Resilient Constrained Learning

Abstract

When deploying machine learning solutions, they must satisfy multiple requirements beyond accuracy, such as fairness, robustness, or safety. These requirements are imposed during training either implicitly, using penalties, or explicitly, using constrained optimization methods based on Lagrangian duality. Either way, specifying requirements is hindered by the presence of compromises and limited prior knowledge about the data. Furthermore, their impact on performance can often only be evaluated by actually solving the learning problem. This paper presents a constrained learning approach that adapts the requirements while simultaneously solving the learning task. To do so, it relaxes the learning constraints in a way that contemplates how much they affect the task at hand by balancing the performance gains obtained from the relaxation against a user-defined cost of that relaxation. We call this approach resilient constrained learning after the term used to describe ecological systems that adapt to disruptions by modifying their operation. We show conditions under which this balance can be achieved and introduce a practical algorithm to compute it, for which we derive approximation and generalization guarantees. We showcase the advantages of this resilient learning method in image classification tasks involving multiple potential invariances and in heterogeneous federated learning.

1 Introduction

Requirements are integral to engineering and of growing interest in machine learning (ML) [1]. This growing interest is evident in, e.g., the advancement towards designing ML systems that are fair [2], robust [3], and safe [4], as well as numerous applications in which we want to attain good performance with respect to more than one metric [5-24]. Two concrete applications that we will use as examples (Section 5) are heterogeneous federated learning , where each client realizes a different loss due to distribution shifts (as in, e.g., [18-20]) and invariant learning , where we seek to achieve good performance even after the data has undergone a variety of transformations (as in, e.g., [15,21-23]).

The goal in these settings is to strike a compromise between some top-line objective metric and the requirements. To this end, an established approach is to combine the top-line and requirement violation metrics in a single training loss. This leads to penalty methods that are ubiquitous in ML, as attested by, e.g., fairness [25-28] and robustness [29, 30] applications. Another approach to balance objective and requirements is formulating and solving constrained learning problems. Though less typical in ML practice, they are not uncommon [5-18,21,24]. In particular, they have also been used in fair [31-34] and robust [12, 35] learning, to proceed with a common set of applications. It is worth noting that penalty and constrained methods are not unrelated. They are in fact equivalent in convex optimization, in the sense that every constrained problem has an equivalent penalty-based formulation. A similar result holds in non-convex ML settings for sufficiently expressive parametrizations [7,8].

In either case, the compromise between objective and different requirements are specified by (hyper)parameters, be they penalty coefficients or constraint levels (Section 2). Finding penalties or constraints specifications that yield reasonable trade-offs is particularly difficult in ML, which often

involves statistical requirements, such as fairness and robustness, that have intricate dependencies with the model and unknown data distributions. Case in point, consider invariant learning for image classification [23]. While we know that invariance to rotations and translations is desirable, we do not know how much invariance to these transformations is beneficial. This depends on the level of invariance of the data distribution, its prevalence in the dataset, and the capability of the model to represent invariant functions. The standard solution to this problem involves time consuming and computationally expensive hyperparameter searches.

This paper addresses this issue by automating the specification of constraint levels during training. To do so, it begins by interpreting constraints as nominal specifications that can be relaxed to find a better compromise between objective and requirements (Section 3). We call this approach resilient constrained learning after the term used to describe ecological systems that adapt to disruptions by modifying their operation [36,37]. Our first contribution is the following insight:

(C1) We relax constraints according to their relative difficulty, which we define as the sensitivity of the objective to perturbations of the constraint (Section 3.1).

That difficult constraints should be relaxed more is a natural choice. The value of (C1) is in defining what is a difficult constraint. We then seek constraint levels such that the objective loss is relatively insensitive to changes in those levels. This relative insensitivity incorporates a user-defined cost that establishes a price for relaxing nominal specifications.

The learning problem implied by (C1) seems challenging. Our next contribution is to show that it is not:

(C2) We use duality and perturbation theory to present reformulations of the resilient learning problem from (C1) (Section 3.2) that lead to a practical resilient learning algorithm (Section 4) for which we derive statistical approximation bounds (Thm. 1).

Our final contribution is the experimental evaluation of the resilient learning algorithm:

(C3) We evaluate resilient formulations of federated learning and invariant learning (Section 5).

Our experiments show that (C1)-(C2) effectively relaxes constraints according to their difficulty , leading to solutions that are less sensitive to the requirement specifications. It illustrates how resilient learning constitutes an interpretable and flexible approach to designing requirements while contemplating performance trade-offs.

2 Learning with Constraints

Let D 0 be a distribution over data pairs ( x , y ) composed of the feature vector x ∈ X ⊂ R d and the corresponding output y ∈ Y ⊂ R . Let f θ : X → R k be the function associated with parameters θ ∈ Θ ⊂ R p and ℓ 0 : R k × Y → [ -B,B ] be the loss that evaluates the fitness of the estimate f θ ( x ) relative to y . Let F θ = { f θ | θ ∈ Θ } be the hypothesis class induced by these functions. Different from traditional (unconstrained) learning, we do not seek f θ that simply minimizes E [ ℓ 0 ( ϕ ( x ) , y )] , but also account for its expected value with respect to additional losses ℓ i : R k ×Y → [ -B,B ] and distributions D i , i = 1 , . . . , m . These losses/distributions typically encode statistical requirements, such as robustness (where D i denote distribution shifts or adversarial perturbations) and fairness (where D i are conditional distributions of protected subgroups).

Explicitly, the constrained statistical learning (CSL) problem is defined as

Without loss of generality, we stipulate the nominal constraint specification to be zero. Other values can be achieved by offsetting ℓ i , i.e., E [ ˜ ℓ ( f θ ( x ) , y ) ] ≤ c is obtained using ℓ i ( · ) = ˜ ℓ ( · ) -c in (P). We also let P ⋆ take values on the extended real line R ∪{∞} by defining P ⋆ = ∞ whenever (P) is infeasible, i.e., whenever for all θ ∈ Θ there exists i such that E D i [ ℓ i ( f θ ( x ) , y ) ] > 0 .

A challenge in formulating meaningful CSL problems lies in specifying the constraints, i.e., the ℓ i . Indeed, while a solution f θ ⋆ always exists for unconstrained learning [ m = 0 in (P)], there may be no θ that satisfies the constraints in (P). This issue is exacerbated when solving the problem using data: even arbitrarily good approximations of the expectations in (P) may introduce errors that hinder the estimation of P ⋆ (see Appendix A for a concrete example). In practice, landing on feasible requirements may require some constraints to be relaxed relative to their initial specification. Then, in lieu of (P), we would use the relaxed problem

where u ∈ R m + collects the relaxations u i ≥ 0 . The value P ⋆ ( u ) is known as the perturbation function of (P) since it describes the effect of the relaxation u on the optimal value. Given P ⋆ ( 0 ) = P ⋆ and (P 0 ) is equivalent to (P), this abuse of notation should not lead to confusion.

It is ready that P ⋆ ( u ) is a componentwise non-increasing function, i.e., that for comparable arguments v i ≤ w i for all i (denoted v ⪯ w ), it holds that P ⋆ ( v ) ≥ P ⋆ ( w ) . However, large relaxations u drive (P u ) away from (P), the learning problem of interest. Thus, relaxing (P) too much can be as detrimental as relaxing it too little (see example in Appendix A). The goal of this paper is to exploit properties of P ⋆ ( u ) together with a relaxation cost to strike a balance between these conflicting objectives. We call this balance a resilient version of (P).

3 Resilient Constrained Learning

We formulate resilient constrained learning using a functional form of (P u ). Explicitly, consider a convex function class F ⊇ F θ and define the relaxed functional problem

The difference between (P u ) and ( ˜ P u ) is that the latter does not rely on a parametric model. Instead, its solutions take values on the convex space of functions F . Still, if F θ is a sufficiently rich parameterization of F (see Section 4 for details), then P ⋆ ( u ) and ˜ P ⋆ ( u ) are close [38, Sec. 3]. Throughout the rest of the paper, we use ∼ to identify these functional problems.

The advantage of working with ( ˜ P u ) is that under mild conditions the perturbation function ˜ P ⋆ is convex. This holds readily if the losses ℓ i are convex (e.g., quadratic or cross-entropy) [39, chap. 5]. However, the perturbation function is also convex for a variety of non-convex programs, e.g., ( ˜ P u ) with non-convex losses, non-atomic D i , and decomposable F (see Appendix B). For conciseness, we encapsulate this hypothesis in an assumption.

Assumption 1 . The perturbation function ˜ P ⋆ ( u ) is a convex function of the relaxation u ∈ R m + .

A consequence of Assumption 1 is that the perturbation function ˜ P ⋆ has a non-empty subdifferential at every point. Explicitly, let its subdifferential ∂ ˜ P ⋆ ( u o ) at u o ∈ R m + be defined as the set of vectors describing supporting hyperplanes at u o of the epigraph of ˜ P ⋆ , i.e.,

The elements of ∂ ˜ P ⋆ ( u o ) are called subgradients of ˜ P ⋆ at u o . If ˜ P ⋆ is differentiable at u o , then it has a single subgradient that is equal to its gradient, i.e., ∂ ˜ P ⋆ ( u o ) = {∇ ˜ P ⋆ ( u o ) } . In general, however, the subdifferential is a non-singleton set [40]. Further notice that since ˜ P ⋆ ( u ) is componentwise nonpositive the subgradients are componentwise negative, p u ⪯ 0 .

Next, we use this property to formalize resilient constrained learning as a compromise between reducing ˜ P ⋆ ( u ) by increasing u and staying close to the original problem ( ˜ P 0 ).

u

u

⋆

a

dh

(

u

)

du

-

d

˜

P

⋆

(

u

)

du

Infeasible

(a)

u

u

⋆

b

dh

(

u

)

du

-

d

˜

P

⋆

(

u

)

du

Infeasible

(b)

u

u

⋆

c

dh

(

u

)

du

-

d

˜

P

⋆

(

u

)

du

Infeasible

(c)

3.1 Resilient Equilibrium

Consider the effect of increasing the value of a specific relaxation u i in ( ˜ P u ) while keeping the rest unchanged. The solution of ( ˜ P u ′ ) is allowed to suffer higher losses on the constraints ( ℓ i for i ≥ 1 ), which may lead to a smaller objective loss ( ℓ 0 ). Hence, while larger relaxations are detrimental because they violate more the requirements, they are also beneficial because they reduce the objective loss. To balance these conflicting outcomes of constraint relaxations, we introduce a function h to capture their costs. Then, since relaxing both increases the costs and decreases the objective value, we conceptualize resilience as an equilibrium between these variations.

Definition 1 (Resilient Equilibrium). Let h : R m + → R + be a convex, differentiable, normalized (i.e., h ( 0 ) = 0 ), and componentwise increasing (i.e., h ( v ) < h ( w ) for v ≺ w ) function. A resilient equilibrium of ( ˜ P u ) is a relaxation u ⋆ satisfying

The resilient constrained learning problem amounts to solving ( ˜ P u ⋆ ), i.e., solving ( ˜ P u ) for a relaxation u ⋆ that satisfies (2). We call this equilibrium resilient because it describes how far ( ˜ P 0 ) can be relaxed before we start seeing diminishing returns. Indeed, u ⋆ from (2) is such that relaxing by an additional ϵ ≻ 0 would incur in a relaxation cost at least ∇ h ( u ⋆ ) T ϵ larger, whereas tightening to u ⋆ -ϵ would incur in an optimal value increase of at least the same ∇ h ( u ⋆ ) T ϵ .

Notice that resilient constrained learning is defined in terms of sensitivity . Indeed, the resilient equilibrium in Def. (1) specifies a learning task that is as sensitive to changes in its requirements as it is sensitive to changes in the relaxation cost. This has the marked advantage of being invariant to constant translations of ℓ 0 , as is also the case for solutions of ( ˜ P u ). Sensitivity also measures the difficulty of satisfying a constraint, since ∂ ˜ P ⋆ ( u ) quantifies the impact of each constraint specification on the objective loss. Hence, the equilibrium in (2) has the desirable characteristic of affecting stringent requirements more.

Two important properties of the equilibrium in Def. 1 are summarized next (proofs are provided in appendices D.1 and D.2).

̸

Proposition 1. Under Ass. 1, the resilient equilibrium (2) exists. If h is strictly convex, it is unique. Proposition 2. Let v , w ∈ R m + be such that [ v ] i = [ w ] i , for i = j , and [ v ] j < [ w ] j . Under Ass. 1, (i) [ ∇ h ( v )] j ≤ [ ∇ h ( w )] j and (ii) [ -p v ] j ≥ [ -p w ] j for all p v ∈ ∂ ˜ P ⋆ ( v ) and p w ∈ ∂ ˜ P ⋆ ( w ) .

Prop. 1 shows that the equilibrium in (2) is well-posed. Prop. 2 states that, all things being equal, relaxing the j -th constraint increases the sensitivity of the cost h to it, while simultaneously decreasing its effect on the objective value ˜ P ⋆ . To illustrate these points better, Fig. 1 considers prototypical learning problems with a single constraint [ m = 1 in ( ˜ P u )], differentiable ˜ P ⋆ ( u ) , and relaxation cost h ( u ) = u 2 / 2 . According to (2), the resilient relaxations are obtained at h ′ ( u ⋆ ) = u ⋆ = ˜ P ⋆ ′ ( u ⋆ ) , where we let g ′ ( u ) = dg ( u ) /du denote the derivative of the function g . As per Prop. 2, h ′ is increasing and -˜ P ⋆ ′ is decreasing. Further observe that the sensitivity -˜ P ⋆ ′ ( u ) diverges as u approaches the value that makes the problem infeasible and vanishes as the constraint is relaxed. These two curves must therefore intersect, claimed by Prop. 1.

The illustrations in Fig. 1 represent progressively more sensitive/difficult problems. In Fig. 1a, the nominal problem ( u = 0 ) is easy to solve (small ˜ P ⋆ ′ (0) ), making the resilient equilibrium u ∗ a ≈ 0 . The original problem and the relaxed problem are essentially equivalent. In Fig. 1b, the nominal problem is difficult to solve (large ˜ P ⋆ ′ (0) ), inducing a significant change in the constraint and objective losses. In Fig. 1c, the nominal problem is unsolvable, but the resilient relaxation recovers a feasible problem.

Having motivated the resilient compromise in Def. 1 and proven that it is well-posed, we proceed to obtain equivalent formulations that show it is also computationally tractable. These formulations are used to show traditional learning tasks that can be seen as resilient learning problems (Sec. 3.3), before deriving a practical algorithm to tackle the resilient learning problem ( ˜ P u ⋆ ) (Sec. 4).

3.2 Equivalent Formulations

While we have shown that the resilient relaxation from Def. 1 exists (Prop. 1), the equilibrium in (2) does not provide a straightforward way to compute it. In this section, we show two more computationally amenable reformulations of Def. 1 by relating u ⋆ to the Lagrange multipliers of ( ˜ P u ) and to the solution of a related optimization problem.

Let λ ∈ R m + collect multipliers λ i associated to the i -th constraint of ( ˜ P u ) and define the Lagrangian

Based on (3), define dual functions g ( λ ; u ) and dual problems ˜ D ⋆ ( u ) for given constraint level u ,

While ˜ D ⋆ ≤ ˜ P ⋆ (weak duality) in general, there are cases in which ˜ D ⋆ = ˜ P ⋆ (strong duality), e.g., in convex optimization. The constrained ( ˜ P u ) is then essentially equivalent to ( ˜ D u ) that can be tackled by solving an unconstrained, penalized problem (minimizing (3) with respect to ϕ and u ), while adapting the weights λ i of the penalties (maximizing (3) with respect to λ ). This is, in fact, the basis of operation of primal-dual constrained optimization algorithms [39, Chapter 5]. The penalties λ ⋆ ( u ) that achieve this equivalence, known as Lagrange multipliers , are solutions of ( ˜ D u ) and subgradients of the perturbation function. Strong duality also holds under the milder Assumption 1 and a constraint qualification requirement stated next.

Assumption 2 . There exist a finite relaxation u ⪯ ∞ and a function ϕ ∈ F such that all constraints are met with margin c > 0 , i.e., E D i [ ℓ i ( ϕ ( x ) , y ) ] ≤ u i -c , for all i = 1 , . . . , m .

Note that since u can be large, this requirement is mild. We can thus leverage strong duality to provide an alternative definition of the resilient relaxation in (2).

Proposition 3. Let λ ⋆ ( u ) be a solution of ( ˜ D u ) for the relaxation u . Under Assumptions 1 and 2, ˜ P ⋆ ( u ∗ ) = ˜ D ⋆ ( u ∗ ) and any u ⋆ ∈ R m + such that ∇ h ( u ⋆ ) = λ ⋆ ( u ⋆ ) is a resilient relaxation of ( ˜ P u ) .

See appendix D.3 for proof. Whereas Def. 1 specifies the resilience relaxation in terms of the marginal performance gains ∂ ˜ P ⋆ , Prop. 3 formulates it in terms of the penalties λ . Indeed, it establishes that the penalty λ ⋆ ( u ⋆ ) that achieves the resilient relaxation of ( ˜ P u ) is encoded in the relaxation cost as ∇ h ( u ⋆ ) . That is not to say that h directly weighs the requirements as in fixed penalty formulations, since the equilibrium in Prop. 3 also depends on the relative difficulty of satisfying those requirements. Though Prop. 3 does not claim that all resilient relaxations satisfy the Lagrange multiplier relation, this holds under additional continuity conditions on ( ˜ P u ) [40].

Prop. 3 already provides a more computationally amenable definition of resilient relaxation, given that Lagrange multipliers are often computed while solving ( ˜ P u ), e.g., when using primal-dual methods. Yet, an even more straightforward formulation of Def. 1 is obtained by rearranging (2) as 0 ∈ ∂ ( ˜ P ⋆ + h )( u ⋆ ) , as we did in the proof of Prop. 1, which suggests that u ⋆ is related to the minimizers of ˜ P ⋆ + h . This is formalized in the following proposition (see proof in appendix D.4).

Proposition 4. A relaxation u ⋆ satisfies the resilient equilibrium (2) if and only if it is a solution of

The corresponding minimizer ϕ ⋆ is a resilient solution of the functional learning problem ( ˜ P u ) .

Prop. 4 shows that it is possible to simultaneously find a resilient relaxation u ⋆ and solve the corresponding resilient learning problem. Indeed, a resilient solution of a constrained learning problem can be obtained by incorporating the relaxation cost in its objective. This is reminiscent of first-phase solvers found in interior-point methods used to tackle convex optimization problems [39, Chap. 11]. Note, once again, that this is not the same as directly adding the constraints in the objective as penalties or regularizations. Indeed, recall from Def. 1 that the resilient relaxation balances the marginal effects of h on ˜ P ⋆ and not ℓ 0 . Before using Prop. 4 to introduce a practical resilient learning algorithm and its approximation and generalization properties (Sec. 4), we use these equivalent formulations to relate resilient learning to classical learning tasks.

3.3 Relation to Classical Learning Tasks

(Un)constrained learning : Both traditional unconstrained and constrained learning can be seen as limiting cases of resilient learning. Indeed, if h ≡ 0 , u has no effect on the objective of ( ˜ P-RES). We can then take u i = B for i = 1 , . . . , m , which reduces ( ˜ P-RES) to an unconstrained learning problem (recall that all losses are [ -B,B ] -valued). On the other hand, if h is the indicator function of the non-negative orthant (i.e., h ( u ) = 0 for u ⪯ 0 and h ( u ) = ∞ , otherwise), then it must be that u = 0 in ( ˜ P-RES) as long as this specification is feasible. Neither of these relaxation costs satisfy the conditions from Def. 1, since they are not componentwise increasing or differentiable, respectively. Still, there exists valid relaxation costs that approximate these problems arbitrarily well (see Appendix D.5).

Penalty-based methods : Rather than the constrained formulations in (P) or ( ˜ P u ), requirements are often incorporated directly into the objective of learning tasks using fixed penalties as in

where the fixed γ i > 0 represent the relative importance of the requirements. It is immediate from Prop. 3 that resilient learning with a linear relaxation cost h ( u ) = ∑ i γ i u i is equivalent to (4) as long as E D i [ ℓ i ( ϕ ⋆ ( x ) , y )] ≥ 0 . From Def. 1, this is the same as fixing the marginal effect of relaxations on the perturbation function.

Soft-margin SVM : Linear relaxation costs are also found in soft-margin SVM formulations, namely

Though written here in its parametrized form, the hypothesis class underlying (PI) (namely, linear classifiers) is convex. It can therefore be seen as an instance of ( ˜ P-RES) where each loss ℓ i represent a classification requirement on an individual sample. Soft-margin SVM is therefore a resilient learning problem as opposed to its hard-margin version, where u i = 0 for i = 1 , . . . , m .

4 Resilient Constrained Learning Algorithm

We defined the resilient equilibrium u ⋆ in (2) and the equivalent resilient learning problems ( ˜ P u ⋆ ) and ( ˜ P-RES) in the context of the convex functional space F . Contrary to (P u ), that are defined on the finite dimensional F θ , these problems are not amenable to numerical solutions. Nevertheless, we have argued that as long as F θ is a good approximation of F , the values of (P u ) and ( ˜ P u ) are close. We use this idea to obtain a practical primal-dual algorithm (Alg. 1) to approximate solutions

Algorithm 1 Resilient Constrained Learning ( η, η u , η λ > 0 ; θ (0) ∈ Θ ; λ (0) , u (0) ∈ R m + )

of ( ˜ P-RES) (and thus ( ˜ P u ⋆ )). The main result of this section (Thm. 1) establishes how good this approximation can be when using only samples from the D i .

Explicitly, consider a set of N i.i.d. sample pairs ( x n,i , y n,i ) drawn from D i and define the parametrized, empirical Lagrangian of the resilient learning problem ( ˜ P-RES) as

The parametrized, empirical dual problem of ( ˜ P-RES) is then given by

The gap between ˆ D ⋆ R and the optimal value ˜ P ⋆ R of the original problem (P u ) can be bounded under the following assumptions.

Assumption 3 . The loss functions ℓ i , i = 0 . . . m , are M -Lipschitz continuous.

Assumption 4 . For every ϕ ∈ F , there exists θ † ∈ Θ such that E D i [ | ϕ ( x ) -f θ † ( x ) | ] ≤ ν , for all i = 0 , . . . , m .

Assumption 5 . There exists ξ ( N,δ ) ≥ 0 such that for all i = 0 , . . . , m and all θ ∈ Θ ,

with probability 1 -δ over draws of { ( x n,i , y n,i ) } .

Although the parameterized functional space F θ can be non-convex, as is the case for neural networks, Ass. 4 requires that it is rich in the sense that the distance to its convex hull is bounded. When ξ exists for all δ > 0 and is a decreasing function of N , Ass. (5) describes the familiar uniform convergence from learning theory. Such generalization bounds can be derived based on bounded VC dimension, Rademacher complexity, or algorithmic stability, to name a few [41].

We can now state the main result of this section, whose proof is provided in Appendix C.

Theorem 1. Consider ˜ P ⋆ R and u ⋆ from ( ˜ P-RES) and ˆ D ⋆ R from ( ˆ D-RES) . Under Ass. 1-5, it holds with probability of 1 -(3 m +2) δ that

Thm. 1 suggests that resilient learning problems can be tackled using ( ˆ D-RES), which can be solved using saddle point methods, as in Alg. 1. Even if the inner minimization problem is non-convex, dual ascent methods can be shown to converge as long as its solution can be well approximated using stochastic gradient descent [38, Thm. 2], as is often the case for overparametrized NNs [42-44]. A more detailed discussion on the algorithm can be found in Appendix E. Next, we showcase its performance and our theoretical results in two learning tasks.

5 Numerical Experiments

We now showcase the numerical properties of resilient constrained learning. As illustrative case studies, we consider federated learning under class imbalance and invariance constrained learning. Additional experimental results for both setups are included in Appendix F and H. We also include ablations on the hyperparameters of the method, including dual and perturbation learning rates, and the choice of the perturbation cost function h .

5.1 Heterogeneous Federated Learning

Federated learning [45] entails learning a common model in a distributed manner by leveraging data samples from different clients . Usually, average performance across all clients is optimized under the assumption that data from different clients is identically distributed. In practice, heterogeneity in local data distributions can lead to uneven performance across clients [46, 47]. Since this may be undesirable, a sensible requirement in this setting is that the loss of the model is similar for all clients.

Let D c be the distribution of data pairs for Client c , and R c ( f θ ) = E ( x ,y ) ∼ D c [ ℓ ( f θ ( x ) , y )] its statistical risk. We denote the average performance as R ( f θ ) := (1 /C ) ∑ C i =1 R c ( f θ ) , where C is the number of clients. As proposed in [18] heterogeneity issues can be tackled by imposing a proximity constraint between the performance of each client R c , and the loss averaged over all clients R . This leads to the constrained learning problem

where ϵ > 0 is a small (fixed) positive scalar. It is ready to see that this problem is of the form in (P); see Appendix F. Note that the constraint in (P-FL) is an asymmetric (and relaxed) version of the equality of error rates common in fairness literature.

As shown by [18] this problem can be solved via a primal-dual approach in a privacy-preserving manner and with a negligible communication overhead, that involves sharing dual variables. However, because the heterogeneity of the data distribution across clients is unknown a priori , it can be challenging to specify a single constraint level ϵ for all clients that results in a reasonable trade-off between overall and individual client performance. In addition, the performance of all clients may be significantly reduced by a few clients whose poor performance make the constraint hard to satisfy. The heuristic adopted in [18] is to clip dual variables that exceed a fixed value.

In contrast, we propose to solve a resilient version of (P-FL) by including a relaxation u c , c = 1 , . . . , C for each constraint and a quadratic relaxation cost h ( u ) = α ∥ u ∥ 2 2 . The resilient version of problem (P-FL) can also be solved in a privacy preserving manner as long as h ( u ) is separable in each of the constraint perturbations u c . In that case u c can be updated locally by client c .

Following the setup of [18], heterogeneity across clients is generated through class imbalance. More specifically, samples from different classes are distributed among clients using a Dirichlet distribution. Experimental and algorithmic details along with privacy considerations are presented in Appendix F.

Constraint relaxation and relative difficulty: Our approach relaxes constraints according to their relative difficulty. In the context of class imbalance, the majority classes exert a stronger influence on the overall objective (average performance). Therefore, the overall performance R tends to favor smaller losses in the majority classes rather than in the minority ones. As a result, meeting the proximity constraint in (P-FL) for clients whose datasets contain a higher fraction of training samples from the minority classes can deteriorate performance. In Figure 2(left), we demonstrate that the constraint is effectively relaxed more for these clients.

Controlling the performance vs. relaxation trade-off: Through the choice of the relaxation cost function, we can control the trade-off between relaxing the equalization requirements from (P-FL) and performance. To illustrate this, we perform an ablation on the coefficient α in the quadratic relaxation cost h ( u ) = α ∥ u ∥ 2 2 . As sown in Figure 2(middle) smaller values of α enable better performance at the cost of larger relaxations. As α increases, the relaxations vanish and the problem approaches the original constrained problem. In this manner, the resilient approach enables navigating this trade-off

0

5

10

15

20

25

Minority Class Samples (%)

0.0

0.2

0.4

0.6

Perturbation (

ui

)

2

4

10

20

40

100

1000

Relaxation Cost (

)

0.000

0.025

0.050

0.075

0.100

0.125

0.150

0.175

Perturbation

u

2

0.052

0.054

0.056

0.058

0.060

Objective

R

(

f

)

u

2

R

(

f

)

Train

Test

Split

0.4

0.2

0.0

0.2

0.4

0.6

0.8

1.0

Constraint Violation

Formulation

Constrained

Resilient

by changing a single hyperparameter. Still, the optimal relaxation for each client is determined by their local data distribution, i.e., the relative difficulty of the constraint. In Appendix F.4 we also perform an ablation on the cost function by changing the perturbation norm.

Constraint violation and generalization: Relaxing stringent requirements not only makes the empirical problem easier to solve, but it can also lead to a better empirical approximation of the underlying statistical problem. As shown in Figure 2(right), the resilient approach has a smaller fraction of clients that are infeasible at the end of training. In addition, when constraints are evaluated on the test set, larger constraint violations are observed for some (outlier) clients in the hard constrained approach ( u c = 0 ). In Appendix F.4 we show that this holds across different problem settings. In addition, we also illustrate the fact that this is partly due to generalization issues, i. e., that overly stringent requirements can harm generalization. This observation is in line with the constrained learning theory developed in [7,8].

Comparing client performances: Our method should sacrifice the performance of outliers-which represent hard to satisfy constraints-in order to benefit the performance of the majority of the clients. In order to showcase this, we sort clients according to their test accuracy Acc [1] ≥ Acc [2] ≥ . . . ≥ Acc [ c ] . We report the fraction of clients in the resilient method that outperform equally ranked clients for the constrained baseline [18] ( Acc res [ c ] ≥ Acc const [ c ] ) , as well as the average and maximum increases and decreases in performance. As shown in Table 1, the majority of clients achieve a small increase in performance, while a small fraction experiences a larger decrease. In Appendix F.4 we include plots of ordered accuracies to further illustrate this.

5.2 Invariance Constrained Learning

As in [21], we impose a constraint on the loss on transformed inputs, as a mean of achieving robustness to transformations which may describe invariances or symmetries of the data. Explicitly,

None

Rot. (180)

Rot. (90)

Scaled

Translation

Synthetic Invariance

0.0

0.2

0.4

0.6

Perturbation (u)

Transformation

Synth. Inv

Other

Rot. (90)

Rot. (180)

None

Translation

Scaled

Synthetic Invariance

10

1

10 0

10 1

Dual variables (

)

Formulation

Constrained

Resilient

where G i is a set of transformations g : X → X such as image rotations, scalings, or translations. The constraint can be approximated by sampling augmentations using MCMC methods (see [12,21] for details). However, it is challenging to specify the transformation sets G i and constraint levels ϵ i adequately, since they depend on the invariances of the unknown data distribution and whether the function class is sufficiently expressive to capture these invariances. Therefore, we propose to solve a resilient version of problem (P-IC) using h ( u ) = α ∥ u ∥ 2 2 as a perturbation cost.

We showcase our approach on datasets with artificial invariances, following the setup of [23]. Explicitly, we generate the synthetic datasets, by applying either rotations, translations, or scalings, to each sample in the MNIST [48] and FashionMNIST [49] datasets. The transformations are sampled from uniform distributions over the ranges detailed in Appendix H.

Constraint relaxation and relative difficulty As shown in Figure 3(left) the relaxations ( u ) associated with synthetic invariances are considerably smaller than for other transformations. This indicates that when the transformations in the constraint correspond to a true invariance of the dataset, the constraint is easier to satisfy. On the other hand, when the transformations are not associated with synthetic invariances of the dataset, they are harder to satisfy and thus result in larger relaxations. This results in smaller dual variables, as shown in Figure 3 (right).

Resilience Improves Performance The resilient approach is able to handle the misspecification of invariance requirements, outperforming in terms of test accuracy both the constrained and unconstrained approaches. We include results for MNIST in Table 2 and F-MNIST in Appendix H. In addition, though it was not designed for that purpose, our approach shows similar performance to the invariance learning method Augerino [22].

6 Conclusion

This paper introduced a method to specify learning constraints by balancing the marginal decrease in the objective value obtained from relaxation with the marginal increase in a relaxation cost. This resilient equilibrium has the effect of prioritizing the relaxation of constraints that are harder to satisfy. The paper also determined conditions under which this equilibrium exists and provided an algorithm to automatically find it during training, for which approximation and statistical guarantees were derived. Experimental validations showcased the advantages of resilient constrained learning for classification with invariance requirements and federated learning. Future work includes exploring different relaxation costs and applications to robustness against disturbances and outliers.

Acknowledgments and Disclosure of Funding

The work of A. Ribeiro and I. Hounie is supported by NSF-Simons MoDL, Award 2031985, NSF AI Institutes program, Award 2112665, and NSF HDR TRipods Award 1934960. The work of Dr. Chamon is supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy (EXC 2075-390740016).

References

Z. Wan, X. Xia, D. Lo, and G. C. Murphy, 'How does machine learning change software development practices?' IEEE Transactions on Software Engineering , vol. 47, no. 9, pp. 1857-1871, 2021.

N. Mehrabi, F. Morstatter, N. Saxena, K. Lerman, and A. Galstyan, 'A survey on bias and fairness in machine learning,' ACM Computing Surveys (CSUR) , vol. 54, no. 6, pp. 1-35, 2021.

S. H. Silva and P. Najafirad, 'Opportunities and challenges in deep learning adversarial robustness: A survey,' arXiv preprint arXiv:2007.00753 , 2020.

Q. Yang, T. D. Simão, S. H. Tindemans, and M. T. Spaan, 'Safety-constrained reinforcement learning with a distributional safety critic,' Machine Learning , vol. 112, no. 3, pp. 859-887, 2023.

C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel, 'Fairness through awareness,' in Proceedings of the 3rd innovations in theoretical computer science conference , 2012, pp. 214-226.

M. Donini, L. Oneto, S. Ben-David, J. S. Shawe-Taylor, and M. Pontil, 'Empirical risk minimization under fairness constraints,' Advances in neural information processing systems , vol. 31, 2018.

L. Chamon and A. Ribeiro, 'Probably approximately correct constrained learning,' Advances in Neural Information Processing Systems , vol. 33, 2020.

L. F. Chamon, S. Paternain, M. Calvo-Fullana, and A. Ribeiro, 'Constrained learning with non-convex losses,' IEEE Transactions on Information Theory , 2022.

S. Paternain, L. Chamon, M. Calvo-Fullana, and A. Ribeiro, 'Constrained reinforcement learning has zero duality gap,' Advances in Neural Information Processing Systems , vol. 32, 2019.

C. Tran, F. Fioretto, and P. Van Hentenryck, 'Differentially private and fair deep learning: A lagrangian dual approach,' in Proceedings of the AAAI Conference on Artificial Intelligence , vol. 35, no. 11, 2021, pp. 9932-9939.

F. Fioretto, P. Van Hentenryck, T. W. Mak, C. Tran, F. Baldo, and M. Lombardi, 'Lagrangian duality for constrained deep learning,' in Machine Learning and Knowledge Discovery in Databases. Applied Data Science and Demo Track: European Conference, ECML PKDD 2020, Ghent, Belgium, September 14-18, 2020, Proceedings, Part V . Springer, 2021, pp. 118-135.

A. Robey, L. Chamon, G. J. Pappas, H. Hassani, and A. Ribeiro, 'Adversarial robustness with semi-infinite constrained learning,' Advances in Neural Information Processing Systems , vol. 34, pp. 6198-6215, 2021.

A. Robey, G. J. Pappas, and H. Hassani, 'Model-based domain generalization,' Advances in Neural Information Processing Systems , vol. 34, pp. 20 210-20 229, 2021.

E. Diana, W. Gill, M. Kearns, K. Kenthapadi, and A. Roth, 'Minimax group fairness: Algorithms and experiments,' in Proceedings of the 2021 AAAI/ACM Conference on AI, Ethics, and Society , 2021, pp. 66-76.

Y. Xu, A. Noy, M. Lin, Q. Qian, H. Li, and R. Jin, 'Wemix: How to better utilize data augmentation,' arXiv preprint arXiv:2010.01267 , 2020.

L. Peng, P. V. Giampouras, and R. Vidal, 'The ideal continual learner: An agent that never forgets,' arXiv preprint arXiv:2305.00316 , 2023.

J. Gallego-Posada, J. Ramirez, A. Erraqabi, Y. Bengio, and S. Lacoste-Julien, 'Controlled sparsity via constrained optimization or: How i learned to stop tuning penalties and love constraints,' 2022. [Online]. Available: https://arxiv.org/abs/2208.04425

Z. Shen, J. Cervino, H. Hassani, and A. Ribeiro, 'An agnostic approach to federated learning with class imbalance,' in International Conference on Learning Representations , 2022.

T. Nishio and R. Yonetani, 'Client selection for federated learning with heterogeneous resources in mobile edge,' in ICC 2019-2019 IEEE international conference on communications (ICC) . IEEE, 2019, pp. 1-7.

F. Yu, W. Zhang, Z. Qin, Z. Xu, D. Wang, C. Liu, Z. Tian, and X. Chen, 'Heterogeneous federated learning,' arXiv preprint arXiv:2008.06767 , 2020.

I. Hounie, L. F. O. Chamon, and A. Ribeiro, 'Automatic data augmentation via invarianceconstrained learning,' ArXiv , vol. abs/2209.15031, 2022.

G. Benton, M. Finzi, P. Izmailov, and A. G. Wilson, 'Learning invariances in neural networks from training data,' Advances in Neural Information Processing Systems , vol. 33, pp. 17 60517 616, 2020.

A. Immer, T. F. A. van der Ouderaa, V. Fortuin, G. Rätsch, and M. van der Wilk, 'Invariance learning in deep neural networks with differentiable laplace approximations,' CoRR , vol. abs/2202.10638, 2022. [Online]. Available: https://arxiv.org/abs/2202.10638

J. Elenter, N. NaderiAlizadeh, and A. Ribeiro, 'A lagrangian duality approach to active learning,' arXiv preprint arXiv:2202.04108 , 2022.

N. Quadrianto, V. Sharmanska, and O. Thomas, 'Discovering fair representations in the data domain,' in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , 2019, pp. 8227-8236.

S. Baharlouei, M. Nouiehed, A. Beirami, and M. Razaviyayn, 'R \ 'enyi fair inference,' arXiv preprint arXiv:1906.12005 , 2019.

S. Jung, D. Lee, T. Park, and T. Moon, 'Fair feature distillation for visual recognition,' in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition , 2021, pp. 12 115-12 124.

S. Jung, T. Park, S. Chun, and T. Moon, 'Re-weighting based group fairness regularization via classwise robust optimization,' arXiv preprint arXiv:2303.00442 , 2023.

A. Sinha, H. Namkoong, R. Volpi, and J. Duchi, 'Certifying some distributional robustness with principled adversarial training,' arXiv preprint arXiv:1710.10571 , 2017.

H. Zhang, Y. Yu, J. Jiao, E. Xing, L. El Ghaoui, and M. Jordan, 'Theoretically principled trade-off between robustness and accuracy,' in International Conference on Machine Learning . PMLR, 2019, pp. 7472-7482.

A. Agarwal, A. Beygelzimer, M. Dudík, J. Langford, and H. Wallach, 'A reductions approach to fair classification,' in International Conference on Machine Learning . PMLR, 2018, pp. 60-69.

M. Donini, L. Oneto, S. Ben-David, J. Shawe-Taylor, and M. Pontil, 'Empirical risk minimization under fairness constraints,' arXiv preprint arXiv:1802.08626 , 2018.

M. Kearns, S. Neel, A. Roth, and Z. S. Wu, 'Preventing fairness gerrymandering: Auditing and learning for subgroup fairness,' in International Conference on Machine Learning . PMLR, 2018, pp. 2564-2572.

A. Cotter, H. Jiang, M. R. Gupta, S. Wang, T. Narayan, S. You, and K. Sridharan, 'Optimization with non-differentiable constraints with applications to fairness, recall, churn, and other goals.' Journal of Machine Learning Research , vol. 20, no. 172, pp. 1-59, 2019.

A. Robey, L. Chamon, G. J. Pappas, and H. Hassani, 'Probabilistically robust learning: Balancing average and worst-case performance,' in Proceedings of the 39th International Conference on Machine Learning , ser. Proceedings of Machine Learning Research, K. Chaudhuri, S. Jegelka, L. Song, C. Szepesvari, G. Niu, and S. Sabato, Eds., vol. 162. PMLR, 17-23 Jul 2022, pp. 18667-18686. [Online]. Available: https://proceedings.mlr.press/v162/robey22a.html

C. S. Holling, 'Resilience and stability of ecological systems,' Annual Review of Ecology, Evolution, and Systematics , vol. 4, pp. 1-23, 1973.

--, 'Engineering resilience versus ecological resilience,' Engineering within ecological constraints , vol. 31, no. 1996, p. 32, 1996.

L. F. O. Chamon, S. Paternain, M. Calvo-Fullana, and A. Ribeiro, 'Constrained learning with non-convex losses,' IEEE Transactions on Information Theory , vol. 69, no. 3, pp. 1739-1760, 2023.

S. Boyd, S. P. Boyd, and L. Vandenberghe, Convex optimization . Cambridge university press, 2004.

J. F. Bonnans and A. Shapiro, 'Optimization problems with perturbations: A guided tour,' SIAM review , vol. 40, no. 2, pp. 228-264, 1998.

M. Mohri, A. Rostamizadeh, and A. Talwalkar, Foundations of machine learning . MIT press, 2018.

R. Ge, J. D. Lee, and T. Ma, 'Learning one-hidden-layer neural networks with landscape design,' in International Conference on Learning Representations , 2018.

A. Brutzkus and A. Globerson, 'Globally optimal gradient descent for a convnet with gaussian inputs,' in International Conference on Machine Learning , 2017, pp. 605-614.

M. Soltanolkotabi, A. Javanmard, and J. D. Lee, 'Theoretical insights into the optimization landscape of over-parameterized shallow neural networks,' IEEE Transactions on Information Theory , vol. 65, no. 2, pp. 742-769, 2018.

R. Shokri and V. Shmatikov, 'Privacy-preserving deep learning,' in Proceedings of the 22nd ACM SIGSAC conference on computer and communications security , 2015, pp. 1310-1321.

T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, 'Federated optimization in heterogeneous networks,' Proceedings of Machine learning and systems , vol. 2, pp. 429-450, 2020.

H. Wang, Z. Kaplan, D. Niu, and B. Li, 'Optimizing federated learning on non-iid data with reinforcement learning,' in IEEE INFOCOM 2020-IEEE Conference on Computer Communications . IEEE, 2020, pp. 1698-1707.

Y. LeCun, C. Cortes, and C. Burges, 'Mnist handwritten digit database,' ATT Labs [Online]. Available: http://yann.lecun.com/exdb/mnist , vol. 2, 2010.

H. Xiao, K. Rasul, and R. Vollgraf, 'Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms,' 2017.

R. T. Rockafellar, Conjugate duality and optimization . SIAM, 1974.

D. P. Bertsekas, 'Nonlinear programming,' Journal of the Operational Research Society , vol. 48, no. 3, pp. 334-334, 1997.

D. Bertsekas, Convex optimization theory . Athena Scientific, 2009, vol. 1.

R. T. Rockafellar, Convex analysis . Princeton university press, 1997, vol. 11.

D. P. Kingma and J. Ba, 'Adam: A method for stochastic optimization,' arXiv preprint arXiv:1412.6980 , 2014.

S. Boyd, L. Xiao, and A. Mutapcic, 'Subgradient methods,' lecture notes of EE392o, Stanford University, Autumn Quarter , vol. 2004, pp. 2004-2005, 2003.

B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y Arcas, 'Communication-efficient learning of deep networks from decentralized data,' in Artificial intelligence and statistics . PMLR, 2017, pp. 1273-1282.

X. Zhang, M. Hong, S. V. Dhople, W. Yin, and Y. Liu, 'Fedpd: A federated learning framework with adaptivity to non-iid data,' IEEE Transactions on Signal Processing , vol. 69, pp. 60556070, 2020.

D. A. E. Acar, Y. Zhao, R. M. Navarro, M. Mattina, P. N. Whatmough, and V. Saligrama, 'Federated learning based on dynamic regularization,' arXiv preprint arXiv:2111.04263 , 2021.

A. Krizhevsky, 'Learning multiple layers of features from tiny images,' Canadian Institute for Advanced Research, Tech. Rep., 2009.

L. Wang, S. Xu, X. Wang, and Q. Zhu, 'Addressing class imbalance in federated learning,' in Proceedings of the AAAI Conference on Artificial Intelligence , vol. 35, no. 11, 2021, pp. 10 165-10 173.

A Constrained learnability and relaxations

In this section, we illustrate how constraints affect learnability, an issue that can be exacerbated by relaxing their specification either too much or too little. Resilient constrained learning, on the other hand, progressively adapts to the underlying problem, striking a balance between modifying the learning task and improving the objective value that can overcome these issues.

Let us begin by stating what we mean by constrained learnability (see [38, Def. 4] for details).

Definition 2 (PACC). A hypothesis class F θ is probably approximately correct constrained (PACC) learnable with respect to the losses { ℓ i } i =0 ,...,m if there exists an algorithm that, for every ϵ, δ ∈ (0 , 1) and every distribution D i , i = 0 , . . . , m , can obtain f θ ∈ F θ using N ( ϵ, δ, m ) samples from each D i that is, with probability 1 -δ ,

probably approximately optimal, i.e., for P ⋆ as in (P),

probably approximately feasible, i.e.,

Definition 2 is an extension of the probably approximately correct (PAC) framework from classical learning theory to the problem of learning under requirements. Indeed, note that for unconstrained learning problems [ m = 0 in (P)], P ⋆ ≤ E D 0 [ ℓ 0 ( f θ ( x ) , y )] for all θ ∈ Θ . In that case, (7) reduces to the classical definition of PAC learnability [41, Def. 2.14]. In general, however, a PACC learner must also satisfy the approximate feasibility condition (8).

Constrained learning theory shows that, under mild conditions, the PAC learnability of F θ with respect to each individual loss ℓ i implies its PACC learnability [38, Thm. 1]. This does not mean that an empirical version of (P) is a PACC learner, i.e., approximates the value of P ⋆ . In fact, this is typically not the the case.

Case in point, consider the learning problem

where D 0 is the distribution of

D 1 is such that ( x , y ) = ([ -1 , τ ] , 1) , and D 2 is such that ( x , y ) = ([ -τ, 1] , 1) , where α is drawn uniformly at random from [0 , 1 / 4] and τ is drawn uniformly at random from [ -1 / 2 , 1 / 2] . Notice that the D i are correlated through the random variable τ . The parameters θ = [ θ 1 , θ 2 ] are taken from the finite set Θ = { θ a , θ b , θ c , θ d } , described below together with their corresponding objective values:

Notice that under these distributions, the constraints in (PII) reduce to -θ 1 ≤ -1 and θ 2 ≤ 1 . Hence, all parameters expect for [1 / 2 , 1 / 2] T are feasible for the statistical (PII). From (9), its optimal value is therefore P ⋆ e = 1 / 16 achieved for θ ⋆ = θ b .

In the sequel, we will show that (i) the empirical version of (PII) [as in (PIII)] recovers its solution with exponentially small probability (Sec. A.1); (ii) relaxing the empirical problem [as in (PIV)] too little or too much fails to mitigate this issue (Sec. A.2); and (iii) a resilient relaxation [as in (PV)] allows the empirical version of (PII) to recover its solutions with high probability. In summary, the empirical counterpart of (PII) can be relaxed into a PACC learner, but care must be taken when choosing that relaxations.

A.1 Empirical constrained risk minimization (ECRM)

Consider the empirical version of (9), which can be written as

where ¯ τ = 1 N ∑ N n =1 τ n is the empirical average of i.i.d. samples τ n drawn uniformly at random from [ -1 / 2 , 1 / 2] . Notice that

for θ a , the first constraint reduces to 1 / 2 ≥ 1 + ¯ τ/ 2 and since ¯ τ ≥ -1 / 2 , it is violated unless ¯ τ = 0 ; and

for θ b , the constraints read 1 ≥ 1 + ¯ τ and 1 ≤ 1 + ¯ τ , so that at least one is violated unless ¯ τ = 0 .

̸

Since τ is a continuous distribution, ¯ τ = 0 almost surely. Immediately, we obtain that ˆ P ⋆ e ≥ min( ˆ J ( θ c ) , ˆ J ( θ d )) . Additionally, ˆ P ⋆ e < ∞ since θ d is always feasible. Hence,

A.2 Relaxed ECRM

Consider now a relaxation of (PIII), namely

Problem (PIV) is the empirical version of (P u ) for the relaxation u = [ u 1 , u 2 ] T . It is straightforward to see that if u 1 , u 2 < ¯ τ , then we are in the situation of Sec. A.1 and once again P [ | ˆ P ⋆ e -P ⋆ e | ≤ 1 / 64 ] → 0 as N →∞ .

On the other hand, notice that the constraints always hold whenever u 1 ≥ 1 + ¯ τθ 2 -θ 1 and u 2 ≥ θ 2 -¯ τθ 1 -1 :

For θ a , this reduces to u 1 ≥ (¯ τ +1) / 2 , since u 2 ≥ -(¯ τ +1) / 2 is satisfied for all u ⪰ 0 . We therefore obtain that

̸

In this case, recalling that ¯ τ = 0 almost surely yields

where we use x ∨ y = min( x, y ) . Using the fact that J ( θ a ) = 1 / 32 , we obtain

For θ b , this becomes u 1 ≥ ¯ τ and u 2 ≥ ¯ τ . Hence,

̸

Since P ⋆ e = J ( θ b ) , we therefore get

Notice that since ˆ J ( θ ) concentrates around J ( θ ) for θ ∈ Θ , for every ϵ > 0 , there exists N 0 such that P [ ˆ J ( θ b ) ≤ ˆ J ( θ c ) ∨ ˆ J ( θ d ) ] ≥ 1 -ϵ . We therefore conclude that

In summary, we have that

A.3 Resilient ECRM

Finally, consider the resilient version of (PIII)

and let ˆ θ ⋆ R be a solution of (PV). Notice that (PV) is an empirical version of the equivalent formulation in Prop. 4. We consider the value of the problem for each possible element of Θ :

For θ a to be feasible, it must be that u 1 ≥ (¯ τ + 1) / 2 ( u 2 , on the other hand, can be 0 ). Hence, we have that

For θ b to be feasible, it must be that u 1 ≥ ¯ τ and u 2 ≥ ¯ τ . Hence,

For θ c to be feasible, it must be that u 1 ≥ ¯ τ/ 3 (once again the second constraint need not be relaxed). Hence,

Finally, θ d is feasible for all u ∈ R m + . Hence,

Putting together these conditions, we obtain that for θ b to be optimal, i.e., for ˆ J ( ˆ θ ⋆ R ) → P ⋆ e , it must be that

From the fact that ˆ J ( θ ) concentrates around J ( θ ) for θ ∈ Θ (e.g., by Hoeffding's inequality) and using the values of J from (9), it holds that there exists N 0 such that θ b is optimal for N ≥ N 0 as long as | ¯ τ | ≤ 0 . 2 . We therefore conclude that

B Convexity of the Perturbation Function for Nonconvex Losses

The definition of resilient equilibrium and all subsequent results in the paper require convexity of the perturbation function ˜ P ⋆ ( u ) defined in ( ˜ P u ). This requisite is stated in Assumption 1.

Assumption 1 is well known to hold if the optimization problem ( ˜ P u ) is convex, for which it is sufficient for the class F to be a convex set and the losses ℓ i to be convex functions (see, e.g., [40]). If the problem is not parametric, as is, e.g., (P), then assuming the hypothesis class F is convex is mild. Consider, e.g., the set F to be the intersection of the space of D i -measurable functions. Overall, it is not a significant restriction to assume that the losses are convex since this is the case for typical losses, such as cross entropy and mean squared error 1 .

This convex losses requirement can be relaxed as long as the distributions are well-behaved and the hypothesis class F is rich enough. We define these conditions in two technical assumptions. In what follows, we consider the distributions D i are defined over the same probability space ( X × Y , Σ , P i ) for the sigma-algebra Σ and the measures P i .

Assumption 6 (Non-atomic distributions). The set Y is finite and the conditional random variables x | y induced by the D i measures are non-atomic. That is, for every measurable event Z ∈ Σ with strictly positive conditional measure P i, x | y ( Z ) > 0 , there exist an event Σ ∋ Z ′ ⊂ Z strictly included in Z with positive conditional measure mbP i, x | y ( Z ′ ) > 0 .

Assumption 7 (Decomposable hypothesis class). The set F is decomposable in the sense that for all pair of functions ϕ 1 , ϕ 2 ∈ F and all measurable set Z ∈ Σ , it holds that ¯ ϕ ∈ F for

Assumption 6 requires data probability distributions in which all points have zero measure. Assumption 7 requires hypothesis classes that are closed under 'cutting and stitching' of functions.

In turns out that Assumptions 6 and 7 are enough to guarantee that the perturbation function is convex. In particular, they imply the following result [38, Lemma A.1].

Lemma 1. Define the cost constraint epigraph of ( ˜ P u ) to be the set

Under Assumptions 6 and 7, the set C is convex.

Notice that Lemma 1 does not require the losses ℓ i to be convex for the cost-constraint epigraph to be convex. This is a significant fact since it implies that the perturbation function of ( ˜ P u ) is also convex, as we show next.

Proposition 5. Consider the perturbation function ˜ P ⋆ ( u ) defined in ( ˜ P u ) . Under Assumptions 6 and 7, ˜ P ⋆ ( u ) is convex.

Proof. Let v and w be two perturbations of ( ˜ P u ) and define the convex combination perturbation u a = a v + (1 -a ) w for some a ∈ [0 , 1] . To prove that ˜ P ⋆ ( u ) is convex we need to show that ˜ P ⋆ ( u a ) ≤ a ˜ P ⋆ ( v ) + (1 -a ) ˜ P ⋆ ( w ) for all a .

If either v or w yield infeasible problems we have ˜ P ⋆ ( v ) = ∞ or ˜ P ⋆ ( w ) = ∞ . In this case, ˜ P ⋆ ( u a ) ≤ a ˜ P ⋆ ( v ) + (1 -a ) ˜ P ⋆ ( w ) = ∞ . In the more interesting case where v and w both yield feasible problems, we have that

for C defined in (11). Indeed, any ϕ ⋆ v that solves ( ˜ P v ) must satisfy E D i [ ℓ i ( ϕ ⋆ v ( x ) , y )] ≤ u i for i > 0 and E D 0 [ ℓ 0 ( ϕ ⋆ v ( x ) , y )] = ˜ P ⋆ ( v ) . Likewise for a function ϕ ⋆ w that solves ( ˜ P w ).

Under Assumptions 6 and 7, we can combine (12) and Lemma 1 to get that

For this to hold, the definition of C in (11) implies that there exists a function ϕ a ∈ F such that

From (14b) we obtain that ϕ a is feasible for ( ˜ P u a ). Hence, it is a suboptimal solution of ( ˜ P u a ), which implies that

thus concluding the proof.

■

Proposition 5 shows that the perturbation function ˜ P ⋆ ( u ) can be convex even when ( ˜ P u ) is defined based on non-convex losses. In the context of resilient learning, this is important because it allows us to quantify the variations of the perturbation function, which is the basis for the resilient equilibrium from Def. 1.

The convexity of the perturbation function ˜ P ⋆ ( u ) is also relevant because, under a constraint qualification such as the one stated in Assumption 2, it implies that the optimization problem is strongly dual. We encapsulate this result in the next lemma since it will be used in subsequent derivations.

Lemma 2. Suppose ˜ P ⋆ ( u ) associated to ( ˜ P u ) is convex (Assumption 1) and there exists ϕ ∈ F strictly feasible for ( ˜ P 0 ) (Assumption 2). Then, strong duality holds for ( ˜ P u ) , i.e., ˜ P ⋆ = ˜ D ⋆ .

Proof. The result follows from [50, Thm. 15] since the constraint qualification in Assumption (2) implies that ˜ P ⋆ is lower semi-continuous [50, Thm. 18(a)], i.e., that its epigraph is closed [51, Prop. 1.1.2]. ■

C Proof of Thm. 1

The proof is divided in three steps that transform the resilient functional dual problem ( ˜ P-RES) into the resilient, parametrized, empirical dual problem ( ˆ D-RES). Explicitly, define the Lagrangian of ( ˜ P-RES) as

and its dual problem as

First, from lemma 2 we have that if assumption 1 and assumption 2 hold then the problem is strongly dual, i.e., ˜ P ⋆ R = ˜ D ⋆ R .

Then, to relate (D-RES) to its parametrized, empirical version ( ˆ D-RES), we begin by approximating F by F θ . Explicitly, we consider the difference between ˜ P ⋆ R and

This difference, which we call the approximation error , is bounded in the following proposition:

Proposition 6. Under Assumptions 1-2, it holds that

for ˜ P ⋆ R and u ⋆ as in ( ˜ P-RES) and ˜ D ⋆ θ as in (D θ -RES) .

The proof of Prop. 6 is deferred to Sec. C.1. We proceed by replacing the expectations in (D θ -RES) by empirical averages, leading to a generalization error bounded as follows:

Proposition 7. Let ˜ D ⋆ θ be the value of the parametrized dual problem (D θ -RES) achieved for a Lagrange multiplier λ ⋆ and ˆ D ⋆ R be the value of the empirical, parametrized dual problem ( ˆ D-RES) achieved for a Lagrange multiplier ˆ λ ⋆ . Under Assumption (5) , it holds that

with probability 1 -2( m +1) δ , where ∆ = max ( ∥ λ ⋆ ∥ 1 , ∥ ˆ λ ⋆ ∥ 1 ) .

A proof can be found in Sec. C.2. Combining the results in Prop. 6 and 7 using the triangle inequality yields (6) and concludes the proof of Thm. 1.

C.1 Bounding the parametrization error: proof of Prop. 6

The lower bound stems directly from the definition of the dual problem in (D θ -RES). Indeed, it is immediate that

In particular, (19) holds for a solution λ ⋆ of the resilient functional dual problem D-RES. Explicitly, we can write

Since F θ ⊆ F , it follows that

The upper bound is obtained by relating the parameterized dual problem (D θ -RES) to a tightened version of ( ˜ P-RES). Start by adding and subtracting ˜ L R ( ϕ, λ ; u ) in (16) from the objective of the parametrized dual problem (D θ -RES) to get

where the relaxations u i and relaxation costs h ( u ) canceled out. To proceed, use the Lipschitz continuity of the losses (Assumption 3) to bound the expected loss difference as

We can then bound (21) as

Minimizing (22) over θ yields

However, from the ν -approximation property of the parametrization (Assumption 4), for every ϕ ∈ F there exists θ ∈ Θ such that E D i [ | f θ -ϕ ( x ) | ] ≤ ν , for i = 0 , . . . , m . Hence, (23) simplifies to

Notice that (24) holds uniformly over ϕ ∈ F . Additionally, since the left-hand side does not depend on ϕ , minimizing it over u and ϕ then maximizing with respect to λ recover the dual value from (D θ -RES). We immediately obtain the upper bound

Expanding ˜ L R and rearranging the terms in (25), we recognize the Lagrangian of a perturbed version of ( ˜ P-RES), namely

Hence, the right-hand side of (25) is the dual problem of (PVI). Since (PVI) is strongly dual (from lemma 2), we obtain that ˜ D ⋆ θ ≤ ˜ P ⋆ Mν . To bound ˜ P ⋆ Mν , note that we can construct a feasible pair for (PVI) from any pair ( ϕ ⋆ , u ⋆ ) that solves the resilient functional learning problem ( ˜ P-RES). Explicitly, observe that the pair ( ϕ ⋆ , u ⋆ + 1 · Mν ) is a (suboptimal) feasible point of (PVI). Thus,

Combining (20) and (26) concludes the proof.

C.2 Bounding the generalization error: Proof of Prop. 7

Let λ ⋆ and ˆ λ ⋆ be solution pairs of (D θ -RES) and ( ˆ D-RES) respectively and consider the sets of dual minimizers

Note that member of these set are pairs ( θ, u ) . Since ˆ λ ⋆ maximizes the minimum (with respect to θ and u ) of the empirical Lagrangian in (5), it holds that min θ ∈ Θ , u ∈ R m + ˆ L θ ( θ, ˆ λ ⋆ ; u ) ≥ min θ ∈ Θ , u ∈ R m + ˆ L θ ( θ, λ ; u ) for all λ ∈ R m + . In particular,

Since ( ˆ θ † , ˆ u † ) ∈ ˆ M ( λ ⋆ ) is suboptimal for ˜ L R ( f θ , λ ⋆ ; u ) , we get

Using a similar argument yields

for ( θ † , u † ) ∈ M ( ˆ λ ⋆ ) . We thus obtain

Using the uniform convergence bound from Assumption 5, we obtain that

holds uniformly over θ with probability 1 -( m +1) δ . Combining (27) with (28) using the union bound concludes the proof. ■

D Proofs from Main Text

D.1 Proof of Proposition 1

Proof. [Existence] To show there exists u ⋆ ∈ R m + satisfying Def. 1, notice that (2) is equivalent to showing that there exists u ⋆ such that 0 ∈ ∂f ( u ⋆ ) for f ( u ) = ˜ P ⋆ ( u ) + h ( u ) . Notice that f is a convex function, so that its subgradient is well-defined [see (1)].

■

Start by noticing that the set of minimizers of f is not empty. Explicitly, let U ⋆ = argmin u ∈ R m + f ( u ) .

Observe that since the losses ℓ i are bounded, ˜ P ⋆ (¯ u ) = ˜ P ⋆ ( v ) for all v ⪰ ¯ u = B · 1 . Immediately, we obtain that f ( v ) is a componentwise increasing function for v ⪰ ¯ u , which implies that U ⋆ = argmin u ∈ ¯ U f ( u ) , where ¯ U = { u ∈ R m + | u ⪯ ¯ u } . Since ¯ U is compact and f is convex, its set of minimizers U ⋆ is compact and non-empty [51, Prop. B.10(b)].

For all u ′ ∈ int( U ⋆ ) , where int( Z ) denotes the interior of the set Z , it must be that 0 ∈ ∂f ( u ′ ) [52, Prop. 5.4.7]. This is simply a statement of the first-order optimality condition for u ′ .

Suppose, now, that U ⋆ has no interior and that for all u ′ ∈ U ⋆ , [ u ′ ] j = 0 for some j . Then, it could be that for all p ∈ ∂f ( u ′ ) are such that [ p ] j > 0 . However, this would lead to a contradiction. Indeed, since h is normalized, it holds that [ ∇ h ( u ′ )] j = 0 , so that ∂f ( u ′ ) = ∂ ˜ P ⋆ ( u ′ ) . Thus, if all p ∈ ∂f ( u ′ ) are such that [ p ] j > 0 , then all p ∈ ∂ ˜ P ⋆ ( u ′ ) are such that [ p ] j > 0 . From the convexity of ˜ P ⋆ , this would imply that ˜ P ⋆ ( u ′ + e j ) ≥ ˜ P ⋆ ( u ′ ) + [ p ] j > ˜ P ⋆ ( u ′ ) , where e j is the j -th element of the canonical basis. This contradicts the fact that ˜ P ⋆ is componentwise non-increasing. It must therefore be that 0 ∈ ∂f ( u ′ ) .

[Unicity] If h is strictly convex, then f is strictly convex. Then, its minimizer is unique [53, Chap. 27], i.e., U ⋆ is a singleton. Suppose there exists u † / ∈ U ⋆ that satisfies the equilibrium in Def. 1. Then, from (2), it holds that 0 ∈ ∂f ( u † ) . Since f is convex, this implies that u † is a minimizer, which violates the hypothesis that it is not in U ⋆ . ■

D.2 Proposition 2

Proof. From the definition of sub-differential, it holds for any p v ∈ ∂ ˜ P ⋆ ( v ) and p w ∈ ∂ ˜ P ⋆ ( w ) that

Adding (29) and (30), we can rearrange the terms to get

Then, since v i -u i > 0 if i = j and 0 otherwise, (31) implies that [ p v ] j -[ p w ] j ≤ 0 , which yields the desired result. Applying the same argument for h concludes the proof. ■

D.3 Proposition 3

Proof. The strong duality of ( ˜ P-RES) under assumptions 1 and 2 holds due to Lemma 2. The proof then follows the same steps used to prove that optimal Lagrange multipliers are subgradients of the dual function in convex problems; see, e.g., [39, Section 5.6.2]. We just verify that the proof holds despite the non-convexity of the problem as long as the problem is strongly dual.

By definition of the dual function we can write

where the inequality is true for any function ϕ . We particularize this inequality to a function ϕ ∗ ( · ; v ) that attains the minimum of (P u ) for relaxation v . We can therefore write

We now substitute the definition of the Lagrangian in (3) for the right hand side of (33) to write

The important property to observe in (34) is that we consider perturbation u and corresponding dual variable λ ∗ ( u ) while evaluating the Lagrangian at the function ϕ ∗ ( x ; v ) that is primal optimal for perturbation v . This latter fact implies that the following equality and inequalities are true

Using the relationships in (35) and (34) we conclude that

The two sums in the right hand side of (36) equal the inner product of multiplier λ ⋆ ( u ) with ( v -u ) . Implementing this substitution in (36) and reordering terms yields

Comparing (37) with (1) we see that λ ∗ ( u ) satisfies Definition 1. ■

D.4 Proposition 4

Proof. As we did in the proof of Prop. 1, we begin by showing that u ⋆ is a minimizer of ( ˜ P ⋆ + h )( u ) = ˜ P ⋆ ( u ) + h ( u ) . Explicitly,

As shown in proposition 1, u ⋆ minimizes ˜ P ⋆ + h iff 0 ∈ ∂ ( ˜ P ⋆ + h )( u ⋆ ) . Then 0 ∈ ∂ ( ˜ P ⋆ + h )( u ⋆ ) is also equivalent to the resilient equilibrium definition (2).

In ( ˜ P u ), the function ˜ P ⋆ ( u ) is defined as the solution of ( ˜ P u ). To show that ( ˜ P-RES ′ ) and ( ˜ P-RES) are equivalent a nested minimization over variables ϕ and u is equivalent to a joint minimization over ϕ and u . To confirm that this holds here recall the definition of u ⋆ as the resilient relaxation and of ϕ ∗ ( x ; u ) as the minimizer of the relaxed problem ( ˜ P u ) - which holds for all u and u ⋆ in particular. Since u ⋆ is the solution of ( ˜ P-RES ′ ). We therefore have that for all perturbations u

Further observe that ϕ ∗ ( x ; u ) is the minimizer of the relaxed problem (P u ) associated with perturbation u . We then have that for any feasible function ϕ we must have

The bound in (39) is true for all ϕ and u . In particular, it is true for the solution ϕ ∗ , u ∗ of ( ˜ P-RES). Particularizing (39) to this pair and combining the resulting inequality with the bound in (38) we conclude that

On the other hand, given that ϕ ∗ , u ∗ solve ( ˜ P-RES) we have that for all feasible u and ϕ

In particular, this is true if we make u = u ⋆ and ϕ = ϕ ∗ ( x ; u ⋆ ) . We can then write,

For (40) and (42) to hold we must have that ϕ ∗ , u ∗ is a solution of ( ˜ P-RES) if and only if u ⋆ and ϕ = ϕ ∗ ( x ; u ⋆ ) are a resilient perturbation and a corresponding resilient minimizer. ■

D.5 Proposition 8

Proposition 8. Let Φ ⋆ = argmin ϕ ∈F E ( x ,y ) ∼D 0 [ ℓ 0 ( ϕ ( x ; u ⋆ ) , y ) ] denote the solution set of the unconstrained problem and b i = min ϕ ∈ Φ ⋆ E ( x ,y ) ∼D i [ ℓ i ( ϕ ( x ; u ⋆ ) , y ) ] , i = 1 , . . . , m be the minimum constraint losses achieved. We show there exists costs such that ¯ u ⋆ i ≤ ϵ and ¯ u ⋆ i ≥ b i -ϵ for i = 1 , . . . , m .

Proof.

First, we will show sufficient conditions for u ⋆ ⪯ 1 ϵ and u ⋆ ⪰ b -1 ϵ , in terms of ∂ ˜ P ⋆ and ∇ h evaluated at 1 ϵ and b -1 ϵ , respectively. For any u ∈ R m + the strong duality of ˜ P ⋆ (lemma 2) implies that ∂ ˜ P ⋆ ( u ) is non empty and bounded. Also, the convexity of ˜ P ⋆ (assumption 1) implies that for all p u ∈ ∂ ˜ P ⋆ ( u ) and p u ⋆ ∈ ∂ ˜ P ⋆ ( u ⋆ ) by (31) from proposition (3) it holds that

Analogously, due to the convexity of h we have that

Adding (43) and (44) we obtain

(45) holds for any p u ⋆ ∈ ∂ ˜ P ⋆ ( u ⋆ ) . Since u ⋆ achieves the resilient equilibrium, by definition -∇ h ( u ⋆ ) = p u ⋆ ∈ ∂ ˜ P ⋆ ( u ⋆ ) , which implies that for all p u ∈ ∂ ˜ P ⋆ ( u )

Finally, by choosing particular values of u in (46) we obtain the desired conditions.

( u ⋆ ⪯ 1 ϵ ): Letting a = ϵ , (46) implies that if there exists

( u ⋆ ⪰ 1 b -1 ϵ ): Letting a = b -1 ϵ , (46) implies that if there exists

Let h ( u ) = α ∥ u ∥ 2 2 , α ∈ R + , which has ∇ h ( u ) = 2 α u . We will now show that there exist coefficients ¯ α and ¯ α such that the associated costs ¯ h and ¯ h satisfy the conditions (47) and (48).

which implies that ¯ h satisfies (47) and thus ¯ u ⋆ ⪯ 1 ϵ .

( ¯ h ): Let ¯ α < min i [ -p ( b -1 ϵ ) + ] i 2( b -ϵ )

which implies that ¯ h satisfies (48) and thus ¯ u ⋆ ⪰ b -1 ϵ . Since the definition of b and ϵ ensures that min i [ -p ( b -1 ϵ ) + ] i 2( b i -ϵ ) > 0 , there exists ¯ α > 0 that satisfies the above condition. ■

E Primal and Dual Updates

In section 4 we introduced the unconstrained problem ( ˆ D-RES) that approximates our original problem (P u ) as the saddle point of the empirical Lagrangian ˆ L θ :

As described in Algorithm 1 he saddle point can be obtained by alternating the minimization and the maximization of the Lagrangian with respect to the primal variables and dual variables respectively. We now describe the updates of both primal and dual variables in greater detail. For clarity, we

describe the updates using gradient descent and sub-gradient ascent for primal and dual variables, respectively. However, nothing precludes our method from using other optimization algorithms, such as Adam [54] or SGD with nesterov momentum.

The optimization is done via gradient descent and u and stochastic gradient descent for the primal variables θ

and stochastic subgradient ascent for the dual variables

In order to obtain the gradients of the Lagrangian with respect to the primal variables, observe that the minimization of the Lagrangian can be separated into two parts that each depend on only one primal variable.

where ˆ L ϕ ( ϕ, λ ) = ˆ L ( ϕ, λ ; 0) and ˆ L u ( λ , u ) is

The gradient with respect to u is obtained from (53)

Solving for the optimal θ is similar to solving a regularized empirical risk minimization problem. The gradient with respect to θ is estimated from ˆ L ( θ, λ ; 0) using a minibatch of B samples as

The constraints evaluated at the optimal Lagrangian minimizers are supergradients of the corresponding Lagrange multipliers [55]. In the same manner, stochastic supergradient ascent is done by updating the dual variable λ with the super-gradient estimated using a batch of B samples.

F Heterogenous Federated Learning Experiments

F.1 Formulation

In this section, we show that the constrained problem P -FL can be re-written as a constrained learning problem of the form of P, and then introduce its resilient version,

Let D i be the distribution of data pairs for Client i , and R i ( f θ ) = E ( x ,y ) ∼ D i [ ℓ ( f θ ( x ) , y )] its statistical risk. We denote the average performance as R ( f θ ) := (1 /C ) ∑ C i =1 R i ( f θ ) , where C is the number of clients. As proposed in [18] heterogeneity issues in federated learning can be tackled by imposing a proximity constraint between the performance of each client R i , and the loss averaged over all clients R . This leads to the constrained learning problem:

where C is the number of clients and D i is the distribution of data pairs for client i , and ϵ is a small (fixed) positive scalar.

In order to show that problem P -FL can be re-written as a constrained learning problem of the form of P, we introduce a random variable c uniformly distributed over client indices { 1 , . . . , C } , i.e.,

Then, we construct a mixture distribution D for data pairs such that

Then we can re-write the average risk R ( f θ ) as the expected loss under D :

where the first inequality holds by law of total expectation.

Let ℓ i ( f θ ( x ) , y ) = ( C ✶ ( c = i ) -1) ℓ ( f θ ( x ) , y ) -ϵ , where ✶ ( c = i ) is the indicator function for client i .

In the same manner, we can re-write the i -th constraint R i ( f θ ) -R ( f θ ) -ϵ as the expectation of the loss ℓ i under D i :

Then, we can re-write ( P -FL) as

which is in the form of (P).

As motivated in section 5.1, we then propose to solve the resilient version of ( P -FL):

In the next section we derive the primal dual algorithm that enables us to tackle (PR-FL) in a distributed, privacy preserving manner.

F.2 Resilient FL Algorithm

In this section we show that the resilient problem (PR-FL) can be tackled in a distributed and privacy preserving manner, as long as h is additively separable in in each component. Explicitly, we assume that

which holds for the quadratic cost used throughout the experimental section. We thus derive a distributed version of the resilient primal-dual algorithm presented in Section 4 (Algorithm 1).

We begin by writing the empirical Lagrangian associated to problem (PR-FL):

Note that in (59) we have used the assumption that the perturbation cost is additively separable. This enables us to update the perturbation for each client locally , and thus the resilient formulation does not incurr in any additional communication costs (with respect to the constrained problem in [18]). That is, clients do not need to communicate u i during optimisation. The server need only compute and communicate to all clients the average dual variable ¯ λ and the average loss R ( f θ ) . Therefore, Homomorphic Encryption techniques can be leveraged to compute these averages without revealing the values of individual dual variables λ i and local losses to the server. In the same manner, Homomorphic Encryption could be used to aggregate the relaxation cost h ( u ) = ∑ X i =1 h i ( u i ) at the server without loss of privacy.

θ update . For a fixed λ and u , the minimization of L with respect to θ is equivalent to a re-weighted version of the standard unconstrained FL objective:

Therefore, θ can be updated using any FL solver. We thus refer to the update on θ as a subroutine ClientUpdate ( { w i } C i =1 , θ t ) → θ t +1 , which can be implemented using, for example FedAVG [56] or FedPD [57].

u update . For a fixed λ and θ , the minimization of ˆ L with respect to u is can be carried independently by each client, since the objective is additively separable:

We can thus employ gradient descent (or any other optimization algorithm) locally at each client.

λ update . For a fixed perturbation u and model θ , we perform dual update on λ by taking dual ascent steps of the following equivalent objective,

If server then computes and communicates the average of the client's losses R ( f ( θ )) , the updates to each multiplier λ i can be made locally by each client as in 56.

As stated before, these update steps can be applied in alternated manner to find a solution of the empirical dual problem, as as described in Algorithm 2.

Algorithm 2 Resilient Federated Learning

Initialize θ (0) , λ (0) , u (0) , and 0 < η ≪ 1 .

for

t

= 1

. . . T

Compute weights: for all

i

[

N

]

, w

∈

Theta Update:

i

(

ClientUpdate

θ

t

Perturbation Update:

u

Dual Update:

i

λ

(

t

i

= 1 +

{

w

u

i

(

t

) = [

(

) =

end

F.3 Experimental Setup

As in [18] we create hetereogeneity between clients through class imbalance. Unless stated otherwise, we use three minority classes (Class Labels { 0 , 2 , 4 } ), and simulate the phenomenon of class imbalance by keeping only ρ = 10% of the data data belonging to the minority classes in the training set.

[

λ

(

t

-

t

}

-

1) +

η

N

i

i

=1

1)

-

[

λ

i

λ

-

, θ

η

1

N

i

t

-

u

, with

λ

¯

1

)

i

u

d

N

λ

¯

;

(

t

i

j

=1

-

ℓ

1)]

(

f

θ

=

+

(

x

j

)

∑

i

1

N

, y

j

)

N

i

=1

∑

-

u

i

(

λ

i

;

t

-

1)

]]

+

We follow the implementation from [58], in which a Dirichlet prior (over the ten classes) is sampled independently for each client. One client at a time, we sample without replacement according to each client's prior. Once a class runs out of samples, the subsequent clients do not own samples of that class.

We also create a test set for each client with the same class balance as the train set. Test sets are then sampled without replacement for each client (but with replacement among different clients, i.e., test sets overlap accross clients).

We use the same small neural network architecture as in [18,58]. Namely, a CNN model consisting of 2 convolutional layers with 645 × 5 filters followed by 2 fully connected layers with 384 and 192 neurons. For both the constrained and resilient formulations, we use FedA VG [56] to update θ , using 5 communication rounds for each primal update, as in [18].

In all experiments we use 100 clients, and all clients participate from each communication round. We run 500 communication rounds in total. We set ϵ = 0 . 1 , dual learning rate η λ = 0 . 1 , local learning rate η θ = 5 × 10 -2 and use no data augmentation in all experiments. In the resilient learning formulation, unless stated otherwise, we use a quadratic penalty on the perturbation h ( u ) = ∥ u ∥ 2 2 and a perturbation learning rate η u = 0 . 1 .

All of the plots in section 5 correspond to CIFAR10 [59]. Results for FashionMNIST [49] can be found on F.4.4.

F.4 Additional Results

F.4.1 Performance Relaxation trade off.

As we have already shown, through the choice of the relaxation cost function, we can control the tradeoff between relaxing requirements and performance. Figure 4 shows that changing the ablation on the coefficient α in the quadratic relaxation cost h ( u ) = α ∥ u ∥ 2 2 not only results in larger relaxations, but that these larger relaxations effectively lead to clients with higher losses.

2

4

10

20

40

1001000

Relaxation Cost (

)

0.02

0.04

0.06

0.08

0.10

0.12

0.14

0.16

Worst Client Loss

(constraint)

0.054

0.056

0.058

0.060

Mean Client Loss

(objective)

Worst

Mean

F.4.2 Sensitivity to Problem Specification

The resilient approach is less sensitive to the specification of the constraints. Dual variables indicate the sensitivity of the objective with respect to constraint perturbations. As shown by Figure 5 the resilient approach yields smaller dual variables, irespectively of the tolerance ϵ in the constraint specification. In this context, setting the constraint levels a priori requires knowledge about the heterogeneity of the client local distributions, which in our setup depends on the imbalance of the dataset. As shown by figure 6 the resilient approach yields smaller dual variables, irrespectively of the tolerance irrespectively of the percentage of samples of minority classes that are kept, whereas the dual variables grow for more imbalanced and thus harder to satisfy scenarios.

Constraint Violation

0.002

0.02

0.2

0

2

4

6

Train

Test

Split

0.4

0.2

0.0

0.2

0.4

0.6

0.8

1.0

Formulation

Constrained

Resilient

5

20

30

Minority Class Samples (%)

0

1

2

3

4

5

F.4.3 Constraint violation across setups.

Relaxing stringent requirements not only makes the empirical problem easier to solve, but it can also lead to a better empirical approximation of the underlying statistical problem. That is, overly stringent requirements can result not only in large dual variables, but can also harm generalization. Figure 7 shows that more stringent constraint specifications can lead to poor constraint satisfaction in the test set. This improvement in constraint satisfaction is associated with smaller generalization gaps for the constraints were observed for the resilient approach, as shown in Figure 8.

F.4.4 Test Accuracy.

In this section we aim to give quantitative performance metrics. We include a constrained baseline [18] and another method for federated learning under class imbalance [60] for comparison.

We first compare approaches in terms of the objective, by averaging the test accuracy over all clients. As shown in Table 3, the average accuracy of the resilient approach is overall similar to the constrained approach and the baseline [60].

In order to asses how the distribution o performance among clients varies we also report spread metrics for the test accuracy across clients. As shown in Table 3, Resilient learning has (generally) less spread in the interquartile range and higher maximum spread than its constrained counterpart.

F.4.5 Comparing client performances

We sort clients according to their test accuracy Acc [1] ≥ Acc [2] ≥ . . . ≥ Acc [ c ] . We plot the accuracy of equally ranked clients for the constrained baseline [18] ( Acc res [ c ] ≥ Acc const [ c ] ) . As shown in Figures 9 and 10, in all setups the majority of clients achieve a small increase in performance, while a small fraction experiences a larger decrease. For higher imbalance ratios, this is more pronounced.

Constraint Violation

0.002

0.02

0.2

0.50

0.25

0.00

0.25

0.50

0.75

1.00

Constraint Violation (T est)

Train

Test

Split

0.4

0.2

0.0

0.2

0.4

0.6

0.8

Formulation

Constrained

Resilient

5

10

20

30

Minority Class Samples (%)

0.4

0.2

0.0

0.2

0.4

0.6

0.8

Constraint Violation (T est)

0.002

0.02

0.2

0.0

0.2

0.4

0.6

0.8

Largest Constraint

Generalization error

F.5 Ablation on perturbation cost function h .

In all experiments, we have used a quadratic perturbation cost function h = α ∥ u ∥ 2 2 In order to assess the impact of the choice of cost the function, we run our algorithm using as a cost ∥ u ∥ β with β = 1 , 2 , 4 , ∞ , for fashion MNIST in both the federated and invariant setting.

As shown in Table 4, both the mean and spread statistics are similar for β = 1 , 2 , 4 , i.e. our approach is not overly sensitive to the choice of cost function in this experimental setup. However, β = ∞ does show a substantially different behaviour. Penalizing the only the largest perturbation results in a smaller range while attaining a higher IQR and lower mean accuracy. That is, it reduces the worst client test accuracy, but the performance of most clients deteriorates, both in terms of its average and spread. The infinity norm is related to Rawlsian (i.e. minimax) formulations which have been proposed in the context of fairness see e.g. [14].

G Ablation on dual and resilient learning rates

We also perform an ablation on η u , η λ , the perturbation and dual learning rates, over a small grid of 12 values. In this particular setup, we find that the performance of the algorithm is not overly sensitive to this choice. We also observe that that the rates that were used in the paper ( η u = 0 . 1 , η λ = 2) are not optimal in this case, and thus further improvements in performance could be obtained through

1.0

0

20

40

60

80

100

50

60

70

80

90

CIFAR10, Imbalance Ratio:10

resilient

constrained

Decrease

Improvement

0

20

40

60

80

100

55

60

65

70

75

80

85

90

CIFAR10, Imbalance Ratio:20

resilient

constrained

Decrease

Improvement

0

20

40

60

80

100

75

80

85

90

95

FASHION-MNIST, Imbalance Ratio:10

resilient

constrained

Decrease

Improvement

0

20

40

60

80

100

50

60

70

80

90

100

FASHION-MNIST, Imbalance Ratio:20

resilient

constrained

Decrease

Improvement

more extensive hyperparameter tuning. However, the main aim of our numerical experiments is to validate empirically the properties of our approach.

H Invariance Constrained Learning Experiments

H.1 Experimental setup.

We showcase our approach on datasets with artificial invariances, following the setup of [23]. Explicitly, we generate the synthetic datasets, by applying either rotations, translations or scalings, to each sample in the MNIST [48] and FashionMNIST [49] datasets. The transformations are sampled from uniform distributions over the ranges detailed in Table 6. We use the same MLP and CNN architectures and hyperparameters as [23], except that we use only 6 augmentations per sample instead of 31 during training.

For each transformation set (rotations, translations and scalings), we constraint the expected loss over samples augmented with the transformations sampled from uniform distributions over the ranges detailed in Table 7. Note that there is a mismatch between the distribution used to generate the

data and that used in the constraints. That is, except for the fully rotated dataset, the constraints are larger than the true transformation range used to construct the synthetic dataset (Table 6).The purpose of this experiments is to showcase that the resilient approach can relax constraints associated to transformation sets that do not describe symmetries or invariances of the data and can thus hinder performance. We use the same transformation sets and constraint specification ( ϵ ) for all synthetic datasets.

.

H.2 Results

H.2.1 Ablation on perturbation cost.

As in the case of federated learning (presented in section 4) perform an ablation on the cost function h using ∥ u ∥ β with β = 1 , 2 , 4 , ∞ .

As shown in table 8, β = 1 showed slightly better performance in terms of average test accuracy across all invariant settings. As discussed in Section 3.3, β = 1 recovers penalty based methods, i.e. it is equivalent to setting a fixed penalization coefficient. Nonetheless, the dynamics of our algorithm are different and can thus lead to different solutions.

H.2.2 Performance on F-MNIST

The resilient approach is able to handle the misspecification of invariance requirements, outperforming in terms of test accuracy both the constrained and unconstrained approaches. In addition, though it was not designed for that purpose, our approach shows similar performance to the invariance learning method Augerino [22].

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nReasonable requirement specification in constrained learning has long been hindered by the presence of compromises and limited prior knowledge about the data. As a treatment, this paper proposes resilient constrained learning that adapts the requirements while simultaneously solving the learning task. Specifically, it balances the performance gains obtained from the constraint relaxation against a user-defined relaxation cost function. The paper provides theoretical provements for the balance (e.g. approximation and generalization guarantees) along with a practical algorithm. The algorithm is validated in invariant learning and federated learning experiments.\n\nSTRENGTHS:\n1. The paper is well motivated to solve the constraint-performance trade-off problem, with the algorithm derived from detailed assumptions and theorems.\n2. Overall, I think the paper is well-written and easy-to-follow.\n3. The final algorithm is simple yet effective, allowing for a straightforward and flexible adjustment of the trade-off through a relaxation cost parameter $\\alpha$.\n\nWEAKNESSES:\n1. My primary concern regarding the acceptance of this paper lies in its simplistic experimentation. From my view, the federated learning problem is more like a toy example.\n2. The paper lacks in-depth study on various aspects of the algorithm's performance.\n\nQUESTIONS:\n1. Have you try cost functions other than $\\alpha||u||^2$, and how does different cost functions impact the algorithm's performance and efficiency?\n2. How does the learning rates $\\eta, \\eta_u,\\eta_\\lambda$ influence the algorithm's performance? Do they require meticulous joint tuning, or are they effective within certain ranges of individual values?\n\nLIMITATIONS:\n1. First, the federated and invariance learning problem are manually synthesized for validating the effectiveness of the proposed method, which I regard not convincing enough without results on large-scale real-world datasets.\n2. The federated learning experiment lacks quantitative metrics and diverse baselines other than single constrained learning.\n3. The empirical efficiency has not been studied in the paper.\n4. The paper lacks a detailed limitation discussion section.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-06-29"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes an approach to solve the constrained learning problem (where the considered function is convex), named resilient constrained learning. The main idea is to relax the learning constraints according to how much they affect the considered task. It can be viewed as a generalization of the standard constrained learning and studies the tradeoff between the gain from constraint relaxations and the cost from the relaxations. The main theoretical result shows that the gap between the relaxed solution and the optimal solution of the original problem is bounded by a function of the relaxation amount. Numerical experiments verified the basic properties of the proposed approach.\n\nSTRENGTHS:\nThe idea of relaxing the constraints and balance between relaxation gain and cost is interesting. When $u$>0, it can be seen as an interpolation between unconstrained learning and constrained learning. The main theorem states a bound for the gap between the relaxed solution and the original optimal solution and the derivation process seems solid (although I did not check every step carefully). It can have meaningful real life applications since in many real cases, the constraints are considered as compromisable depending on the gains of relaxations.\n\nWEAKNESSES:\nThe writing is a little hard to follow and some important parts are put in the appendix, like the algorithm 2 mentioned below theorem 1. \n\nOne major concern is that the experimental results are quite weak even considering that this is a theoretical paper. The experiments are only sanity checks to make sure the proposed method can indeed solve some constrained learning problems, but did not demonstrate how well the solution is. There is no comparison with existing algorithms for solving constrained learning problems, which hinders the contribution of the proposed method to a large extent.\n\nQUESTIONS:\nIt would be much better if there were some comparison with existing constrained learning algorithms, and discuss the cases where $u=0$ and $u>0$.\n\nLIMITATIONS:\nDid not see discussions of limitations.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-08"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper introduces the concept of resilient constrained learning, which aims to find a compromise between reducing the objective loss and staying close to the original problem. This paper presents conditions for achieving a resilient equilibrium and provides equivalent formulations of resilient relaxation. This paper derives approximation and statistical guarantees for the algorithm used to find this equilibrium. It showcases its advantages in image classification tasks involving multiple potential invariances and federated learning under distribution shift. The paper's contributions include introducing a practical algorithm to compute the resilient equilibrium, determining conditions under which this equilibrium exists, and showcasing the advantages of resilient constrained learning in real-world applications.\n\nSTRENGTHS:\n+ In terms of originality, resilient constrained learning is introduced, a novel approach to balancing multiple requirements in machine learning tasks. The idea of adapting the requirements while simultaneously solving the learning task is innovative. It addresses the challenge of specifying requirements in the presence of compromises and limited prior knowledge about the data. The paper also presents conditions for achieving a resilient equilibrium and provides equivalent formulations of resilient relaxation.\n\n+ The paper's significance lies in its potential to enable machine learning solutions that better satisfy real-world requirements beyond accuracy, such as fairness, robustness, or safety.\n\nWEAKNESSES:\n- One weakness is that the paper does not comprehensively compare existing approaches to constrained learning, such as penalty-based methods or Lagrangian duality-based methods. While the article mentions these approaches, it does not compare their strengths and weaknesses with the Resilient Constrained Learning approach. Such a comparison could help clarify the advantages and limitations of the Resilient Constrained Learning approach and provide insights into when it is most appropriate.\n\n- Additionally, the paper could benefit from a more detailed discussion of the limitations and assumptions of the proposed method. \n\n- From my humble understanding, the inequality in eq (1) should be P(v) >= P(u) + p\\top (v - u_0).\n\n- Grammar issues: L 39. be they penalty coefficients or constraint levels\n\nQUESTIONS:\nSee Above\n\nLIMITATIONS:\nN/A", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-21"}

comments: SUMMARY:
This paper proposes a novel resilient learning approach for constrained learning problem. In the presented approach, constraints are interpreted as nominal specification that can be relaxed to find a better compromise between objective and requirements. The first main contribution of this paper is to relax constraints according to the sensitivity of the objective to perturbations of the constraint. Then the next contribution is to design a practical resilient learning algorithm based on duality and perturbation theory.

STRENGTHS:
1.	The assumption and properties of the convex function of relaxation and resilient equilibrium are discussed in detail in this paper, which provides a theoretical proof to the effectiveness of the presented approach.      
2.	The authors also interpret why both traditional unconstrained and constrained learning can be seen as limiting cases of resilient learning.  
3.	The paper is well written.

WEAKNESSES:
1.	Some basic concepts should be explained more clearly, such as the definition of nominal specification.
2.	The experiment of invariant learning is missed in Section 5 although in the abstract it is claimed to has been conducted.
3.	The authors do not explain which constrained approaches are involved in the contrast experiment.

QUESTIONS:
I cannot find the evaluation of resilient formulation of invariant learning. Where is it?

LIMITATIONS:
No limitations or potential negative societal impact are mentioned.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-27