SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\mathbb {E} _ {\mathcal {A}} \left\| \left( \begin{array}{c} \mathcal {A} _ {\boldsymbol {x}} (\mathcal {S}) - \mathcal {A} _ {\boldsymbol {x}} (\mathcal {S} ^ {\prime}) \\ \mathcal {A} _ {\boldsymbol {y}} (\mathcal {S}) - \mathcal {A} _ {\boldsymbol {y}} (\mathcal {S} ^ {\prime}) \end{array} \right) \right\| _ {2} \leq \epsilon .
$$
2.  $\mathcal{A}$  is  $\epsilon$ -weakly stable if there holds for any neighboring datasets  $S, S'$ :
$$
\sup  _ {\boldsymbol {\xi}} \left[ \sup  _ {\boldsymbol {y} ^ {\prime} \in \mathcal {Y}} \mathbb {E} _ {A} [ \boldsymbol {f} (\mathcal {A} _ {\boldsymbol {x}} (\mathcal {S}), \boldsymbol {y} ^ {\prime}; \boldsymbol {\xi}) - \boldsymbol {f} (\mathcal {A} _ {\boldsymbol {x}} (\mathcal {S} ^ {\prime}), \boldsymbol {y} ^ {\prime}; \boldsymbol {\xi}) ] + \sup  _ {\boldsymbol {x} ^ {\prime} \in \mathcal {X}} \mathbb {E} _ {A} [ \boldsymbol {f} (\boldsymbol {x} ^ {\prime}, \mathcal {A} _ {\boldsymbol {y}} (\mathcal {S}); \boldsymbol {\xi}) - \boldsymbol {f} (\boldsymbol {x} ^ {\prime}, \mathcal {A} _ {\boldsymbol {y}} (\mathcal {S} ^ {\prime}); \boldsymbol {\xi}) ] \right] \leq \epsilon .
$$
where  $\pmb{\xi} \triangleq \{\xi_1, \dots, \xi_m\}$  denotes sample index with  $\xi_i \in \mathcal{D}_i$  and  $\pmb{f}(\pmb{x}, \pmb{y}; \pmb{\xi}) \triangleq \frac{1}{m} \sum_{i=1}^{m} f_i(\pmb{x}, \pmb{y}; \xi_i)$ .
And we further specify the stability error as  $\epsilon_{sta}^{arg}(\mathcal{A})$  and  $\epsilon_{sta}^w (\mathcal{A})$  respectively.
Remark 3. The definition of neighboring datasets in the decentralized setting can degenerate to the traditional neighboring datasets where there is at most a single different sample between  $S$  and  $S'$ . And the refined concepts of algorithmic stability are also fit for classic stability without decentralization in [19]. These facts validate that our definitions above are well-defined. Notice that the argument stability can imply weak stability because of the property of Lipschitz continuity (see Assumption 1). Specifically speaking, when algorithm  $\mathcal{A}$  is  $\epsilon$ -argument stable, then it is  $\sqrt{2} G\epsilon$ -weakly stable. So we will mainly focus on the argument stability in the rest part.
Theorem 1 (Connection). For an  $\epsilon$ -argument stable decentralized algorithm  $\mathcal{A}$ , under Assumption 1, we have the following different measures of generalization gap:
a. Weak primal-dual generalization gap:  $\epsilon_{gen}^{w}(\mathcal{A}_{\boldsymbol{x}}(\mathcal{S}),\mathcal{A}_{\boldsymbol{y}}(\mathcal{S}))\leq \sqrt{2} G\epsilon.$
b. Strong primal-dual generalization gap holds under extra Assumption 2 when  $f_{i}$  is  $\mu_{\pmb{x}}SC - \mu_{\pmb{y}}SC$ :
$\epsilon_{gen}^{s}(\mathcal{A}_{\boldsymbol{x}}(\mathcal{S}),\mathcal{A}_{\boldsymbol{y}}(\mathcal{S}))\leq G\sqrt{2 + \frac{2L^{2}}{\mu^{2}}}\epsilon ,where\mu \triangleq \min \{\mu_{\boldsymbol{x}},\mu_{\boldsymbol{y}}\} .$
Remark 4. The complete proof is provided in Appendix D. We establish the connection between argument stability and a different measure of generalization gap under different constraints, where weak primal-dual generalization gap does not require any convexity or concavity in part a. and strong primal-dual generalization gap requires both strong convexity and strong concavity in part b.. And this connection is not limited to the single decentralized algorithm D-SGDA, but a universal connection for decentralized minimax algorithms. Actually weak stability is sufficient to prove the weak primal-dual generalization gap in part a. that when algorithm  $\mathcal{A}$  is  $\epsilon$ -weakly stable, we have  $\mathbb{E}_{\mathcal{A},S}[\epsilon_{gen}^{w}(\mathcal{A}_{x}(S),\mathcal{A}_{y}(S))]\leq \epsilon$ . And the theorem implies that once we have access to the stability error, we can derive the generalization gap as an accompanying result.
4 Theoretical Results on D-SGDA
In this section, we study algorithmic stability and generalization bound in SC-SC, C-C, and NC-NC settings in Sec 4.1, Sec 4.2 and Sec 4.3, respectively. Due to the space limitation, the proofs are placed in the Appendix E, F, G respectively.
4.1 Results on Strongly-Convex-Strongly-Concave Case
Below, we first characterize the argument stability with fixed and decaying learning rates, respectively.
Theorem 2 (Argument Stability). Under Assumption 1,2,3 when each  $f_{i}$  is  $\mu_{\mathbf{x}}$ -strongly convex and  $\mu_{\mathbf{y}}$ -strongly concave, we have the argument stability bound for D-SGDA (denoted as  $\mathcal{A}$ ):
$$
\epsilon_ {s t a} ^ {a r g} (\mathcal {A}) \leq \frac {2 G}{n} \sum_ {k = 0} ^ {T - 1} \eta_ {k} ^ {m a x} \prod_ {s = k + 1} ^ {T - 1} (1 - \eta_ {s} ^ {m i n} \frac {L \mu}{L + \mu}) + 4 G L \sum_ {k = 1} ^ {T - 1} \left(\eta_ {k} ^ {m a x} \sum_ {s = 0} ^ {k - 1} \eta_ {s} ^ {m a x} \lambda^ {k - 1 - s}\right) \prod_ {j = k + 1} ^ {T - 1} (1 - \eta_ {j} ^ {m i n} \frac {L \mu}{L + \mu}).
$$
where  $\eta_t^{max} \triangleq \max \{\eta_{\boldsymbol{x},t}, \eta_{\boldsymbol{y},t}\}$ ,  $\eta_t^{min} \triangleq \min \{\eta_{\boldsymbol{x},t}, \eta_{\boldsymbol{y},t}\}$ ,  $\mu = \min \{\mu_{\boldsymbol{x}}, \mu_{\boldsymbol{y}}\}$ . Furthermore,
a. for fixed learning rates,  $\epsilon_{sta}^{arg}(\mathcal{A})\leq 2G\frac{L + \mu}{\eta^{min}L\mu} (\frac{2(\eta^{max})^2L}{1 - \lambda} +\frac{\eta^{max}}{n}).$
b. for decaying learning rates with  $\eta_t^{min} = \frac{1}{\mu(t + 1)}$  and  $\eta_t^{max} = \frac{1}{\mu(t + 1)^c}$ ,  $c \leq 1$ , we have:
$$
\epsilon_ {s t a} ^ {a r g} (\mathcal {A}) \leq \frac {2 G}{\mu n T ^ {\frac {L}{L + \mu}}} \sum_ {k = 0} ^ {T - 1} \frac {1}{(k + 1) ^ {c - \frac {L}{L + \mu}}} + \frac {4 G L}{\mu^ {2} T ^ {\frac {L}{L + \mu}}} \sum_ {k = 1} ^ {T - 1} \frac {1}{(k + 1) ^ {c - \frac {L}{L + \mu}}} \frac {C _ {\lambda}}{k ^ {c}}.
$$
where  $C_{\lambda} \triangleq \frac{(k / e)^{c}}{\lambda(\ln\frac{1}{\lambda})^{c}} + \frac{2e^{-1}}{\lambda\ln\frac{1}{\lambda}} + \frac{2^{c}}{\lambda\ln\frac{1}{\lambda}}$ .
Remark 5. (i) Bound analysis and comparison. For case a with fixed learning rates, the argument stability is bounded by  $\mathcal{O}\left(\frac{\eta}{1 - \lambda} +\frac{1}{n}\right)$ , which can reach  $\mathcal{O}\left(\frac{1}{(1 - \lambda)T} +\frac{1}{n}\right)$  when  $\eta \sim \frac{1}{T}$ . For case b. with decaying learning rates, we should require  $2c\geq \frac{L}{L + \mu} +1$  otherwise the bound can tend to infinity, then we have  $\epsilon_{sta}^{arg}(\mathcal{A})\leq \frac{2G}{\mu(1 - c + \frac{L}{L + \mu})}\frac{T^{1 - c}}{n} +\frac{4GLC_{\lambda}}{\mu^2T^{\frac{L}{L + \mu}}} (\frac{\mathbf{1}_{2c > L / (L + \mu) + 1}}{2c - \frac{L}{L + \mu} - 1} +\ln T\cdot \mathbf{1}_{2c = L / (L + \mu) + 1})$ . Both can be bounded by  $\widetilde{\mathcal{O}}\left(\frac{T^{1 - c}}{n} +\frac{C_{\lambda}}{T^{\frac{L}{L + \mu}}}\right)$  with  $\widetilde{\mathcal{O}}$  containing the logarithmic function into consideration, which matches the corresponding results for SGDA (see Thm.2.(e) in [19]) except an extra multiplication factor  $C_\lambda$ :  $\widetilde{\mathcal{O}} (\frac{1}{\sqrt{T}} +\frac{1}{N})$  with decaying learning rates and  $N$  the total sample size. (ii) Factor influence. It is apparent that a smaller stability bound is achieved with larger sample size  $n$ , and smaller learning rates  $\eta$  (which is associated with larger  $T$ ). And notice that the decaying learning rates may slightly underperform than the fixed one, it is easy to explain that at the beginning decaying learning rates are too large and therefore result in weaker stability. The influence of these factors is consistent with vanilla SGDA. (iii) Effect of topology. So the major difference lies in  $C_\lambda$  and the number of nodes  $m$ . For  $C_\lambda = \frac{(k / e)^c}{\lambda(\ln\frac{1}{\lambda})^c} +\frac{2e^{-1}}{\lambda\ln\frac{1}{\lambda}} +\frac{2^c}{\lambda\ln\frac{1}{\lambda}}$ , when  $\lambda \to 1$ , it is bounded by  $\mathcal{O}\left(\frac{1}{\lambda\ln\frac{1}{\lambda}}\right)$  and when  $\lambda \to 0$ ,  $C_\lambda$  is bounded by  $\mathcal{O}\left(\frac{1}{\lambda(\ln\frac{1}{\lambda})^c}\right)$ . We list some common topology with estimated value of  $\lambda$  along with the upper bound of  $C_\lambda$  in Table 2. We can conclude that topology with a denser connection (larger spectral gap  $1 - \lambda$ ) will have a smaller stability error, i.e., be more stable. In extreme conditions, the fully connected network will behave as well as vanilla SGDA, and the stability error of the disconnected network will diverge. Furthermore, under the same topology, fewer nodes will result in better stability.
Generalization gap. According to Thm. 1, we can directly derive the weak and strong primal-dual generalization gap of D-SGDA as  $\sqrt{2} G\epsilon_{sta}^{arg}$  and  $G\sqrt{2 + \frac{2L^2}{\mu^2}}\epsilon_{sta}^{arg}$  respectively. Therefore, we hold the same analysis as stability in above Remark 5.
Next, we will first derive the optimization error and then provide the population risk by decomposition  $\Delta^s (\pmb {x},\pmb {y}) = \epsilon_{gen}^s (\pmb {x},\pmb {y}) +$ $\Delta_S^s (\pmb {x},\pmb {y})$  . Population risk is an important evaluation for the performance of a stochastic learning algorithm, which will evaluate how our model obtained by training dataset behave over the whole distribution. Notice that we will use the average output instead of the last iterate in analyzing the optimization errors. We denote that:
Table 2:  $\lambda$  value of different topology. Here 0 means the extra term will disappear and N/A means the term will diverge.
Topology	λ([40])	Cλ	1/1-λ
fully connected exponential	0	0	0
1 - 2/1+ln m	O(ln m)	O(ln m)
grid	1 - 1/m ln m	O(m ln m)	O(m ln m)
ring	1 - 16π2/3m2 ([21])	O(m2)	O(m2)
star	1 - 1/m2	O(m2)	O(m2)
disconnected	1	N/A	N/A
$$
\boldsymbol {x} _ {a v e} ^ {T} \triangleq \frac {\sum_ {t = 0} ^ {T - 1} \eta_ {\boldsymbol {x} , t} \boldsymbol {x} ^ {t}}{\sum_ {t = 0} ^ {T - 1} \eta_ {\boldsymbol {x} , t}}, \quad \boldsymbol {y} _ {a v e} ^ {T} \triangleq \frac {\sum_ {t = 0} ^ {T - 1} \eta_ {\boldsymbol {y} , t} \boldsymbol {y} ^ {t}}{\sum_ {t = 0} ^ {T - 1} \eta_ {\boldsymbol {y} , t}}. \tag {3}
$$
Theorem 3 (Strong primal-dual population risk). Under Assumption 1,2,3, when each  $f_{i}$  is  $\mu_{\mathbf{x}}SC - \mu_{\mathbf{y}}SC$ , we have the strong primal-dual population risk as follows, where  $\eta_t^{\text{max}} \triangleq \max \{\eta_{\mathbf{x},t}, \eta_{\mathbf{y},t}\}$ ,  $\eta_t^{\text{min}} \triangleq \min \{\eta_{\mathbf{x},t}, \eta_{\mathbf{y},t}\}$ ,  $\mu = \min \{\mu_{\mathbf{x}}, \mu_{\mathbf{y}}\}$ , and  $(\boldsymbol{x}_{ave}^T, \boldsymbol{y}_{ave}^T)$  is defined in Eq. (3):
a. for fixed learning rates,
$$
\begin{array}{l} \Delta^ {s} (\boldsymbol {x} _ {a v e} ^ {T}, \boldsymbol {y} _ {a v e} ^ {T}) \leq G \sqrt {2 + \frac {2 L ^ {2}}{\mu^ {2}}} (2 G \frac {L + \mu}{\eta^ {\min} L \mu} (\frac {2 (\eta^ {\max}) ^ {2} L}{1 - \lambda} + \frac {\eta^ {\max}}{n})) + \frac {C _ {\boldsymbol {x}} ^ {2} + C _ {\boldsymbol {y}} ^ {2}}{2 \eta^ {\min} T} \\ + \eta^ {m a x} G ^ {2} + \frac {4 (C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}) G L \eta^ {\max}}{1 - \lambda} + \frac {2 (C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}) G}{\sqrt {T}}. \\ \end{array}
$$
b. for decaying learning rates that  $\eta_t^{min} = \frac{1}{\mu(t + 1)}$  and  $\eta_t^{max} = \frac{1}{\mu(t + 1)^c}$  with  $c \leq 1$  and  $2c \geq \frac{L}{L + \mu} + 1$ ,
$$
\begin{array}{l} \Delta^ {s} (\boldsymbol {x} _ {a v e} ^ {T}, \boldsymbol {y} _ {a v e} ^ {T}) \\ \leq G \sqrt {2 + \frac {2 L ^ {2}}{\mu^ {2}}} \left(\frac {2 G}{\mu (1 - c + \frac {L}{L + \mu})} \frac {T ^ {1 - c}}{n} + \frac {4 G L C _ {\lambda}}{\mu^ {2} T ^ {\frac {L}{L + \mu}}} \left(\frac {\mathbf {1} _ {2 c \neq L / (L + \mu) + 1}}{2 c - \frac {L}{L + \mu} - 1} + \ln T \cdot \mathbf {1} _ {2 c = L / (L + \mu) + 1}\right)\right) \\ + \frac {2 G \left(C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}\right)}{\sqrt {T}} + \frac {G ^ {2}}{2 \mu} \left(\frac {1 + \ln T}{T} + \frac {\mathbf {1} _ {c \neq 1}}{(1 - c) T ^ {c}} + \frac {(1 + \ln T) \mathbf {1} _ {c = 1}}{T}\right) + \frac {4 G L C _ {\lambda} \left(C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}\right)}{\mu T ^ {c}} \left(\frac {\mathbf {1} _ {c \neq 1}}{1 - c} + \ln T \cdot \mathbf {1} _ {c = 1}\right). \\ \end{array}
$$
Remark 6. By Jensen's inequality (see Remark 2), we can conclude that weak primal-dual population risk also satisfies the conclusions above. (i) Bound analysis and comparison. For fixed learning rates, it is interesting to see that we should choose  $\eta \sim 1 / \sqrt{T}$  to get the optimal population risk of  $\mathcal{O}\left(\frac{1}{n} +\frac{1}{(1 - \lambda)\sqrt{T}}\right)$ , although when  $\eta \sim 1 / T$  we can get optimal generalization performance but the optimization error will not converge. While for the decaying learning rates, the population risk bound is  $\widetilde{\mathcal{O}} (T^{1 - c} / n + C_{\lambda} / T^{\min \left\{\frac{1}{2},\frac{L}{L + \mu}\right\}})$ , which matches the corresponding results for SGDA (see Thm.3.(c) in [19]) of  $\mathcal{O}(\ln N / N\mu)$  when  $n\sim T^{\min \left\{\frac{1}{2},\frac{L}{L + \mu}\right\}}$ . (ii) Topology influence. We omit the trivial factor influence analysis here (or see Remark 5). And the effect of topology is captured quantitatively by  $C_\lambda$  and  $\frac{1}{1 - \lambda}$  which have been discussed in Remark 5 and Table 2.
4.2 Results on Convex-Concave Case
In this section, we provide the argument stability and weak primal-dual population risk of D-SGDA algorithm for the NC-NC condition in the following theorems with proof in Appendix F.
Theorem 4 (Argument Stability). Under Assumption 1,2,3, when each  $f_{i}$  is convex-concave, we have the argument stability bound for D-SGDA (denoted as  $\mathcal{A}$ ):
$$
\epsilon_ {s t a} ^ {a r g} (\mathcal {A}) \leq \frac {2 G}{n} \sum_ {k = 0} ^ {T - 1} \eta_ {k} ^ {m a x} + 4 G L \sum_ {k = 1} ^ {T - 1} \left(\eta_ {k} ^ {m a x} \sum_ {s = 0} ^ {k - 1} \eta_ {s} ^ {m a x} \lambda^ {k - 1 - s}\right).
$$
Remark 7. (i) Bound analysis and comparison. When there is no strong convexity or strong concavity, we can no longer choose the decaying learning rates, otherwise the argument stability error may not converge. For fixed learning rates,  $\epsilon_{sta}^{arg}$  is upper bounded by  $\mathcal{O}\left(\frac{\eta T}{n} +\frac{\eta^2T}{1 - \lambda}\right)$ , which is slightly looser than SC-SC condition. While we can still choose  $\eta \sim 1 / T$  to obtain optimal result  $\mathcal{O}\left(\frac{1}{n} +\frac{1}{(1 - \lambda)T}\right)$ . Besides, compared with the corresponding result for SGDA (see Thm.2.(b) in [19]) of  $\mathcal{O}\left(\frac{\sqrt{T}}{N} +\frac{1}{\sqrt{N}}\right)$ , we can approach it when  $\eta \sim 1 / T^{3 / 4}$  and  $n\sim T^{3 / 4}$ . (ii) Topology influence. In C-C condition, the effect of topology on the stability is quantified by  $\frac{1}{1 - \lambda}$  which has been discussed in Table 2. And we can conclude that denser topology is more stable and fewer nodes will increase stability under the same topology.
Generalization gap. Thm. 1 implies  $\epsilon_{gen}^{w}(\mathcal{A}_{\boldsymbol{x}}(\mathcal{S}),\mathcal{A}_{\boldsymbol{y}}(\mathcal{S}))\leq \sqrt{2} G\epsilon_{sta}^{arg}(\mathcal{A})$ . So the generalization gap holds with the same quantitative analysis as stability above. Analogously we can present the weak primal-dual population risk in the following theorem.
Theorem 5 (Weak primal-dual population risk). Under Assumption 1,2,3, when each  $f_{i} \in C$ , we have the weak primal-dual population risk as follows, where  $\eta_{t}^{max} \triangleq \max \{\eta_{\mathbf{x},t}, \eta_{\mathbf{y},t}\}$ ,  $\eta_{t}^{min} \triangleq \min \{\eta_{\mathbf{x},t}, \eta_{\mathbf{y},t}\}$ ,  $\mu = \min \{\mu_{\mathbf{x}}, \mu_{\mathbf{y}}\}$ , and  $(\pmb{x}_{ave}^T, \pmb{y}_{ave}^T)$  is defined in Eq. (3):
$$
\begin{array}{l} \Delta^ {w} \left(\boldsymbol {x} _ {a v e} ^ {T}, \boldsymbol {y} _ {a v e} ^ {T}\right) \leq \sqrt {2} G \left(\frac {2 G \eta^ {\max} T}{n} + \frac {4 G L (\eta^ {\max}) ^ {2} T}{1 - \lambda}\right) + \frac {C _ {\boldsymbol {x}} ^ {2} + C _ {\boldsymbol {y}} ^ {2}}{2 \eta^ {\min} T} \\ + \eta^ {m a x} G ^ {2} + \frac {4 (C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}) G L \eta^ {\max}}{1 - \lambda} + \frac {2 (C _ {\boldsymbol {x}} + C _ {\boldsymbol {y}}) G}{\sqrt {T}}. \\ \end{array}
$$
Remark 8. The weak primal-dual population risk attains optimal of  $\mathcal{O}\left(\frac{T^{1/3}}{n} + \frac{1}{(1 - \lambda)T^{1/3}}\right)$  when we choose  $\eta^{max} = \eta^{\min} \sim 1 / T^{\frac{2}{3}}$ . Note that we select  $\eta \sim 1 / T$  to obtain optimal generalization performance (see Remark 7), but the optimization error will diverge in that case. Compared with the result of SGDA:  $\mathcal{O}(N^{-1/2})$  (see Thm.3.(b) in [19]), our result can approach it by  $n^{1/2} \sim T^{1/3}$ . Then the effect of topology and number of nodes on the population risk is reflected by  $\frac{1}{1 - \lambda}$ , which has been discussed in Remark 5 and Table 2.
4.3 Results on Nonconvex-Nonconcave Case
In this section, we present the weak stability and weak primal-dual generalization gap of D-SGDA algorithm for the NC-NC problem in the following theorem with proof in Appendix G.
Theorem 6 (Weak stability). Under Assumption 1,2,3, denoting  $D$ -SGDA algorithm as  $\mathcal{A}$ , we have the following weak stability bound when  $\eta_t^{max} \triangleq \max \{\eta_{x,t}, \eta_{y,t}\}$ , and  $\eta_t^{min} \triangleq \min \{\eta_{x,t}, \eta_{y,t}\}$ :
a. for fixed learning rates that  $\eta_t^{max} = \eta^{max}$ , and  $\eta_t^{min} = \eta^{min}$
$$
\epsilon_ {s t a} ^ {w} (\mathcal {A}) \leq 2 \sqrt {2} G ^ {2} \left(\frac {\eta^ {m a x} T}{n} + \frac {2 L \eta^ {m a x 2} T}{1 - \lambda}\right).
$$
b. for decaying learning rates that  $\eta_t^{min} = \frac{1}{t + 1}$ , and  $\eta_t^{max} = \frac{1}{(t + 1)^c}, c \leq 1$ ,
$$
\epsilon_ {s t a} ^ {w} (\mathcal {A}) \leq (c + L) (c + L - 1) ^ {\frac {1}{c + L}} \left(\frac {2 \sqrt {2} G ^ {2} T ^ {L}}{(c + L - 1) n} + \frac {4 \sqrt {2} G ^ {2} L C _ {\lambda} T ^ {L}}{2 c + L - 1}\right) ^ {\frac {1}{c + L}} \left(\frac {B m}{n}\right) ^ {1 - \frac {1}{c + L}}.
$$
Weak primal-dual generalization gap. According to Thm. 1, we can derive the weak primal-dual generalization gap as  $\epsilon_{gen}^{w}(\mathcal{A}_{\boldsymbol{x}}(\mathcal{S}),\mathcal{A}_{\boldsymbol{y}}(\mathcal{S}))\leq \sqrt{2} G\epsilon_{sta}^{w}(\mathcal{A})$  for D-SGDA in NC-NC condition.
Remark 9. For case a. with fixed learning rates, the weak stability and weak primal-dual generalization gap is bounded by  $\mathcal{O}\left(\frac{\eta T}{n} +\frac{\eta^2T}{1 - \lambda}\right)$ , which can reach  $\mathcal{O}\left(\frac{1}{n} +\frac{1}{(1 - \lambda)T}\right)$  when  $\eta \sim \frac{1}{T}$ . For case b. with decaying learning rates, the stability and generalization gap is bounded by  $\mathcal{O}\left((C_{\lambda})^{\frac{1}{c + L}}T^{\frac{L}{c + L}}\left(\frac{m}{n}\right)^{1 - \frac{1}{c + L}}\right)$ . It is evident to analyze the influence of factors that, larger sample size and fewer nodes will result in a smaller stability error and generalization gap, which coincides with results in (S)C-(S)C conditions (see Remark 5). Approaching to the weak primal-dual generalization bound of  $\mathcal{O}\left(n^{-\frac{2c\rho + 1}{2c\rho + 3}}T^{\frac{2c\rho}{2c\rho + 3}}\right)$  provided  $\rho$ -weakly-convex-weakly-concave (see Thm.5 in [19]).  $C_{\lambda}$  reflects the effect of topology on the stability and generalization gap and its value has been discussed in Reamrk 5 and Table 2.
Figure 1:  $\Delta$  against the number of iterations, with the first row showing different settings. From left to right, the settings include varying learning rates, communication typologies, sample sizes on the w5a dataset, and learning rates(svmguide3). The generalization error is displayed at the bottom accordingly.
Figure 2: The first row shows the performance of the generator. From left to right, the settings include varying learning rates, the number of nodes, sample sizes, and communication typologies on the MNIST dataset. The performance of the discriminator is displayed at the bottom accordingly. The dashes denote different layers.
Experiments Setup. We evaluate our theoretical results of the C-C case by adopting the S0LAM method [41] to solve the AUC problem on two datasets svmguide and w5a, and the NC-NC case by solving the generative adversarial network on MNIST. We extend the methods for both cases to a decentralized implementation. Our experimental setting follows the way conducted in [13, 19] to study how the stability and generalizability of D-SGDA would behave along the learning process with different factors, including learning rates, typologies, nodes, and sample sizes. We employ the same randomized method to generate two model sequences, one for the original data and another for a one-observation perturbing data, and subsequently calculate the Euclidean distance  $\Delta$  between their respective parameter sets. Additional implementation details can be found in the Appendix.
Results analysis: From Fig. 1 and Fig. 2, we can observe that: (i) faster learning rates, fewer number of nodes and smaller sample size can result in a smaller Euclidean distance between weights and a smaller difference between training dataset and validation dataset; (ii) the performance of different topology on stability: fully connected(all)  $>$  exponential  $>$  grid  $\approx$  ring  $\geq$  star  $>$  disconnected(single).
These validate our theoretical results of the algorithmic stability for D-SGDA (see Remark 5 below Thm. 2). And the impact of different topologies also coincides with our discussion in Table 2.
In this paper, we provide the first comprehensive analysis for the stability and generalization of D-SGDA for decentralized minimax problems. Our theoretical results show that a decentralized structure does not destroy the stability and generalization of D-SGDA, instead we can leverage between the iterations and the number of nodes, as well as sample size to achieve better population performance. Numerical experiments also validate our theory. Our analysis technique has the potential used for studying the ability and generalization of other decentralized minimax algorithms.
Limitation&Broader Impacts. In our analysis, we require the Lipschitz smoothness, which may be further relaxed in future work. In addition, D-SGDA can converge with the heterogeneous data distribution, whose stability and generalization are still unexplored in this work. Since our work focuses on the theoretical understanding of D-SGDA, it does not suffer from negative impacts.
This work was supported in part by the National Natural Science Foundation of China under Grants 62225113.
The authors appreciate Erdun Gao for providing valuable suggestions on the experimental implementation. The authors also thank Tongtian Zhu for pointing out typos as well as useful discussions on the experimental results.