SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Aniket Murhekar<sup>1</sup> Zhuowen Yuan<sup>1</sup> Bhaskar Ray Chaudhury<sup>1</sup> Bo Li<sup>1</sup> Ruta Mehta<sup>1</sup>
<sup>1</sup>University of Illinois, Urbana-Champaign {aniket2,zhuowen3,bryacha,lbo,rutameht}@illinois.edu
Federated learning (FL) has emerged as a powerful scheme to facilitate the collaborative learning of models amongst a set of agents holding their own private data. Although the agents benefit from the global model trained on shared data, by participating in federated learning, they may also incur costs (related to privacy and communication) due to data sharing. In this paper, we model a collaborative FL framework, where every agent attempts to achieve an optimal trade-off between her learning payoff and data sharing cost. We show the existence of Nash equilibrium (NE) under mild assumptions on agents' payoff and costs. Furthermore, we show that agents can discover the NE via best response dynamics. However, some of the NE may be bad in terms of overall welfare for the agents, implying little incentive for some fraction of the agents to participate in the learning. To remedy this, we design a budget-balanced mechanism involving payments to the agents, that ensures that any  $p$ -mean welfare function of the agents' utilities is maximized at NE. In addition, we introduce a FL protocol FedBR-BG that incorporates our budget-balanced mechanism, utilizing best response dynamics. Our empirical validation on MNIST and CIFAR-10 substantiates our theoretical analysis. We show that FedBR-BG outperforms the basic best-response-based protocol without additional incentivization, the standard federated learning protocol FedAvg (McMahan et al. [2017]), as well as a recent baseline MWFed (Blum et al. [2021]) in terms of achieving superior  $p$ -mean welfare.
Federated Learning (FL) has emerged as an effective collaborative training paradigm, where a group of agents can jointly train a common machine learning model. The success of collaborative learning paradigms is visible in the domains of autonomous vehicles (Elbir et al. [2020]), digital healthcare (Dayan et al. [2021], Xu et al. [2021], Nvidia [2019]), multi-devices (Learning [2017]), and biology (Bergen and Petryshen [2012]). Although such collaborative learning is immensely beneficial to the agents, individually, they may not be incentivized to share their data. This is because sharing data may incur costs attributed to bandwidth use, privacy leakage, and the use of computing resources. In turn, high costs and low learning payoffs may cause some of the agents to drop out of FL, resulting in subpar learning. As noted by Blum et al. [2021], the success of FL systems depends on its ability to attract and retain a large number of federating agents.
Thus, it is crucial to achieve fairness and welfare guarantees for all participating agents.
This calls for game-theoretic modeling and analysis of the agent's payoff and costs, and subsequent mechanism design to incentivize participation. Towards the former, Blum et al. [2021] introduce a model, where every agent receives a payoff from the collaboration measuring the "learning benefit" the agent derives from the total data shared. In particular, when each agent  $i$  contributes  $s_i$  units of data, the payoff for agent  $i$  is captured by  $a_i(\boldsymbol{s})$ , where  $\boldsymbol{s} = \langle s_1, s_2, \ldots, s_n \rangle$  is the data contribution
profile, or sample vector. Blum et al. [2021] consider the constrained cost-minimizing model, where each agent minimizes her data contribution  $(s_i)$  subject to the requirement that her payoff should be larger than a threshold  $(a_i(s_i, s_{-i}) \geq \mu_i)$ . They show that a Nash equilibrium (NE) (Nash [1951]), arguably the most sought after solution concept in game theory, may not always exist in this model. They derive sufficient conditions for existence of NE, as well as provide novel structural results about the equilibria.
We note that an agent's cost for sharing data may be more complex than just the size of the total data shared. There are studies dedicated to quantifying the losses (attributed to data collection, processing, and privacy) that are incurred with increased sharing of data (Li and Raghunathan [2014], Laudon [1996], Jaisingh et al. [2008]). Furthermore, within game theory (and economics) typically agents are considered as net utility maximizers, i.e., maximizing payoff minus cost, for example value minus payment in auctions (Myerson [1981]), and revenue minus cost in markets (Huber et al. [2001], Börgers [2015]). To capture these aspects, in this paper we propose an unconstrained utilitarian model, where we define the utility  $u_{i}(\boldsymbol{s})$  of each agent  $i$  as the difference between her payoff and her cost of sharing data, i.e.,  $u_{i}(\boldsymbol{s}) = a_{i}(\boldsymbol{s}) - c_{i}(s_{i})$ , where  $c_{i}(s_{i})$  denotes the cost incurred by agent  $i$  on sharing  $s_{i}$  data samples. Each agent aims to maximize their utility. This model is natural in FL settings where there is a natural coupling between payoffs and costs, and there are no hard cost constraints, i.e., having an upper bound on the total cost that an agent can incur. Since utility functions are directly indicative of the welfare for the agents, this facilitates defining global fairness and welfare criteria in terms of the utilities of the agents. This motivates the following questions:
When agents strategize on data contribution to maximize their net utility, does a Nash equilibrium always exist? If yes, then can agents actually discover a Nash equilibrium when acting independently? Can any welfare function of utilities of the agents be optimized at such a Nash equilibrium by designing new rules (mechanisms)?
The goal of this paper is to address the above questions. Before we describe our contributions, we note that Karimireddy et al. [2022] also consider a framework similar to ours, by defining the utility function to be payoff minus cost. However, their focus is data maximization and avoiding free-riding, while the focus of our paper is to design mechanisms that achieve fairness and welfare for all agents. Furthermore, our model generalizes the model of Karimireddy et al. [2022] as we do not require the agents' data to be identically distributed and in turn to have identical payoff functions.
We work under the concavity assumption on the utility functions. In particular, we assume that the payoff functions are concave and cost functions are convex. These assumptions are standard in the literature (Blum et al. [2021], Karimireddy et al. [2022]). Convexity of cost functions is a natural choice since it captures the property of increasing marginal costs. For instance, data sharing through ordered selection, i.e., sharing records in ascending order of costs involved for collecting the records, results in convex cost functions. There are more models that result in strictly convex cost functions (Li and Raghunathan [2014]). Similarly, several important ML models exhibit concave payoff functions; for instance payoffs in linear or random discovery models, random coverage models, and general PAC learning are all concave - see Section 2.1. Furthermore, there is empirical evidence that the accuracy function in neural networks under the cross-entropy loss is also concave (Kaplan et al. [2020]).
Existence and Reachability of Nash Equilibrium: Under the concavity assumptions, we show that a Nash equilibrium (NE) is guaranteed to exist. We note that our existence result holds for more general settings than those of Blum et al. [2021] – we do not assume that the cost functions are linear, or that the utility functions have bounded derivatives. In particular, our result shows the existence of NE under the general PAC learning framework (see Section 2.1); under this setting an equilibrium in the model of Blum et al. [2021] fails to exist. We also demonstrate that if the concavity assumption is relaxed, there exist instances which do not admit NE.
Furthermore, we show that the agents can discover a NE through an intuitive best response dynamics, where agents update their data contribution proportional to the gradient of their utility functions in the direction that increases their utility. We show that for strongly concave utility functions and under the mild assumption of the gradient of the utilities being bounded, the best response dynamics converges
to an approximate NE in time polynomial in  $O(\log (\varepsilon^{-1}))$ . This contribution may be of independent interest to equilibrium computation in concave games.
A Fair and Welfare Maximizing Mechanism: In general, a Nash equilibrium need not be fair or maximize any notion of welfare for the agents (see Example 1). Therefore, we next focus on designing mechanisms that optimize welfare of the agents at its NE. The generalized  $p$ -mean welfare, defined to be the  $p^{th}$ -norm of the utilities of the agents  $\left(\frac{1}{n}\sum_{i\in [n]}u_i(s)^p\right)^{\frac{1}{p}}$  for  $p\in (-\infty ,1]$ , constitutes a family of functions characterized by natural fairness axioms including the Pigou-Dalton principle (Moulin [2003]). This notion encompasses well studied notions of fairness and economic welfare, such as (i) the average social welfare  $\left(\frac{1}{n}\sum_{i\in [n]}u_i(s)\right)$  when  $p = 1$ , (ii) the egalitarian welfare  $(\min_{i\in [n]}u_i(s))$  when  $p = -\infty$ , which is a fundamental measure of fairness, and (iii) the Nash welfare  $(\prod_{i\in [n]}u_i(s))^{1 / n}$  in the limiting  $p\to 0$  case, which is a popular notion in social choice theory that achieves a balance between welfare and fairness (Varian [1974], Caragiannis et al. [2019]).
As our second main contribution, for linear costs, we design a budget-balanced mechanism that always admits a Nash equilibrium. The mechanism involves payments, however, budget-balancedness ensures that the total payment of all the agents is zero, and thereby the central server operates on no-profit-no-loss. Moreover we show that when the sample vector at NE is positive, i.e., all agents contribute positive amount of data samples, then the NE maximizes the  $p$ -mean welfare among all positive sample vectors. Since we can ensure the server does not communicate with an agent who does not contribute any data points, insisting on positive sample vectors is a mild assumption.
Our mechanism builds on ideas from a mechanism of Falkinger et al. [2000] for the efficient provisioning of public goods. The key idea is to compensate an agent who incurs a cost higher than the average cost incurred by other agents via a subsidy proportional to her excess cost; likewise, agents incurring a lower cost than average of others are proportionally taxed. By setting the level of tax/subsidy carefully, we show that the NE of the mechanism are  $p$ -mean welfare maximizing. To the best of our knowledge, our work is the first to explore this intimate connection between FL and public goods provisioning. Our results highlight the promise of bridging the fields of machine learning and social choice theory.
Once we have established the mechanism, we show that a corollary of our first main result implies that the best response dynamics under this mechanism will lead to the discovery of the  $p$ -mean welfare maximizing Nash equilibrium.
Empirical Evaluation: We design a distributed training protocol for FL based on our mechanism, called FedBR-BG. We compare our algorithm with three other algorithms: the distributed protocol for the vanilla mechanism without budget balancing FedBR, the standard federated learning protocol FedAvg (McMahan et al. [2017]), and a recent adaptation of FedAvg called MWFed (Blum et al. [2021]). We show that our budget-balancing algorithm achieves superior  $p$ -mean welfare under different settings on two datasets, MNIST (LeCun et al. [2010]) and CIFAR-10 (Krizhevsky [2009]).
We mention some additional literature on welfare maximization and incentives in FL, as well as other related mechanisms in public goods theory.
Welfare maximization in FL. Typically federated learning protocols compute a model which maximize some weighted sum of agent accuracies (i.e. utilities). Examples of such protocols include the standard FedAvg (McMahan et al. [2017]), AFL (agnostic FL) (Mohri et al. [2019]), and  $q$ -FFL (Li et al. [2020]). However, unlike our work, all these methods ignore the strategic aspects arising from costs involved in data sharing, and instead assume agents honestly contribute all their data.
Incentives in FL. This line of work adopts game theory for incentivizing the contribution of data owners. Common models include the Stackelberg game, non-cooperative game, and coalition game. More specifically, the Stackelberg game is employed to optimize the utility of both the server and agents Feng et al. [2019]. On the other hand, in non-cooperative games, the server or the agent seeks to maximize its own utility Zou et al. [2019]. While most previous methods analyze the properties of a certain scenario, we aim to design mechanisms that achieve fairness and welfare for all agents.
Mechanisms for public good provisioning. There is a long line of work for the efficient provisioning of public goods, beginning from Samuelson [1954]. Several works such as Falkinger et al. [2000], Andreoni and Bergstrom [1996] and Bergstrom et al. [1986] use the idea of imposing a tax/subsidy on the agents but differ in the specific manner in which this tax/subsidy is imposed. While our mechanism is inspired by Falkinger et al. [2000], our model is more general than theirs. The design of our mechanism for this general model and the proof of its properties are our novel contributions.
We consider a federated learning problem with  $n$  agents who wish to jointly solve a common learning problem. Let  $\mathcal{D}_i$  be the distribution of data points available to agent  $i$ . Towards jointly solving the learning problem, each agent  $i$  contributes some set  $T_i \sim \mathcal{D}_i^{s_i}$  of  $s_i$  data samples. Under the assumption that agent  $i$ 's data is i.i.d. from their distribution  $\mathcal{D}_i$ , each agent's contribution can be captured simply by their contribution level, i.e., amount of data samples they contribute. Let  $S_i \subseteq \mathbb{R}_{\geq 0}$  be the set of feasible contribution levels of agent  $i$ , and let  $S := \times_j S_j$ . Given a sample vector  $s = (s_1, \ldots, s_n) \in S$ , the central server returns model(s) trained using the samples  $\bigcup_i T_i$ .
In our model, each agent  $i$  derives a payoff from the jointly learned model, e.g. the payoff could be the accuracy of the model. We assume a general framework which models the payoff of agent  $i$  as a function  $a_{i}:\mathcal{S}\to \mathbb{R}_{\geq 0}$ . We typically assume each payoff function  $a_{i}$  is bounded, continuous in  $\mathbf{s}$ , and non-decreasing in the contribution  $s_i$  of agent  $i$ . Moreover each agent  $i$  incurs a cost associated with data sharing captured through a non-decreasing cost function  $c_{i}:S_{i}\rightarrow \mathbb{R}_{\geq 0}$ . The net utility of agent  $i$  is the payoff minus cost, i.e.,
$$
u _ {i} (\boldsymbol {s}) = a _ {i} (\boldsymbol {s}) - c _ {i} (s _ {i}).
$$
Given the above framework, the goal of an agent  $i$  is to decide how many samples to contribute so that her net utility  $u_{i}(\cdot)$  is maximized. Note that the utility of agent  $i$  depends on the contributions of other agents as well. Further, we can assume without loss of generality that each set  $S_{i} = [0,\tau_{i}]$  for some threshold  $\tau_{i} > 0$ . This is because we can discard contribution levels where an agent gets negative utility. Since the payoff  $a_{i}(s)$  is bounded above by some constant  $A_{i} > 0$  and costs are increasing, agent  $i$  cannot obtain a positive utility by contributing more than  $\tau_{i} := c_{i}^{-1}(A_{i})$  samples.
Payoff and cost functions are assumed to be concave and convex respectively (Blum et al. [2021], Karimireddy et al. [2022]). As discussed in Section 1.1, it is natural to assume that cost functions are convex to capture increasing marginal costs (Li and Raghunathan [2014]). Similarly, there are ample justifications to concave payoff functions, as discussed in Section 2.1 where we analyze payoff functions arising from some of the canonical learning paradigms, and their concavity properties.
Remark 1. Our framework generalizes those of Blum et al. [2021] and Karimireddy et al. [2022]. In the former, an agent's goal is to contribute the fewest number of data samples subject to ensuring that their payoff crosses a certain threshold; and in the latter all agents have a common payoff function that is a function of  $\| s\| _1 = s_1 + \dots +s_n$ , and linear cost functions.
Nash Equilibrium (NE). Arguably the most sought after solution concept within game theory is of Nash Equilibrium (Nash [1951]), a stable state or an equilibrium state of the system where no agent gains by unilaterally changing their data contribution level. Formally,
Definition 1 (Nash equilibrium (NE)). A sample vector  $s \in S$  is said to be at a Nash equilibrium if for every  $i \in [n]$ , and every  $s_i'$ , we have  $u_i(s) \geq u_i(s_i', s_{-i})$  where  $(s_i', s_{-i}) = (s_1, \ldots, s_i', \ldots, s_n)$ .
An alternate view of a Nash equilibrium relies on the concept of best response. Given the sample contributions  $s_{-i}$  of other agents, the set  $f_{i}(s_{-i})$  of contribution levels of agent  $i$  that maximize her utility is the best response set of agent  $i$ :
$$
f _ {i} (\boldsymbol {s} _ {- i}) = \arg \max  _ {x \in S _ {i}} \left\{a _ {i} (x, \boldsymbol {s} _ {- i}) - c _ {i} (x) \right\} \subseteq S _ {i}.
$$
The best response correspondence  $f$  is then defined as a set-valued function  $f: S \to \times_{i} 2^{S_{i}}$ , where  $[f(s)]_{i} = f_{i}(s_{-i})$ . It is then clear that:
Proposition 1. A sample vector  $s \in S$  is a Nash equilibrium if and only if it is a fixed point of the best response correspondence, i.e.,  $s \in f(s)$ .
2.1 Canonical examples of payoff functions
We now discuss a few examples of payoff functions that are captured by our general framework. In all the examples below, the payoff functions  $a_{i}(s)$  are non-negative, bounded, continuous, nondecreasing, and concave in  $s_i$  for any fixed strategy profile  $s_{-i}$  of the other agents.
Linear or Random discovery. In this model, the payoff is linear in the sample vector and is given by  $a_{i}(s) = (Ws)_{i}$  for a matrix  $W$ . For example, Blum et al. [2021] consider a setting where each agent has a sampling probability distribution  $\mathbf{q}_i$  over the instance space  $X$  and gets a reward equalling  $q_{ix}$  whenever the instance  $x$  is sampled by any agent. Then the expected payoff to agent  $i$  is  $a_{i}(s) = (QQ^{T}s)_{i}$ , where  $Q$  is a matrix given by  $Q[i,x] = q_{ix}$  for  $i \in [n]$  and  $x \in X$ . Here  $W = QQ^{T}$  is a symmetric PSD matrix with an all one diagonal.
Random coverage. In the above setting, agent  $i$  obtains a reward  $q_{ix}$  each time some agent samples instance  $x$ . In the random coverage model arising in binary classification (Blum et al. [2021]), an agent gets this reward only once. Under this model, the payoff given by expected accuracy takes the form:
$$
a _ {i} (\boldsymbol {s}) = 1 - \frac {1}{2} \sum_ {x \in X} q _ {i x} \prod_ {j = 1} ^ {n} \left(1 - q _ {j x}\right) ^ {s _ {j}} \in [ 0, 1 ]. \tag {1}
$$
Generalization bounds from general PAC learning. Consider a general learning setting where we want to learn a model  $h$  from a hypothesis class  $\mathcal{H}$  which minimizes the error over a data distribution  $\mathcal{D}$  given by  $R(h) = \mathbb{E}_{(x,y)\in \mathcal{D}}e(h(x),y)$ , for some loss function  $e(\cdot)$ . Given  $m$  i.i.d. data points, the empirical risk minimizer (ERM) can be computed as the model  $h_m = \arg \min_{h\in \mathcal{H}}\sum_{\ell \in [m]}e(h(x_\ell),y_\ell)$ . Mohri et al. [2018] show the following bound on the error of  $h_m$ , which holds with high probability:
$$
1 - R \left(h _ {m}\right) \geq a (m) := a _ {0} - \frac {4 + \sqrt {2 k \left(2 + \log (m / k)\right)}}{\sqrt {m}}, \tag {2}
$$
where  $(1 - a_0)$  is the accuracy of the optimal model from  $\mathcal{H}$ , and  $k$  is a (constant) measure of the difficulty of the learning problem depending on  $e(\cdot)$  and  $\mathcal{H}$ . Using this we can define the agent payoff  $a_i$  function as the accuracy of the learning task as  $a_i(s) = a(\|s\|_1)^1$ .
Empirical evidence. Kaplan et al. [2020] discuss empirical scaling laws relating the cross-entropy loss on neural language models. They observe that the loss scales with the dataset size  $m$  as a power law  $\ell(m) = \alpha \cdot m^{-\beta}$ , for some parameters  $\alpha > 0$  and  $\beta \in (0,1]$ . This naturally defines the payoff function as the accuracy of the learning task as
$$
a _ {i} (\boldsymbol {s}) = 1 - \alpha_ {i} \cdot \| \boldsymbol {s} \| _ {1} ^ {- \beta_ {i}}. \tag {3}
$$
In addition, the pay-off functions of current large language models (e.g., accuracies) are also non-negative and non-decreasing as a function of the data size (Henighan et al. [2020]).
3 Nash Equilibrium: Existence and Best Response Dynamics
In this section, we investigate the existence and computation of a Nash equilibrium. We start with two positive results showing the existence of a Nash equilibrium for a broad class of payoff and cost functions.
Theorem 3.1. A Nash equilibrium exists in any federated learning problem where for every agent  $i$  the payoff function  $a_{i}(\pmb{s})$  is continuous in  $\pmb{s}$  and concave in  $s_i$ , and cost function  $c_{i}$  is increasing and convex in  $s_i$ .
Proof. We will show the existence of a Nash equilibrium by showing that the best response correspondence  $f$  has a fixed point. First observe that  $f$  is defined over a compact, convex domain  $S = \times_{j} S_{j}$  since each  $S_{j}$  is convex. Next, note that agent  $i$ 's utility function  $u_{i}(\boldsymbol{s}) = a_{i}(\boldsymbol{s}) - c_{i}(s_{i})$  is continuous in  $s$  due to the continuity of  $a_{i}$  and  $c_{i}$ . The continuity of  $u_{i}$  in  $s$  and the concavity of
<sup>1</sup>We define  $a(\mathbf{0}) = 0$ .
$u_{i}$  in  $s_i$  implies the upper semi-continuity of the best response correspondence  $f_{i}$ . Moreover,  $u_{i}$  is concave in  $s_i$  for each fixed  $s_{-i}$ , since  $a_{i}$  and  $-c_{i}$  are concave in  $s_i$ . Thus for each fixed  $s_{-i}$ , the best response set  $f_{i}(s_{-i}) \subseteq \mathbb{R}_{\geq 0}$  is a non-empty interval, and hence is also convex. Thus  $f$  is a upper semi-continuous non-empty and convex valued correspondence defined over a compact, convex domain. By the Kakutani fixed-point theorem (Kakutani [1941]),  $f$  admits a fixed point.
The above result can also be proved directly by invoking Rosen [1965], who showed the existence of a Nash equilibrium of  $n$ -person concave games, where the utility function of an agent  $i$  is defined over closed, compact set, is continuous and concave in  $i$ 's own strategy.
Implications. Theorem 3.1 shows that a Nash equilibrium exists when payoffs are concave and costs are convex. All our motivating examples from Section 2.1 lie under this concave/convex regime and therefore admit a NE. In Appendix A we discuss existence and non-existence of Nash equilibrium in our model when we go beyond the concave-convex regime of payoff and cost functions. In particular, we show that Nash equilibrium exists even with decreasing payoff function of an agent as long as the function is separable between her and other agents' data contribution. We also show that a NE need not exist even with linear cost functions if the payoff functions are non-concave.